Revoke Chain
Revoke an existing chain connection. This terminates the authorization and prevents the requesting account from creating charges or performing actions on behalf of the sub-merchant. This action cannot be undone.
Request Parametersโ
Required - 1 fieldPath Parameters
`id`STRING(required)
Chain identifier matching pattern /acch(_test)?_[0-9a-z]+/. This is provided in the URL path.
Responsesโ
200
Successful revocationChain revoked successfully. The chain connection is now terminated and the requesting account can no longer perform actions on behalf of the sub-merchant.
Response includes:
id- Chain identifierkey- Authentication key (no longer valid)email- Sub-merchant account emailrevoked- Will be true after revocationlivemode- Production vs test environment indicatorcreated_at- Creation timestamp
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid chain ID format
- Chain is already revoked
- Chain has pending transfers
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 foundChain not found with the provided ID.
Common causes:
- Invalid chain ID format
- Chain does not exist
- Chain belongs to different account
- Using test key with live chain 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/chains/acch_test_5xuy4w91xqz7d1w9u0t/revoke \
-X POST \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = Omise::Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
chain.revoke
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = omise.Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
chain.revoke()
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const chain = await omise.chains.revoke('acch_test_5xuy4w91xqz7d1w9u0t');
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$chain = OmiseChain::retrieve('acch_test_5xuy4w91xqz7d1w9u0t');
$chain->revoke();
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Chain chain = client.chains().revoke("acch_test_5xuy4w91xqz7d1w9u0t");
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var chain = await client.Chains.Revoke("acch_test_5xuy4w91xqz7d1w9u0t");
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
chain, _ := client.Chains().Revoke("acch_test_5xuy4w91xqz7d1w9u0t")
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
authentication_failure | Invalid API key | Verify your secret key is correct |
not_found | Chain not found | Check chain ID is correct and exists |
invalid_chain_id | Malformed chain ID | Ensure ID matches format acch(test)?[0-9a-z]+ |
already_revoked | Chain is already revoked | Chain has already been revoked |
pending_transfers | Chain has pending transfers | Wait for pending transfers to complete |
Chain Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "chain" |
id | string | Unique chain identifier |
key | string | Authentication key (invalid after revocation) |
email | string | Sub-merchant account email |
livemode | boolean | Production vs test environment indicator |
revoked | boolean | Will be true after revocation |
created_at | string | Creation timestamp (ISO 8601) |
API Credentials
Try it outโ
Your IP:
...Loading...