locations

Get Locations

SecurityRemoteAuthentication or M2MAuthentication or BasicAuthentication or cookieAuth
Request
query Parameters
active
boolean
format
string
Enum: "csv" "json"
headquarter
boolean
legal_entity__active
boolean

Filter locations by whether their assigned legal entity is active. Locations without a legal entity are excluded from both results. Ignored when Multi-Entity is not enabled.

order_by
string

Which field to use when ordering the results.

page
integer

A page number within the paginated result set.

page_size
integer

Number of results to return per page.

search
string

A search term.

Responses
200
Response Schema:
object
Array of objects (LocationView)
get/api/v2/locations/
Response samples
{
  • "metadata": {
    },
  • "data": [
    ]
}

Create New Location

Create New Location. Note: only users with superuser permission can create locations.

SecurityRemoteAuthentication or M2MAuthentication or BasicAuthentication or cookieAuth
Request
query Parameters
format
string
Enum: "csv" "json"
Request Body schema:
required
name
required
string [ 1 .. 150 ] characters
url
string or null
logo
string or null
currency
required
string non-empty
phoneOne
required
string [ 1 .. 20 ] characters
fax
string or null <= 20 characters
email
string or null <email> <= 254 characters
required
object (AddressRequest)
required
object (AddressRequest)
required
Array of objects (AddressRequest)
language
integer [ -2147483648 .. 2147483647 ]
  • 1 - English
Value: 1
(LocationTimezoneEnum (integer or null)) or (BlankEnum (integer or null)) or (NullEnum (integer or null))
active
boolean
external_id
string or null <= 100 characters

External id

legal_entity
integer
Responses
201
Response Schema:
object
Default: {}
required
object (LocationView)
post/api/v2/locations/
Request samples
{
  • "name": "string",
  • "url": "string",
  • "logo": "string",
  • "currency": "string",
  • "phoneOne": "string",
  • "fax": "string",
  • "email": "user@example.com",
  • "primary_billing_address": {
    },
  • "primary_shipping_address": {
    },
  • "shipping_addresses": [
    ],
  • "language": 1,
  • "locationTimezone": "Africa/Abidjan",
  • "active": true,
  • "external_id": "string",
  • "legal_entity": 0
}
Response samples
{
  • "metadata": { },
  • "data": {
    }
}

Get Location by ID

SecurityRemoteAuthentication or M2MAuthentication or BasicAuthentication or cookieAuth
Request
path Parameters
id
required
string
query Parameters
format
string
Enum: "csv" "json"
Responses
200
Response Schema:
object
Default: {}
required
object (LocationView)
get/api/v2/locations/{id}/
Response samples
{
  • "metadata": { },
  • "data": {
    }
}

Update Location

⚠️ Full replacement. This operation is a full replacement of the targeted Location's data, including its alternate shipping addresses. Any field or alternate shipping address omitted from the request is overwritten or deactivated. Include any information you wish to retain by first performing a GET Location by ID call and sending it back in this request.

Alternate shipping addresses (shipping_addresses) are treated as the complete set for the location: include an id to update an existing address, omit id to create a new one, and any existing address not present in the request is deactivated. Sending an empty list deactivates all alternate shipping addresses.

SecurityRemoteAuthentication or M2MAuthentication or BasicAuthentication or cookieAuth
Request
path Parameters
id
required
string^\d+$
query Parameters
format
string
Enum: "csv" "json"
Request Body schema:
required
name
required
string [ 1 .. 150 ] characters
url
string or null
logo
string or null
currency
required
string non-empty
phoneOne
required
string [ 1 .. 20 ] characters
fax
string or null <= 20 characters
email
string or null <email> <= 254 characters
required
object (AddressRequest)
required
object (AddressRequest)
required
Array of objects (AddressRequest)
language
integer [ -2147483648 .. 2147483647 ]
  • 1 - English
Value: 1
(LocationTimezoneEnum (integer or null)) or (BlankEnum (integer or null)) or (NullEnum (integer or null))
active
boolean
external_id
string or null <= 100 characters

External id

legal_entity
integer
Responses
200
Response Schema:
object
Default: {}
required
object (LocationView)
put/api/v2/locations/{id}/
Request samples
{
  • "name": "string",
  • "url": "string",
  • "logo": "string",
  • "currency": "string",
  • "phoneOne": "string",
  • "fax": "string",
  • "email": "user@example.com",
  • "primary_billing_address": {
    },
  • "primary_shipping_address": {
    },
  • "shipping_addresses": [
    ],
  • "language": 1,
  • "locationTimezone": "Africa/Abidjan",
  • "active": true,
  • "external_id": "string",
  • "legal_entity": 0
}
Response samples
{
  • "metadata": { },
  • "data": {
    }
}