PATCH

Update Checkout


Updates a checkout.

Use this endpoint to update checkout fields such as billing and shipping info, or to add a coupon code or gift card.

To update a checkout's lineItems, completed status, or to remove coupons and gift cards, see these endpoints:

Notes:

  • If nothing is passed in the request, the call will fail.
  • The checkout.buyerInfo.email may not be removed once it is set.
Permissions
Manage eCommerce - all permissions
Manage Stores - all permissions
Manage Orders
Manage Restaurants - all permissions
Manage eCommerce - Admin Permissions
Learn more about app permissions.
Endpoint
PATCH
https://www.wixapis.com/ecom/v1/checkouts/{checkout.id}

Path Params
checkout.idstringRequired

Checkout ID.

Body Params
checkoutCheckoutRequired

Checkout information.


couponCodestring

Coupon code.

The checkout can only hold 1 couponCode at a time. If an additional couponCode is added, it will override the existing couponCode.


giftCardCodestring

Gift card code.


overrideCheckoutUrlstringmaxLength 1000

overrideCheckoutUrl allows the flexibility to redirect customers to a customized checkout page.

This field overrides the checkoutUrl in a cart or checkout. checkoutUrl is used in the Abandoned Checkout API to send customers back to their checkouts. By default, a checkoutUrl generates for a checkout and directs to a standard Wix checkout page. When overrideCheckoutUrl has a value, it will replace and set the value of checkoutUrl.


lineItemsArray <LineItem>maxItems 300

Catalog line items.


customLineItemsArray <CustomLineItem>betamaxItems 300

Custom line items. Custom line items don't trigger the Catalog service plugin.

To access and manage custom line items, your app must have the permission scope named "Manage eCommerce - Admin Permissions". Learn more about permission scopes.

Response Object
checkoutCheckout

Updated checkout.

Request
cURL
curl -X PATCH 'https://www.wixapis.com/ecom/v1/checkouts/98efbd87-8097-44e9-9005-72093d7a21d5' \ -H 'Content-Type: application/json' \ -H 'Authorization: <AUTH>' \ -d '{ "couponCode": "summer sale", "giftCardCode": "100dollars", "checkout": { "shippingInfo": { "shippingDestination": { "address": { "country": "US", "subdivision": "US-ME", "city": "Richmond", "postalCode": "04357", "addressLine": "1773 Fantages Way" }, "contactDetails": { "firstName": "John1", "lastName": "Doe", "phone": "2075555217" } }, "selectedCarrierServiceOption": { "code": "c0feaab1-60d1-8eed-4283-b3bc10765af9", "carrierId": "c8a08776-c095-4dec-8553-8f9698d86adc" } }, "billingInfo": { "address": { "country": "US", "subdivision": "US-ME", "city": "Richmond", "postalCode": "04357", "addressLine": "1772 Fantages Way" }, "contactDetails": { "firstName": "John", "lastName": "Doe", "phone": "2075555217" } }, "buyerInfo": { "email": "janedoe1@gmail.com" }, "buyerNote": "wrap it as present", "customFields": [ { "title": "Tax id", "translatedTitle": "Tax id", "value": "12345" } ] } }'
Response
JSON
{ "checkout": { "id": "98efbd87-8097-44e9-9005-72093d7a21d5", "lineItems": [ { "id": "00000000-0000-0000-0000-000000000001", "quantity": 10, "catalogReference": { "catalogItemId": "6b332137-422d-c53b-57b1-5130e01c7e0c", "appId": "215238eb-22a5-4c36-9e7b-e7c08025e04e" }, "productName": { "original": "T-shirt", "translated": "T-shirt" }, "url": { "relativePath": "/product-page/t-shirt", "url": "https://wixsite.com/coffeestore" }, "price": { "amount": "45", "convertedAmount": "45", "formattedAmount": "$45.00", "formattedConvertedAmount": "$45.00" }, "fullPrice": { "amount": "50", "convertedAmount": "50", "formattedAmount": "$50.00", "formattedConvertedAmount": "$50.00" }, "totalPriceAfterTax": { "amount": "446", "convertedAmount": "446", "formattedAmount": "$446.00", "formattedConvertedAmount": "$446.00" }, "totalPriceBeforeTax": { "amount": "371.67", "convertedAmount": "371.67", "formattedAmount": "$371.67", "formattedConvertedAmount": "$371.67" }, "taxDetails": { "taxableAmount": { "amount": "446", "convertedAmount": "446", "formattedAmount": "$446.00", "formattedConvertedAmount": "$446.00" }, "taxRate": "0.2", "totalTax": { "amount": "74.33", "convertedAmount": "74.33", "formattedAmount": "$74.33", "formattedConvertedAmount": "$74.33" }, "rateBreakdown": [] }, "discount": { "amount": "4", "convertedAmount": "4", "formattedAmount": "$4.00", "formattedConvertedAmount": "$4.00" }, "descriptionLines": [], "media": { "id": "47ab5a_b162aea573dd4e708e2e6c21536a0f5e~mv2.png", "url": "https://static.wixstatic.com/media/47ab5a_b162aea573dd4e708e2e6c21536a0f5e~mv2.png/v1/fit/w_4032,h_3024,q_90/file.png", "height": 3024, "width": 4032 }, "availability": { "status": "AVAILABLE" }, "physicalProperties": { "weight": 0.1, "sku": "1234", "shippable": true }, "couponScopes": [ { "namespace": "stores", "group": { "name": "product", "entityId": "6b332137-422d-c53b-57b1-5130e01c7e0c" } } ], "itemType": { "preset": "PHYSICAL" } } ], "billingInfo": { "address": { "country": "US", "subdivision": "US-ME", "city": "Richmond", "postalCode": "04357", "addressLine": "1772 Fantages Way", "countryFullname": "United States", "subdivisionFullname": "Maine" }, "contactDetails": { "firstName": "John", "lastName": "Doe", "phone": "2075555217" } }, "shippingInfo": { "shippingDestination": { "address": { "country": "US", "subdivision": "US-ME", "city": "Richmond", "postalCode": "04357", "addressLine": "1773 Fantages Way", "countryFullname": "United States", "subdivisionFullname": "Maine" }, "contactDetails": { "firstName": "John1", "lastName": "Doe", "phone": "2075555217" } }, "selectedCarrierServiceOption": { "code": "c0feaab1-60d1-8eed-4283-b3bc10765af9", "title": "standard", "logistics": { "deliveryTime": "" }, "cost": { "totalPriceAfterTax": { "amount": "10", "convertedAmount": "10", "formattedAmount": "$10.00", "formattedConvertedAmount": "$10.00" }, "totalPriceBeforeTax": { "amount": "8.33", "convertedAmount": "8.33", "formattedAmount": "$8.33", "formattedConvertedAmount": "$8.33" }, "taxDetails": { "taxRate": "0.2", "totalTax": { "amount": "1.67", "convertedAmount": "1.67", "formattedAmount": "$1.67", "formattedConvertedAmount": "$1.67" }, "rateBreakdown": [] }, "price": { "amount": "10", "convertedAmount": "10", "formattedAmount": "$10.00", "formattedConvertedAmount": "$10.00" } }, "requestedShippingOption": true, "otherCharges": [], "carrierId": "c8a08776-c095-4dec-8553-8f9698d86adc" }, "region": { "id": "9249fd9c-7424-5ec3-21b6-7c28b8c0b485", "name": "Region 2" }, "carrierServiceOptions": [ { "carrierId": "c8a08776-c095-4dec-8553-8f9698d86adc", "shippingOptions": [ { "code": "c0feaab1-60d1-8eed-4283-b3bc10765af9", "title": "standard", "logistics": { "deliveryTime": "" }, "cost": { "price": { "amount": "10", "convertedAmount": "10", "formattedAmount": "$10.00", "formattedConvertedAmount": "$10.00" }, "otherCharges": [] } }, { "code": "83f392e7-ec2e-4931-9449-7a85b8217704", "title": "qfvbge", "logistics": { "deliveryTime": "", "instructions": "sGW", "pickupDetails": { "address": { "country": "UA", "subdivision": "", "city": "Dnepropetrovsk", "postalCode": "12345", "addressLine": "qgrqgerh", "addressLine2": "qgrqgerh", "countryFullname": "Ukraine", "subdivisionFullname": "" }, "businessLocation": true } }, "cost": { "price": { "amount": "0", "convertedAmount": "0", "formattedAmount": "$0.00", "formattedConvertedAmount": "$0.00" }, "otherCharges": [] } } ] } ] }, "buyerNote": "wrap it as present", "buyerInfo": { "contactId": "3ba28845-0904-490a-94a7-9ba0cd6d9465", "email": "janedoe1@gmail.com", "visitorId": "9cef4c21-ad14-4a3b-8526-0d8628160965" }, "conversionCurrency": "USD", "priceSummary": { "subtotal": { "amount": "375.67", "convertedAmount": "375.67", "formattedAmount": "$375.67", "formattedConvertedAmount": "$375.67" }, "shipping": { "amount": "8.33", "convertedAmount": "8.33", "formattedAmount": "$8.33", "formattedConvertedAmount": "$8.33" }, "tax": { "amount": "76", "convertedAmount": "76", "formattedAmount": "$76.00", "formattedConvertedAmount": "$76.00" }, "discount": { "amount": "4", "convertedAmount": "4", "formattedAmount": "$4.00", "formattedConvertedAmount": "$4.00" }, "total": { "amount": "456", "convertedAmount": "456", "formattedAmount": "$456.00", "formattedConvertedAmount": "$456.00" } }, "calculationErrors": {}, "giftCard": { "id": "f78f162c-b6e9-4230-a97c-fd4c784160c8", "obfuscatedCode": "******lars", "amount": { "amount": "100", "convertedAmount": "100", "formattedAmount": "$100.00", "formattedConvertedAmount": "$100.00" }, "appId": "ca5af76c-16be-4ff7-96cc-02c0920bce70" }, "appliedDiscounts": [ { "discountType": "GLOBAL", "lineItemIds": [], "coupon": { "id": "bc75c299-bb39-47a1-a0a6-68005011ce14", "code": "summer sale", "amount": { "amount": "4", "convertedAmount": "4", "formattedAmount": "$4.00", "formattedConvertedAmount": "$4.00" }, "name": "summer sale", "couponType": "MoneyOff" } } ], "customFields": [ { "value": "12345", "title": "Tax id", "translatedTitle": "Tax id" } ], "weightUnit": "KG", "taxSummary": { "taxableAmount": { "amount": "371.67", "convertedAmount": "371.67", "formattedAmount": "$371.67", "formattedConvertedAmount": "$371.67" }, "totalTax": { "amount": "76", "convertedAmount": "0", "formattedAmount": "", "formattedConvertedAmount": "" }, "manualTaxRate": "0.2", "calculationDetails": { "rateType": "MANUAL_RATE", "manualRateReason": "GLOBAL_SETTING_TO_MANUAL" } }, "currency": "USD", "channelType": "WEB", "siteLanguage": "en", "buyerLanguage": "en", "completed": false, "taxIncludedInPrice": true, "createdBy": { "visitorId": "9cef4c21-ad14-4a3b-8526-0d8628160965" } } }
Errors
404Not Found

There are 4 errors with this status code.

428Failed Precondition

There are 8 errors with this status code.

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

Event TriggersThis method triggers the following events:
Did this help?