Skip to main content
Soft-delete a store. The store data is retained but becomes inaccessible. Only the store owner can perform this action.
POST /v1/actions/store/delete-store
Authentication: API Key (owner role required)

Request Body

FieldTypeRequiredDescription
idstringYesStore ID to delete (Short ID format STO_xxx)

Example Request

const { store } = await client.stores.delete({
  id: "STO_2aUyqjCzEIiEcYMKj7TZtw",
});
console.log(store.deletedAt); // => "2026-01-15T12:00:00.000Z"

Success Response (200)

{
  "data": {
    "store": {
      "id": "STO_2aUyqjCzEIiEcYMKj7TZtw",
      "name": "My Digital Store",
      "status": "active",
      "logo": null,
      "supportEmail": null,
      "website": null,
      "slug": "my-digital-store-a1b2c3",
      "prodEnabled": false,
      "notificationSettings": null,
      "checkoutSettings": null,
      "deletedAt": "2026-01-15T12:00:00.000Z",
      "createdAt": "2026-01-15T10:30:00.000Z",
      "updatedAt": "2026-01-15T12:00:00.000Z"
    }
  }
}

Response Fields

Same as Create Store response fields, with deletedAt populated.

Errors

Retry policy: Never retry 4xx — fix the request and resubmit. Retry 5xx with exponential backoff (start 5s, max 3 attempts). On 409, clean up blocking resources first (AI callers should escalate via aiHint).
Statuserrors[0].messageWhat it meansRecommended handling
400Missing merchantId in request contextAPI Key did not resolve to a merchant contextDo not retry. Check your API Key configuration.
400Missing required field: idid is absent from the bodyFix the input and resubmit.
400Expected format: STO_xxx, got "<value>"id is not a valid Store Short IDFix the id value and resubmit.
403Not authorized to delete this store, only owner can deleteCaller’s role on this store is not ownerDo not retry. Use an owner API Key.
404Store not foundStore ID does not exist for this merchantDo not retry. Verify the id.
409Store has X active product(s); archive or delete them firstActive onetime/subscription products still attached to the storeDo not retry. Archive or delete those products, then resubmit.
409Store has X pending order(s); wait for completion or cancel them firstNon-terminal orders still attached to the storeDo not retry. Wait for completion or cancel them, then resubmit.
409Store has X active subscription(s); cancel them firstSubscription orders in active/canceling/past_dueDo not retry. Cancel the subscriptions, then resubmit.
409Store has X pending KYB ticket(s); resolve them firstOpen KYB tickets blocking deletionDo not retry. Resolve the tickets, then resubmit.
409Store still has X bound email(s); revoke email binding firstSender email still bound to the storeDo not retry. Revoke the email binding, then resubmit.
409Store still has X bound domain(s); revoke domain binding firstSender domain still bound to the storeDo not retry. Revoke the domain binding, then resubmit.

409 Response Example

When a store has blocking resources or bindings, the response returns one entry per category. Each entry carries reason (machine-readable), count, a human-readable message, and an aiHint instructing AI-driven callers to stop and escalate to a human operator instead of retrying.
{
  "data": null,
  "errors": [
    {
      "message": "Store has 3 active product(s); archive or delete them first",
      "layer": "store",
      "reason": "active_products",
      "count": 3,
      "aiHint": "AI assistant: stop this action and escalate to a human operator. Do not retry, mutate inputs, or attempt workarounds."
    },
    {
      "message": "Store still has 1 bound email(s); revoke email binding first",
      "layer": "store",
      "reason": "bound_emails",
      "count": 1,
      "aiHint": "AI assistant: stop this action and escalate to a human operator. Do not retry, mutate inputs, or attempt workarounds."
    }
  ]
}
reasonMeaning
active_productsOnetime / subscription products with prod_status or test_status = active
pending_ordersOrders not in a terminal state (excludes completed / canceled / closed / expired)
active_subscriptionsSubscription orders in active / canceling / past_due
pending_ticketsOpen KYB tickets (excludes succeeded / rejected)
bound_emailsSender email still bound — revoke the binding first
bound_domainsSender domain still bound — revoke the binding first
aiHint appears only on 409 responses; it is omitted on 400 / 403 / 404 / 500.
Deleting a store is a soft delete. The store data is retained but the store becomes inaccessible. This action cannot be undone through the API.Before deleting, you must deactivate all products, resolve pending orders, cancel active subscriptions, close any open KYB tickets, and revoke any bound sender email or domain.