Orders
Create order
Creates an order using information from a third-party sales channel. A successful request creates an Order resource.
post/1.0/commerce/orders
Request
- Base URLhttps://api.squarespace.com
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
Idempotency-Keystring required
Idempotency key to prevent duplicate order creation.
Authorizationstring required
API key or OAuth access token
User-Agentstring required
User Agent
Request body
Example request
{
"customerEmail": "john.doe@example.com",
"discountLines": [
{
"amount": {
"value": 49.99
}
}
],
"discountTotal": {
"value": 49.99
},
"grandTotal": {
"value": 49.99
},
"lineItems": [
{
"nonSaleUnitPrice": {
"value": 49.99
},
"unitPricePaid": {
"value": 49.99
}
}
],
"shippingLines": [
{
"amount": {
"value": 49.99
}
}
],
"shippingTotal": {
"value": 49.99
},
"subtotal": {
"value": 49.99
},
"taxTotal": {
"value": 49.99
}
}Response
The created order.
Example response
{
"billingAddress": {
"address1": "459 Broadway",
"city": "New York",
"countryCode": "US",
"firstName": "Bob",
"lastName": "Loblaw",
"phone": "5553334444",
"postalCode": "10003",
"state": "NY"
},
"channel": "web",
"channelName": "Faire Wholesale",
"createdOn": "2016-12-23T15:58:07.187Z",
"customerEmail": "foo@example.com",
"customerId": "585d498fdee9f31a60284a38",
"discountLines": [
{
"amount": {
"value": 49.99
},
"description": "20% off all orders over $50",
"name": "Summer Sale - 20% Off",
"promoCode": "SUMMER20"
}
],
"discountTotal": {
"value": 49.99
},
"externalOrderReference": "EXT-98765",
"formSubmission": [
{
"label": "How did you hear about us?",
"value": "Facebook"
}
],
"fulfillments": [
{
"carrierName": "FedEx",
"service": "Same-Day Delivery",
"shipDate": "2017-01-29T22:19:26.98Z",
"trackingNumber": "103932814692659",
"trackingUrl": "https://www.fedex.com/apps/fedextrack/?tracknumbers=103932814692659"
}
],
"grandTotal": {
"value": 49.99
},
"id": "585d498fdee9f31a60284a37",
"internalNotes": [
{
"content": "First note"
}
],
"lineItems": [
{
"customizations": [
{
"label": "How did you hear about us?",
"value": "Facebook"
}
],
"height": 4,
"id": "585d4975dee9f31a60284a16",
"imageUrl": "https://static.squarespace.com/universal/commerce/images/brine-32oz-spring-mix-v2.jpg?format=300w",
"length": 3,
"lineItemType": "PHYSICAL_PRODUCT",
"productId": "565c8f3da7c8a3cf71d5fd0a",
"productName": "Product",
"quantity": 1,
"sku": "SQ3381024",
"unitPricePaid": {
"value": 49.99
},
"variantId": "88c16ee4-547b-445e-a392-bded9991ae30",
"variantOptions": [
{
"optionName": "Size",
"value": "Large"
}
],
"weight": 1,
"width": 2
}
],
"modifiedOn": "2016-12-23T15:58:07.187Z",
"orderNumber": "3",
"priceTaxInterpretation": "EXCLUSIVE",
"refundedTotal": {
"value": 49.99
},
"shippingAddress": {
"address1": "459 Broadway",
"city": "New York",
"countryCode": "US",
"firstName": "Bob",
"lastName": "Loblaw",
"phone": "5553334444",
"postalCode": "10003",
"state": "NY"
},
"shippingLines": [
{
"amount": {
"value": 49.99
},
"method": "UPS Ground"
}
],
"shippingTotal": {
"value": 49.99
},
"subtotal": {
"value": 49.99
},
"taxTotal": {
"value": 49.99
}
}Changes
No recorded changes to this operation across all 1 revision of this API.