Balance API
Retrieve your Opn Payments account balances. All amounts are expressed in the smallest currency unit.
Attributes
Name | Type | Description |
---|---|---|
object | string | The string |
livemode | boolean | Whether this is a live ( |
location | string | API path to retrieve the current |
available | integer | Amount available to be transferred. |
currency | string | Currency for balance as three-letter ISO 4217 code. |
reserve_amount | integer | Amount reserved. |
total | integer | Total balance after deducted fees. |
Example
-
JSON Response
{ "object": "balance", "livemode": false, "currency": "thb", "reserve_amount": 0, "available": 0, "total": 0, "location": "/balance" }
Retrieve the balance
- GET https://api.omise.co/balanceReturns the current balance of the account.
Example
-
Retrieve the balance
- curl
- php
- node.js
- ruby
- C#
- java
- python
- go
- elixir
curl https://api.omise.co/balance \ -u $OMISE_SECRET_KEY:
<?php $balance = OmiseBalance::retrieve(); // After retrieving it, the balance can be refreshed: $balance->reload();
const omise = require('omise')({ secretKey: 'skey_test_no1t4tnemucod0e51mo', }); const balance = await omise.balance.retrieve(); console.log(balance);
require "omise" Omise.secret_api_key = "skey_test_4xs8breq3htbkj03d2x" balance = Omise::Balance.retrieve # After retrieving it, the balance can be refreshed: balance.reload
var balance = await Client.Balance.Get(); Console.WriteLine($"available balance: {balance.Available}"); Console.WriteLine($"total balance: {balance.Total}");
Balance balance = client.balance().get(); System.out.printf("available balance: %d", balance.getAvailable());
import omise omise.api_secret = "skey_test_no1t4tnemucod0e51mo" balance = omise.Balance.retrieve() balance.total
client, _ := omise.NewClient( "pkey_test_no1t4tnemucod0e51mo", "skey_test_no1t4tnemucod0e51mo", ) result := &omise.Balance{} err := client.Do(result, &operations.RetrieveBalance{}) if err != nil { log.Fatalln(err) } log.Println(result)
Omise.configure(secret_key: "skey_test_4xs8breq3htbkj03d2x") Omise.Balance.retrieve