# Enable Paylink

To enable the paylink for a terminal:

{% stepper %}
{% step %}
Use the PUT method with the `/rest/v2/settings/terminal/paylink` endpoint.
{% endstep %}

{% step %}
Add the parameters as shown in the following sample request body.

{% code lineNumbers="true" %}

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

{% endcode %}

The following table describes the request body parameters:

<table><thead><tr><th width="119.666748046875" valign="top">Name</th><th width="120.3333740234375" valign="top">Data type</th><th width="119.66668701171875" valign="top">Required?</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>cancel-url</code></td><td valign="top">String</td><td valign="top">Required</td><td valign="top">The URL where customers are redirected after canceling a payment.</td></tr><tr><td valign="top"><code>enabled</code></td><td valign="top">String</td><td valign="top">Required</td><td valign="top"><p>Indicates whether the Paylink setting is enabled.</p><ul><li> <code>true</code>: Enable.</li><li><code>false</code>: Disable.</li></ul></td></tr><tr><td valign="top"><code>metadata</code></td><td valign="top">Object</td><td valign="top">Required</td><td valign="top">Contains the configuration details for Paylink page elements.</td></tr><tr><td valign="top"><code>metadata.show-billing-address</code></td><td valign="top">Boolean</td><td valign="top">Required</td><td valign="top"><p>Indicates whether the billing address section is shown on the payment form.</p><ul><li><code>true</code>: Shows the billing address section.</li><li><code>false</code>: Hides the billing address section.</li></ul></td></tr><tr><td valign="top"><code>metadata.require-billing-address</code></td><td valign="top">Boolean</td><td valign="top">Required</td><td valign="top"><p>Indicates whether the billing address is required.</p><ul><li><code>true</code>: The billing address is required.</li><li><code>false</code>: The billing address is optional. </li></ul></td></tr><tr><td valign="top"><code>amount</code></td><td valign="top">Text</td><td valign="top">Required</td><td valign="top">Specifies the payment amount.</td></tr><tr><td valign="top"><code>success-url</code></td><td valign="top">String</td><td valign="top">Required</td><td valign="top">The URL where customers are redirected after a successful payment.</td></tr><tr><td valign="top"><code>terminalId</code></td><td valign="top">String</td><td valign="top">Required</td><td valign="top">The internal terminal ID.</td></tr></tbody></table>
{% endstep %}
{% endstepper %}

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

{% code lineNumbers="true" %}

```json
{
   "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"
   }
}
```

{% endcode %}

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

<table><thead><tr><th width="150.33331298828125" valign="top">Name</th><th width="120" valign="top">Data type</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>status</code></td><td valign="top">Text</td><td valign="top"><p>A text in response to your API authentication request, such as:</p><ul><li><code>Success</code>: The API request was authenticated successfully.</li><li><code>Fail</code>: The API request failed authentication.</li></ul></td></tr><tr><td valign="top"><code>exchange-id</code></td><td valign="top">String</td><td valign="top">The GUID (Global Unique Identifier) associated with the paylink.</td></tr><tr><td valign="top"><code>links</code></td><td valign="top">Array</td><td valign="top">List of links associated with the paylink.</td></tr><tr><td valign="top"><code>rel</code></td><td valign="top">Text</td><td valign="top">The current status of the Paylink. This field shows <code>self</code> when the setting is enabled for a merchant.</td></tr><tr><td valign="top"><code>href</code></td><td valign="top">Text</td><td valign="top">The URL associated with the merchant’s Paylink.</td></tr><tr><td valign="top"><code>payload</code></td><td valign="top">Object</td><td valign="top">Contains the details of the payload.</td></tr><tr><td valign="top"><code>payload.paylink</code></td><td valign="top">Object</td><td valign="top">Contains the details of the paylink and configurations</td></tr><tr><td valign="top"><code>payload.paylink.terminalId</code></td><td valign="top">Text</td><td valign="top">The internal terminal ID associated with the paylink.</td></tr><tr><td valign="top"><code>payload.paylink.enabled</code></td><td valign="top">Boolean</td><td valign="top"><p>Indicates whether the paylink setting is enabled.</p><ul><li><code>true</code> – The paylink setting is enabled.</li><li><code>false</code> – The paylink setting is disabled.</li></ul></td></tr><tr><td valign="top"><code>payload.paylink.metadata</code></td><td valign="top">Object</td><td valign="top">Contains the details of the paylink configurations and attributes.</td></tr><tr><td valign="top"><code>payload.paylink.metadata.show-billing-address</code></td><td valign="top">Boolean</td><td valign="top"><p>Indicates whether the billing address section is shown on the payment form.</p><ul><li><code>true</code> – The billing address section is shown.</li><li><code>false</code> – The billing address section is hidden.</li></ul></td></tr><tr><td valign="top"><code>payload.paylink.metadata.required-biiling-address</code></td><td valign="top">Boolean</td><td valign="top"><p>Indicates whether the billing address section is required on the payment form.</p><ul><li><code>true</code> – The billing address section is required.</li><li><code>false</code> – The billing address section is optional.</li></ul></td></tr><tr><td valign="top"><code>payload.success-url</code></td><td valign="top">String</td><td valign="top">The URL where customers are redirected after a successful payment.</td></tr><tr><td valign="top"><code>payload.cancel-url</code></td><td valign="top">String</td><td valign="top">The URL where customers are redirected after canceling a payment.</td></tr><tr><td valign="top"><code>payload.payloadType</code></td><td valign="top">String</td><td valign="top">The payload type classification.</td></tr></tbody></table>
