Create Invoice
POST/rest/invoices
/rest/invoicesProduction URL
https://api.betterpayment.de/rest/invoicesTest URL
https://testapi.betterpayment.de/rest/invoicesThe 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_nameStringrequiredURL name of the channel at the root level of the request.
invoice.debt_claim_numberStringInvoice number. If not provided, auto-generated (format: INV-XXXX)
invoice.first_nameStringFirst name of the customer
invoice.last_nameStringLast name of the customer
invoice.addressStringCustomer's address
invoice.address2StringAdditional address information
invoice.postal_codeStringCustomer's postal code
invoice.cityStringCustomer's city
invoice.emailStringCustomer's email address
invoice.countryStringCustomer's country
invoice.amountFloatrequiredInvoice amount (decimal format, e.g., 10.55)
invoice.descriptionStringDescription of the invoice/service
invoice.customer_idStringYour internal customer ID
invoice.currencyString3-letter currency code (defaults to channel currency)
invoice.stateStringCustomer's state/region
invoice.print_dateStringInvoice date (YYYY-MM-DD format, defaults to current date)
invoice.tax_idStringCustomer's tax ID
invoice.phoneStringCustomer's phone number
invoice.redirect_after_paymentsBooleanWhether to redirect after payment (boolean, defaults to false)
invoice.success_urlStringURL to redirect to after successful payment
invoice.error_urlStringURL to redirect to after failed payment
invoice.expires_inIntegerNumber of units after which the payment link expires (requires
expires_in_unit)invoice.expires_in_unitStringUnit for expiration:
"minutes", "hours", or "days" (requires expires_in). Omit both to disable expiration.invoice.send_initial_emailBooleanOpt-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_typeStringWhich 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.localeStringPer-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
invoiceObjectComplete invoice object with all fields. See Get Invoice for the full field list.
messageStringSuccess message
errorStringError information (
null on success)paylinkStringDirect payment link for the customer
qrcodeStringBase64-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..."
}