> For the complete documentation index, see [llms.txt](https://docs.txn.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.txn.io/payment-links/expiring-payment-link.md).

# Expiring payment link

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

Expires a payment link before its `expiresAt`: the hosted page stops accepting payment and `status` becomes `expired`. Only links in `created` or `pending` can be expired; a link in any other status is not found by this endpoint and returns `404`.

**Headers**

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

**Path Parameters**

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

**cURL**

```bash
curl -X "POST" "https://api.sandbox.txn.io/api/public/v1/payment_links/e33e1727-1eba-4581-bfd5-ded60713a5b8/expiration" \
     -H 'Content-Type: application/vnd.api+json' \
     -H 'Authorization: Bearer <api_key>'
```

**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>Always <code>paymentLinks</code>.</td></tr><tr><td>data.attributes.amount</td><td>string</td><td>Payment amount displayed to the end user.</td></tr><tr><td>data.attributes.currency</td><td>string</td><td>Currency of the payment amount.</td></tr><tr><td>data.attributes.accountCurrency</td><td>string</td><td>Merchant account currency used for settlement or funding.</td></tr><tr><td>data.attributes.network</td><td>string</td><td>Network code selected by the end user. <code>null</code> if not yet selected.</td></tr><tr><td>data.attributes.networkName</td><td>string</td><td>Human-readable network name. <code>null</code> if not yet selected.</td></tr><tr><td>data.attributes.reference</td><td>string</td><td>Your internal correlation key, as set at creation.</td></tr><tr><td>data.attributes.hostedPageUrl</td><td>string</td><td>URL of the Txn-hosted page.</td></tr><tr><td>data.attributes.status</td><td>string</td><td>Always <code>expired</code> after a successful call.</td></tr><tr><td>data.attributes.approvalStatus</td><td>string</td><td>Approval workflow status for payout payment links subject to an approval rule. <code>null</code> otherwise.</td></tr><tr><td>data.attributes.expiresAt</td><td>string</td><td>ISO 8601 timestamp of when the payment link expired.</td></tr><tr><td>data.attributes.createdAt</td><td>string</td><td>ISO 8601 timestamp of when the payment link was created.</td></tr><tr><td>data.attributes.paymentType</td><td>string</td><td><code>Invoice</code> or <code>Payout</code>.</td></tr><tr><td>data.attributes.paymentMethods[]</td><td>array</td><td>Payment methods that were available on the hosted page.</td></tr><tr><td>data.attributes.successRedirectUrl</td><td>string</td><td>Success redirect URL. <code>null</code> if not set.</td></tr><tr><td>data.attributes.unsuccessRedirectUrl</td><td>string</td><td>Unsuccessful redirect URL. <code>null</code> if not set.</td></tr><tr><td>data.relationships.target.data</td><td>object</td><td>ID and type of the child invoice or payout. <code>null</code> if none was triggered before expiry.</td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="HTTP 200" %}

```json
{
  "data": {
    "id": "e33e1727-1eba-4581-bfd5-ded60713a5b8",
    "type": "paymentLinks",
    "attributes": {
      "amount": "50.00",
      "currency": "EUR",
      "accountCurrency": "EUR",
      "network": null,
      "networkName": null,
      "reference": "docs-example-pl-payout-001",
      "hostedPageUrl": "https://sandbox.txn.io/redirect?payment_link_id=e33e1727-1eba-4581-bfd5-ded60713a5b8&request_type=payment_link_hosted_page",
      "status": "expired",
      "approvalStatus": null,
      "expiresAt": "2026-05-17T10:07:53.269Z",
      "createdAt": "2026-05-17T10:07:43.353Z",
      "paymentType": "Payout",
      "successRedirectUrl": null,
      "unsuccessRedirectUrl": null,
      "paymentMethods": [
        "on_chain"
      ]
    },
    "relationships": {
      "target": {
        "data": null
      }
    }
  },
  "meta": {},
  "jsonapi": {
    "version": "1.0"
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.txn.io/payment-links/expiring-payment-link.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
