Skip to content

Update a customer

PUT
/{currentTeam}/customers/{customer}
curl --request PUT \
--url https://api.tradeops.cc/v1/example/customers/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "number": "example", "type": "example", "channel": "example", "region": "example", "territory": "example", "address": "example", "city": "example", "parish": "example", "latitude": 1, "longitude": 1, "contact_name": "example", "contact_phone": "example", "contact_email": "hello@example.com", "metadata": "example", "is_active": true, "locations": [ { "id": 1, "name": "example", "address": "example", "city": "example", "state_province": "example", "latitude": 1, "longitude": 1, "contact_name": "example", "contact_phone": "example", "contact_email": "hello@example.com", "is_primary": true, "is_active": true } ] }'
currentTeam
required
string

The current team slug

customer
required
string

The customer ulid

include
Array<string>
Allowed values: locations
fields[customers]
Array<string>
Allowed values: name slug number type channel region territory address city parish latitude longitude contact_name contact_phone contact_email metadata is_active created_at updated_at
fields[customer_locations]
Array<string>
Allowed values: name address city state_province latitude longitude contact_name contact_phone contact_email is_primary is_active created_at updated_at
Media typeapplication/json
UpdateCustomerRequest
object
name
string
<= 255 characters
number
string | null
<= 100 characters
type
string | null
<= 100 characters
channel
string | null
<= 100 characters
region
string | null
<= 100 characters
territory
string | null
<= 100 characters
address
string | null
city
string | null
<= 100 characters
parish
string | null
<= 100 characters
latitude
number | null
>= -90 <= 90
longitude
number | null
>= -180 <= 180
contact_name
string | null
<= 255 characters
contact_phone
string | null
<= 50 characters
contact_email
string | null format: email
<= 255 characters
metadata

Custom attributes keyed by attribute name.

object | null
is_active
boolean
locations
Array<object>
>= 1 items
object
id
integer | null
name
string
<= 255 characters
address
string | null
city
string | null
<= 100 characters
state_province
string | null
<= 100 characters
latitude
number | null
>= -90 <= 90
longitude
number | null
>= -180 <= 180
contact_name
string | null
<= 255 characters
contact_phone
string | null
<= 50 characters
contact_email
string | null format: email
<= 255 characters
is_primary
boolean
is_active
boolean

Example generated

{
"name": "example",
"number": "example",
"type": "example",
"channel": "example",
"region": "example",
"territory": "example",
"address": "example",
"city": "example",
"parish": "example",
"latitude": 1,
"longitude": 1,
"contact_name": "example",
"contact_phone": "example",
"contact_email": "hello@example.com",
"metadata": "example",
"is_active": true,
"locations": [
{
"id": 1,
"name": "example",
"address": "example",
"city": "example",
"state_province": "example",
"latitude": 1,
"longitude": 1,
"contact_name": "example",
"contact_phone": "example",
"contact_email": "hello@example.com",
"is_primary": true,
"is_active": true
}
]
}

CustomerResource

Media typeapplication/vnd.api+json
object
data
required
CustomerResource
object
id
required
string
type
required
string
Allowed value: customers
attributes
object
name
string
slug
string
number
string | null
type
string | null
channel
string | null
region
string | null
territory
string | null
address
string | null
city
string | null
parish
string | null
latitude
string | null
longitude
string | null
contact_name
string | null
contact_phone
string | null
contact_email
string | null
metadata
object
is_active
boolean
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
locations
object
data
required
Array<object>
object
id
required
string
type
required
string
Allowed value: customer_locations
links
required
object
self
required
string
included
Array<object>
CustomerLocationResource
object
id
required
string
type
required
string
Allowed value: customer_locations
attributes
object
name
string | null
address
string | null
city
string | null
state_province
string | null
latitude
string | null
longitude
string | null
contact_name
string | null
contact_phone
string | null
contact_email
string | null
is_primary
boolean
is_active
boolean
created_at
string | null format: date-time
updated_at
string | null format: date-time

Example

{
"data": {
"type": "customers",
"relationships": {
"locations": {
"data": [
{
"type": "customer_locations"
}
]
}
}
},
"included": [
{
"type": "customer_locations"
}
]
}

Unauthenticated

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Authorization error

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Not found

Media typeapplication/json
object
message
required

Error overview.

string

Example generated

{
"message": "example"
}

Validation error

Media typeapplication/json
object
message
required

Errors overview.

string
errors
required

A detailed description of each field that failed validation.

object
key
additional properties
Array<string>

Example generated

{
"message": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

Too many requests. Wait for Retry-After seconds before trying again.

Media typeapplication/json
object
message
required
string

Example generated

{
"message": "example"
}
Retry-After
integer

Seconds until you can try again.