Invoice Addresses

This endpoint allows you to create, update and delete addresses that belong to customer invoices and to list and fetch addresses that belong to reversal invoices.

Addresses only exist in the context of a specific invoice. So whenever you want to list or interact with the addresses for an invoice, you have to keep the type of invoice in mind and construct the endpoint's path from there. When referring to an endpoint's path below, whenever there's a {invoice_path}/address, you have to adapt the path to the type of invoice you're dealing with. For example the path to listing the address for a customer invoice is /api/v1/customer_invoices/{customer_invoice_id}/address while the respective path for a reversal invoice is /api/v1/reversal_invoices/{reversal_invoice_id}/address.

Attributes of an Address

addressable_type integer The address type
addressee string The addressee, which usually holds the name and lastname of the entity being addressed
street string The street name of the address
number string The number of the address
addition string The address addition
zip_code string The zip code of the address
town string The town of the address
country_code string The ISO country code of the address
state_or_province string The state or province of the address

Attributes you send to Keyline to Create or Update an Address

addressee string The addressee
street string The street name of the address
number string The number of the address
addition string The address addition
zip_code string The zip code of the address
town string The town of the address
country_code string The country code of the address
state_or_province string The state or province of the address

Actions

Creating an invoice address

An address can be created for invoices as long as the customer invoice is not billed yet.

POST
{invoice_path}/address

Example request

$ curl -i -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
  -H "Content-Type: application/json"\
  -X POST \
  -d '{"address": {
        "addressee": "Mustermann GmbH",
        "street": "Musterstraße",
        "number": "12",
        "addition": "Floor 1",
        "zip_code": "12345",
        "town": "Musterstadt",
        "country_code": "DE"
        }
      }'
  https://api.keyline-mis.com/api/v1/customer_invoices/3609/address

Updating an invoice address

An address can be updated for invoices as long as the customer invoice is not billed yet.

PATCH
/api/v1/invoices/{INVOICE_ID}/address

Example request

$ curl -X PATCH -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
-H "Content-Type: application/json"\
-d '{"address": { "number": "24" } }'
https://api.keyline-mis.com/api/v1/customer_invoices/3609/address

Deleting an invoice address

An address can be deleted for invoices as long as the customer invoice is not billed yet.

DELETE
{invoice_path}/address

Example request

$ curl -X DELETE -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f"\
-H "Content-Type: application/json"\
https://api.keyline-mis.com/api/v1/customer_invoices/3609/address