Skip to content

Delete a collection

DELETE
/stores/{storeRef}/collections/{id}
curl --request DELETE \
--url https://apibase.ecomweb.app/api/v1/stores/example/collections/1 \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "soft_delete": true, "force": false }'

Soft-deletes the collection by default: it disappears from the store and its slug is freed, but the record is kept. Send force: true to delete it permanently, which cannot be undone.

Required scopes: write:categories

id
required
integer

The collection ID.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
soft_delete

Has no effect. Use force to choose between a soft and a permanent delete.

boolean
default: true
force

Send true to delete the collection permanently instead of soft-deleting it. Cannot be undone.

boolean
Media typeapplication/json
object
type
required

soft keeps the record out of sight but recoverable by staff; hard removes it permanently.

string
Allowed values: soft hard
success
required

Whether the deletion succeeded.

boolean
message
required

A readable result message.

string
collection_id
required

ID of the deleted collection.

number
deleted_at

When the collection was soft-deleted, as an ISO 8601 timestamp. Absent for a hard delete.

string

Example

{
"type": "soft"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}