Skip to main content

Create Invoice

POST/rest/invoices

The Jetztzahlen Invoice Creation API allows you to create new invoices programmatically. This endpoint will automatically generate a unique invoice number if none is provided, set default values for missing fields, and return a complete invoice object with payment links.

All parameters should be nested under the invoice key in the request body. You also have to pass url_name of your channel on the root level of the request body.

Request

url_nameStringrequired
URL name of the channel at the root level of the request.
invoice.debt_claim_numberString
Invoice number. If not provided, auto-generated (format: INV-XXXX)
invoice.first_nameString
First name of the customer
invoice.last_nameString
Last name of the customer
invoice.addressString
Customer's address
invoice.address2String
Additional address information
invoice.postal_codeString
Customer's postal code
invoice.cityString
Customer's city
invoice.emailString
Customer's email address
invoice.countryString
Customer's country
invoice.amountFloatrequired
Invoice amount (decimal format, e.g., 10.55)
invoice.descriptionString
Description of the invoice/service
invoice.customer_idString
Your internal customer ID
invoice.currencyString
3-letter currency code (defaults to channel currency)
invoice.stateString
Customer's state/region
invoice.print_dateString
Invoice date (YYYY-MM-DD format, defaults to current date)
invoice.tax_idString
Customer's tax ID
invoice.phoneString
Customer's phone number
invoice.redirect_after_paymentsBoolean
Whether to redirect after payment (boolean, defaults to false)
invoice.success_urlString
URL to redirect to after successful payment
invoice.error_urlString
URL to redirect to after failed payment
invoice.expires_inInteger
Number of units after which the payment link expires (requires expires_in_unit)
invoice.expires_in_unitString
Unit for expiration: "minutes", "hours", or "days" (requires expires_in). Omit both to disable expiration.
invoice.send_initial_emailBoolean
Opt-in flag for the initial invoice e-mail. When true, the customer receives the e-mail immediately after creation. Defaults to false. Requires email to be present — the create fails with 422 otherwise.
invoice.initial_email_typeString
Which template to use for the on-creation e-mail. One of "initial" or "reminder". Only honoured when send_initial_email is true. Defaults to "initial" if blank; rejected with 422 if outside the whitelist.
invoice.localeString
Per-invoice language for customer e-mails. One of en, de, pt. Defaults to channel language; rejected with 422 if outside the whitelist.
Example Request
POST /rest/invoices
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"url_name": "your_channels_url_name",
"invoice": {
"debt_claim_number": "INV-2024-001",
"first_name": "Peter",
"last_name": "Struwwel",
"address": "Teststr 5",
"address2": "12B",
"postal_code": "10178",
"city": "Berlin",
"email": "dev@betterpayment.de",
"country": "Germany",
"amount": 10.55,
"description": "Payment for drinks",
"customer_id": "123456",
"currency": "EUR",
"state": "BE",
"print_date": "2024-08-14",
"tax_id": "123456789",
"phone": "+4917143214321",
"redirect_after_payments": false,
"success_url": "https://example.com/success",
"error_url": "https://example.com/error",
"expires_in": 24,
"expires_in_unit": "hours",
"send_initial_email": true,
"initial_email_type": "initial",
"locale": "de"
}
}

Response

invoiceObject
Complete invoice object with all fields. See Get Invoice for the full field list.
messageString
Success message
errorString
Error information (null on success)
paylinkString
Direct payment link for the customer
qrcodeString
Base64-encoded QR code image for the payment
Example Response
{
"invoice": {
"status": "pending",
"created_at": "2024-08-14T07:50:20.123Z",
"updated_at": "2024-08-14T07:50:20.123Z",
"debt_claim_number": "INV-2024-001",
"print_date": "2024-08-14",
"first_name": "Peter",
"last_name": "Struwwel",
"address": "Teststr 5",
"address2": "12B",
"postal_code": "10178",
"city": "Berlin",
"country": "Germany",
"email": "dev@betterpayment.de",
"amount": 10.55,
"amount_cents": 1055,
"currency": "EUR",
"description": "Payment for drinks",
"customer_id": "123456",
"state": "BE",
"phone": "+4917143214321",
"redirect_after_payments": false,
"success_url": "https://example.com/success",
"error_url": "https://example.com/error",
"tax_id": "123456789",
"expires_in": 24,
"expires_in_unit": "hours",
"expired": false,
"uuid": "f34b3b2f-2680-4d62-a0c9-ce2e50ddbb8a",
"channel_id": 123,
"import_id": 456,
"locale": "de",
"effective_locale": "de",
"send_initial_email": true,
"initial_email_type": "initial",
"effective_initial_email_type": "initial",
"last_email": {
"email_type": "reminder",
"status": "sent",
"sent_at": "2026-05-20T14:30:00Z",
"recipient_email": "dev@betterpayment.de",
"locale": "de"
}
},
"message": "Invoice has been successfully created.",
"error": null,
"paylink": "http://yourchannel.jetztzahlen.de/pay/f34b3b2f-2680-4d62-a0c9-ce2e50ddbb8a",
"qrcode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}