Skip to content
Browse documentation

API reference

Checkout

Validate the current cart and create the order and payment records in one call. The response contains the order reference and the resolved line items and totals.

Feature requirement: the project must have the commerce feature enabled, or these endpoints return 404.

  • Send both X-Cart-Token and an Idempotency-Key header. Replaying the same Idempotency-Key with an identical body returns the stored result; a different body returns 409.
  • The current checkout flow defaults to manual payment confirmation. Webtools does not initiate a provider charge or refund from the storefront — merchants record external payment evidence in the dashboard.
POST/api/v1/storefront/projects/{project_slug}/checkout

Create Checkout

Parameters
NameTypeInDescription
project_slugstringpathRequired.
Idempotency-Keystring (nullable)headerOptional.
x-cart-tokenstring (nullable)headerOptional.
Request body · CheckoutRequest
FieldTypeDescription
emailstring<email>required—
shipping_method_idstring (nullable)optional—
discount_codestring (nullable)optional—
shipping_addressShippingAddress (nullable)optional—
billing_addressobject (nullable)optional—
notesstring (nullable)optional—
payment_providerPaymentProvideroptional—
callback_urlstring (nullable)optional—
client_total_minorinteger (nullable)optional—
Response 200 · CheckoutResponse
FieldTypeDescription
checkout_idstringrequired—
order_idstringrequired—
payment_idstringrequired—
payment_referencestringrequired—
payment_providerstringrequired—
payment_statusstringrequired—
authorization_urlstring (nullable)required—
payment_instructionsstring (nullable)optional—
currencystringrequired—
subtotal_minorintegerrequired—
discount_minorintegerrequired—
shipping_minorintegerrequired—
tax_minorintegerrequired—
total_minorintegerrequired—
linesCheckoutLineRead[]required—
Example request
curl -X POST "https://api.webtools.ng/api/v1/storefront/projects/your-project/checkout" \
  -H "X-Project-Key: wt_pk_your_key" \
  -H "Content-Type: application/json" \
  -d '{ "email": "…" }'

← All resource groups