Wocart
Wocart API

Checkout Form

Server

Get the checkout form policy

GET
https://api.wocart.store
/api/checkout-form
X-API-Key (header)

The storefront order form's configuration. A store that has never customised it returns the defaults, which describe the form exactly as it behaved before this feature existed.

Get the checkout form policy › Responses

200

The current policy

success
​boolean · required
​object · required

Replace the checkout form policy

PUT
https://api.wocart.store
/api/checkout-form
X-API-Key (header)

Replaces the whole policy — a key you omit takes its default rather than keeping the stored value, so what the screen shows is what the store gets.

Ids are server-owned. Omit id on a field to create it; the response carries the minted id. An id the store does not already have is refused, because ids key the answer snapshots on existing orders.

Unknown keys are refused rather than ignored, so a typo cannot silently vanish. Every problem is reported at once in context.issues.

Saving the defaults clears the stored policy entirely (the column goes back to NULL), which is also the documented rollback for the feature.

Fixed fields — name, phone, wilaya, commune — are not configurable: COD dispatch, customer identity and delivery pricing all depend on them.

Replace the checkout form policy › Request Body

A policy document. Same shape as CheckoutFormPolicy, with `customFields[].id` optional (omit it to create a field). Validated server-side by the policy module: unknown keys, an empty delivery-option pair, an unknown field id and every authoring limit are refused, with each problem listed in `context.issues`.
No data returned

Replace the checkout form policy › Responses

The saved policy

success
​boolean · required
​object · required