Put Order
Use this endpoint to create or update an order that can be shipped from webship.
Before you can use the Put Order endpoint, you must create a Rest API Integration in your eCommerce Webship account.
Steps to Configure the Rest API Integration
- Go to eCommerce Webship and select the gear icon to access the settings screen
- Click eCommerce Integrations
- At this page you can view and modify previous integrations. Since we are adding a new one, select Add eCommerce Integration
- Click Rest API
- In order to generate an integration ID for your Rest API integration, click the "Save New Integration" button
- After the integration has been saved, you can copy the integration ID for use with the API
REST Endpoint
PUT /restapi/v1/customers/:customerId/integrations/:integrationId/orders/:orderId
Request Content Type
application/json
Request JSON Example
PUT /restapi/v1/customers/TEST00002/integrations/3214/orders/123456
{
"orderId": "123ABC",
"orderDate": "2016-04-24",
"orderNumber": "abc123",
"fulfillmentStatus": "pending",
"shippingService": "Standard",
"shippingTotal": "8.24",
"weightUnit": "lb",
"dimUnit": "in",
"dueByDate": "2016-04-26",
"orderGroup": "Workstation 1",
"contentDescription": "Stuff and things",
"sender": {
"name": "Albert Jones",
"company": "Jones Co.",
"address1": "123 Some Street",
"address2": "#54",
"city": "Holladay",
"state": "UT",
"zip": "84117",
"country": "US",
"phone": "8015042351",
"email": "albert@jones.egg"
},
"returnTo": {
"name": "Steve Smith",
"company": "Smith Co.",
"address1": "123 A street",
"address2": "Apt 7",
"city": "American Fork",
"state": "UT",
"zip": "84115",
"country": "US",
"phone": "8015555555",
"email": "steve@smith.egg"
},
"receiver": {
"name": "Alice Janson",
"company": "",
"address1": "54 Green St.",
"address2": "",
"city": "Salt Lake City",
"state": "UT",
"zip": "84106",
"country": "US",
"phone": "8013920046",
"email": "alice@jensen.egg"
},
"items": [
{
"productId": "856673",
"sku": "ade3-fe21-bb9a",
"title": "Socks",
"price": "3.99",
"quantity": 2,
"weight": "0.5",
"imgUrl": "http://sockstore.egg/img/856673",
"htsNumber": "555555",
"countryOfOrigin": "US",
"lineId": "1",
"pickLocation": "100-03S"
}
],
"packages": [
{
"weight": "0.5",
"length": "6",
"width": "5",
"height": "2.5",
"insuranceAmount": null,
"declaredValue": null
}
]
}
Explanation of Request Fields
Field | Type | Required | Description |
---|---|---|---|
orderId | string | true | Unique ID of this order (must match order ID in URL) |
orderDate | date | true | Date order was placed |
orderNumber | string or null | true | Invoice number of order |
fulfillmentStatus | string | true | One of "pending", "fulfilled", or "partial" |
shippingService | string or null | true | Name of shipping service associated with order (e.g. "Standard" or "Expedited") |
shipperReference | string or null | false | Text that will show up on shipping label in the reference field. If nothing is specified, order number will be used. If no order number exists, order id will be used |
shipperReference2 | string or null | false | An additional reference field. When possible it will be added to the label, though not all carriers support this field. |
contentDescription | string | false | Content description of the shipment |
shippingTotal | decimal or null | true | Amount that customer paid for shipping |
weightUnit | string or null | true | Either "lb" for pounds or "kg" for kilograms |
dimUnit | string or null | true | Either "in" for inches or "cm" for centimeters |
dueByDate | date or null | true | Date by which the order must be fulfilled |
orderGroup | string or null | true | May be set to allow multiple users to ship at the same time without overlapping |
sender.name | string | true | Name of sender |
sender.company | string | false | Company name of sender |
sender.address1 | string | true | Sender street address line 1 |
sender.address2 | string | false | Sender street address line 2 |
sender.city | string | true | Sender city |
sender.state | string | true | Sender state/province (must be two-character code for US and CA) |
sender.zip | string | true | Sender zip or postal code |
sender.country | string | true | ISO two-character country code |
sender.phone | string | false | 10-digit phone number |
sender.email | string | false | email address |
returnTo.name | string | false | Name of return to address |
returnTo.company | string | false | Company name of return to address |
returnTo.address1 | string | false | Return to address line 1 |
returnTo.address2 | string | false | Return to address line 2 |
returnTo.city | string | false | Return to city |
returnTo.state | string | false | Return to state/province (must be two-character code for US and CA) |
returnTo.zip | string | false | Return to zip or postal code |
returnTo.country | string | false | ISO two-character country code |
returnTo.phone | string | false | 10-digit phone number |
returnTo.email | string | false | return to email address |
receiver.name | string | true | Name of receiver |
receiver.company | string | false | Company name of receiver - Not required but recommended to ensure delivery |
receiver.address1 | string | true | Receiver street address line 1 |
receiver.address2 | string | false | Receiver street address line 2 |
receiver.city | string | true | Receiver city |
receiver.state | string | true | Receiver state/province (must be two-character code for US and CA) |
receiver.zip | string | true | Receiver zip or postal code |
receiver.country | string | true | ISO two-character country code |
receiver.phone | string | false | 10-digit phone number |
receiver.email | string | false | email address |
items | array or null | true | Can be provided if the order has item information |
items[n].productId | string | false | ID of product |
items[n].sku | string or null | false | Sku of product |
items[n].title | string | false | Title of product |
items[n].price | decimal | false | Per unit price of product |
items[n].quantity | integer | false | Quantity of product |
items[n].weight | decimal or null | false | Per unit weight of product |
items[n].imgUrl | string or null | false | URL of product image |
items[n].htsNumber | string or null | false | HTS number of product |
items[n].countryOfOrigin | string or null | false | Two-character country code |
items[n].lineId | string or null | false | ID of order line item |
items[n].pickLocation | string or null | false | The Pick Location of product |
packages | array or null | true | Can be provided if shipping dimensions have been precalculated for this order |
packages[n].weight | string | false | Numeric weight as a JSON string |
packages[n].length | string or null | false | Numeric length as a JSON string (set to null if packageType has preset dimensions) |
packages[n].width | string or null | false | Numeric width as a JSON string (set to null if packageType has preset dimensions) |
packages[n].height | string or null | false | Numeric height as a JSON string (set to null if packageType has preset dimensions) |
packages[n].insuranceAmount | decimal or null | false | The value of the piece to be covered by insurance. Must be null for no insurance |
packages[n].declaredValue | decimal or null | false | The declared value of the piece for international shipments. Must be null for domestic shipments |
Response Status Code
201 Created
Response Content Type
application/json
Response JSON Example
{
"ok": true
}