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.
Updatable - 3 fieldsUpdatable Parameters
`title`STRING(optional)
Link name displayed to customers on the payment page.
`description`STRING(optional)
Link details and additional context shown to customers.
`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.
Responsesโ
200
Successful updateLink updated successfully. Returns the complete updated link object.
Response includes:
id- Link identifiertitle- Updated link titledescription- Updated link descriptionmetadata- Updated metadata objectpayment_uri- Shareable URL for customer payment (unchanged)amount- Payment amount (unchanged)currency- Currency code (unchanged)
400
Bad requestRequest 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
UnauthorizedAuthentication 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 foundLink 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 errorServer-side error occurred. These are rare but should be handled gracefully.
How to handle:
- Retry the request with exponential backoff
- Check status.omise.co for service incidents
- See Error Handling for detailed guidance
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
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"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
link = Omise::Link.retrieve('link_test_5xuy4w91xqz7d1w9u0t')
link = link.update(
title: 'Updated Invoice #12345 Payment',
description: 'Updated payment description for February 2025'
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
link = omise.Link.retrieve('link_test_5xuy4w91xqz7d1w9u0t')
link.update(
title='Updated Invoice #12345 Payment',
description='Updated payment description for February 2025'
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const link = await omise.links.update('link_test_5xuy4w91xqz7d1w9u0t', {
title: 'Updated Invoice #12345 Payment',
description: 'Updated payment description for February 2025'
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$link = OmiseLink::retrieve('link_test_5xuy4w91xqz7d1w9u0t');
$link->update([
'title' => 'Updated Invoice #12345 Payment',
'description' => 'Updated payment description for February 2025'
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Link link = client.links().update("link_test_5xuy4w91xqz7d1w9u0t")
.title("Updated Invoice #12345 Payment")
.description("Updated payment description for February 2025")
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var link = await client.Links.Update("link_test_5xuy4w91xqz7d1w9u0t", new UpdateLinkRequest
{
Title = "Updated Invoice #12345 Payment",
Description = "Updated payment description for February 2025"
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
link, _ := client.Links().Update("link_test_5xuy4w91xqz7d1w9u0t", &operations.UpdateLink{
Title: "Updated Invoice #12345 Payment",
Description: "Updated payment description for February 2025",
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Link not found | Check link ID is correct and exists |
invalid_link_id | Malformed link ID | Ensure ID matches format link(test)?[0-9a-z]+ |
immutable_field | Cannot update field | Amount and currency cannot be changed |
invalid_metadata | Metadata validation failed | Check metadata format and size limits |
Updatable vs Immutable Fieldsโ
| Field | Updatable | Notes |
|---|---|---|
title | Yes | Display name for customers |
description | Yes | Additional context for customers |
metadata | Yes | Replaces existing metadata entirely |
amount | No | Cannot be changed after creation |
currency | No | Cannot be changed after creation |
multiple | No | Cannot be changed after creation |
API Credentials
Try it outโ
Required - 1 fields
Additional - 3 fields
Your IP:
...Loading...