Create a location

Creates a new location in your account.

The name must be one you don't already use — names are compared case-insensitively, so Shelf A and shelf a count as the same and the second request returns CONFLICT.

Send "upsert": true to make the call safe to repeat: when the location already exists it is returned — updated with any color or icon you sent — instead of failing with CONFLICT. One call then guarantees the location exists before you reference it on inventory lines.

Requires the inventory:write scope.

Body
required
application/json
  • name
    Type: string
    min length:  
    1
    max length:  
    100
    required

    The location's name, unique within your account.

  • color
    Type: string
    min length:  
    1
    max length:  
    50

    An optional display colour, free-form text.

  • icon
    Type: string
    min length:  
    1
    max length:  
    50

    An optional display icon, free-form text.

  • upsert
    Type: boolean

    When true and you already have a location with this name, the request returns that location — updated with any color or icon you sent — instead of failing with CONFLICT. The existing location keeps its stored name spelling.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/inventory/locations
curl https://public-api.cardnexus.com/v1/inventory/locations \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "name": "Trade binder",
  "color": "",
  "icon": "",
  "upsert": true
}'
{
  "name": "Trade binder",
  "color": "#22c55e",
  "icon": "star"
}