List All Chains
Returns a paginated collection of sub-merchant chain accounts. Chains represent sub-merchants who have authorized another account to create charges and perform actions on their behalf.
API Credentials
Request Parametersโ
Additional - 5 fieldsAdditional Parameters
Responsesโ
200
Successful retrievalChains list retrieved successfully. Returns a paginated list with metadata.
Response structure:
object- Always returns "list"data- Array of chain objectslimit- Records per pageoffset- Number of records skippedtotal- Total number of chains matching filters
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
Code samplesโ
- cURL
- Ruby
- Python
- Node.js
- PHP
- Java
- C#
- Go
curl https://api.omise.co/chains \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d "limit=20" \
-d "offset=0"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
chains = Omise::Chain.list(
limit: 20,
offset: 0
)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
chains = omise.Chain.list(
limit=20,
offset=0
)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const chains = await omise.chains.list({
limit: 20,
offset: 0
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$chains = OmiseChain::retrieve([
'limit' => 20,
'offset' => 0
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Chain> chains = client.chains().list()
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var chains = await client.Chains.GetList(new ListOptions
{
Limit = 20,
Offset = 0
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
chains, _ := client.Chains().List(&omise.ListParams{
Limit: 20,
Offset: 0,
})
Error and result codesโ
Common Error Codesโ
| Code | Description | Resolution |
|---|---|---|
bad_request | Missing or invalid parameters | Check parameter values and formats |
authentication_failure | Invalid API key | Verify your secret key is correct |
invalid_date_format | Date format validation failed | Use ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) |
Chain Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "chain" |
id | string | Chain identifier matching /acch(_test)?_[0-9a-z]+/ |
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โ
Additional - 5 fields