Voucher Status Endpoint for e-RUPI Vendor
The Voucher Status API allows you to check the status of an existing voucher, providing information about its current status. This is useful in scenarios where you need to verify the status of a voucher before processing a transaction or handling user inquiries.
Endpoint Details
This endpoint allows you to check the status of an existing e-RUPI voucher by providing the voucher ID in the request body.
endpoint: path: /vendor/voucher-status 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 orderId and eRupiOrderId. required: true response: description: JSON object containing voucherStatus, and umn.
Endpoint Url:
/vendor/voucher-status
Note: Append this path to the appropriate base URL mentioned in the Prerequisites section.
Endpoint Description and Usage:
This endpoint is used to check the status of an existing e-RUPI voucher. The request must include all required headers and a valid JSON body containing the voucher ID to be checked. Upon successful status retrieval, the API returns a status indicating the current state 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 status using this endpoint:
curl -X POST \ https://{{base_url}}/vendor/voucher-status \ -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 status 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 status:
{ "status": { "code": "200", "error": false }, "message": "Voucher status retrieved successfully", "result": { "voucherStatus": "ACTIVE", "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: voucherStatus: type: string description: Current status of the voucher (e.g., ACTIVE, REDEEMED, EXPIRED). 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