Skip to content

Archive a supplier

POST
/stores/{storeRef}/suppliers/{id}/archive
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/suppliers/1/archive \
--header 'x-api-key: <x-api-key>'

Archives a supplier so it can no longer be put on a new purchase order, while existing orders keep showing it. Returns the supplier with archived_at set. Archive instead of deleting once a purchase order names the supplier.

Required scopes: write:purchase_orders

id
required
integer

The supplier ID.

storeRef
required
string

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

Media typeapplication/json
object
id
required

Supplier ID.

number
name
required

Supplier name. Unique among the store’s live suppliers.

string
contact_name
required

Name of the contact person, or null.

string
nullable
email
required

Email address that purchase orders are sent to, or null.

string
nullable
phone
required

Phone number, or null.

string
nullable
address_line1
required

First address line, or null.

string
nullable
address_line2
required

Second address line, or null.

string
nullable
province
required

Province code, or null.

string
nullable
ward
required

Ward code, or null.

string
nullable
country
required

Two-letter country code.

string
note
required

Internal note about the supplier, or null.

string
nullable
archived_at
required

When the supplier was archived, as an ISO 8601 timestamp, or null while the supplier is live.

string
nullable
created_at
required

When the supplier was created, as an ISO 8601 timestamp.

string
updated_at
required

When the supplier was last updated, as an ISO 8601 timestamp.

string

Example generated

{
"id": 1,
"name": "example",
"contact_name": "example",
"email": "example",
"phone": "example",
"address_line1": "example",
"address_line2": "example",
"province": "example",
"ward": "example",
"country": "example",
"note": "example",
"archived_at": "example",
"created_at": "example",
"updated_at": "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"
}