Skip to main content
PUT
/
collections
Upsert Collection
curl --request PUT \
  --url https://api.loopreturns.com/api/v1/collections \
  --header 'Content-Type: application/json' \
  --header 'X-Authorization: <api-key>' \
  --data '
{
  "external_id": "<string>",
  "name": "<string>",
  "channel": "<string>",
  "products": [
    {
      "id": 123
    }
  ]
}
'
{
  "id": 123,
  "external_id": "<string>",
  "channel": "<string>",
  "name": "<string>",
  "products": [
    {
      "id": 2,
      "external_id": "<string>",
      "sku": "<string>",
      "name": "<string>"
    }
  ]
}

Authorizations

X-Authorization
string
header
required

API Scope: "Collections (write)"

Body

application/json
external_id
string
required

The identifier used by an external source to identify the collection.

Maximum string length: 64
Example:

"1263csss-12uhsdfh-2138dja"

name
string
required

The name of the collection.

Maximum string length: 255
Example:

"Footwear"

channel
string | null

If a channel with this is not already associated with the shop, it will be used to create a new channel.

Maximum string length: 64
Example:

"shopify"

products
object[] | null

An array of products to add to the collection.

Response

Success

id
integer<int64>

The unique identifier for the collection, created by Loop.

external_id
string | null

The identifier used by an external source to identify the collection.

channel
string

The name of the channel.

name
string

The name of the collection.

products
ProductResponse · object[] | null

An array of products associated with the collection.