curl --request POST \
--url https://api.exowpee.com/v1/customer/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/customer/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/customer/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/customer/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/customer/customers"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/customer/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/customer/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"is_creditable": true,
"initial_balance": 123,
"max_balance": 123,
"max_credit_amount": 123,
"computed_balance": 123,
"global_due_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}Create a customer
Registers a new customer, optionally allowing them to buy on credit with an opening balance and limits.
curl --request POST \
--url https://api.exowpee.com/v1/customer/customers \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.exowpee.com/v1/customer/customers"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.exowpee.com/v1/customer/customers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.exowpee.com/v1/customer/customers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.exowpee.com/v1/customer/customers"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.exowpee.com/v1/customer/customers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/customer/customers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"phone_number": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"is_creditable": true,
"initial_balance": 123,
"max_balance": 123,
"max_credit_amount": 123,
"computed_balance": 123,
"global_due_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"errors": {}
}customers.create
Conditions
- The customer name must be unique among the company’s customers, including removed ones; it is saved with each word capitalised before the comparison.
- The name is required and at least 3 characters long.
- Amounts (initial_balance, max_balance, max_credit_amount) cannot be negative and cannot have more decimals than the company currency allows.
- global_due_date cannot be in the past.
- When is_creditable is true, a debt account is opened for the customer in the accounts, and the customer is marked as creditable.
- When the opening balance is above zero, an opening entry is posted that moves it from the company credit-sales account to the customer’s debt account, so the customer starts out owing that amount.
- initial_balance is kept only for a creditable customer; for a non-creditable customer it is stored empty.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, name, phone_number, address, city, country, is_creditable, initial_balance, max_balance, max_credit_amount, computed_balance, global_due_date, created_at, updated_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Response
Resource (only with response=resource).
Identifier of the customer (27-character KSUID string).
Name of the customer, stored with each word capitalised. Unique among the company's customers.
Phone number of the customer, or null when none was given.
Free-text postal address of the customer, or null when none was given.
City of the customer, or null when none was given.
Country of the customer, or null when none was given.
True when the customer is allowed to buy on credit. A creditable customer has a debt account in the accounts.
Amount the customer owed when credit was first enabled, in major units of the company currency. Null for a customer that was never creditable.
Most the customer may owe at any time, in major units of the company currency. Null means no limit is set.
Largest amount of credit allowed on a single order, in major units of the company currency. Null means no limit is set.
What the customer currently owes, in major units of the company currency, read from the customer's debt account. 0 for a customer without a debt account.
Default due date for the customer's credit orders that have no due date of their own. Null when none is set.
Date and time the record was created (ISO 8601, UTC).
Date and time the record was last changed (ISO 8601, UTC).