Create Receipt
You can use this endpoint to create a new receipt.
Request
POST /api/v1/receipts
curl --request POST \
--url 'https://www.zep-online.de/zepinstanz/next/api/v1/receipts' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"employee_id": "john.doe",
"date": "2024-11-15",
"receipt_type_id": "Train Ticket",
"project_id": 456,
"payment_method": "private",
"currency": "EUR",
"is_amount_net": false,
"note": "Berlin -> Hamburg (Deutsche Bahn)",
"receiptAmounts": [
{
"tax": 19.0,
"quantity": 1,
"amount": 89.90
}
]
}'Required Fields
The following fields are required when creating a receipt:
- employee_id (string): Username of the employee (max. 255 characters)
- date (string): Receipt date in format
YYYY-MM-DD - receipt_type_id (string): Receipt type identifier (max. 255 characters)
- project_id (integer): Project ID
- payment_method (string): Payment method (max. 255 characters)
- currency (string): Currency code, e.g. EUR, USD (max. 32 characters)
- is_amount_net (boolean): Indicates whether the amount is net (
true) or gross (false) - receiptAmounts (array): Array of receipt amounts (at least one entry required)
- tax (number): Tax rate percentage (0-100), must match the tax rate of the receipt type
- quantity (number): Quantity (minimum 1)
- amount (number): Amount (greather than 0)
Optional Fields
- performance_date (string, nullable): Performance date in format
YYYY-MM-DD(can differ from receipt date if the receipt type supports it) - project_task_id (integer, nullable): Project task ID
- is_invoice_amount_net (boolean, nullable): Indicates whether the invoice amount is net (
true) or gross (false). Required if any receiptAmount has invoicing_share > 0 - note (string, nullable): Receipt notes (max. 255 characters)
- receiptAmounts[].private_share (number, nullable): Private share amount (minimum 0)
- receiptAmounts[].invoicing_share (number, nullable): Invoicing share amount (minimum 0), will only be considered if project allows invoicing
Response
{
"data": {
"id": 123,
"employee_id": "john.doe",
"date": "2024-11-15",
"receipt_type_id": "Train Ticket",
"currency": "EUR",
"invoice_amount_currency": null,
"note": "Berlin -> Hamburg (Deutsche Bahn)",
"payment_method": "private",
"breakfast": 0,
"lunch_or_dinner": 0,
"location": null,
"is_amount_net": false,
"is_invoice_amount_net": false,
"billing_status": null,
"performance_date": "2024-11-15",
"client_id": null,
"created": "2024-11-15T14:23:45.000000Z",
"modified": "2024-11-15T14:23:45.000000Z",
"invoice_item_id": null,
"project_id": 456,
"project_task_id": null,
"ticket_id": null,
"subtask_id": null,
"filename": null
}
}Error Codes
- 401 Unauthorized: Invalid or missing authentication
- 422 Unprocessable Entity: Validation error - check your request data
Examples
Receipt with Multiple Amounts
{
"employee_id": "john.doe",
"date": "2024-11-20",
"receipt_type_id": "Hotel",
"project_id": 789,
"payment_method": "Company Credit Card",
"currency": "EUR",
"is_amount_net": true,
"is_invoice_amount_net": true,
"note": "Client visit accommodation Munich",
"receiptAmounts": [
{
"tax": 7.0,
"quantity": 2,
"amount": 120.00,
"private_share": 0,
"invoicing_share": 240.00
},
{
"tax": 19.0,
"quantity": 1,
"amount": 25.00,
"private_share": 0,
"invoicing_share": 25.00
}
]
}Receipt with Performance Date
{
"employee_id": "john.doe",
"date": "2024-11-22",
"performance_date": "2024-11-20",
"receipt_type_id": "Business Meal",
"project_id": 456,
"project_task_id": 12,
"payment_method": "private",
"currency": "EUR",
"is_amount_net": false,
"note": "Business dinner with client",
"receiptAmounts": [
{
"tax": 19.0,
"quantity": 1,
"amount": 85.50
}
]
}