Appearance
Register Fiscal Receipt API
This API sends a transaction to the fiscal system (OFD) to generate a fiscal receipt. It registers a cash payment in the OFD system.
Old endpoint (will be deprecated)
plaintext
POST BASE_URL/merchant/registerFiscalReceipt/New Enpoint
plaintext
POST BASE_URL/merchant/fiscalization/register/Endpoints
Method:
POST
URL: BASE_URL/merchant/fiscalization/register/
Headers:
plaintext
api-key: "merchant_secure_api_key"Request body
| Field | Type | Required | Description |
|---|---|---|---|
| transactionId | string | No | Unique identifier for the transaction. Required if it is a Card payment. |
| items | array | Yes | List of items to be included in the fiscal receipt. |
| externalId | string | No | Unique identifier for the fiscal receipt. Required if it is a Cash payment. |
| phoneNumber | string | No | Client phone number who made the payment. Format: +998*******. Required if it is a Cash payment. |
Item Object (inside items)
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | Yes | Name of the item. |
| price | integer | Yes | Price of the item (before discounts), expressed in tiyn |
| discount | integer | No | Discount applied to the item. Cannot exceed the price. |
| count | integer | Yes | Quantity of the item. Must be at least 1. |
| code | string | Yes | Unique code for the item. |
| vat_percent | integer | Yes | VAT percentage applicable to the item. |
| package_code | string | Yes | Package type code. |
| pinfl | string | No | Individual Taxpayer Number (must be 14 digits if provided). |
| tin | string | No | Taxpayer Identification Number (must be 9 digits if provided). INN |
💡 Note:
pinflortinmust be provided, but not both
Request Example
Example Request for Card Payment
json
{
"transactionId": "e2da46c6-8c89-400e-8bd9-037297b2e8b1",
"items": [
{
"title": "title",
"price": 10000, # 10000 = 100 UZS
"discount": 0,
"count": 1,
"code": "01902001001000000",
"vat_percent": 12,
"package_code": "1437667",
"tin": "310100000"
}
]
}Request example with eternalId and phoneNumber for Cash Payments
json
{
"externalId": "646",
"phoneNumber": "+998910000000",
"items": [
{
"title": "title",
"price": 10000, # 10000 = 100 UZS
"discount": 0,
"count": 1,
"code": "01902001001000000",
"vat_percent": 12,
"package_code": "1437667",
"tin": "310100000"
}
]
}Response format
Success Response
json
json
{"result": {
"ofd": {
"receiptUrl": "https://ofd.example.com/receipt/12345",
"terminalId": "T123456",
"receiptId": 987654,
"fiscalSign": "FS123ABC"
}
}
}| Field | Type | Description |
|---|---|---|
| receiptUrl | string | URL to the generated fiscal receipt. |
| terminalId | string | Terminal ID used for the transaction. |
| receiptId | integer | Unique ID of the fiscal receipt. |
| fiscalSign | string | Fiscal signature of the receipt. |
Error responses
| Error Code | Description |
|---|---|
receipt_not_available_for_operation | The transaction is not eligible for fiscal receipt generation. |
field_required | Required field missing (e.g., items). |
ofd_check_already_generated | The transaction already has a fiscal receipt. |
invalid_amount | The total price of items does not match the transaction amount. |
ofd_error | An issue occurred while processing with OFD. |
fiscal_receipt_not_generated | Fiscal receipt was not generated successfully. |