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

Delete Link

Delete a payment link to prevent further payments through that link. Once deleted, the payment URL will no longer be accessible to customers. Existing charges associated with the link are preserved.

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

Responsesโ€‹

200

Successful deletion

Link deleted successfully. Returns the deleted link object with deleted flag set to true.

Response includes:
  • object - Always returns "link"
  • id - The deleted link's identifier
  • deleted - Set to true indicating successful deletion
  • livemode - Production vs test environment indicator

400

Bad request

Request validation failed. Check the error message for details.

Common causes:
  • Link has already been deleted
  • Link cannot be deleted due to pending operations
  • Invalid request format

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)
  • Link was already deleted

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 DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t:

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]+
already_deletedLink already deletedLink was previously deleted

Important Notesโ€‹

TopicDescription
Deletion is permanentOnce deleted, a link cannot be recovered
Charges preservedExisting charges made through the link remain in your account
Payment URL disabledCustomers can no longer access the payment page
WebhooksA link.deleted event is triggered upon deletion

๐Ÿ”‘API Credentials

Try it outโ€‹

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