Account API
Account object จะแสดงรายละเอียดบัญชีโอมิเซะ สามารถเรียกใช้ API นี้เพื่อตรวจสอบข้อมูลที่ใช้ลงทะเบียนของคุณ รวมถึงอีเมล์ และ Account ID
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
id | object_id | The account identifier matching |
livemode | boolean | Whether this is a live ( |
location | string | API path to retrieve the current |
api_version | string | Default API version for account. Note: this version can be overridden for a given request in the header. |
auto_activate_recipients | boolean | Whether to automatically activate recipients upon creation. |
chain_enabled | boolean | Whether account chaining is enabled. |
chain_return_uri | string | URI to which submerchant is redirected after they have authorized you (the master merchant) to make API calls on their behalf. |
country | string | Country in which account is registered as two-letter ISO 3166 code. |
created_at | datetime | UTC datetime of account creation in ISO 8601 format ( |
currency | currency | Currency for account as three-letter ISO 4217 code. |
string | Account email address. |
|
metadata_export_keys | object | Object specifying the metadata keys to include in exports. |
supported_currencies | array | Currencies supported for credit and debit card charges by the country in which the account was registered. Enable multi-currency to use currencies other than your account currency. |
team | string | The account team identifier matching |
webhook_uri | string | |
zero_interest_installments | boolean | Whether merchant absorbs the interest for installment payments. |
Example
-
JSON Response
{ "object": "account", "id": "account_test_no1t4tnemucod0e51mo", "team": "acct_no1t4tnemucod0e51mo", "livemode": false, "location": "/account", "country": "TH", "currency": "THB", "email": "somchai.prasert@example.com", "created_at": "2019-12-31T12:59:59Z", "supported_currencies": [ "THB", "JPY", "USD", "EUR", "GBP", "SGD", "AUD", "CHF", "CNY", "DKK", "HKD" ], "api_version": "2019-05-29", "auto_activate_recipients": true, "chain_enabled": true, "zero_interest_installments": true, "chain_return_uri": "https://dashboard.omise.co/test/settings", "webhook_uri": "https://omise-flask-example.herokuapp.com/webhook", "metadata_export_keys": { "charge": [ "color", "order_id" ] } }
Retrieve account information
- GET https://api.omise.co/accountReturns information about the account.
Example
-
Retrieve the account
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/account \ -u $OMISE_SECRET_KEY:
<?php $account = OmiseAccount::retrieve(); // After retrieving it, the account can be refreshed: $account->reload();
omise.account.retrieve(function(error, account) { /* Response. */ });
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" account = Omise::Account.retrieve # After retrieving it, the account can be refreshed: account.reload
var account = await Client.Account.Get(); Console.WriteLine($"account: {account.Email}");
Request<Account> request = new Account.GetRequestBuilder().build(); Account account = client().sendRequest(request); System.out.printf("Account id: %s", account.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" account = omise.Account.retrieve() # After retrieving it, the account can be refreshed: account.reload()
account := &omise.Account{} if e := client.Do(account, &operations.RetrieveAccount{}); e != nil { log.Fatalln(e) } log.Println("my account: %#v\n", account)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Account.retrieve
Update account information
- PATCH https://api.omise.co/accountUpdates and returns information about the account.
Request Parameters
Name | Type | Description |
---|---|---|
chain_enabled | boolean | (optional) Whether account chaining is enabled. |
chain_return_uri | string | (optional) URI to which submerchant is redirected after they have authorized you (the master merchant) to make API calls on their behalf. |
metadata_export_keys | object | (optional) Object specifying the metadata keys to include in exports. |
webhook_uri | string | |
zero_interest_installments | boolean | (optional) Whether merchant absorbs the interest for installment payments. |
Example
-
Updates the account
- curl
curl https://api.omise.co/account \ -X PATCH \ -u $OMISE_SECRET_KEY: \ -d "metadata_export_keys[charge][]=color" \ -d "metadata_export_keys[charge][]=order_id" \ -d "webhook_uri=https://omise-flask-example.herokuapp.com/webhook"