Customers endpoints
Quick reference
Verb | Path | Method |
|---|---|---|
POST | /api/v1/clients/bulk_create_or_update/ | Upsert customers |
POST | /api/v1/clients/schema/ | Upsert customer's dynamic schema |
Define Customer Schema
Description
With our API, you can easily create or update customers. You may want to define specific characterstic of your customers by defining its schema. The schema is defined as list of columns
curl --location --request POST 'https://api.pricemoov.com/api/v1/clients/schema/' \
--header 'Authorization: jwt <your_token>' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"column_name" = "Estimated Revenue",
"column_type" = "FLOAT",
},
{
"column_name" = "Activity",
"column_type" = "STR",
}
}'Column Parameters
column_name
column_type
type: string, Required
The name of the column as it will appear in the platform
type: string, Required
The type of the column. This has to be one of the following: "ARRAY_STR", "BIGINT", "BOOL", "FLOAT", "INT", "JSONB", "STR", "TIMESTAMP"
Example
Upon success, the response is 201 OK and returns
[schema_created]
Upsert Customers
Once a schema is defined, you can upsert customers in Pricemoov using following this schema. Based on the fact that the code of the clients should be unique, this will create new clients and update those existing.
curl --location --request POST 'https://api.pricemoov.com/api/v1/clients/bulk_create_or_update/' \
--header 'Authorization: jwt <your_token>' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"code" = "C0123",
"Estimated Revenue" = 22311123,
"Activity" = "Carwash",
"parent_client" = "C01",
},
{
"code" = "C22113",
"Estimated Revenue" = 1000,
"Activity" = "Bike Rental",
"parent_client" = "C01",
}
}'Parameters
code
parent_client
spectific schema columns
type: string, Required
The code of the client, this code should be unique.
type: string, Optional
The code of the parent of the client. Required
All the columns as defined in the schema.
Example
Upon success, the response is 201 OK and returns
{
"created_clients": [list of created clients' ids],
"updated_clients": [list of updated clients' ids],
}