Overview
This API will take the single receipt json as a payload. If UUID available in the input json then it will validate the UUID with the newly generating UUID and compare it. Valid receipt will be stored in local cache sql lite db receipt’s table
and generating QR code will be stored in ReceiptQr table.
Toolkit will consider all the new, cancelled status valid receipts for submission.
Note!
• If Restrict receipt issuance to business buyers flag is enabled at admin portal, then issuing receipt to the business buyer will be rejected and an error will be returned.
• Valid receipts will be stored with the status 0 (It is the new receipt status).
Signature
Signature:
POST /toolkit/receipt
Inputs
Header parameter | Type | Description | Value example |
---|---|---|---|
version | String | version number of the toolkit. |
Body of the request contains a single object that contains these fields:
Input parameter | Type | Description | Value example |
---|---|---|---|
receipt/return receipt json | String | issue receipt input json. |
Outputs
It will generate the uuid, qrcode url and qrcode image as base 64 format and given it as a response.
Upon successful submission, API must return 200
status code with the below mentioned output parameters.
Output parameter | Type | Description | Value example |
---|---|---|---|
uuid | String | issue receipt output uuid | 999fd4e6-1a40-40e4-9b86-3f28aafa5529 |
qrCode | String | issue receipt output QR code. | |
qrCodeImageBase64 | String | issue receipt output QR code image base 64. | |
correlationId | String | Correlation id of the successful issue receipt. | |
target | String | issue receipt output target. | |
code | String | Success code | 200 Ok / 201 Created etc., |
message | String | Success message | |
details | String | Additional details |
If buyer type B in receipt input data and restrict receipt Issuance to business buyers enabled then the message would be You are not allowed to issue receipts to the business buyers.
If 4xx
or 5xx
codes appeared as a result, It will be mentioned with the below error output parameters.
Output parameter | Type | Description | Value example |
---|---|---|---|
correlationId | String | Correlation id of the issue receipt error. | |
target | String | Error occurred field information. | |
code | String | Error code | bad request/invalid data etc., |
message | String | Error message. | |
details | String | Error additional details, useful for further investigation. |
Additional considerations
This API is called only over protected HTTPS
channel.