Chain API
Retrieve and revoke chains. Chains represent sub-merchant accounts which have authorized another account to create charges and perform other actions on their behalf. When performing these actions, merchants use the sub-merchant chain key when interacting with the API.
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
id | string | The chain identifier matching |
livemode | boolean | Whether this is a live ( |
location | string | API path to retrieve the current |
created_at | string | UTC datetime of sub-merchant chain creation in ISO 8601 format ( |
string | Sub-merchant account email address |
|
key | string | Chain key. Use instead of sub-merchant's secret key to perform actions on their behalf |
revoked | boolean | Whether this sub-merchant chain is revoked |
Example
-
JSON Response
{ "object": "chain", "id": "acch_test_no1t4tnemucod0e51mo", "livemode": false, "location": "/chains/acch_test_no1t4tnemucod0e51mo", "created_at": "2019-04-23T07:44:31Z", "revoked": false, "key": "ckey_test_no1t4tnemucod0e51mo", "email": "somchai.prasert@esimo.co" }
List sub-merchant chains
- GET https://api.omise.co/chainsReturns a list of sub-merchant chains belonging to your account.
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (optional, default: |
limit | integer | (optional, default: |
offset | integer | (optional, default: |
order | string | (optional, default: |
to | string | (optional) Latest UTC datetime for returned records in ISO 8601 format ( |
Example
-
List all sub-merchant chains
- curl
- ruby
curl https://api.omise.co/chains \ -u $OMISE_SECRET_KEY:
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" chains = Omise::Chain.list
Retrieve a sub-merchant chain
- GET https://api.omise.co/chains/{id}Returns the sub-merchant chain matching :id
.
Example
-
Retrieve a sub-merchant chain
- curl
- ruby
curl https://api.omise.co/chains/acch_test_57io26ws5af7plco6k1 \ -u $OMISE_SECRET_KEY:
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" chain = Omise::Chain.retrieve("acch_test_57io26ws5af7plco6k1")
Revoke a sub-merchant chain
- POST https://api.omise.co/chains/{id}/revokeRevokes the sub-merchant chain matching :id
.
Example
-
Revoke a sub-merchant chain
- curl
- ruby
curl https://api.omise.co/chains/acch_test_57io26ws5af7plco6k1/revoke \ -X POST \ -u $OMISE_SECRET_KEY:
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" chain = Omise::Chain.retrieve("acch_test_57io26ws5af7plco6k1") chain.revoke