Complete Cart
code examples curl request post \\ \ url https //app sparklayer io/api/v1/carts/{id}/complete \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ header 'site id jones climbing' \\ \ data '{ "shipping rate handle" "", "payment method" "", "ignore validation errors" \[] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); myheaders append("site id", "jones climbing"); var raw = json stringify({ "shipping rate handle" "", "payment method" "", "ignore validation errors" \[] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/carts/{id}/complete", 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("https //app sparklayer io/api/v1/carts/{id}/complete") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request\["site id"] = "jones climbing" request body = json dump({ "shipping rate handle" "", "payment method" "", "ignore validation errors" \[] }) response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/carts/{id}/complete" payload = json dumps({ "shipping rate handle" "", "payment method" "", "ignore validation errors" \[] }) headers = { 'accept' 'application/json', 'content type' 'application/json', 'site id' 'jones climbing' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful response { "purchase id" "" }// cart not found // unprocessable entity {}// error response