Voucher Balance Endpoint for e-RUPI Vendor
The Voucher Balance API allows you to check the balance of an existing voucher, providing information about its current balance. This is useful in scenarios where you need to verify the balance of a voucher before processing a transaction or handling user inquiries.
Endpoint Details
This endpoint allows you to check the balance of an existing e-RUPI voucher by providing the voucher ID in the request body.
endpoint: path: /vendor/voucher-balance method: POST headers: - name: X-API-KEY required: true description: API key for authentication. - name: X-API-SECRET required: true description: API secret for authentication. - name: X-PARTNER-ID required: true description: Partner ID for authentication. contentType: application/json requestBody: description: JSON object containing eRupiOrderId and orderId. required: true response: description: JSON object containing balance and umn.
Endpoint Url:
/vendor/voucher-balance
Note: Append this path to the appropriate base URL mentioned in the Prerequisites section.
Endpoint Description and Usage:
This endpoint is used to fetch the current balance of an existing e-RUPI voucher. The request must include all required headers and a valid query parameter specifying the eRupiOrderId. Upon successful retrieval, the API returns the remaining balance of the voucher.
Security
All requests to this endpoint must be authenticated using the required headers as specified in the Prerequisites section. Ensure that your API key and other credentials are kept secure and not exposed in client-side code. Failure to provide valid authentication headers will result in a 401 Unauthorized error.
Sample Request:
Here is an example of a cURL command to check voucher balance using this endpoint:
curl -X POST \ https://{{base_url}}/vendor/voucher-balance \ -H "Content-Type: application/json" \ -H "X-API-KEY: your-api-key" \ -H "X-API-SECRET: your-api-secret" \ -H "X-PARTNER-ID: your-partner-id" \ -d '{ "orderId": "order_123456", "eRupiOrderId": "5c8c3469-807f-45ea-b058-9ee36d255968" }'
Request Body
The POST request to the e-RUPI API must include a JSON payload with the following fields:
{ "orderId": "order_123456", "eRupiOrderId": "5c8c3469-807f-45ea-b058-9ee36d255968" }
Request Schema (YAML)
The request schema for checking voucher balance is as follows:
parameters: - name: orderId in: body description: Unique order identifier for the voucher to be revoked. required: true schema: type: string - name: eRupiOrderId in: body description: Unique eRupi order ID of the voucher to be revoked. required: true schema: type: string
Success Response
Upon a successful request, the API will return a JSON object with the voucher balance:
{ "status": { "code": "200", "error": false }, "message": "Voucher balance retrieved successfully", "result": { "balance": "500", "umn": "EDAmsYjjwxJSuei0T3GiTodAHKkg1rYg@ypay" } }
Error Response
If there is an error with the request, the API will return a JSON object with error details:
{ "status": { "code": "400", "error": true }, "message": "Error message describing the issue", "result": null }
Response Schema (YAML)
The response schema for both success and error responses is as follows:
Note: The result field will contain the voucher details on success and will be null in case of an error.parameters: - name: status in: body description: Contains response metadata. required: true schema: type: object properties: code: type: string description: HTTP-style status code. error: type: boolean description: Indicates if the API encountered an error. - name: message in: body description: Human-readable message describing the result or error. required: true schema: type: string - name: result in: body description: Contains details of the result in case of success; will be null in case of an error. required: true schema: type: object nullable: true properties: balance: type: string description: Current balance of the voucher. umn: type: string description: Unique Merchant Number associated with the voucher.
Integration Support
For assistance during the integration process, please contact e-RUPI support at help@meribachat.in