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 | 固定値 |
id | string |
|
livemode | boolean | 本番モード ( |
location | string | 現在の |
created_at | string | ISO 8601 形式 ( |
string | chain(チェーン)に関連付けられたメールアドレス。 |
|
key | string | チェーンキー |
revoked | boolean | このチェーンがすでに無効になっているかどうか。 |
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 chains
- GET https://api.omise.co/chainschainに属するすべての お客様のアカウントオブジェクトの list を返します。
Request Parameters
Name | Type | Description |
---|---|---|
from | string | (任意, default: |
limit | integer | (任意, default: |
offset | integer | (任意, default: |
order | string | (任意, default: |
to | string | (任意) ISO 8601形式 ( |
Example
-
List all 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 chain
- GET https://api.omise.co/chains/{id}Returns the chain matching :id
.
Example
-
Retrieve a 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 chain
- POST https://api.omise.co/chains/{id}/revokeRevokes the chain matching :id
.
Example
-
Revoke a 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