Skip to main content
Version: 2019-05-29 (Current)

Update Link

Update a payment link's properties. You can modify the title, description, and metadata of an existing link. Note that amount and currency cannot be changed after creation.

Request Parametersโ€‹

Required - 1 fieldRequired Parameters
โ–ผ
`link_id`STRING(required)
Link identifier matching pattern /link(_test)?_[0-9a-z]+/. This is provided in the URL path.
Example:"link_test_5xuy4w91xqz7d1w9u0t"
Constraints:Must be a valid link ID
Updatable - 3 fieldsUpdatable Parameters
โ–ผ
`title`STRING(optional)
Link name displayed to customers on the payment page.
Example:"Updated Invoice #12345 Payment"
`description`STRING(optional)
Link details and additional context shown to customers.
Example:"Updated payment description for February 2025"
`metadata`OBJECT(optional)
Custom key-value pairs (max 15,000 characters total). Useful for storing order IDs, customer references, or any custom data. Replaces existing metadata.
Example:{"order_id":"1234","customer_email":"john@example.com","updated_at":"2025-02-01"}

Responsesโ€‹

200

Successful update

Link updated successfully. Returns the complete updated link object.

Response includes:
  • id - Link identifier
  • title - Updated link title
  • description - Updated link description
  • metadata - Updated metadata object
  • payment_uri - Shareable URL for customer payment (unchanged)
  • amount - Payment amount (unchanged)
  • currency - Currency code (unchanged)

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Attempting to update immutable fields (amount, currency)
  • Invalid metadata format
  • Metadata exceeds size limit
  • Invalid data types

401

Unauthorized

Authentication failed. Invalid or missing API key.

Common causes:
  • Missing Authorization header
  • Invalid secret key
  • Using public key instead of secret key
  • Incorrect HTTP Basic Auth format

404

Not found

Link not found with the provided ID.

Common causes:
  • Invalid link ID format
  • Link does not exist
  • Link belongs to different account
  • Using test key with live link ID (or vice versa)

5xx

Server error

Server-side error occurred. These are rare but should be handled gracefully.

How to handle:

Code samplesโ€‹

curl https://api.omise.co/links/link_test_5xuy4w91xqz7d1w9u0t \
-X PATCH \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-d "title=Updated Invoice #12345 Payment" \
-d "description=Updated payment description for February 2025"

Error and result codesโ€‹

Common Error Codesโ€‹

CodeDescriptionResolution
authentication_failureInvalid API keyVerify your secret key is correct
not_foundLink not foundCheck link ID is correct and exists
invalid_link_idMalformed link IDEnsure ID matches format link(test)?[0-9a-z]+
immutable_fieldCannot update fieldAmount and currency cannot be changed
invalid_metadataMetadata validation failedCheck metadata format and size limits

Updatable vs Immutable Fieldsโ€‹

FieldUpdatableNotes
titleYesDisplay name for customers
descriptionYesAdditional context for customers
metadataYesReplaces existing metadata entirely
amountNoCannot be changed after creation
currencyNoCannot be changed after creation
multipleNoCannot be changed after creation

๐Ÿ”‘API Credentials

Try it outโ€‹

Required - 1 fields
โ–ผ
Additional - 3 fields
Your IP: ...Loading...