Purchasing API
...
Purchasing API Docs
Purchasing
Get Purchase
code examples curl location globoff '/api/v1/purchases/{lookupby}/{identifier}' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'get', headers myheaders, redirect 'follow' }; fetch("/api/v1/purchases/{lookupby}/{identifier}", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("/api/v1/purchases/{lookupby}/{identifier}") http = net http new(url host, url port); request = net http get new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" response = http request(request) puts response read body import requests import json url = "/api/v1/purchases/{lookupby}/{identifier}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("get", url, headers=headers, data=payload) print(response text) responses { "type" "order", "purchase identifiers" { "sparklayer" "63428136 658f 48a6 beb7 7f333dfd9686", "platform" "123456789", "internal" "", "visible" "b2b01123" }, "customer identifiers" { "sparklayer" "cu 123", "sparklayer impersonator" "cu 123", "sparklayer child" "cu 123" }, "payment method" "", "dates" { "created at" "2020 01 01t00 00 00+02 00", "updated at" "2020 01 01t00 00 00+02 00", "placed at" "2020 01 01t00 00 00+02 00", "calculated submitted at" "2020 01 01t00 00 00+02 00" }, "customer reference" "po number", "currency code" "gbp", "calculated shipping address" "john spark, sparklayer, sparklayer hq, example city, 12345", "calculated total" {}, "calculated total usd" {}, "calculated fulfilment status" "processing", "revision date" "2020 01 01t00 00 00+02 00", "billing address" { "name" "tom jones", "company" "tom jones hardware ltd", "address line1" "7 philosophy way", "address line2" "", "city" "willerby", "region code" "", "postal code" "bj6 9mk", "country code" "gb", "phone" "0123456789", "sparklayer id" "ca 100" }, "packages" {}, "accounting files" \[ { "identifiers" { "internal" "inv011", "visible" "" }, "data" {}, "file type" "invoice" } ], "custom fields" \[ { "name" "delivery date", "value" "2023 10 28" } ], "metadata" \[ { "name" "example key", "value" "1234" } ] }// error response // error response