POST

Create Order


Creates an order from a specified checkout.

Note: The following requirements must be met for an order to be created from a checkout.

  • A checkout cannot have calculation errors. Pass the checkout._id to Get Checkout and take a look at the calculationErrors field.
  • A checkout must have at least 1 line item.
  • All of the line Items have an availability.status of "AVAILABLE" or "PARTIALLY_AVAILABLE".
  • If there is a payment to be made, meaning that priceSummary.total is greater than 0, the billingInfo.address field must be provided.
  • When a checkout has line items to be shipped, the shippingInfo.shippingDestination.address and shippingInfo.selectedCarrierServiceOption fields must be provided.
  • When a checkout has line items for pickup, the shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails field must be provided.
Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/ecom/v1/checkouts/{id}/create-order

Path Params
idstringRequired

Checkout ID.

Body Params
savePaymentMethodbooleanbeta

Indicates the payment method should be saved on the order


delayCapturebooleanbeta

Indicates whether to authorize the payment and delay the capture

Response Object
paymentGatewayOrderIdstring

Payment gateway order ID.

For online orders, pass this value as the paymentId parameter to the Wix Pay startPayment() function so your customer can pay for the order. paymentGatewayOrderId will be returned if money needs to be charged.

In some cases, money cannot be charged:

  • When the total price (the priceSummary.total.amount field in the checkout/order objects) is 0. For example, in the case of a free item or an item with a 100% discount.
  • If the total price is not 0, but the payment is covered by alternative payment methods, such as a gift card.

ONE OF:

orderIdstringformat GUID

ID of newly created order.


subscriptionIdstringformat GUID

ID of newly created subscription. Learn more about your site's Subscriptions.

Request
cURL
curl -X POST 'https://www.wixapis.com/ecom/v1/checkouts/98efbd87-8097-44e9-9005-72093d7a21d5/create-order' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \
Response
JSON
{ "orderId": "f2eaeee3-8ade-460c-b622-5b63eec6f75f", "paymentGatewayOrderId": "42c7ae00-b96c-4e36-9eb9-026667193f13" }
Errors
400Invalid Argument

There is 1 error with this status code.

409Already Exists

There are 2 errors with this status code.

428Failed Precondition

There are 13 errors with this status code.

500Internal

There is 1 error with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?