Delete a Linked Account
Permanently delete a linked account from your platform. This action is irreversible and the linked account can no longer be used for payments.
Request Parametersโ
Required - 1 fieldRequired Parameters
`id`STRING(required)
Linked Account ID to delete (must be a valid linked account ID starting with lacct_).
Responsesโ
200
Linked account deleted successfullyLinked account permanently deleted. The account can no longer be used for payments.
Deletion effects:
- Linked account status is set to "deleted"
- Account can no longer process payments
- Registration URI becomes invalid
- Past transactions remain in records
- Deletion cannot be undone
400
Bad requestInvalid linked account ID format.
Common causes:
- Linked account ID format is invalid
- ID does not start with lacct_
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 foundLinked account not found.
Common causes:
- Linked account ID does not exist
- Linked account has already been deleted
- Linked account does not belong to your platform
- Mixing test and live mode IDs
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/linked_accounts/lacct_test_5xuy4w91xqz7d1w9u0t \
-X DELETE \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
linked_account = Omise::LinkedAccount.destroy('lacct_test_5xuy4w91xqz7d1w9u0t')
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
linked_account = omise.LinkedAccount.retrieve('lacct_test_5xuy4w91xqz7d1w9u0t')
linked_account.destroy()
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const linkedAccount = await omise.linkedAccounts.destroy('lacct_test_5xuy4w91xqz7d1w9u0t');
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$linked_account = OmiseLinkedAccount::retrieve('lacct_test_5xuy4w91xqz7d1w9u0t');
$linked_account->destroy();
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
LinkedAccount linkedAccount = client.linkedAccounts().destroy("lacct_test_5xuy4w91xqz7d1w9u0t");
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var linkedAccount = await client.LinkedAccounts.Destroy("lacct_test_5xuy4w91xqz7d1w9u0t");
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
deleted, _ := client.LinkedAccounts().Destroy("lacct_test_5xuy4w91xqz7d1w9u0t")
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
bad_request | Invalid linked account ID format | Check ID format |
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Linked account not found | Verify linked account ID exists |
Deletion Responseโ
| Field | Description |
|---|---|
object | Object type (always "linked_account") |
id | ID of the deleted linked account |
livemode | Whether this was a live mode linked account |
status | Status (always "deleted" for successful deletions) |
deleted | Boolean flag (always true for successful deletions) |
API Credentials
Try it outโ
Required - 1 fields
Your IP:
...Loading...