Create a purchase history entry
code examples curl request post \\ \ url /api/v1/purchases/{lookupby}/{identifier}/history \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "event type" "", "created by" "4217ba4f 7618 4e3b b1af 9055639b18d1", "body" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "event type" "", "created by" "4217ba4f 7618 4e3b b1af 9055639b18d1", "body" "" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("/api/v1/purchases/{lookupby}/{identifier}/history", 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}/history") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "event type" "", "created by" "4217ba4f 7618 4e3b b1af 9055639b18d1", "body" "" }) response = http request(request) puts response read body import requests import json url = "/api/v1/purchases/{lookupby}/{identifier}/history" payload = json dumps({ "event type" "", "created by" "4217ba4f 7618 4e3b b1af 9055639b18d1", "body" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // ok {}// error response // error response