Update order

PUT https://api.ecartapi.com/api/v2/orders/:id

Updates the order provided with the information sent in the payload.

Payload specifications

status.status allowed values:

on_hold, pending, paid, cancelled, refunded.

Status value reference table:

You will find the comparisson between the ecartapi status required to be sent on the payload and its Magento 2 equivalent with a short description.

EcartAPIMagento 2Status description
on_holdpending_paymentThe payment is pending, and still to be paid
pendingprocessingThe order is paid and is currently in process
paidprocessingThe order is paid and is currently in process
cancelledcanceledThe order has been cancelled
refundedrefundedThe payment has been refunded

Request Body

{"order"=>{"status"=>{"status"=>"pending"}, "totals"=>{"subtotal"=>"90", "total"=>"100", "tax"=>"10", "discount"=>"0", "weight"=>"300"}, "currency"=>"MXN", "taxesIncluded"=>"false", "payment"=>{"method"=>"cashondelivery"}, "billingAddressId"=>"1", "products"=>[{"sku"=>"TEST-1561478276562", "quantity"=>"1", "discount"=>"0", "taxable"=>"false"}, {"sku"=>"TEST-1561479271774", "quantity"=>"2", "discount"=>"0", "taxable"=>"false"}]}}

HEADERS

KeyDatatypeRequiredDescription
Authorizationstring
Content-Typestring

RESPONSES

status: OK

{"success":true,"orders":{"id":"1","number":"000000001","marketPlaceId":null,"groupId":null,"name":"000000001","email":"roni_cost@example.com","fulfillmentStatus":{"id":null,"status":null,"ecartapi":null,"ecartapiId":null,"partiallAvailable":"true"},"currency":"USD","totals":{"subtotal":"29","total":"36.39","tax":"2.39","discount":null,"weight":"1","shipping":null},"taxesIncluded":"true","taxLines":[],"units":{"weight":null},"status":{"id":null,"status":"processing","financial":"processing","ecartapi":"pending","ecartapiId":"2"},"locationId":null,"reference":null,"tags":[],"payment":{"method":"checkmo","status":"pending"},"customer":{"id":1,"email":"roni_cost@example.com","firstName":"Veronica","lastName":"Costello","phone":null,"ecartapiUrl":"https://api.ecartapi.com/api/v2/customers/1","company":null},"billingAddress":{"id":null,"firstName":"Veronica","lastName":"Costello","dni":null,"address1":"6146 Honey Bluff Parkway","address2":null,"address3":null,"country":{"code":"US","name":null,"codeIso2":null,"codeIso3":null},"state":{"code":"MI","name":"Michigan","codeIso2":null,"codeIso3":null},"city":"Calder","postalCode":"49628-7978","phone":"(555) 229-3326","email":null,"company":null,"references":null},"shippingMethod":"Flat Rate - Fixed","shippingLabel":null,"shippingAddress":{"id":null,"firstName":"Veronica","lastName":"Costello","dni":null,"address1":"6146 Honey Bluff Parkway","address2":null,"address3":null,"country":{"code":"US","name":null,"codeIso2":null,"codeIso3":null},"state":{"code":"MI","name":"Michigan","codeIso2":null,"codeIso3":null},"city":"Calder","postalCode":"49628-7978","phone":"(555) 229-3326","email":null,"company":null,"references":null},"items":[{"id":"1","variantId":null,"productId":"1436","offerId":null,"sku":"WS03-XS-Red","fulfillment":{"quantity":null,"service":null,"status":null},"name":"Iris Workout Top","upc":null,"requiresShipping":null,"quantity":"1","price":"29","discount":null,"associatedItems":[],"bundled":null,"tax":null,"taxable":"true","weight":"1","vendor":null,"imageUrl":null,"ecartapiUrl":"https://api.ecartapi.com/api/v2/products/1436"}],"packages":[],"meta":null,"dates":{"deliveredAt":null,"canceledAt":null,"closedAt":null,"createdAt":"2019-01-14 09:43:39","updatedAt":"2019-01-14 09:43:40","paidAt":null},"cancelReason":null,"note":null,"locations":[],"checkoutId":null,"partialFulfillment":null}}