Skip to main content

Customers

TypeBase PathTrigger Name
REST resource~{realm}/customers/customers

This resource holds the business's customer register. Customers may be referenced from other resources, such as direct marketing campaign, invoices, orders, receipts and vouchers.

Endpoints

NameMethodRelative PathPayloadResponseDescription
addCustomerPOST~{realm}/customers/CustomerStored_CustomerAdds a new customer to the list.
listCustomersGET~{realm}/customers/N/AStored_Customer[]Retrieves a list of customers.
getCustomerGET~{realm}/customers/{id}N/AStored_CustomerRetrieves a customer.
putCustomerPUT~{realm}/customers/{id}CustomerStored_CustomerReplaces a customer.
updateCustomerPATCH~{realm}/customers/{id}Partial_CustomerStored_CustomerUpdates specified customer fields.
removeCustomerDELETE~{realm}/customers/{id}N/AN/ADeletes a customer.

Permissions

PermissionDescription
edit-customersClient is allowed to add new customers and to modify or delete existing customers.
show-customersClient is allowed to query the customer list and to fetch individual customers.

Entities

Interface Customer

namespace Customer {
export type Type = 'individual' | 'organization';
}

interface Customer {
'name': string;
'type'?: Customer.Type;
'street-address'?: string;
'zip-code'?: string;
'city'?: string;
'country'?: string;
'reference-name'?: string;
'email'?: string;
'phone-number'?: string;
'org-number'?: string;
'comment'?: string;
'customer-number'?: string;
'subscription'?: boolean;
'client-references'?: string[];
'id'?: number;
'created'?: DateTime;
'updated'?: DateTime;
'deleted'?: DateTime;
'updated-by'?: number;
'updated-from'?: number;
'tags'?: string[];
'labels'?: number[];
}
PropertyData TypeDescription
nameStringThe customer's name (first and last name for individuals, company name for organizations).
typeCustomer.Type?The type of customer, individual, organization or unknown if not present.
street-addressString?The customer's street address.
zip-codeString?The customer's zip code.
cityString?The customer's city.
countryString?The customer's country. You should use uppercase ISO 3166-1 alpha-2 code, but for historical reasons, we also accept natural language country names.
reference-nameString?A reference name, contact person or similar. Used for invoices.
emailString?The customer's email address.
phone-numberString?The customer's phone number. You should use all-numeric E.164 format (with a leading + sign), but for historical reasons, we also accept other formats.
org-numberString?The customer's organization number (for organizations) or personal identity number (for individuals).
commentString?A private comment about the customer.
customer-numberString?A customer number. Also used for invoices, and this must match what the accounting/invoicing system expects if invoice payments are used.
subscriptionBoolean?Whether the customer would like to receive marketing material.
client-referencesString[]?A list of device/client identifiers for the customer in external systems, such as ordering web sites.
idInt64?The resource ID of this entity.
createdDateTime?Date and time when this entity was first created.
updatedDateTime?Date and time when this entity was last modified.
deletedDateTime?Date and time when this entity was deleted.
updated-byInt64?ID of User who last modified this entity.
updated-fromInt64?ID of Till (trusted device) which last modified this entity.
labelsInt64[]?A list of Label IDs associated with this entity.