orders
Update an order
Changed onUpdate an order
patch/orders/{orderId}
Request
- Base URLhttps://{your_organization_slug}.commercelayer.io/api
- URLhttps://{your_organization_slug}.commercelayer.io/api/orders/{orderId}
- AuthHTTP bearer
Path parameters
orderIdstring required
The resource's id
Request body
Example request
{
"data": {
"id": "XAyRWNUzyN",
"attributes": {
"number": "1234",
"affiliate_code": "xxxx-yyyy-zzzz",
"autorefresh": true,
"place_async": true,
"guest": true,
"customer_email": "john@example.com",
"customer_password": "secret",
"language_code": "it",
"freight_taxable": true,
"payment_method_taxable": true,
"adjustment_taxable": true,
"shipping_country_code_lock": "IT",
"coupon_code": "SUMMERDISCOUNT",
"gift_card_code": "cc92c23e-967e-48b2-a323-59add603301f",
"gift_card_or_coupon_code": "cc92c23e-967e-48b2-a323-59add603301f",
"cart_url": "https://yourdomain.com/cart",
"return_url": "https://yourdomain.com/",
"terms_url": "https://yourdomain.com/terms",
"privacy_url": "https://yourdomain.com/privacy",
"_archive": true,
"_unarchive": true,
"_pending": true,
"_place": true,
"_cancel": true,
"_approve": true,
"_approve_and_capture": true,
"_authorize": true,
"_authorization_amount_cents": 500,
"_capture": true,
"_refund": true,
"_fulfill": true,
"_update_taxes": true,
"_validate_tax_exemption_code": true,
"_fix_payment_source": true,
"_billing_address_clone_id": "1234",
"_shipping_address_clone_id": "1234",
"_customer_payment_source_id": "1234",
"_shipping_address_same_as_billing": true,
"_billing_address_same_as_shipping": true,
"_commit_invoice": true,
"_refund_invoice": true,
"_save_payment_source_to_customer_wallet": true,
"_save_shipping_address_to_customer_address_book": true,
"_save_billing_address_to_customer_address_book": true,
"_refresh": true,
"_refresh_prices": true,
"_validate": true,
"_create_subscriptions": true,
"_start_editing": true,
"_stop_editing": true,
"expires_at": "2018-01-02T12:00:00.000Z",
"expiration_info": {
"summary_message": "Your tickets are reserved for the remaining time.",
"expired_message": "Your session has expired. Please start your checkout again.",
"redirect_url": "https://yourshop.com/"
},
"_reset_circuit": true,
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"market": {
"data": {
"id": "XAyRWNUzyN"
}
},
"customer": {
"data": {
"id": "XAyRWNUzyN"
}
},
"shipping_address": {
"data": {
"id": "XAyRWNUzyN"
}
},
"billing_address": {
"data": {
"id": "XAyRWNUzyN"
}
},
"store": {
"data": {
"id": "XAyRWNUzyN"
}
},
"payment_method": {
"data": {
"id": "XAyRWNUzyN"
}
},
"payment_source": {
"data": {
"id": "XAyRWNUzyN",
"attributes": {
"public_key": "xxxx-yyyy-zzzz",
"payment_methods": {
"foo": "bar"
},
"payment_request_data": {
"foo": "bar"
},
"payment_request_details": {
"foo": "bar"
},
"payment_response": {
"foo": "bar"
},
"balance": 1000,
"expires_at": "2018-01-02T12:00:00.000Z",
"closed_at": "2018-01-02T12:00:00.000Z",
"payment_instrument": {
"issuer": "cl bank",
"card_type": "visa"
},
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": "ANY-EXTERNAL-REFEFERNCE",
"reference_origin": "ANY-EXTERNAL-REFEFERNCE-ORIGIN",
"metadata": {
"foo": "bar"
}
},
"relationships": {
"order": {
"data": {
"id": "XAyRWNUzyN"
}
},
"payment_gateway": {
"data": {
"id": "XAyRWNUzyN"
}
},
"event_stores": {
"data": {
"id": "XAyRWNUzyN"
}
}
}
}
},
"tags": {
"data": {
"id": "XAyRWNUzyN"
}
}
}
}
}Response
The updated order object
Changes
- info
added the new optional request property
//
- info
- warning
removed the request property
//
- warning