Skip to main content

Update Order

This API endpoint allows you to update an existing order based on the provided orderId.

HTTP Request

  • URL: /orders/{orderId}
  • Method: PUT
  • Headers:
    • Content-Type: application/json
    • accessToken: Required. This is your access token for authenticating the request.

Path Parameters

ParameterTypeDescription
orderIdStringThe unique identifier of the order to update.

Request Body

The request body should be a JSON object with the following structure:

FieldTypeDescription
paymentStatusStringStatus of the payment (e.g., "paid").
orderStatusStringStatus of the order (e.g., "fulfilled").
fulfilledItemsArray of ObjectsList of items fulfilled, including carrier and tracking details.
taxAmountNumberAmount of tax applied to the order.
billingAddressStringID of the billing address.
ShippingAddressIdStringID of the shipping address (if applicable).
newShippingAddressObjectDetails of a new shipping address, if applicable.
refundedAmountNumberAmount refunded for the order.
shippingCostNumberCost of shipping.
currencyObjectCurrency details with code and symbol.
metaFieldsArray of ObjectsCustom metadata fields for the order.
paymentTermIDId of payment term assigned for that company
lineItemsArray of ObjectsList of line items in the order, including discounts and fulfillment details.

Fulfilled Items

FieldTypeDescription
itemsArray of ObjectsList of fulfilled items with quantities.
carrierStringCarrier used for shipping.
trackingNumberStringTracking number provided by the carrier.
fulfilledAtStringDate of fulfillment (YYYY-MM-DD format).

Items in Fulfilled Items

FieldTypeDescription
lineItemIdStringID of the line item.
quantityStringQuantity of the item fulfilled.

New Shipping Address

FieldTypeDescription
companyNamestringCompany name of this contact (Optional).
companyEmailstringCompany email of the contact (Optional).
firstNameStringFirst name of the recipient.
lastNameStringLast name of the recipient.
phoneNumberStringContact phone number.
address1StringPrimary address line.
address2StringSecondary address line (optional).
cityStringCity of the address.
stateStringState of the address.
countryStringCountry code of the address.
zipcodeStringZip or postal code.

Currency

FieldTypeDescription
currencyStringCurrency code.
symbolStringCurrency symbol.

MetaFields

FieldTypeDescription
codeStringCode for metadata field.
valueStringValue of metadata field.

Line Items

FieldTypeDescription
idStringID of the line item.
productIdStringID of the product.
variantIdStringID of the product variant.
discountAmountStringAmount of discount applied.
quantityNumberQuantity of the product.
priceNumberPrice of the product.
fulfilledQuantityNumberQuantity of the product that has been fulfilled.
returnedBooleanWhether the item has been returned.

Sample Payload

{
"paymentStatus": "paid",
"orderStatus": "fulfilled",
"fulfilledItems": [
{
"items": [
{ "lineItemId": "637727d2c6aef8f9662bc3db", "quantity": "2" },
{ "lineItemId": "637cdcda4e71ed1db40e910f", "quantity": "5" }
],
"carrier": "something",
"trackingNumber": "8498461648",
"fulfilledAt": "2022-10-20"
}
],
"taxAmount": 0,
"billingAddress": "63356b3b3a6353a69043680b",
"ShippingAddressId": "",
"newShippingAddress": {
"firstName": "Prashanth",
"lastName": "Viru",
"phoneNumber": "65161861",
"address1": "12/4, test st",
"address2": "",
"city": "Elizabeth",
"state": "NJ",
"country": "US",
"zipcode": "07202"
},
"refundedAmount": 0,
"shippingCost": 0,
"currency": {
"currency": "$",
"symbol": "$"
},
"metaFields": [{ "code": "orderId", "value": "#123445363" }],
"lineItems": [
{
"id": "637727d2c6aef8f9662bc3db",
"productId": "",
"variantId": "",
"discountAmount": "10",
"quantity": 2,
"price": 100,
"fulfilledQuantity": 1,
"returned": false
},
{
"id": "637cdcda4e71ed1db40e910f",
"productId": "",
"variantId": "",
"discountAmount": "5",
"quantity": 5,
"price": 55,
"fulfilledQuantity": 3,
"returned": false
}
]
}

Response

  • Status Code: 200 Created

Success Response Body

{
"success": true,
"message": "Order updated successfully",
"data": {
"id": "<Order ID>"
//...
}
}

Success Response Structure

FieldTypeDescription
successbooleanIndicates whether the request was successful.
messagestringProvides a descriptive message about the outcome.
dataobjectContains the details of the newly created order. Defines in Order Object.

Error Responses

Status CodeDescription
400Bad Request: Invalid input data.
401Unauthorized: Access token is invalid or missing.
500Internal Server Error: An error occurred on the server.

Notes

  • Ensure that the accessToken is valid and not expired.
  • Ensure all required fields are filled according to your business rules when updating the order.