Fetch Voucher Generators Endpoint for e-RUPI Vendor
The Fetch Voucher Generators API allows e-RUPI Vendors to retrieve the current voucher generators associated with their account.
Endpoint Details
This endpoint retrieves the current voucher generators associated with a vendor account.
endpoint: /vendor/fetch-voucher-generators method: GET 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 queryParameters: - name: page in: query description: Page number for pagination (default is 1). required: false schema: type: integer default: 1 - name: count in: query description: Number of items per page (default is 10). required: false schema: type: integer default: 10 - name: nonPaginated in: query description: If true, returns all results without pagination. required: false schema: type: boolean default: false response: description: JSON object containing list of voucher generators.
Endpoint Url:
/vendor/fetch-voucher-generators
Note: Append this path to the appropriate base URL mentioned in the Prerequisites section.
Endpoint Description and Usage:
This endpoint is used by e-RUPI Vendors to fetch the list of voucher generators associated with their account. Vendors can use this information to create vouchers on behalf of the generators. The response includes details such as generator IDs, names, TnC, and etc. This endpoint is essential for managing voucher generation and ensuring that vouchers are created under the correct generator profiles.
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 fetch wallet balances using this endpoint:
curl -X GET \ https://{{base_url}}/vendor/fetch-voucher-generators?page=1&count=10&nonPaginated=false \ -H "X-API-KEY: your-api-key" \ -H "X-API-SECRET: your-api-secret" \ -H "X-PARTNER-ID: your-partner-id"
Success Response
Upon a successful request, the API will return a JSON object with the voucher status:
{ "status": { "code": "200", "error": false }, "message": "Voucher generators fetched successfully", "result": [ { "id": "generator_123", "name": "Generator 1", "voucherMinAmount": 100, "voucherMaxAmount": 5000, "giftCardExpiryPeriod": 6, // in months "logo": "https://example.com/logo.png", "tnc": "Terms and conditions text" }, { "id": "generator_456", "name": "Generator 2", "voucherMinAmount": 100, "voucherMaxAmount": 1000, "giftCardExpiryPeriod": 12, // in months "logo": "https://example.com/logo.png", "tnc": "Terms and conditions text" } ] }
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 wallet balance 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: array nullable: true items: type: object properties: id: type: string description: Unique identifier of the voucher generator. name: type: string description: Name of the voucher generator. voucherMinAmount: type: integer description: Minimum voucher amount allowed. voucherMaxAmount: type: integer description: Maximum voucher amount allowed. giftCardExpiryPeriod: type: integer description: Expiry period of the gift card in months. logo: type: string description: Logo URL of the voucher generator. tnc: type: string description: Terms and conditions text for the voucher generator.
Integration Support
For assistance during the integration process, please contact e-RUPI support at help@meribachat.in