Manage purchase receipts, confirmations, and receipt-related operations in the transaction system.
/api/receipts
The Receipts API provides endpoints for managing purchase receipts including creation, retrieval, export functionality, and deletion. Supports both soft and hard delete operations.
Creates a new purchase receipt for a completed order.
{
"orderId": "ord_456",
"customerId": "cust_123",
"receiptNumber": "RCP-2026-001",
"receiptDate": "2026-06-02T10:30:00Z",
"items": [
{
"description": "Cloud Server Premium",
"quantity": 1,
"price": 299.99,
"amount": 299.99
}
],
"subtotal": 299.99,
"tax": 29.99,
"total": 329.98,
"currency": "USD",
"paymentMethod": "credit_card"
}
{
"id": "rcp_789",
"receiptNumber": "RCP-2026-001",
"orderId": "ord_456",
"customerId": "cust_123",
"total": 329.98,
"createdAt": "2026-06-02T10:30:00Z"
}
Gets all receipts with filtering and pagination.
| Parameter | Type | Description |
|---|---|---|
| $filter | string | OData filter expression |
| $skip | integer | Skip n records |
| $top | integer | Take n records |
{
"value": [
{
"id": "rcp_789",
"receiptNumber": "RCP-2026-001",
"orderId": "ord_456",
"customerId": "cust_123",
"total": 329.98,
"receiptDate": "2026-06-02T10:30:00Z"
}
],
"count": 150
}
Gets receipt details by ID with all line items.
| Parameter | Type |
|---|---|
| id | string |
{
"id": "rcp_789",
"receiptNumber": "RCP-2026-001",
"orderId": "ord_456",
"customerId": "cust_123",
"receiptDate": "2026-06-02T10:30:00Z",
"items": [
{
"description": "Cloud Server Premium",
"quantity": 1,
"price": 299.99,
"amount": 299.99
}
],
"subtotal": 299.99,
"tax": 29.99,
"total": 329.98,
"currency": "USD",
"paymentMethod": "credit_card",
"createdAt": "2026-06-02T10:30:00Z"
}
Exports receipt to PDF format.
| Parameter | Type |
|---|---|
| id | string |
PDF file download
Soft deletes receipt (marks as deleted but preserves data).
| Parameter | Type |
|---|---|
| id | string |
| Parameter | Type | Description |
|---|---|---|
| hard | boolean | Set to true for permanent hard delete |
{
"success": true,
"message": "Receipt deleted"
}
| Code | HTTP Status | Description |
|---|---|---|
| RECEIPT_NOT_FOUND | 404 | Receipt does not exist |
| ORDER_NOT_FOUND | 404 | Associated order not found |
| RECEIPT_ALREADY_EXISTS | 409 | Receipt already exists for this order |