Modify Customer Balance

The Modify Customer Balance API is used to add or deduct money from/to a postpaid balance of the account. This function does not change the RATE type offer’s limit values.

HTTP URL

 

PUT api/v2/customer/{id}/balance

Eligibility

The Requestor is eligible to add or deduct money to/from his direct sub-accounts only. It is not allowed to perform these changes neither on its own account nor any other sub-accounts level.

API Request

Request Structure

Parameter Type M/O/CM Description
subAccountId UUID M Universal unique ID of the sub account that its balance will be modified.
amount Decimal M Add or deduct money to/from the customer’s postpaid balance. Sending positive value will perform a DEBIT action (deduct money from the balance). Negative value will perform a CREDIT action (add money to the balance)
currency String M Monetary currency. e.g., USD, GBP, EUR
quantity Numeric O Quantity represents how many adjustments are needed.e.g. amount 10, currency “USD” with quantity 3 will result in an adjustment of 30$ (amount*quantity). Must be positive number. Default if not sent is 1.
referenceTime DateTime O Self-recorded timestamp. It is not the actual transaction date and time. It is not possible to populate date for future execution. The adjustment is being executed immediately when the API is sent. Default if not sent – now()
externalTransactionId String O External Reference identifier. Relevant if search of transaction is required in reports or extractions
description String O Adjustment description. Free text.
transactionType String O Type of transaction. Currently supports manual adjustments only. ENUM valid values: MANUAL_ADJUSTMENT. Default if not sent: MANUAL_ADJUSTMENT
reason String O Reason for the transaction per type. Manual adjustment ENUM valid values: GENERAL, DISCOUNT, RATES_ADJUSTMENTS, REFUND, CREDIT, SHIPMENT_COST, ORDER_COST, DEBT. Default if not sent: GENERAL

API Response

Response Structure

Parameter Type M/O/CM Description
errorCode String O Failure code. See list below, under ‘Error Codes’ section
errorMessage String O Failure detailed description. See list below, under ‘Error Codes’ section
content Object O Array of main response body object. Displayed when an API call was successful. For a failure it will be empty.
pageable Object O Paging information object. Displayed when an API call was successful. For a failure it will be empty.

Content Data Objects

Parameter Type M/O/CM Description
requestId UUID M Request instance ID. To be used by external systems to query the call (operation) status, whether in progress, successful or failed.

Error Codes

In addition to the general success and failure codes, the following error codes are possible.

Code Message
GLOBAL_1001 Service unavailable. Please try again
CUSTOMER_1002 Subscriber does not exist
CUSTOMER_1006 Failed to retrieve customer details

Examples

Request Body

Copy
{
  "subAccountId": "fe84aea1-5e3f-4f45-b32c-03562913c350",
  "amount": -25,
  "currency": "USD",
  "quantity": 3,
  "referenceTime": "2024-12-30 22:05:59",
  "externalTransactionId": "",
  "description": "Applying a discount",
  "transactionType": "MANUAL_ADJUSTMENT",
  "reason": "DISCOUNT"
}

Response Body: Full Success (ACK)

Copy
{
  "errorCode": "",
  "errorMessage": "",
  "content": [
    {
      "requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370"
    }
  ],
  "pageable": null
}

Response Body: Includes Failure(s) (NAK)

Copy
{
  "errorCode": "CUSTOMER_1039",
  "errorMessage": "Requested BCD is not eligible for the customer",
  "content": "",
  "pageable": ""
}