Check account balance
In some situations it is useful to be able to ascertain the current balance in a merchant's settlement account. Vyne has provided an endpoint to allow you to get this information. There are 2 steps required to get this information:
1. Get payment token
Start by generating a payment token. Make a HTTP POST
request to the relevant endpoint + /api/oauth/token/
using the access token you generated.
Request
curl --location --request POST 'https://uat.app.payvyne.com/api/oauth/token'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'grant_type=client_credentials'
--data-urlencode 'client_id=<payment_key>'
--data-urlencode 'client_secret=<payment_secret>’
Try it out
If your request was successful you will receive a payment token like this in the response
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjaGFudElkIjoxLCJzY29wZSI6WyJwYXkiXSwiaXNzIjoiaHR0cDovL2FwcC5kZXYucGF5dnluZS5zeXN0ZW1zIiwiZXhwIjoxNTg2MzY5NzExLCJpYXQiOjE1ODYzNjYxMTEsImF1dGhvcml0aWVzIjpbIlJPTEVfUEFZIl0sImp0aSI6ImExY2UzZjdmLTE3MzItNDhmNC04NTI3LTA5NWQ5NjlhNjkzNSIsImNsaWVudF9pZCI6IllNUFE2aDZQYTNaYmpEMXplbkQ0eXcifQ.g3XSXftyHvlCL1z1tlW6khboY7hzbiZVZgIzKHF2Rdc
2. Make balance request
Send an HTTP GET
request to the relevant endpoint + /api/v1/partners/merchants/{merchantId}/settlementAccounts/{identifier}/balance
.
Request
curl --location --request GET 'https://uat.app.payvyne.com/api/v1/partners/merchants/<merchantId>/settlementAccounts/<identifier>/balance' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <payment_token>'
Request parameters
Parameter | Description |
---|---|
identifier | Settlement account identifier for the account you wish to retrieve the balance. This value can be found in your portal. |
merchantId | The unique ID used to differentiate your linked merchants. |
Response
{
"currency": "GBP",
"balance": 120.50,
"availableBalance": 120.50
}
Response parameters
Parameter | Description |
---|---|
currency | The currency of the settlement account. |
balance | The current total balance of the settlement account. |
availableBalance | The balance available to be used for money out transactions. A disparity between balance and availableBalance is rare, but can arrive if payments are in a processing state. |
Updated 10 months ago