---
title: "Updates an existing payment link"
method: PATCH
path: "/v2/payment-links/{payment_link_id}"
tags: ["PayByLink"]
---

# Updates an existing payment link

`PATCH /v2/payment-links/{payment_link_id}`

## Request

- Base URL: `https://docs.teya.com` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.teya.com/v2/payment-links/{payment_link_id}`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://id.teya.xyz/oauth/v2/oauth-authorize`
    - Client credentials
    - Token URL: `https://id.teya.xyz/oauth/v2/oauth-token`
  - OAuth 2
    - Authorization code: `https://id.teya.com/oauth/v2/oauth-authorize`
    - Client credentials
    - Token URL: `https://id.teya.com/oauth/v2/oauth-token`
- TypeScript: <https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/docs/v2/payment-links/:payment_link_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Updates mutable properties of a payment link.
Currently supports updating expiration timestamp.
<br><strong>Access Token Required scope:</strong> payment-links/id/update

## Path parameters

- `payment_link_id` string, uuid, required: A unique identifier for the created payment link

## Headers

- `User-Agent` string, required

## Request body

- PblUpdatePaymentLinkRequest
  - `expires_at` string, date-time: New expiration timestamp in ISO-8601 format. Expiration can be set up to 5 minutes in the past or any time in the future. Expiry in the past effectively cancels the link. These links can have their expiration changed if needed in the future again. Payment link must be in one of the following states to be updated: VALID, EXPIRED, or MANUALLY_EXPIRED. If not provided in the request, the expiration will not be updated. If provided as null, the expiration will be cleared.

## Response `200`

Payment link updated successfully

- PblGetPaymentLinkResponse: The requested payment link data
  - `amount` PblAmount, required: The transaction amount in the smallest currency unit according to ISO 4217 format. For example: - 100 ISK (Icelandic króna): the amount is 100 (since 1 ISK = 1 subunit). - 100 EUR (Euro): the amount is 10000 (since 1 EUR = 100 cents). - 100 USD (US Dollar): the amount is 10000 (since 1 USD = 100 cents). - 100 KWD (Kuwaiti Dinar): the amount is 100000 (since 1 KWD = 1000 fils).
    - `currency` 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BHD' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BOV' | 'BRL' | 'BSD' | 'BTN' | 'BWP' | 'BYN' | 'BYR' | 'BZD' | 'CAD' | 'CDF' | 'CHE' | 'CHF' | 'CHW' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'COU' | 'CRC' | 'CUC' | 'CUP' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ERN' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GHS' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'IQD' | 'IRR' | 'ISK' | 'JMD' | 'JOD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KPW' | 'KRW' | 'KWD' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'LYD' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MRU' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MXV' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'OMR' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SDG' | 'SEK' | 'SGD' | 'SHP' | 'SLE' | 'SLL' | 'SOS' | 'SRD' | 'SSP' | 'STD' | 'STN' | 'SVC' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TMT' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'USN' | 'UYI' | 'UYU' | 'UZS' | 'VED' | 'VEF' | 'VES' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XCG' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW' | 'ZWL', enum, required: Currency code (e.g. `USD`, `GBP`, `EUR`) following ISO-4217 format.
    - `value` integer, required: The transaction amount in the smallest currency unit according to ISO 4217 format.
  - `billing_address` PblAddressDto: An address
    - `city` string: City name
    - `country` string, required: ISO-3166-1 alpha2 country code
    - `state` string: State or province
    - `street_address_line1` string: Street address line 1
    - `street_address_line2` string: Street address line 2
    - `street_address_line3` string: Street address line 3
    - `zipcode` string: Postal/ZIP code
  - `cancel_url` string: URL to redirect to when the customer cancels the payment
  - `customer` PblCustomer
    - `email` string: Customer email address
    - `name` string: Customer name, used to prefill the hosted checkout form
    - `phone_number` string: Customer phone number. An international phone number including the country code, formatted according to the E.164 standard.
  - `customer_success_email` string: Email address to send customer success notification to
  - `expires_at` string, date-time: Date when the link will be considered expired in ISO 8601 format
  - `line_items` PblPaymentLinkLineItem[]: Basket information to be shown in payment page
    - `description` string, required: This a description for a item in the basket
    - `quantity` integer, required: The number of items, Must be a positive value
    - `unit_price` integer, required: The price of a single item including VAT, Can be negative for discounts
  - `merchant_reference` string: An identifier that can be used to reference the transaction on the merchant's side. Overrides 'source_reference_id
  - `merchant_success_email` string: Email address to send merchant success notification to
  - `metadata` object: Metadata key-value pairs associated with the payment link
  - `payment_link_id` string, uuid, required: A unique identifier for the created payment link
  - `post_success_payment` 'SHOW_SUCCESS_PAGE' | 'REDIRECT': Action to take after a successful payment
  - `required_customer_fields` string[]: Customer fields that must be collected during checkout
  - `status` 'VALID' | 'COMPLETED' | 'MANUALLY_EXPIRED' | 'DISABLED' | 'EXPIRED', required: The status of the payment link
  - `success_url` string: URL to redirect to after a successful payment
  - `supported_card_brands` string[]: Card brands supported for this payment link
  - `supported_payment_methods` string[]: Payment methods supported for this payment link

## Other responses

- `400`: Bad request
- `401`: Lacks valid authentication credentials for the requested resource
- `403`: The server understands the request but refuses to authorise it
- `404`: Payment link not found
- `429`: Too many requests in a given amount of time
- `500`: Internal Server Error

---

[API](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins.md) - [All operations](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/llms.txt) - [OpenAPI document](https://skmtc.dev/teya/apis/teya-apis-for-external-plugins/revisions/e26c4d895fa7?raw)
