Overview
This method will take the single receipt json as a payload. If UUID value is 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 enabled at admin portal and issuing receipt to the business buyer then it would be rejected.
• Valid receipts will be stored with the status 0 (It is the new receipt status).
Signature
Signature:
IssueReceiptResponseDto response = await _toolkitHandler.IssueReceipt("__Receipt json content__")
public class GenerateQrCodeResponseDto : BaseResponseDto
{
public string Uuid { get; set; } = null!;
public string QrCode { get; set; } = null!;
public string QrCodeImageBase64 { get; set; } = null!;
}
public class BaseResponseDto
{
public string? CorrelationId { get; set; }
public string? Target { get; set; }
public string? Code { get; set; }
public string? Message { get; set; }
public object? Details { get; set; }
}
Inputs
IssueReceipt method takes the below input parameter:
Input parameter | Type | Description | Value example |
---|---|---|---|
receipt/return receipt json | String |
Outputs
It will generate the UUID, QR code url and QR code image as base 64 format and given it as a response.
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 | CorrelationId is a unique number for the request. It has nothing to do with the receipt. It gets a value only in case of an error. | |
Target | String | Output target. | |
Code | String | Code is an error code, and it’s only sent if there is an error. | 404 / 500 etc., |
Message | String | Error message. | |
Details | String | Details of the error. |
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.