PayByLink

Updates an existing payment link

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

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)
  • Auth
    • OAuth 2
      Authorization codehttps://id.teya.xyz/oauth/v2/oauth-authorize
      Client credentials
      Token URLhttps://id.teya.xyz/oauth/v2/oauth-token
    • or OAuth 2
      Authorization codehttps://id.teya.com/oauth/v2/oauth-authorize
      Client credentials
      Token URLhttps://id.teya.com/oauth/v2/oauth-token
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Path parameters

payment_link_idstring uuid required

A unique identifier for the created payment link

Example:20eb276c-5b6b-4474-a5a1-49bcd6193148

The payment link id

Headers

User-Agentstring required
Example:YourCompany-Integration/1.0

Identifies your integration, for example YourCompany-Integration/1.0. Requests without a User-Agent can be blocked by our firewall before they reach the API.

Request body

expires_atstring 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.

Example request

{
  "expires_at": "2026-07-03T13:37:58.709Z"
}

Response

Payment link updated successfully

cancel_urlstring

URL to redirect to when the customer cancels the payment

customer_success_emailstring

Email address to send customer success notification to

expires_atstring date-time

Date when the link will be considered expired in ISO 8601 format

merchant_referencestring

An identifier that can be used to reference the transaction on the merchant's side. Overrides 'source_reference_id

merchant_success_emailstring

Email address to send merchant success notification to

metadataobject

Metadata key-value pairs associated with the payment link

payment_link_idstring 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_fieldsstring[]

Customer fields that must be collected during checkout

status'VALID' | 'COMPLETED' | 'MANUALLY_EXPIRED' | 'DISABLED' | 'EXPIRED' required

The status of the payment link

success_urlstring

URL to redirect to after a successful payment

supported_card_brandsstring[]

Card brands supported for this payment link

supported_payment_methodsstring[]

Payment methods supported for this payment link

Example response

{
  "amount": {
    "currency": "USD",
    "value": 100
  },
  "billing_address": {
    "city": "London",
    "country": "GB",
    "street_address_line1": "Main Street",
    "zipcode": "SW1A1AA"
  },
  "cancel_url": "https://example.com/cancel",
  "customer": {
    "email": "emailaddress@example.com",
    "name": "John Doe",
    "phone_number": "+447911123456"
  },
  "customer_success_email": "customer@example.com",
  "expires_at": "2024-07-03T13:37:58.709Z",
  "line_items": [
    {
      "description": "Product 1",
      "quantity": 1,
      "unit_price": 100
    }
  ],
  "merchant_reference": "merchant-reference-id",
  "merchant_success_email": "merchant@example.com",
  "metadata": {
    "order_id": "12345",
    "table_number": "5"
  },
  "payment_link_id": "20eb276c-5b6b-4474-a5a1-49bcd6193148",
  "post_success_payment": "REDIRECT",
  "required_customer_fields": [
    "EMAIL",
    "PHONE"
  ],
  "status": "COMPLETED",
  "success_url": "https://example.com/success",
  "supported_card_brands": [
    "VISA",
    "MASTERCARD"
  ],
  "supported_payment_methods": [
    "CARD"
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.