Create a customer
Create a customer to your company. Before making a POST request to create a customer in your company, you might find it useful to look at the list of available companies.
POST customers?skipCreationInAccountingSystem=false
Request details
The post request will contain all the required information to create a customer in your company.
Request properties
Property | Type | Description | Optional |
---|---|---|---|
Request | Customer request object | The customer request to add. | No |
SkipCreationInAccountingSystem | Bool | Flag that allows also to create the customer in the accounting system. | Yes |
For customer create request object properties see details.
Example request
{ "company":{ "companyId":"00000000-0000-0000-0000-000000000000" }, "code":"code", "externalId":"externalId", "address":{ "streetName":"street", "streetNumber":"number", "city":"city", "postalCode":"postalcode", "country":{ "code":"country code" } }, "payCollectType":{ "code":"code" }, "vatCode":{ "code":"code" }, "name":"name", "vatNumber":"vatnumber", "chamberOfCommerce":"ChamberOfCommerce", "phone":"phone", "fax":"fax", "bankAccounts":[ { "default":true, "externalId":"externalId", "number":"number", "iban":"iban", "bicCode":"biccode", "bankName":"bankname", "nationalBankCode":"nationalbankcode", "country":{ "code":"code" } } ], "SubstitutionGeneralLedger":{ "Code":"code" }, "Number":"number", "PaymentCondition":{ "Code":"code" }, "Email":"email" }
Response
Upon successful creation of a customer in the Basecone system, a 201 http status code will be returned together with the newly created CustomerId unique identifier. If something goes wrong, an error message with failure details will be given together with a suitable http error status code.
Example response
{ "customerId": "52a4471b-8cb4-4a13-981f-86a30b72feff" }
Possible error responses
Status code | Error code | Details |
---|---|---|
400 | invalid_request_payload | Create customer request cannot be null |
400 | invalid_request_payload | Company id cannot be empty |
400 | invalid_request_payload | The company provided does not exist. |
400 | user_credentials_invalid | Invalid credentials. |
400 | invalid_request_payload | The customer code provided is invalid. |
400 | invalid_request_payload | The customer code provided already exists. |
400 | invalid_request_payload | The SubstitutionGeneralLedger code provided is invalid. |
400 | invalid_request_payload | The VatCode value provided is invalid. |
400 | invalid_request_payload | The PaymentCondition DueDays provided is invalid. |
400 | invalid_request_payload | The PaymentCondition provided is invalid. |
400 | invalid_request_payload | The PayCollectType code provided is invalid. |
400 | invalid_request_payload | The AddressCountry code provided is invalid. |
400 | invalid_request_payload | The BankAccount Country code provided is invalid. |
400 | validation_error | Other validation errors from the accounting system |
400 | invalid_request_payload | Request properties are not valid to perform the requested operation. |
400 | validation_error | One or more properties were not valid |
400 | validation_error | One or more validation errors occurred. |
403 | unauthorized | User does not have access to the company provided. |
403 | unauthorized | User has no access to the accounting system company. |
403 | unauthorized | User is not allowed to change Bank Account. |