Retrieve Chain Transfer
Retrieve a specific chain by its identifier. Returns the chain object which includes the associated charge and transfer details.
API Credentials
Request Parametersโ
Required - 1 fieldRequired Parameters
`chain_id`STRING(required)
Chain identifier matching pattern /acch(_test)?_[0-9a-z]+/. This is provided in the URL path.
Responsesโ
200
Successful retrievalChain retrieved successfully. Returns the complete chain object with charge and transfer details.
Response includes:
id- Chain identifierkey- Authentication key for the sub-merchantemail- Sub-merchant account emailrevoked- Whether chain access has been revokedcreated_at- Creation timestamp
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)
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/chains/acch_test_5xuy4w91xqz7d1w9u0t \
-u skey_test_5xuy4w91xqz7d1w9u0t:
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = Omise::Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = omise.Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const chain = await omise.chains.retrieve('acch_test_5xuy4w91xqz7d1w9u0t');
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$chain = OmiseChain::retrieve('acch_test_5xuy4w91xqz7d1w9u0t');
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
Chain chain = client.chains().get("acch_test_5xuy4w91xqz7d1w9u0t");
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var chain = await client.Chains.Get("acch_test_5xuy4w91xqz7d1w9u0t");
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
chain, _ := client.Chains().Get("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]+ |
Chain Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "chain" |
id | string | Unique chain identifier |
key | string | Authentication key for performing actions on behalf of the sub-merchant |
email | string | Sub-merchant account email |
livemode | boolean | Production vs test environment indicator |
revoked | boolean | Indicates if chain access has been revoked |
created_at | string | Creation timestamp (ISO 8601) |
Try it outโ
Required - 1 fields