Creating the paylink

To create the paylink:

1

Use the PUT method with the /rest/v2/settings/terminal/paylink endpoint.

2

Add the parameters as shown in the following sample request body.

{
  "cancel-url":"string",
  "enabled":true,
  "metadata":
              {
                "show-billing-address":"true",
                "require-billing-address":"true",
                "amount":null
              },
  "success-url":"string",
  "terminalId":0
}

The following table describes the request body parameters:

Name
Data type
Required?
Description

cancel-url

String

Required

The URL where customers are redirected after canceling a payment.

enabled

String

Required

Indicates whether the Paylink setting is enabled.

  • true: Enable.

  • false: Disable.

metadata

Object

Required

Contains the configuration details for Paylink page elements.

metadata.show-billing-address

Boolean

Required

Indicates whether the billing address section is shown on the payment form.

  • true: Shows the billing address section.

  • false: Hides the billing address section.

metadata.require-billing-address

Boolean

Required

Indicates whether the billing address is required.

  • true: The billing address is required.

  • false: The billing address is optional.

amount

Text

Required

Specifies the payment amount.

success-url

String

Required

The URL where customers are redirected after a successful payment.

terminalId

String

Required

The internal terminal ID associated with the Paylink settings.

The following response code appears when the paylink is created successfully:

{
   "code":"200",
   "status":"SUCCESS",
   "exchange-id":"ID-clearent-gss-2-5916cad4-675d-4b15-ac5f-675989590094",
   "links":[
      {
         "rel":"terminal",
         "href":"https://gateway-sb.clearent.net/rest/v2/settings/terminal"
      },
      {
         "rel":"hpp",
         "href":"https://gateway-sb.clearent.net/rest/v2/settings/terminal/hpp"
      },
      {
         "rel":"self",
         "href":"https://gateway-sb.clearent.net/rest/v2/settings/terminal/paylink"
      }
   ],
   "payload":{
      "paylink":{
         "terminalId":42930,
         "enabled":true,
         "metadata":{
            "show-billing-address":"true",
            "require-billing-address":"true",
            "amount":null
         },
         "success-url":"https://www.website.com/success",
         "cancel-url":"https://www.website.com/cancel"
      },
      "payloadType":"paylink-settings"
   }
}

The following table describes the fields in the response body for the created paylink:

Name
Data type
Description

status

Text

A text in response to your API authentication request, such as:

  • Success: The API request was authenticated successfully.

  • Fail: The API request failed authentication.

exchange-id

String

The GUID (Global Unique Identifier) associated with the paylink.

links

Array

List of links associated with the paylink.

rel

Text

The current status of the Paylink. This field shows self when the setting is enabled for a merchant.

href

Text

The URL associated with the merchant’s Paylink.

payload

Object

Contains the details of the payload.

payload.paylink

Object

Contains the details of the paylink and configurations

payload.paylink.terminalId

Text

The internal terminal ID associated with the paylink.

payload.paylink.enabled

Boolean

Indicates whether the paylink setting is enabled.

  • true – The paylink setting is enabled.

  • false – The paylink setting is disabled.

payload.paylink.metadata

Object

Contains the details of the paylink configurations and attributes.

payload.paylink.metadata.show-billing-address

Boolean

Indicates whether the billing address section is shown on the payment form.

  • true – The billing address section is shown.

  • false – The billing address section is hidden.

payload.paylink.metadata.required-biiling-address

Boolean

Indicates whether the billing address section is required on the payment form.

  • true – The billing address section is required.

  • false – The billing address section is optional.

payload.success-url

String

The URL where customers are redirected after a successful payment.

payload.cancel-url

String

The URL where customers are redirected after canceling a payment.

payload.payloadType

String

The payload type classification.

The following table describes the HTTP status codes in the response body:

Code
Description

200

The paylink created successfully.

401

Unauthorized

403

Forbidden

Last updated

Was this helpful?