Skip to content

Create Draft Cart

Starts a fresh Create-Order session by spawning an empty draft cart (is_active = false) bound to the given customer. This is the customer-nested counterpart to the POST /api/admin/orders/{id}/reorder action (which builds the cart from an existing order). Both flows produce the same kind of draft cart and end up at the cart-keyed write endpoints (POST /api/admin/carts/{id}/items, addresses, shipping, payment).

Endpoint

EndpointMethod
/api/admin/customers/{customerId}/draft-cartsPOST

The customer is taken from the URL — the request body is empty.

Response Fields

FieldTypeDescription
cartIdintegerThe new draft cart's ID — use it for the rest of the Create-Order flow.
customerIdintegerThe customer the cart belongs to.
successbooleanWhether the cart was created.
messagestringResult message.

Why a separate endpoint and not just one cart-create route

The customer-nested URL keeps fresh Create-Order distinct from Reorder, which is important because the two have completely different inputs and side-effects. Reorder consumes an existing order id; this endpoint only needs the customer.

TIP

For how the Create-Order helper panels fit together, see the Create-Order Helpers overview.

Released under the MIT License.