Orders API
You can access sales orders in a Uphance account or create new sales orders using these API calls. You can retrieve all sales orders or new sales orders since a certain ID.
GET all orders
Retrieve all orders. This endpoint will return 100 orders at most (see the Pagination section to learn how to access all pages).
$ curl https://api.uphance.com/sales_orders \
-H "Authorization: ACCESS_TOKEN"
Example response:
{
"sales_orders": [
{
"id": 9005,
"created_at": "2018-11-01T20:51:14.000+00:00",
"updated_at": "2019-01-09T16:00:45.000+00:00",
"items_total": "54.0",
"items_tax": "2.76",
"subtotal": "54.0",
"total_tax": "2.76",
"grand_total": "56.76",
"total_quantity": 12,
"shipping_cost": "0.0",
"shipping_tax": "0.0",
"settlement_discount": "0.0",
"deposit_percentage": "0.0",
"start_ship_date": null,
"cancel_ship_date": null,
"submitted_at": "2012-11-01T20:54:45.000+00:00",
"confirmed_at": "2015-11-17T10:37:54.000+00:00",
"notes": null,
"currency": "GBP",
"proforma_number": null,
"proforma_date": null,
"order_number": 101,
"purchase_order_ref": "PO234",
"invoice_numbers": "60168",
"shipment_numbers": "",
"next_due_date": "2015-12-17",
"company_name": "Barneys",
"season_id": 8210,
"organisation_id": 9579,
"channel_id": 6933,
"company_id": 9498,
"fulfillment_status": "nothing_shipped",
"financial_status": "nothing_paid",
"payment_term_name": "Net 30",
"line_items": [
{
"id": 8652,
"product_id": 6409,
"product_name": "Aamira",
"variation_id": 7696,
"color": "RED",
"unit_tax": "0.23",
"tax_level": "5.0",
"unit_price": "4.5",
"original_price": "5.0",
"percentage_discount": "10.0",
"line_quantities": [
{
"id": 8440,
"size": "S",
"quantity": 3,
"sku_id": 7436
},
{
"id": 8441,
"size": "M",
"quantity": 3,
"sku_id": 7437
},
{
"id": 8442,
"size": "L",
"quantity": 3,
"sku_id": 7438
},
{
"id": 8443,
"size": "XL",
"quantity": 3,
"sku_id": 7439
},
{
"id": 3282319,
"size": "LG",
"quantity": 0,
"sku_id": 1115032
}
]
}
]
},
{
"id": 9042,
"created_at": "2013-02-24T00:03:23.000+00:00",
"updated_at": "2019-05-24T07:09:41.000+01:00",
"items_total": "2701.2",
"items_tax": "0.0",
"subtotal": "2701.2",
"total_tax": "0.0",
"grand_total": "2701.2",
"total_quantity": 122,
"shipping_cost": "0.0",
"shipping_tax": "0.0",
"settlement_discount": "0.0",
"deposit_percentage": "0.0",
"start_ship_date": "2012-11-15",
"cancel_ship_date": "2013-01-10",
"submitted_at": "2013-02-24T00:05:44.000+00:00",
"confirmed_at": "2013-11-21T07:15:40.000+00:00",
"notes": null,
"currency": "GBP",
"proforma_number": null,
"proforma_date": null,
"order_number": 102,
"invoice_numbers": "6002",
"shipment_numbers": "",
"next_due_date": "2013-11-21",
"company_name": "Closing , Ceremony",
"season_id": 8210,
"organisation_id": 9579,
"channel_id": 6933,
"company_id": 9936,
"fulfillment_status": "nothing_shipped",
"financial_status": "paid",
"payment_term_name": null,
"line_items": [
{
"id": 8778,
"product_id": 7056,
"product_name": "Akeila",
"variation_id": 9198,
"color": "Blue",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "16.0",
"original_price": "16.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9162,
"size": "XS",
"quantity": 4,
"sku_id": 14234
},
{
"id": 9163,
"size": "S",
"quantity": 5,
"sku_id": 14235
},
{
"id": 9164,
"size": "M",
"quantity": 8,
"sku_id": 14236
},
{
"id": 9165,
"size": "L",
"quantity": 8,
"sku_id": 14237
},
{
"id": 9166,
"size": "XL",
"quantity": 3,
"sku_id": 14238
}
]
},
{
"id": 8779,
"product_id": 7056,
"product_name": "Akeila",
"variation_id": 9197,
"color": "Yellow",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "25.0",
"original_price": "25.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9167,
"size": "XS",
"quantity": 5,
"sku_id": 14229
},
{
"id": 9168,
"size": "S",
"quantity": 5,
"sku_id": 14230
},
{
"id": 9169,
"size": "M",
"quantity": 8,
"sku_id": 14231
},
{
"id": 9170,
"size": "L",
"quantity": 8,
"sku_id": 14232
},
{
"id": 9171,
"size": "XL",
"quantity": 3,
"sku_id": 14233
}
]
},
{
"id": 8780,
"product_id": 7055,
"product_name": "Agrafina",
"variation_id": 9195,
"color": "Antracite",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "63.0",
"original_price": "63.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9172,
"size": "XS",
"quantity": 0,
"sku_id": 14219
},
{
"id": 9173,
"size": "S",
"quantity": 1,
"sku_id": 14220
},
{
"id": 9174,
"size": "M",
"quantity": 2,
"sku_id": 14221
},
{
"id": 9175,
"size": "L",
"quantity": 1,
"sku_id": 14222
},
{
"id": 9176,
"size": "XL",
"quantity": 0,
"sku_id": 14223
}
]
},
{
"id": 8781,
"product_id": 7055,
"product_name": "Agrafina",
"variation_id": 9194,
"color": "Black",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "18.0",
"original_price": "18.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9177,
"size": "XS",
"quantity": 4,
"sku_id": 14214
},
{
"id": 9178,
"size": "S",
"quantity": 6,
"sku_id": 14215
},
{
"id": 9179,
"size": "M",
"quantity": 7,
"sku_id": 14216
},
{
"id": 9180,
"size": "L",
"quantity": 7,
"sku_id": 14217
},
{
"id": 9181,
"size": "XL",
"quantity": 4,
"sku_id": 14218
}
]
},
{
"id": 8782,
"product_id": 7054,
"product_name": "Agnessa",
"variation_id": 9193,
"color": "Yellowish",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "15.6",
"original_price": "15.6",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9182,
"size": "XS",
"quantity": 0,
"sku_id": 14209
},
{
"id": 9183,
"size": "S",
"quantity": 4,
"sku_id": 14210
},
{
"id": 9184,
"size": "M",
"quantity": 4,
"sku_id": 14211
},
{
"id": 9185,
"size": "L",
"quantity": 4,
"sku_id": 14212
},
{
"id": 9186,
"size": "XL",
"quantity": 0,
"sku_id": 14213
},
{
"id": 3231108,
"size": "XXL",
"quantity": 0,
"sku_id": 1096147
}
]
},
{
"id": 8783,
"product_id": 7054,
"product_name": "Agnessa",
"variation_id": 9192,
"color": "Green",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "21.0",
"original_price": "21.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9187,
"size": "XS",
"quantity": 3,
"sku_id": 14204
},
{
"id": 9188,
"size": "S",
"quantity": 3,
"sku_id": 14205
},
{
"id": 9189,
"size": "M",
"quantity": 4,
"sku_id": 14206
},
{
"id": 9190,
"size": "L",
"quantity": 4,
"sku_id": 14207
},
{
"id": 9191,
"size": "XL",
"quantity": 1,
"sku_id": 14208
},
{
"id": 3231100,
"size": "XXL",
"quantity": 0,
"sku_id": 1096146
}
]
},
{
"id": 8784,
"product_id": 7057,
"product_name": "Aksana",
"variation_id": 9200,
"color": "Black",
"unit_tax": "0.0",
"tax_level": "0.0",
"unit_price": "45.0",
"original_price": "45.0",
"percentage_discount": "0.0",
"line_quantities": [
{
"id": 9192,
"size": "XS",
"quantity": 0,
"sku_id": 14244
},
{
"id": 9193,
"size": "S",
"quantity": 1,
"sku_id": 14245
},
{
"id": 9194,
"size": "M",
"quantity": 2,
"sku_id": 14246
},
{
"id": 9195,
"size": "L",
"quantity": 2,
"sku_id": 14247
},
{
"id": 9196,
"size": "XL",
"quantity": 1,
"sku_id": 14248
}
]
}
]
},
{
.
.
.
.
}
],
"meta": {
"current_page": 1,
"next_page": 2,
"prev_page": null,
"total_pages": 2,
"total_count": 141
}
}
GET orders with filter parameters
Retrieve all orders since a certain order ID. This endpoint will return 100 orders at most (see the Pagination section to learn how to access all pages).
$ curl https://api.uphance.com/sales_orders?since_id=12500 \
-H "Authorization: ACCESS_TOKEN"
Filter by purchase order reference
$ curl https://api.uphance.com/sales_orders??by_purchase_order_ref= PURCHASE_ORDER_REF \
-H "Authorization: ACCESS_TOKEN"
Filter by shipment number
$ curl https://api.uphance.com/sales_orders??by_shipment_number= SHIPMENT_NUMBER \
-H "Authorization: ACCESS_TOKEN"
GET one sales order
Retrieve a single sales order by passing the order ID or order number.
$ curl https://api.uphance.com/sales_orders/[ORDER_ID] \
-H "Authorization: ACCESS_TOKEN"
$ curl https://api.uphance.com/sales_orders?by_order_number=ORDER_NUMBER \
-H "Authorization: ACCESS_TOKEN"
POST a sales order
You can create a sales order in Uphance from an external system using a POST request to /sales_orders. These orders can be in a draft or confirmed state.
POST https://api.uphance.com/sales_orders
The caller should provide the following headers along with the request:
Content-Type : application/json
Authorization: Bearer ACCESS_TOKEN
The body of your request should be a JSON document formatted as below.
Example request:
{
"customerId": 55140,
"season_name": "UPHANCE2023",
"channel_name": "Wholesale",
"channel_currency": "USD",
"notes": "Sale from API",
"purchaseOrderRef": "PO 0000001",
"startShipDate": "2019-06-06",
"endShipDate": "2020-07-07",
"paymentTerm":"30% Deposit, Net 30",
"billing_contact_id":51678,
"shipping_contact_id":51678,
"billing_address_id":68207,
"shipping_address_id":68207,
"tax_level":10,
"shipping_cost": 15,
"order_status":"confirmed",
"agent_name":"Mary Jones",
"warehouse_name":"Primary warehouse",
"total_tax": "10",
"total_amount": "125",
"line_items":
[
{
"product_id": "uphance-cap",
"variation_id": 163794,
"unit_price": 1,
"line_quantities":
[
{
"sku_id":867893,
"quantity": 10
}
]
},
{
"product_id": 77630,
"variation_id": 163772,
"unit_price": 10,
"line_quantities":
[
{
"quantity": 3,
"sku_id": 867799
},
{
"quantity": 3,
"sku_id": 867800
},
{
"quantity": 3,
"sku_id": 867801
}
]
}
]
}
Channels
GET all channels
$ curl https://api.uphance.com/channels \
-H "Authorization: ACCESS_TOKEN"