Skip to main content

Response Model Structure

If the Valuetopup API returns a response with HTTP status code 200, the response will be provided in the following format:

{
"responseCode": "string",
"responseMessage": "string",
"payLoad": object
}

Field Description

FieldExample value1Example value2
responseCode000501
responseMessagenullThe Subscriber number is not valid
payloadIt will show request information only if responseCode is 000. Otherwise, it is always null.null
Transaction StatusSuccessfulFailed - It means the transaction is failed as the subscriber number is not valid.

[!IMPORTANT] Check for successful transaction you must check 2 conditions:

  1. HTTP status code must be 200 OK
  2. responseCode must be "000"

If HTTP status is 200 and responseCode is not "000", then transaction is failed. If HTTP status is not 200, consider transaction failed.

Successful Transaction Example:

HTTP Status Code: 200 OK

{
"responseCode": "000",
"responseMessage": null,
"payLoad": object
}

Failed Transaction Example:

HTTP Status Code: 200 OK

{
"responseCode": "501",
"responseMessage": "The Subscriber number is not valid",
"payLoad": null
}