Skip to main content

Get Balance (Merchant)

The Get Balance API allows merchants to retrieve their current balance for one or multiple payment methods. This API uses HMAC-SHA256–based signature verification.


Endpoint

Request URL: https://apihit.net/api/creedo/balance/get-balance


Request Headers

Header NameValue
Content-Type"application/json"
Accept"application/json"
X-SignatureThe HMAC signature used for verification.

Request Parameters

PropertyPresenceTypeDescription
midMandatoryStringMerchant public key provided during onboarding.
payment_methodMandatoryStringUse "all" for all payment methods or specify a method such as "BKASH_P2C", "NAGAD_P2C", "EASYPAISA_P2C", etc.

Signature Generation

The signature (X-Signature) is generated using HMAC with SHA-256.

secret_string = mid:payment_method

Request Body Example

POST /api/creedo/balance/get-balance HTTP/1.1
Host: https://apihit.net
Content-Type: application/json
Accept: application/json
X-Signature: <hash_str>

{
"mid": "2982146287",
"payment_method": "all"
}

Valid Values for payment_method

ValueDescription
allReturns balance for all payment methods
BKASH_P2CBalance for Bkash P2C
NAGAD_P2CBalance for Nagad P2C
EASYPAISA_P2CBalance for Easypaisa P2C
JAZZCASH_P2CBalance for JazzCash P2C

Success Response Parameters

PropertyTypeDescription
currency_codeStringCurrency of the balance amount.
payment_methodStringPayment method name.
balanceNumberCurrent merchant balance for the method. Can be positive or negative.

Success Response Example

[
{
"currency_code": "BDT",
"payment_method": "BKASH_P2C",
"balance": 10088.52
},
{
"currency_code": "PKR",
"payment_method": "EASYPAISA_P2C",
"balance": -914
}
]

Error Response Parameters

PropertyTypeDescription
gateway_statusString"rejected"
messageStringError message here.

Error Response Example

{
"gateway_status": "rejected",
"message": "Invalid signature."
}

Notes

  • The mid must match the merchant's assigned public key.
  • Always convert the HMAC signature to uppercase.
  • When using "all", balances for every active payment method will be returned.
  • Signature must be regenerated for every request.