Customers
Type | Base Path | Trigger 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
Name | Method | Relative Path | Payload | Response | Description |
---|---|---|---|---|---|
addCustomer | POST | ~{realm}/customers/ | Customer | Stored_Customer | Adds a new customer to the list. |
listCustomers | GET | ~{realm}/customers/ | N/A | Stored_Customer[] | Retrieves a list of customers. |
getCustomer | GET | ~{realm}/customers/{id} | N/A | Stored_Customer | Retrieves a customer. |
putCustomer | PUT | ~{realm}/customers/{id} | Customer | Stored_Customer | Replaces a customer. |
updateCustomer | PATCH | ~{realm}/customers/{id} | Partial_Customer | Stored_Customer | Updates specified customer fields. |
removeCustomer | DELETE | ~{realm}/customers/{id} | N/A | N/A | Deletes a customer. |
Permissions
Permission | Description |
---|---|
edit-customers | Client is allowed to add new customers and to modify or delete existing customers. |
show-customers | Client 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[];
}
Property | Data Type | Description |
---|---|---|
name | String | The customer's name (first and last name for individuals, company name for organizations). |
type | Customer.Type? | The type of customer, individual , organization or unknown if not present. |
street-address | String? | The customer's street address. |
zip-code | String? | The customer's zip code. |
city | String? | The customer's city. |
country | String? | 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-name | String? | A reference name, contact person or similar. Used for invoices. |
email | String? | The customer's email address. |
phone-number | String? | 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-number | String? | The customer's organization number (for organizations) or personal identity number (for individuals). |
comment | String? | A private comment about the customer. |
customer-number | String? | A customer number. Also used for invoices, and this must match what the accounting/invoicing system expects if invoice payments are used. |
subscription | Boolean? | Whether the customer would like to receive marketing material. |
client-references | String[]? | A list of device/client identifiers for the customer in external systems, such as ordering web sites. |
id | Int64? | The resource ID of this entity. |
created | DateTime? | Date and time when this entity was first created. |
updated | DateTime? | Date and time when this entity was last modified. |
deleted | DateTime? | Date and time when this entity was deleted. |
updated-by | Int64? | ID of User who last modified this entity. |
updated-from | Int64? | ID of Till (trusted device) which last modified this entity. |
labels | Int64[]? | A list of Label IDs associated with this entity. |