> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gettrxn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Payment claim links

> Create and manage payment claim links for customers to submit cryptocurrency payment information. Links support expiration, use limits, and metadata.

This API allows you to create and manage payment claim links for customers to submit cryptocurrency payment information.

## The payment claim link object

<ResponseField name="id" type="string">
  Unique identifier with `pcl_` prefix (e.g., `pcl_abc123def456`).
</ResponseField>

<ResponseField name="object" type="string">
  Always `"payment_claim_link"`.
</ResponseField>

<ResponseField name="status" type="string">
  Link status: `active`, `used`, or `expired`.
</ResponseField>

<ResponseField name="expires_at" type="string">
  When the link expires (ISO 8601).
</ResponseField>

<ResponseField name="max_uses" type="integer">
  Maximum number of times the link can be used.
</ResponseField>

<ResponseField name="use_count" type="integer">
  Number of times the link has been used.
</ResponseField>

<ResponseField name="used_at" type="string">
  When the link was last used (ISO 8601). `null` if never used.
</ResponseField>

<ResponseField name="metadata" type="string">
  Additional notes or metadata.
</ResponseField>

<ResponseField name="link" type="string">
  The full URL to share with the customer.
</ResponseField>

<ResponseField name="customer_id" type="string">
  The customer this link belongs to.
</ResponseField>

<ResponseField name="crypto_payment_claim_id" type="string">
  ID of the resulting payment claim. `null` if not used.
</ResponseField>

<ResponseField name="usable" type="boolean">
  Whether the link can still be used.
</ResponseField>

<ResponseField name="expired" type="boolean">
  Whether the link has expired.
</ResponseField>

<ResponseField name="created_at" type="string">
  When the link was created (ISO 8601).
</ResponseField>

<ResponseField name="updated_at" type="string">
  When the link was last updated (ISO 8601).
</ResponseField>

## List payment claim links

```
GET /v1/payment_claim_links
```

Retrieves a paginated list of all payment claim links in your account. Links are ordered by creation date (newest first).

<ParamField query="page" type="integer" default="1">
  Page number for pagination. Results are returned 25 items per page.
</ParamField>

```bash theme={null}
curl https://api.gettrxn.com/v1/payment_claim_links \
  -H "Authorization: Bearer $TRXN_TOKEN"
```

```json Response theme={null}
{
  "payment_claim_links": [
    {
      "id": "pcl_abc123def456",
      "object": "payment_claim_link",
      "status": "active",
      "expires_at": "2025-01-26T12:00:00Z",
      "max_uses": 1,
      "use_count": 0,
      "used_at": null,
      "metadata": "Payment for Invoice #123",
      "link": "https://gettrxn.com/payment-claim/RTL1LDMHAdL6JR64ai7frBpphuuNig9q",
      "customer_id": "cust_xyz789",
      "crypto_payment_claim_id": null,
      "usable": true,
      "expired": false,
      "created_at": "2025-01-25T12:00:00Z",
      "updated_at": "2025-01-25T12:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "pages": 3,
    "count": 67
  }
}
```

## Get payment claim link

```
GET /v1/payment_claim_links/:id
```

Retrieves a specific payment claim link by ID.

<ParamField path="id" type="string" required>
  The payment claim link's ID (e.g., `pcl_abc123def456`).
</ParamField>

```bash theme={null}
curl https://api.gettrxn.com/v1/payment_claim_links/pcl_abc123def456 \
  -H "Authorization: Bearer $TRXN_TOKEN"
```

```json Response theme={null}
{
  "id": "pcl_abc123def456",
  "object": "payment_claim_link",
  "status": "active",
  "expires_at": "2025-01-26T12:00:00Z",
  "max_uses": 1,
  "use_count": 0,
  "used_at": null,
  "metadata": "Payment for Invoice #123",
  "link": "https://gettrxn.com/payment-claim/RTL1LDMHAdL6JR64ai7frBpphuuNig9q",
  "customer_id": "cust_xyz789",
  "crypto_payment_claim_id": null,
  "usable": true,
  "expired": false,
  "created_at": "2025-01-25T12:00:00Z",
  "updated_at": "2025-01-25T12:00:00Z"
}
```

## Create payment claim link

```
POST /v1/payment_claim_links
```

Creates a new payment claim link for a customer.

<ParamField body="customer_id" type="string" required>
  The customer's ID (e.g., `cust_abc123def456`). Must belong to your account.
</ParamField>

<ParamField body="expires_at" type="string">
  When the link expires (ISO 8601 format). Defaults to 24 hours from now.
</ParamField>

<ParamField body="max_uses" type="integer" default="1">
  Maximum number of times the link can be used. Must be greater than 0.
</ParamField>

<ParamField body="metadata" type="string">
  Additional notes or metadata for the link.
</ParamField>

```bash theme={null}
curl -X POST https://api.gettrxn.com/v1/payment_claim_links \
  -H "Authorization: Bearer $TRXN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "cust_abc123def456",
    "expires_at": "2025-01-26T10:00:00Z",
    "max_uses": 1,
    "metadata": "Payment for Invoice #123"
  }'
```

```json Response theme={null}
{
  "id": "pcl_xyz789abc123",
  "object": "payment_claim_link",
  "status": "active",
  "expires_at": "2025-01-26T10:00:00Z",
  "max_uses": 1,
  "use_count": 0,
  "used_at": null,
  "metadata": "Payment for Invoice #123",
  "link": "https://gettrxn.com/payment-claim/RTL1LDMHAdL6JR64ai7frBpphuuNig9q",
  "customer_id": "cust_abc123def456",
  "crypto_payment_claim_id": null,
  "usable": true,
  "expired": false,
  "created_at": "2025-01-25T14:30:00Z",
  "updated_at": "2025-01-25T14:30:00Z"
}
```

### Error responses

```json Customer not found theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "resource_not_found",
    "message": "Customer not found",
    "param": "customer_id"
  }
}
```

```json Invalid max_uses theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "code": "parameter_invalid",
    "message": "Max uses must be greater than 0",
    "param": "max_uses"
  }
}
```

## Delete payment claim link

```
DELETE /v1/payment_claim_links/:id
```

Deletes a payment claim link.

<ParamField path="id" type="string" required>
  The payment claim link's ID (e.g., `pcl_xyz789abc123`).
</ParamField>

```bash theme={null}
curl -X DELETE https://api.gettrxn.com/v1/payment_claim_links/pcl_xyz789abc123 \
  -H "Authorization: Bearer $TRXN_TOKEN"
```

Returns `204 No Content` on successful deletion.

## Link statuses

| Status    | Description                            |
| --------- | -------------------------------------- |
| `active`  | Link is active and can be used.        |
| `used`    | Link has reached its `max_uses` limit. |
| `expired` | Link has expired (past `expires_at`).  |

## Checking link usability

The `usable` field indicates whether a link can still be used. A link is usable if:

* Status is `active`.
* Not expired (`expires_at` is in the future).
* Use count is less than `max_uses`.

## Usage flow

1. **Create a payment claim link** for a customer using their ID.
2. **Share the link** with the customer (via email, SMS, etc.).
3. **Customer visits the link** and submits their payment information.
4. **Review the submission** in your dashboard under Crypto Payment Claims.
5. **Approve or reject** the payment claim.
6. **Optionally delete the link** if no longer needed.

## Sandbox support

<Note>
  The API respects sandbox scoping. If your API token is associated with a sandbox, you can only access links created in that sandbox. Links created in sandbox mode will be isolated from production data.
</Note>
