---
title: "Update a payment link"
method: PATCH
path: "/gateway/payment-links/{id}"
tags: ["Payment Links"]
---

# Update a payment link

`PATCH /gateway/payment-links/{id}`

## Request

- Base URL: `https://api.agentaos.ai/api/v1`
- URL: `https://api.agentaos.ai/api/v1/gateway/payment-links/{id}`
- Auth: API key in header `x-api-key`

Partial update: only send the fields you want to change.

## Path parameters

- `id` string, uuid, required

## Request body

- PaymentLinkUpdateRequest: Partial update. Every field is optional; only fields present are changed.
  - `name` string
  - `description` string
  - `imageUrl` string, uri
  - `amount` number
  - `type` 'one_time' | 'subscription': Checked against the resulting merged state.
  - `billingInterval` 'month' | 'year'
  - `trialPeriodDays` integer: Free-trial length in days; subscription links only.

## Response `200`

The updated payment link.

- PaymentLink
  - `id` string, uuid, required: Payment link UUID.
  - `org_id` string, uuid, required
  - `user_id` string, uuid, required
  - `secure_link_id` string, required: Public ID used in the checkout URL.
  - `amount` number, required: Currency units.
  - `currency` string, required: Settlement currency or token.
  - `description` string, nullable, required
  - `metadata` object, required: Your custom data.
  - `checkout_fields` CheckoutField[], required
    - `key` string, required
    - `label` string, required
    - `type` 'text' | 'email' | 'tel' | 'select', required
    - `required` boolean, required
    - `placeholder` string
    - `options` string[]: For `type: select` only.
  - `webhook_url` string, nullable, required
  - `success_url` string, nullable, required
  - `cancel_url` string, nullable, required
  - `tax_rate_id` string, uuid, nullable, required
  - `status` 'active' | 'cancelled', required
  - `payment_count` integer, required: Successful payments against this link so far.
  - `supported_networks` string[], required
  - `expires_at` string, date-time, nullable, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required
  - `name` string, nullable, required
  - `image_url` string, nullable, required
  - `max_uses` integer, nullable, required: null means unlimited.
  - `seller_mode` 'mor' | 'crypto', required: mor (card + bank) or crypto (on-chain). The snake_case column equivalent of the computed `sellerMode`.
  - `type` 'one_time' | 'subscription', required
  - `billing_interval` 'month' | 'year' | 'null', nullable, required
  - `environment` 'test' | 'live', required
  - `checkoutUrl` string, required: Full URL to share with buyers. Computed, camelCase, no snake_case equivalent.
  - `sellerMode` 'mor' | 'crypto', required

## Other responses

- `400`: A required field is missing, out of range, or the wrong type. `ValidationPipe` also rejects any field not in the documented schema.
- `401`: Missing or invalid `x-api-key`.
- `403`: The key is valid but the resource belongs to a different organization.
- `404`: Resource not found (or not visible to your key; the two are not distinguished).

---

[API](https://skmtc.dev/agentaos/apis/agentaos-gateway-api.md) · [All operations](https://skmtc.dev/agentaos/apis/agentaos-gateway-api/llms.txt) · [OpenAPI document](https://skmtc.dev/agentaos/apis/agentaos-gateway-api/revisions/3a8ad3c6b965?raw)
