Skip to content

Place Order

Create an order from a cart and complete the checkout process.

Authentication

This query supports both authenticated customers and guest users:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
  • Guest users: Provide the Guest Cart Token cartToken obtained from the Create Cart mutation.
Authorization: Bearer <accessToken>

Response

FieldTypeDescription
idStringCheckout order ID
orderIdStringCreated order ID

Prerequisites

All of these must be completed before placing an order:

  1. ✅ Cart must contain items
  2. ✅ Shipping address must be set
  3. ✅ Billing address must be set
  4. ✅ Shipping method must be selected
  5. ✅ Payment method must be selected
  6. ✅ Valid coupon (if applicable)

Validation Rules

  • Cart must have at least one item
  • All checkout steps must be completed
  • Billing and shipping addresses are required
  • Shipping and payment methods must be selected
  • Stock must be available for all items
  • Inventory must not be exceeded

Error Responses

json
{
  "errors": {
    "checkout": ["Unable to complete checkout. Please verify all required fields."],
    "inventory": ["Insufficient stock for one or more items."],
    "payment": ["Payment processing failed."]
  }
}

Order Status Values

StatusDescription
pendingOrder created, awaiting payment
processingPayment confirmed, preparing shipment
shippedOrder has been shipped
deliveredOrder delivered
cancelledOrder cancelled
refundedOrder refunded

After Order Placement

  1. Cart is cleared
  2. Order confirmation email is sent
  3. Inventory is updated
  4. Customer can track order using order ID

Released under the MIT License.