docs

Update a payment link

Partially updates an existing payment link. Only provided fields will be updated. Features: - Partial updates: Only send fields you want to update - Updates line items with adjustable quantities (if provided, replaces all existing line items) - Updates custom fields (if provided, replaces all existing custom fields) - Updates after completion settings (if provided, replaces existing settings) - Recalculates amount from line items when line items are updated - Validates currency consistency across line items when line items are updated Note: - If lineItems is provided, all existing line items are replaced - If customFields is provided, all existing custom fields are replaced - If customFields is an empty array, all custom fields are removed - expiresAt can be set to null to remove expiration

PATCH
/payment-links/{id}
  Partially updates an existing payment link. Only provided fields will be updated.
  
  Features:
  - Partial updates: Only send fields you want to update
  - Updates line items with adjustable quantities (if provided, replaces all existing line items)
  - Updates custom fields (if provided, replaces all existing custom fields)
  - Updates after completion settings (if provided, replaces existing settings)
  - Recalculates amount from line items when line items are updated
  - Validates currency consistency across line items when line items are updated
  
  Note: 
  - If lineItems is provided, all existing line items are replaced
  - If customFields is provided, all existing custom fields are replaced
  - If customFields is an empty array, all custom fields are removed
  - expiresAt can be set to null to remove expiration
AuthorizationBearer <token>

API key for merchant integrations. Send as Authorization: Bearer <your key>.

In: header

Path Parameters

id*string

Payment link ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X PATCH "https://example.com/payment-links/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "id": "plink_abc123",
  "merchantId": "mer_xyz789",
  "active": true,
  "expiresAt": "string",
  "currency": "EGP",
  "computedAmount": 100000,
  "nameCollection": false,
  "billingAddressCollection": false,
  "shippingAddressCollection": false,
  "phoneNumberCollection": false,
  "allowPromotionCodes": false,
  "submitType": "PAY",
  "customerCreation": "always",
  "afterCompletion": {
    "type": "redirect",
    "redirect": {
      "url": "string"
    },
    "hostedConfirmation": {
      "customMessage": "string",
      "returnUrl": "string"
    }
  },
  "lineItems": [
    {
      "id": "li_abc123",
      "quantity": 1,
      "price": {},
      "adjustableQuantity": {},
      "amountSubtotal": 200000,
      "amountTotal": 200000,
      "amountDiscount": 0,
      "amountTax": 0,
      "currency": "EGP",
      "description": "Premium Plan - Monthly",
      "presentmentDetails": {}
    }
  ],
  "customFields": [
    {
      "label": "Company Name",
      "type": "TEXT",
      "isOptional": false,
      "hasLimits": false,
      "limitType": "BETWEEN",
      "minCharacters": 5,
      "maxCharacters": 100,
      "dropdownOptions": [
        {}
      ]
    }
  ],
  "feeConfig": {
    "feesPassThrough": false,
    "vatCollectionEnabled": false,
    "vatCollectionRate": 1400,
    "source": "merchant"
  },
  "metadata": {},
  "brandingSettings": {
    "colorMode": "light",
    "borderStyle": "rounded",
    "spacing": "condensed",
    "inputSize": "small",
    "inputStyle": "flat",
    "formLayout": "compact",
    "colors": {
      "primary": "string",
      "primaryForeground": "string",
      "background": "string",
      "foreground": "string",
      "border": "string",
      "input": "string",
      "ring": "string",
      "muted": "string",
      "mutedForeground": "string",
      "accent": "string",
      "accentForeground": "string",
      "destructive": "string"
    },
    "fontFamily": "string"
  },
  "paymentMethodConfigurationId": "string",
  "createdAt": "string",
  "updatedAt": "string"
}
Empty
Empty