Skip to Content
StarsellDocs
Developers

Errors

The error body, every error code and status, what causes each one in the store API, and which errors are safe to retry.

A call that fails answers with a non-2xx status and a JSON body with an error object:

{
  "error": {
    "code": "conflict",
    "message": "The order has moved on since you opened it. Reload and try again."
  }
}
FieldDescription
codeA stable machine code from the table below. Branch on this.
messageA sentence for people: what went wrong, often what to do. It can change wording, so don't match on it. Some errors have no message, only a code.

The status always matches the code: not_found is always 404, conflict always 409. The one exception is invalid, which is 422 for a body or query that fails a check and 400 for a body that isn't JSON at all.

Codes

CodeStatusMeaning
unauthorized401No key, a wrong or revoked key, or its maker lost access to the store.
forbidden403The key is real but can't do this: another store's key, a read-only key writing, or a permission its maker doesn't have.
not_found404Nothing with that id in this store, or no such path.
conflict409The request is fine, but the object's current state doesn't allow it.
invalid422 / 400A field is missing, wrong, out of range, or the body isn't JSON.
rate_limited429Over 240 calls this minute with this key.
internal500Something broke on Starsell's side.
slug_taken409Not returned by the store API. The admin uses it when a store or organization address is already taken.
host_taken409Not returned by the store API. The admin uses it when a domain is connected to another store.
not_configured412Not returned by the store API. The admin uses it when a feature needs setup first, such as a supplier account.
upstream502Not returned by the store API. The admin uses it when an outside service it called (a supplier, Starsell AI, exchange rates) failed.

What causes each

unauthorized (401)

MessageCause
Send Authorization: Bearer <key>. Make a key in Settings, API and webhooks.No Authorization header, not in the form Bearer <key>, or the value doesn't start with vtk_.
This key is not valid or was revoked.The key doesn't exist: mistyped, cut off, or revoked.
The member who made this key no longer has access to this store.Its maker was removed from the store or the organization.

401 answers carry WWW-Authenticate: Bearer realm="starsell", error="invalid_token". See Authentication.

forbidden (403)

MessageCause
This key belongs to another store.The storeId in the path isn't the key's store. Keys reach one store each.
This key can only read. Make a key that can edit to change things.A POST, PATCH or DELETE with a Read only key.
The member who made this key has no <permission> access in this store.The key's maker lacks the permission the call needs (orders, products, customers or settings). See What a key can reach.

not_found (404)

MessageCause
No such order in this store/orders/{orderId} is neither an order number nor an order id in this store.
No such product in this store/products/{productId} matches no product id or handle in this store.
No such checkout in this store/checkouts/{checkoutId} isn't a checkout id in this store.
No such deliveryThe delivery id isn't a delivery of that webhook.
(no message)No such webhook in this store, or the path doesn't exist.

A real object in another store answers 404, the same as one that doesn't exist.

conflict (409)

MessageCause
This order is cancelledAny change to a cancelled order except adding a note, or payment_status: "refunded" while its payment is paid or test.
This order is cancelled and has nothing to refundpayment_status: "refunded" on a cancelled order that was never paid.
The order has moved on since you opened it. Reload and try again.The fulfillment change isn't possible from where the order is now. See the table below.
The payment has changed since you opened it. Reload and try again.payment_status: "paid" on an order whose payment is refunded or test. Only a pending payment can be marked paid.
This store has 20 webhooks. Delete one first.POST /webhooks when the store already has 20.
A request with this Idempotency-Key is still running. Try again in a moment.A POST or PATCH with the same Idempotency-Key as a call that hasn't answered yet. See Retrying safely.

Which fulfillment changes PATCH /orders/{orderId} accepts, by where the order is:

You sendAllowed when fulfillment_status is
"fulfillment_status": "sent_to_supplier"unfulfilled
"fulfillment_status": "shipped"unfulfilled or sent_to_supplier
"fulfillment_status": "delivered"shipped
"fulfillment_status": "returned"shipped or delivered
"status": "cancelled"unfulfilled
tracking alonesent_to_supplier, shipped or delivered

Sending a status the order already has is not an error: it is skipped. Sending "shipped" again with a different tracking changes the tracking number.

invalid (422 and 400)

The API checks every query and body against its schema first. Anything that doesn't fit - a wrong type, an unknown value for an enum, a string that is too long, limit over 100 - gets 422 with a generic message:

{ "error": { "code": "invalid", "message": "Some fields are missing or wrong" } }

A body that isn't valid JSON gets 400 with { "error": { "code": "invalid" } }.

These checks run before the key is read, so a malformed request gets 422 or 400 even with a missing or wrong key, and it doesn't count against the rate limit.

Past the schema, the endpoints refuse with a specific message:

MessageWhere
created_after must be an ISO 8601 date, like 2026-11-27T10:00:00ZA date filter (created_after, created_before, updated_after) that isn't a date.
Unknown event type <type>type on GET /events or on a webhook test isn't an event type.
Send fulfillment_status, status, payment_status, tracking or notePATCH /orders/{orderId} with nothing to change.
Send fulfillment_status "shipped" with the tracking numbertracking alone on an order that hasn't left yet.
Send status or variantsPATCH /products/{productId} with nothing to change.
No version <id> on this productA variants[].id that isn't one of this product's versions.
A bundle's stock comes from its parts. Change the parts' stock.stock on a bundle's version.
Pick at least one event from the listA webhook's events is empty or has a type that doesn't exist.
That is not a valid URL, Use an https URL, Leave the user name and password out of the URL, That URL is too long, Use port 80, 443 or one above 1023A webhook url Starsell won't call.
Webhooks can only call public addresses, <host> does not resolveA webhook url whose host is local, private or doesn't exist. See Webhooks.
Idempotency-Key must be 1 to 255 visible characters, such as a UUID.An Idempotency-Key header that is empty, too long or has spaces.
This Idempotency-Key was used for a different request. Use a new key for each change.The key was used before, within 24 hours, with another path or body.

rate_limited (429)

The key made more than 240 calls in the current minute. The answer says how long to wait, in the body and in Retry-After:

{ "error": { "code": "rate_limited", "message": "This key made over 240 calls this minute. Wait 17 seconds." } }

See Pagination and limits.

internal (500)

{ "error": { "code": "internal" } }, with no message. Something failed inside Starsell; the details are in Starsell's own logs, not in the answer.

Writes that change several things

PATCH /orders/{orderId} can set several things at once. They are checked and applied in this order: payment_status, fulfillment_status, status, tracking, note, all in one go with the order locked. If any step fails, none of them is saved: no timeline line, no event, no activity line, and the call answers with the error.

# Mark paid, then ship. If shipping is refused with 409, the order is not marked paid either.
curl -X PATCH "$BASE/orders/1042" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -d '{"payment_status":"paid","fulfillment_status":"shipped","tracking":"RR123456789IL"}'

PATCH /products/{productId} is all or nothing too: the status and every version change are saved together, or none are.

Retrying

StatusRetry?
400, 422No. Fix the request.
401, 403No. Fix the key, its scope, or its maker's permissions.
404No.
409Not as is. Read the object again and decide.
429Yes, after Retry-After seconds.
500Yes, with backoff. Send the same Idempotency-Key again. Without one, read the object first.
No answer (timeout, dropped connection)For a GET, yes. For a write, yes with the same Idempotency-Key; without one, read first: the change may have gone through.

Repeating a status change is safe even without a key: a status the order already has is skipped, so sending "fulfillment_status": "shipped" twice ships once. A note is not: without an Idempotency-Key, it is added to the timeline again on every call that carries it.

Retrying safely

Every POST and PATCH takes an Idempotency-Key header: any string of 1 to 255 visible characters, unique to the change you mean. A UUID made when you decide to make the change is the usual choice.

curl -X PATCH "$BASE/orders/1042" \
  -H "Authorization: Bearer $KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 6f0c1d2e-8a4b-4c7d-9e3f-1b5a7c9d2e40" \
  -d '{"note":"Called the customer, leaving it at the door"}'
  • The first call with a key runs as usual. Its answer is kept for 24 hours, per store and key.
  • A repeat with the same key, path and body gets that same answer back, status included, without running again, and carries Idempotent-Replayed: true. A note is added once, a webhook is made once.
  • Only answers that went through (2xx) are kept. A call that failed changed nothing, so a repeat of it runs again: fix what the error said and send the same key.
  • A repeat while the first call hasn't answered yet gets 409 conflict. Wait a moment and send it again.
  • The same key with another path or body gets 422 invalid. Make a new key for each change.
  • Replays count against the rate limit like any call. GET and DELETE ignore the header: repeating a GET changes nothing, and a repeated DELETE answers 404.

Related: Authentication, Pagination and limits, API reference.

On this page