Import Invoices
POST/rest/import
/rest/importProduction URL
https://api.betterpayment.de/rest/importTest URL
https://testapi.betterpayment.de/rest/importThe Jetztzahlen Import API is used to create invoice records for your Jetztzahlen channels.
Request
url_nameStringrequiredURL name of the channel. You can find it under channel configurations in the Jetztzahlen Dashboard.
batch_nameStringA reference you would like to add to this batch import. Optional.
invoicesArrayrequiredAn array of invoice params as hash. See below for invoice params.
Example Request
POST /rest/import
Authorization: Basic <base64(api_key:api_password)>
Content-Type: application/json
{
"url_name": "test_url",
"batch_name": "any optional note you would like to add",
"invoices": [
{
"debt_claim_number": "123",
"amount": 1.99,
"currency": "EUR",
"print_date": "12.10.2018",
"first_name": "Peter",
"last_name": "Mustermann",
"address": "Egal Str. 1",
"address2": "Complementary str",
"tax_id": null,
"postal_code": "10434",
"city": "Berlin",
"email": "test@testov.com",
"state": "Berlin",
"country": "Deutschland",
"phone": "+49333222111",
"description": "Sport sneakers",
"redirect_after_payments": false,
"success_url": null,
"error_url": null,
"send_initial_email": true,
"initial_email_type": "initial",
"locale": "de"
}
]
}
Invoice params
debt_claim_numberStringrequiredInvoice number
amountFloatrequiredAmount for the invoice. One EUR and 90 CENTS is represented as 1.90.
print_dateStringrequiredDue date for the invoice. DD-MM-YYYY format.
currencyStringFalls back to channel's default currency if not given. 3 letter currency code. ISO-4217. E.g EUR, USD, CHF...
first_nameStringFirst name of the payee
last_nameStringLast name of the payee
addressStringAddress of the payee
address2StringComplementary address of the payee
tax_idStringTax ID of the payee
postal_codeStringPostal code of the payee
cityStringCity of the payee
emailStringEmail of the payee
countryStringCountry of the payee. Full country name either in English or German.
phoneStringPhone number of the payee
redirect_after_paymentsBooleanTrue or false. Indicating if customers should be redirected to success or error URLs after payments
success_urlStringSuccess URL that customers should be redirected to after payments
error_urlStringError URL that customers should be redirected to after failed payments
send_initial_emailBooleanOpt-in flag for the initial invoice e-mail. When
true, the customer receives the e-mail right after the import completes. Defaults to false. Accepts JSON boolean true/false, or the strings "true", "1", "yes".initial_email_typeStringWhich template to use for the on-creation e-mail. One of
"initial" or "reminder". Only meaningful when send_initial_email is true. Defaults to "initial" when blank or unrecognised.localeStringPer-invoice language for customer e-mails. One of
en, de, pt. Unrecognised values are stored as null. Falls back to the channel's default language, then en.Invoice Object Fields
{
"debt_claim_number": "123",
"amount": 1.99,
"currency": "EUR",
"print_date": "12.10.2018",
"first_name": "Peter",
"last_name": "Mustermann",
"address": "Egal Str. 1",
"address2": "Complementary str",
"tax_id": null,
"postal_code": "10434",
"city": "Berlin",
"email": "test@testov.com",
"state": "Berlin",
"country": "Deutschland",
"phone": "+49333222111",
"description": "Sport sneakers",
"redirect_after_payments": false,
"success_url": null,
"error_url": null,
"send_initial_email": true,
"initial_email_type": "initial",
"locale": "de"
}
About the initial e-mail
Rows where send_initial_email is true, active is true, and email is present have their initial e-mail enqueued for delivery in the background once the import has committed. The HTTP response returns as soon as the rows are persisted — actual e-mail delivery happens asynchronously. Use the Send Invoice E-mail endpoint to retry a single send manually.
Response
messageStringSuccess message
Example Response
{
"message": "Invoices have been successfully imported."
}