List Chain Keys
List API keys for a chain connection. Returns a paginated list of keys associated with the sub-merchant account, which can be used for authentication when performing operations on their behalf.
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.
Additional - 5 fieldsQuery Parameters
Responsesโ
200
Successful retrievalKeys list retrieved successfully. Returns a paginated list with metadata.
Response structure:
object- Always returns "list"data- Array of key objectslimit- Records per pageoffset- Number of records skippedtotal- Total number of keys matching filters
400
Bad requestRequest validation failed. Check the error message for details.
Common causes:
- Invalid chain ID format
- Invalid date format for from/to parameters
- Invalid pagination parameters
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/keys \
-u skey_test_5xuy4w91xqz7d1w9u0t: \
-G \
-d "limit=20" \
-d "offset=0"
require 'omise'
Omise.api_key = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = Omise::Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
keys = chain.keys(limit: 20, offset: 0)
import omise
omise.api_secret = 'skey_test_5xuy4w91xqz7d1w9u0t'
chain = omise.Chain.retrieve('acch_test_5xuy4w91xqz7d1w9u0t')
keys = chain.keys(limit=20, offset=0)
const omise = require('omise')({
secretKey: 'skey_test_5xuy4w91xqz7d1w9u0t'
});
const keys = await omise.chains.listKeys('acch_test_5xuy4w91xqz7d1w9u0t', {
limit: 20,
offset: 0
});
<?php
define('OMISE_SECRET_KEY', 'skey_test_5xuy4w91xqz7d1w9u0t');
$chain = OmiseChain::retrieve('acch_test_5xuy4w91xqz7d1w9u0t');
$keys = $chain->keys([
'limit' => 20,
'offset' => 0
]);
Client client = new Client.Builder()
.secretKey("skey_test_5xuy4w91xqz7d1w9u0t")
.build();
ScopedList<Key> keys = client.chains().listKeys("acch_test_5xuy4w91xqz7d1w9u0t")
.limit(20)
.offset(0)
.send();
var client = new Client("skey_test_5xuy4w91xqz7d1w9u0t");
var keys = await client.Chains.ListKeys("acch_test_5xuy4w91xqz7d1w9u0t", new ListOptions
{
Limit = 20,
Offset = 0
});
client, _ := omise.NewClient(
"pkey_test_5xuy4w91xqz7d1w9u0t",
"skey_test_5xuy4w91xqz7d1w9u0t",
)
keys, _ := client.Chains().ListKeys("acch_test_5xuy4w91xqz7d1w9u0t", &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 |
not_found | Chain not found | Check chain ID is correct and exists |
invalid_date_format | Date format validation failed | Use ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) |
Key Object Fieldsโ
| Field | Type | Description |
|---|---|---|
object | string | Always returns "key" |
id | string | Unique key identifier |
livemode | boolean | Production vs test environment indicator |
secret | boolean | Whether this is a secret key |
created_at | string | Key creation timestamp (ISO 8601) |
API Credentials
Try it outโ
Additional - 5 fields
Your IP:
...Loading...