Revoke Voucher Endpoint for e-RUPI Vendor
The Revoke Voucher API allows you to invalidate an existing voucher, rendering it unusable for future transactions. This is useful in scenarios where a voucher needs to be canceled due to various reasons such as fraud, user request, or administrative decisions.
Endpoint Details
This endpoint allows you to revoke an existing e-RUPI voucher by providing the voucher ID in the request body.
endpoint: path: /vendor/revoke-voucher 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 status and message.
Endpoint Url:
/vendor/revoke-voucher
Note: Append this path to the appropriate base URL mentioned in the Prerequisites section.
Endpoint Description and Usage:
This endpoint is used to revoke an existing e-RUPI voucher. The request must include all required headers and a valid JSON body containing the voucher ID to be revoked. Upon successful revocation, the API returns a status indicating the outcome of the operation.
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 revoke a voucher using this endpoint:
curl -X POST \ https://{{base_url}}/vendor/revoke-voucher \ -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 revoking a voucher 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 successful revocation, the API will return a JSON object with the following details:
{ "status": { "code": "200", "error": false }, "message": "Voucher revoked successfully", "result": null }
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 be null for this endpoint as there is no additional data to return upon successful revocation.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: // No result properties as result is null on success
Integration Support
For assistance during the integration process, please contact e-RUPI support at help@meribachat.in