Skip to main content
POST
/
api
/
storefront
/
checkout
/
{checkout_id}
/
complete
Complete Checkout
curl --request POST \
  --url https://api.example.com/api/storefront/checkout/{checkout_id}/complete \
  --header 'Content-Type: application/json' \
  --header 'X-Site-ID: <x-site-id>' \
  --data '
{
  "payment_method": "stripe",
  "payment_intent_id": "<string>",
  "cod": {
    "phone": "<string>",
    "accepted_terms": false,
    "notes": "<string>"
  },
  "bank_transfer_reference": "<string>"
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "cart_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "email": "<string>",
  "shipping_address": {
    "first_name": "<string>",
    "last_name": "<string>",
    "company": "<string>",
    "address1": "<string>",
    "address2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postal_code": "<string>",
    "country": "<string>",
    "phone": "<string>"
  },
  "billing_address": {
    "first_name": "<string>",
    "last_name": "<string>",
    "company": "<string>",
    "address1": "<string>",
    "address2": "<string>",
    "city": "<string>",
    "state": "<string>",
    "postal_code": "<string>",
    "country": "<string>",
    "phone": "<string>"
  },
  "items": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "variant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "product_name": "<string>",
      "variant_name": "<string>",
      "sku": "<string>",
      "image_url": "<string>",
      "price": "<string>",
      "quantity": 123,
      "total": "<string>"
    }
  ],
  "subtotal": "<string>",
  "tax_amount": "<string>",
  "shipping_amount": "<string>",
  "total": "<string>",
  "currency": "<string>",
  "status": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "payment_intent_id": "<string>",
  "order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "completed_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.stella-commerce.com/llms.txt

Use this file to discover all available pages before exploring further.

Headers

X-Site-ID
string
required
X-Stella-Token
string | null
Idempotency-Key
string | null

Path Parameters

checkout_id
string<uuid>
required

Body

application/json

Storefront checkout completion request — Phase 8-B.

Phase 4-A's freeform payment_method: str is replaced by a Literal-restricted method discriminator. The PaymentMethodHandler registry routes the body to the matching handler. Stripe still arrives via the webhook for buyer-Stripe-Element flows; this route is for COD + (future PR-C) bank transfer + back-compat callers that explicitly know their PI.

Field rules per method:

  • stripepayment_intent_id required.
  • codcod block populated; phone required at API time when CodConfig.require_phone=true.
  • bank_transferbank_transfer_reference optional. Wired in PR-C; this route 422s today via the handler's NotImplementedError.
payment_method
enum<string>
required
Available options:
stripe,
cod,
bank_transfer
payment_intent_id
string | null
cod
CodSubmission · object

Buyer-supplied COD details. Phase 8-B accepts these but only phone and accepted_terms are checked at the API edge today — OTP wiring is Phase 8 Decision 3 (deferred).

bank_transfer_reference
string | null

Response

Successful Response

Schema for checkout response.

id
string<uuid>
required
cart_id
string<uuid>
required
email
string
required
shipping_address
AddressSchema · object
required

Schema for address. Fields are optional to support simpler address formats from AI widget.

billing_address
AddressSchema · object
required

Schema for address. Fields are optional to support simpler address formats from AI widget.

items
CartItemResponse · object[]
required
subtotal
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
tax_amount
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
shipping_amount
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
total
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
currency
string
required
status
string
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
payment_intent_id
string | null
order_id
string<uuid> | null
completed_at
string<date-time> | null