Account API
Account object จะแสดงรายละเอียดบัญชีโอมิเซะ สามารถเรียกใช้ API นี้เพื่อตรวจสอบข้อมูลที่ใช้ลงทะเบียนของคุณ รวมถึงอีเมล์ และ Account ID
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
id | string | 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: can be overridden for a given request using 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 | For account chaining, URI to which submerchant is redirected after they have authorized you (the master merchant) to make API calls on their behalf |
chaining_allowed | boolean | Whether account chaining is allowed |
country | string | Country in which account is registered as two-letter ISO 3166 code |
created_at | string | UTC datetime of account creation in ISO 8601 format ( |
currency | string | Currency for account as three-letter ISO 4217 code |
string | Account email address |
|
last_updated_api_version | string | Last updated API version. Note: This is an internal API field used by the dashboard. |
metadata_export_keys | object | Object specifying the metadata keys to include in data exports using the Dashboard |
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. Different payment methods may support different currencies |
team | string | The account team identifier matching |
transfer_config | object | The configuration for fund transfer. This configuration is set on the admin dashboard for each merchant or a PSP. |
webhook_uri | string | |
zero_interest_installments | boolean | Whether merchant absorbs the interest for installment payments by default. Note: can be overridden for a given charge or source by passing the |
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": false, "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" ] }, "chaining_allowed": true, "last_updated_api_version": "2019-06-06", "transfer_config": { "min_transfer_amount": "30.00", "max_transfer_amount": 2000000, "is_payout_enabled": false } }
Retrieve account information
- GET https://api.omise.co/account/api_versionsReturns information about the account. Both test and live keys return the same 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();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const account = await omise.account.retrieve(); console.log(account);
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()
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Account{} err := client.Do(result, &operations.RetrieveAccount{}) if err != nil { log.Fatalln(err) } log.Println(result)
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, default: |
chain_return_uri | string | (optional) For account chaining, 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 data exports using the Dashboard |
webhook_uri | string | |
zero_interest_installments | boolean | (optional, default: |
Example
-
Updates the account
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
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"
<?php $account = OmiseAccount::retrieve(); $account->update(['webhook_uri' => 'https://www.omise.co']); // After retrieving it, the account can be refreshed: $account->reload();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const account = omise.account.UpdateAccount({ webhook_uri: 'https://webhook-url' }); console.log(account);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" Omise.webhook_uri = "https://webhook-url" account = Omise::Account.update # After updating it, the account can be refreshed: account.reload
var account = await Client.Account.Update("https://webhook-url"); Console.WriteLine($"account: {account.Id}");
Account account = client.account().update("https://webhook-url"); System.out.printf("Updated account id: %s\n", account.getId());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" omise.webhook_uri = "https://webhook-url" account = omise.Account.update() # After updating it, the account can be refreshed: account.update()
account := &omise.UpdateAccount{ webhook_uri: "https://webhook-url" } if e := client.Do(account, &operations.UpdateAccount{}); e != nil { log.Fatalln(e) } log.Println("Updated account:", account)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.configure(webhook_uri: "https://webhook-url") Omise.Account.update
Update API version
- PATCH https://api.omise.co/account/api_versionUpdates API version to the latest version (see API Versioning)
Note: This is an internal API used by the dashboard.