Create/Update Purchase
PUT
/api/v1/purchases/{lookupBy}/{identifier}
lookupBystring<p>Lookup by an identifier set within the purchase_identifiers object</p>
identifierobject<p>Lookup by an identifier. Note: lookupBy=sparklayer requires UUID</p>
acceptstringGenerated from available response content types
bodyobjectSparkLayer purchase object
200
403<p>Trying to update purchase SparkLayer ID, which is immutable</p>
404Error Response
409A conflict has occurred
500Error Response
curl --request PUT \
--url /api/v1/purchases/{lookupBy}/{identifier} \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"type": "order",
"purchase_identifiers": {},
"customer_identifiers": {
"sparklayer": "4217ba4f-7618-4e3b-b1af-9055639b18d1"
},
"dates": {},
"calculated_total": {
"number": "15.99",
"currency": "GBP"
},
"calculated_total_usd": {
"number": "15.99",
"currency": "GBP"
},
"calculated_total_base": {
"number": "15.99",
"currency": "GBP"
},
"total_paid": {
"number": "15.99",
"currency": "GBP"
},
"tax_lines": [
{
"title": "HST",
"amount": {
"number": "15.99",
"currency": "GBP"
},
"amount_base": {
"number": "15.99",
"currency": "GBP"
},
"rate": 20
}
],
"billing_address": {
"address_line1": "7 Philosophy way",
"city": "Willerby",
"country_code": "GB"
},
"packages": {
"identifiers": {
"sparklayer_package_id": "63428136-658f-48a6-beb7-7f333dfd9686"
},
"accounting_files": [
{
"identifiers": {
"visible": "INV011"
},
"data": {
"type": "uri"
},
"file_type": "invoice"
}
],
"line_items": [
{
"identifiers": {},
"name_parent": "T-Shirt",
"quantity": 4,
"custom_attributes": [
{
"key": "mug text",
"value": "best company ever"
}
],
"line_total": {
"total_net": {
"number": "15.99",
"currency": "GBP"
},
"total_net_base": {
"number": "15.99",
"currency": "GBP"
},
"total_tax": {
"number": "15.99",
"currency": "GBP"
},
"total_tax_base": {
"number": "15.99",
"currency": "GBP"
},
"total_gross": {
"number": "15.99",
"currency": "GBP"
},
"total_gross_base": {
"number": "15.99",
"currency": "GBP"
},
"discount_net": {
"number": "15.99",
"currency": "GBP"
},
"discount_net_base": {
"number": "15.99",
"currency": "GBP"
}
},
"tax_lines": [
{
"title": "HST",
"amount": {
"number": "15.99",
"currency": "GBP"
},
"amount_base": {
"number": "15.99",
"currency": "GBP"
},
"rate": 20
}
]
}
],
"shipping_method": {
"name": "Standard Shipping",
"line_total": {
"total_net": {
"number": "15.99",
"currency": "GBP"
},
"total_net_base": {
"number": "15.99",
"currency": "GBP"
},
"total_tax": {
"number": "15.99",
"currency": "GBP"
},
"total_tax_base": {
"number": "15.99",
"currency": "GBP"
},
"total_gross": {
"number": "15.99",
"currency": "GBP"
},
"total_gross_base": {
"number": "15.99",
"currency": "GBP"
},
"discount_net": {
"number": "15.99",
"currency": "GBP"
},
"discount_net_base": {
"number": "15.99",
"currency": "GBP"
}
},
"tax_lines": [
{
"title": "HST",
"amount": {
"number": "15.99",
"currency": "GBP"
},
"amount_base": {
"number": "15.99",
"currency": "GBP"
},
"rate": 20
}
]
},
"shipping_address": {
"address_line1": "7 Philosophy way",
"city": "Willerby",
"country_code": "GB"
},
"shipments": [
{
"carrier": "Carrier Company Ltd",
"carrier_id": ""
}
],
"type": ""
},
"accounting_files": [
{
"identifiers": {
"visible": "INV011"
},
"data": {
"type": "uri"
},
"file_type": "invoice"
}
],
"custom_fields": [
{
"name": "delivery-date"
}
],
"metadata": [
{
"name": "example-key",
"value": "1234"
}
]
}'