Create invoice for identity by identityReference
This will create an invoice assigned to the given identity.
The netbased flag is used to determine if the invoice should be calculated with net prices or gross prices. If netbased is set to true, the prices will be calculated with net prices. If netbased is set to false, the prices will be calculated with gross prices.
The paymentkind is used to determine the payment method. The following payment methods are available:
CT- Credit TransferDD- Direct DebitCC- Credit CardPP- PayPalIN- InvoiceOT- Other
The items array contains the items of the invoice. Each item must have a label, quantity, unit, unitprice, and detail field. The detail field is an object that can contain additional information about the item, if tax jurisdiction is used this should contain the items taxprofile.
The addresses array contains the addresses of the invoice. Each address must have a kind, firstname, lastname, street, housenumber, zipcode, city, and country field. The extra field is optional and can be used to provide additional information about the address.
Basic authentication is a simple authentication scheme built into the HTTP protocol. To use it, send your HTTP requests with an Authorization header that contains the word Basic followed by a space and a base64-encoded string username:password.Example: Authorization: Basic ZGVtbzpwQDU1dzByZA==
In: header
Path Parameters
Your identityReference
Header Parameters
Set this optional header to the same value for idempotent requests. If the request is repeated with the same idempotency key, the server will return the same response as for the first request. Our servers retain the idempotency key and their result for 24 hours after the initial request, if not defined otherwise in your Abillify contract.
Date on which the invoice is booked, normaly the issued date
Optional, addresses of the invoice, if not provided they will be copied from the identity in the moment of creation.
Date of the cancellation of the invoice
Taken from order
"If invoice is based on an order, the currency is copied from the order, otherwise the customers default currency is used."Due date of the invoice, relevant for all delay payment methods
Date printed on the invoice
Merchant information related to the entity, you can store any JSON here. Size limits according to your contract.
If true the calculations are rounded to 2 decimal places, this is the recommended option for B2B business.
If false (null) the calculations are rounded to 4 decimal places to achieve better gross amounts for end customers.
Your invoiceNumber, only send this if you want to override the default invoice number generation.
Date of the order, only send this if invoice it not based on an order. (Invoice flow)
Your orderNumber, only send this if invoice it not based on an order. (Invoice flow)
Kind of payment intended to be used for this order, can be different for subsequent invoices.
PP: Paypal
CC: Credit Card
DD: Direct Debit
CT: Cash Transfer
CD: Cash on Delivery
"PP" | "CC" | "DD" | "CT" | "CD"Your invoiceReference (A unique identifier in your system), if you don't send this Abillify will generate one.
Response Body
curl -X POST "https://staging1.abillify.dev/api/identities/string/invoices" \
-H "Idempotency-Key: string" \
-H "Content-Type: application/json" \
-d '{
"addresses": [
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "billing",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
},
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "shipping",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
}
],
"currency": "EUR",
"items": [
{
"constcenter": "1234",
"detail": {
"taxprofile": "default"
},
"label": "Product 1",
"quantity": 1,
"unit": "pcs",
"unitprice": "100.00"
}
],
"netbased": true,
"orderdate": "2020-01-01T00:00:00.000Z",
"ordernumber": "xyz-1234",
"paymentkind": "CT",
"reference": "1234567890"
}'const body = JSON.stringify({
"addresses": [
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "billing",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
},
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "shipping",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
}
],
"currency": "EUR",
"items": [
{
"constcenter": "1234",
"detail": {
"taxprofile": "default"
},
"label": "Product 1",
"quantity": 1,
"unit": "pcs",
"unitprice": "100.00"
}
],
"netbased": true,
"orderdate": "2020-01-01T00:00:00.000Z",
"ordernumber": "xyz-1234",
"paymentkind": "CT",
"reference": "1234567890"
})
fetch("https://staging1.abillify.dev/api/identities/string/invoices", {
headers: {
"Idempotency-Key": "string"
},
body
})package main
import (
"fmt"
"net/http"
"io/ioutil"
"strings"
)
func main() {
url := "https://staging1.abillify.dev/api/identities/string/invoices"
body := strings.NewReader(`{
"addresses": [
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "billing",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
},
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "shipping",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
}
],
"currency": "EUR",
"items": [
{
"constcenter": "1234",
"detail": {
"taxprofile": "default"
},
"label": "Product 1",
"quantity": 1,
"unit": "pcs",
"unitprice": "100.00"
}
],
"netbased": true,
"orderdate": "2020-01-01T00:00:00.000Z",
"ordernumber": "xyz-1234",
"paymentkind": "CT",
"reference": "1234567890"
}`)
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Idempotency-Key", "string")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}import requests
url = "https://staging1.abillify.dev/api/identities/string/invoices"
body = {
"addresses": [
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "billing",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
},
{
"city": "Berlin",
"company": "ACME Inc.",
"country": "DE",
"extra": "C/O Mr. Smith",
"firstname": "John",
"housenumber": "1",
"info": "string",
"kind": "shipping",
"lastname": "Doe",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115"
}
],
"currency": "EUR",
"items": [
{
"constcenter": "1234",
"detail": {
"taxprofile": "default"
},
"label": "Product 1",
"quantity": 1,
"unit": "pcs",
"unitprice": "100.00"
}
],
"netbased": true,
"orderdate": "2020-01-01T00:00:00.000Z",
"ordernumber": "xyz-1234",
"paymentkind": "CT",
"reference": "1234567890"
}
response = requests.request("POST", url, json = body, headers = {
"Idempotency-Key": "string",
"Content-Type": "application/json"
})
print(response.text){
"accountingdate": "2020-01-01T00:00:00.000Z",
"addresses": [
{
"city": "Berlin",
"country": "DE",
"extra": "C/O Mr. Smith",
"housenumber": "1",
"info": "string",
"kind": "shipping",
"state": "Berlin",
"street": "Main Street",
"zipcode": "10115",
"company": "ACME Inc.",
"firstname": "John",
"lastname": "Doe"
}
],
"cancelationdate": "2020-01-01T00:00:00.000Z",
"created": "2020-01-01T00:00:00.000Z",
"currency": "EUR",
"detail": {
"dunning": {
"customPeriods": {
"COLLECTION": 28,
"DUNNING1": 7,
"DUNNING2": 7,
"DUNNING3": 7,
"REMINDER": 7
},
"delayedUntil": "2020-01-01",
"deliveryKind": "letter",
"disabled": true
},
"footerText": [
"string"
],
"footerTextId": "5ad2114c-9bf0-4dd2-a058-a4047dbabdeb",
"introText": [
"string"
],
"introTextId": "6ad2114c-9bf0-4dd2-a058-a4047dbabdeb",
"locale": "de-DE",
"paymentterm": "Zu zahlen innerhalb von 14 Tagen",
"paymenttermId": "4ad2114c-9bf0-4dd2-a058-a4047dbabdeb",
"placeOfSupplyCountry": "DE",
"reverseCharge": true,
"vatId": "DE987654321"
},
"due": "2020-01-01T00:00:00.000Z",
"dunninglevel": 0,
"dunningstate": "open",
"id": "5e4a7b2b-1b0b-4c7a-8f0a-5b9b6b7c8d9e",
"identity": "1",
"issued": "2020-01-01T00:00:00.000Z",
"items": [
{
"account": "8400",
"costcenter": "8086",
"created": "2020-01-01T00:00:00.000Z",
"detail": {
"description": "This is a product description",
"taxprofile": "default",
"vatclause": "Umsatzsteuerbefreit gem. UstG. §4 Nr. 1a"
},
"groupingflag": "DE|1234",
"id": "5e4a7b2b-1b0b-4c7a-8f0a-5b9b6b7c8d9e",
"kind": "principal",
"label": "Couch Grey 3-Seater",
"modified": "2020-01-01T00:00:00.000Z",
"net": 991.6,
"pos": 1,
"product_number": "1234567890",
"quantity": 1,
"reference": "1234567890",
"servicebegin": "2020-01-01T00:00:00.000Z",
"serviceend": "2020-01-01T00:00:00.000Z",
"taxaccount": "1776",
"taxrate": 0.19,
"unit": "pieces",
"unitprice": 1190
}
],
"meta": {
"custom_key": "custom_value"
},
"modified": "2020-01-01T00:00:00.000Z",
"net": 991.6,
"netbased": true,
"number": "1234567890",
"orderdate": "2020-01-01T00:00:00.000Z",
"ordernumber": "1234567890",
"paymentkind": "CT",
"reference": "1234567890",
"tax": 188.4,
"total": 1180
}{
"code": 400,
"details": [
{
"error": "Value for field 'debtor' is of wrong type, expected bigint.",
"fields": [
"debtor"
],
"hint": "Value must be a number or a string containing only a number."
}
],
"message": "InvalidValue, see error details",
"name": "ClientError",
"type": "ERR_INVALID_VALUE"
}{
"code": 400,
"details": [
{
"error": "Value for field 'debtor' is of wrong type, expected bigint.",
"fields": [
"debtor"
],
"hint": "Value must be a number or a string containing only a number."
}
],
"message": "InvalidValue, see error details",
"name": "ClientError",
"type": "ERR_INVALID_VALUE"
}