Skip to content

API Balance Inquiry

API Balance Inquiry is used to obtain balance information available on the MC Senmo account.


API Information

FieldValue
Path/api/{version}/balance-inquiry
HTTP MethodPOST
Service Code11
Versionv1.0
TypeJSON
AuthenticationOAuth 2.0 with Access Token

Request Structure

Request Header

Details
Parameter / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource. Use: application/json
AuthorizationMStringRepresents the access_token of a request. Starts with keyword "Bearer" followed by the access token. e.g.: Bearer eyJraWQiOi...
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format
X-SIGNATUREMStringSymmetric signature using HMAC_SHA512. Formula: stringToSign = HTTPMethod + ":" + EndpointUrl + ":" + AccessToken + ":" + Lowercase(HexEncode(SHA256(minify(RequestBody)))) + ":" + TimeStamp. Notes: (1) Use full URL endpoint including all parameters. (2) If no Request Body, use empty string for minify parameter.
X-PARTNER-IDMStringUnique ID for a partner. Use the iFortepay Client ID obtained after the onboarding process.
X-EXTERNAL-IDMStringNumeric String. A unique reference number you should generate. Must be unique on the same day.
ORIGINOStringOrigin domain registered on the iFortepay system.
CHANNEL-IDMStringDevice identification on which the API services are being accessed. Use value: api

M = Mandatory, O = Optional

Request Body

Details
Parameter / FieldMandatoryTypeLengthDescription
partnerReferenceNoOString64Transaction identifier from client's system
accountNoMString16Registered company's bank account number
balanceTypeOString-Balance type to be queried. Currently only supports cash. Fill: cash
additionalInfoOObject-Additional info object

Example Request

Details
artifact
id: balance-inquiry-request
name: Example Request - API Balance Inquiry
type: code.bash
content: |-
  curl --location --request POST 'https://api-stage.senmo.id/api/v1.0/balance-inquiry' \
  --header 'Content-Type: application/json' \
  --header 'X-TIMESTAMP: 2023-01-02T14:06:09+07:00' \
  --header 'X-SIGNATURE: CYkbBOApXkXnNUh9ZJfMdqX9ymQlq+BCP03EgM1jIJth0Ct+kvnIvEf1I6kaOQcFArmTWIUOYsNw/SErzH4GEw==' \
  --header 'X-PARTNER-ID: MCPD00000012' \
  --header 'X-EXTERNAL-ID: 1672643169814' \
  --header 'CHANNEL-ID: api' \
  --header 'ORIGIN: https://www.mcpayment.id' \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --data-raw '{
    "partnerReferenceNo": "20221228-0004",
    "accountNo": "123812939120",
    "balanceType": "cash"
  }'

Response Structure

Response Header

Details
Parameter / FieldMandatoryTypeDescription
Content-TypeMStringIndicates the media type of the resource. Value: application/json
X-TIMESTAMPMStringClient's current local time in yyyy-MM-ddTHH:mm:ss.SSSTZD format

Response Body

Details
Parameter / FieldMandatoryTypeLengthDescription
responseCodeMString7Response code
responseMessageMString150Response message/description based on the responseCode
referenceNoMString64Transaction identifier on iFortepay system. Filled upon successful transaction
partnerReferenceNoOString64Transaction identifier on client's system
accountNoOArray16Registered company's bank account number
nameOString-Account holder name
accountInfoMObject-Collection of balances based on types
balanceTypeOString-Balance type queried. Currently only cash
amountOObject-Total net amount of the balance. See Balance Object Detail
floatAmountOObject-Amount of deposit not yet effective (e.g. due to holidays). See Balance Object Detail
holdAmountOObject-Hold amount that cannot be used. See Balance Object Detail
availableBalanceOObject-Account balance available for financial transactions. See Balance Object Detail
ledgerBalanceOObject-Account balance at the beginning of each day, updated daily. See Balance Object Detail
currentMultiLateralLimitOObject-Credit limit or company transaction limit. See Balance Object Detail
statusOString-Balance account status: 0001 = Active, 0002 = Closed, 0007 = Frozen

Balance Object Detail

Parameter / FieldMandatoryTypeLengthDescription
valueOString-Amount value of the balance
currencyOString3Currency of the amount value (e.g. IDR)

Example Response

Details

✅ Success Response

json
{
  "responseCode": "2001100",
  "responseMessage": "Successful",
  "referenceNo": "63b4010ef1c4599ccc5553f2",
  "partnerReferenceNo": "20221228-0004",
  "name": "Final Fantasy 8",
  "accountInfo": [
    {
      "balanceType": "CASH",
      "amount": { "value": "99978000.00", "currency": "IDR" },
      "floatAmount": { "value": "0.00", "currency": "IDR" },
      "holdAmount": { "value": "508000.00", "currency": "IDR" },
      "availableBalance": { "value": "99470000.00", "currency": "IDR" },
      "ledgerBalance": { "value": "99978000.00", "currency": "IDR" },
      "currentMultilateralLimit": { "value": "0.00", "currency": "IDR" },
      "status": "0001"
    }
  ]
}

❌ Error Response

json
{
  "responseCode": "4091101",
  "responseMessage": "Duplicate partnerReferenceNo"
}

iFortepay API Documentation