Purchasing API
Purchasing API Docs
Create a new Purchase Transaction
code examples curl location globoff request post '/api/v1/purchases/{lookupby}/{identifier}/transactions' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'site id string'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("site id", "string"); var requestoptions = { method 'post', headers myheaders, redirect 'follow' }; fetch("/api/v1/purchases/{lookupby}/{identifier}/transactions", 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}/transactions") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["site id"] = "string" response = http request(request) puts response read body import requests import json url = "/api/v1/purchases/{lookupby}/{identifier}/transactions" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json', 'site id' 'string' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses { "id" "63428136 658f 48a6 beb7 7f333dfd9686", "purchase spark id" "63428136 658f 48a6 beb7 7f333dfd9686", "platform id" "123456789", "full transaction" "", "type" "", "apply to balance" false, "currency code" "gbp", "total" "20 99", "transaction date" "2020 01 01t00 00 00+02 00", "created at" "2020 01 01t00 00 00+02 00" }// error response // error response