# Expiring payment link

<mark style="color:green;">`POST`</mark> `/api/public/v1/payment_links/:id/expiration`

This endpoint expires payment links. Only payment links with the statuses **Created** or **Pending** can be updated to **Expired.**

**Headers**

| Name          | Value                      |
| ------------- | -------------------------- |
| Content-Type  | `application/vnd.api+json` |
| Authorization | `Bearer <api_key>`         |

**Path Parameters**

| Name | Value           |
| ---- | --------------- |
| id   | Payment link ID |

**Response Body**

<table><thead><tr><th>Name</th><th width="97">Type</th><th>Description</th></tr></thead><tbody><tr><td>data.id</td><td>string</td><td>Payment link ID.</td></tr><tr><td>data.type</td><td>string</td><td>Entity type returned. Always <code>paymentLinks</code>.</td></tr><tr><td>data.attributes</td><td>object</td><td>Set of payment attributes.</td></tr><tr><td>data.attributes.amount</td><td>string</td><td>Payment amount to display to end users.</td></tr><tr><td>data.attributes.currency</td><td>string</td><td>Payment currency to display to end users. Refer to <a href="../api-basics/supported-currencies">Supported currencies</a>.</td></tr><tr><td>data.attributes.accountCurrency</td><td>string</td><td>Specifies the merchant account to be used for crediting invoice payments or debiting payout amounts.</td></tr><tr><td>data.attributes.network</td><td>string</td><td>Payment network code. E.g. <code>trx:usdt</code>. Refer to <a href="../api-basics/supported-currencies">Supported currencies</a>.</td></tr><tr><td>data.attributes.networkName</td><td>string</td><td>Payment network name. E.g. <code>Tron (TRC20)</code>. Refer to <a href="../api-basics/supported-currencies">Supported currencies</a>.</td></tr><tr><td>data.attributes.reference</td><td>string</td><td>The custom reference ID to tie the payment to end-user.</td></tr><tr><td>data.attributes.hostedPageUrl</td><td></td><td>The payment hosted page URL to redirect your end-users to.</td></tr><tr><td>data.attributes.status</td><td>string</td><td>Payment link status context. Can be <code>created</code>, <code>pending</code>, <code>completed</code>, <code>expired</code>.</td></tr><tr><td>data.attributes.network</td><td>string</td><td>Network code. Refer to <a href="../api-basics/supported-currencies">Supported currencies</a>.</td></tr><tr><td>data.attributes.expiresAt</td><td>string</td><td>Payment link expiry date and time.</td></tr><tr><td>data.attributes.createdAt</td><td>string</td><td>Date and time payment was created at.</td></tr><tr><td>data.attributes.paymentType</td><td>string</td><td>Payment type. Can be either <code>Invoice</code> or <code>Payout</code>.</td></tr><tr><td>data.attributes.paymentMethods[]</td><td>array</td><td>Available payment methods.</td></tr><tr><td>data.attributes.payCurrencies[]</td><td>array</td><td>A list of cryptocurrency and token options your end-users can make payments in. This can be left empty if no value is passed in the request.</td></tr><tr><td>data.attributes.successRedirectUrl</td><td>string</td><td>URL you want your customer to be redirected from our hosted page to if the invoice completes.</td></tr><tr><td>data.attributes.unsuccessRedirectUrl</td><td>string</td><td>URL you want your customer to be redirected from our hosted page to if the invoice gets expired, cancelled or rejected.</td></tr><tr><td>data.relationships.target</td><td>object</td><td>This object will contain ID of the child Invoice or Payout generated by the Payment Link.</td></tr><tr><td>included</td><td>array</td><td>This array will contain data about the child Invoice or Payout generated by the Payment Link. For more details refer to <a href="../invoices/reading-invoice">Invoice</a> and <a href="../payouts/reading-payout">Payout</a> pyaloads.</td></tr></tbody></table>
