Recover
...
Recover Enterprise API
Payments
1 min
code examples curl location 'https //api butterpayments com/recover/payments' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{"body" {"customer" {"id" "string"},"subscription" {"id" "string","start date" "string","billing" {}},"invoice" {"id" "string","created at" "string"},"transactions" \["string","string","string\<adyen | braintree | recurly | recharge | stripe | worldpay>","string",0,"string","string\<credit | debit | mixed | paypal | prepaid | uncategorized | unknown>",{"raw response message" "string"},"string","string","string",false,{"level 2" {},"level 3" {}}],"custom" {}}}'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "body" { "customer" { "id" "string" }, "subscription" { "id" "string", "start date" "string", "billing" {} }, "invoice" { "id" "string", "created at" "string" }, "transactions" \[ "string", "string", "string\<adyen | braintree | recurly | recharge | stripe | worldpay>", "string", 0, "string", "string\<credit | debit | mixed | paypal | prepaid | uncategorized | unknown>", { "raw response message" "string" }, "string", "string", "string", false, { "level 2" {}, "level 3" {} } ], "custom" {} } }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //api butterpayments com/recover/payments", 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 //api butterpayments com/recover/payments") 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 body = json dump({ "body" { "customer" { "id" "string" }, "subscription" { "id" "string", "start date" "string", "billing" {} }, "invoice" { "id" "string", "created at" "string" }, "transactions" \[ "string", "string", "string\<adyen | braintree | recurly | recharge | stripe | worldpay>", "string", 0, "string", "string\<credit | debit | mixed | paypal | prepaid | uncategorized | unknown>", { "raw response message" "string" }, "string", "string", "string", false, { "level 2" {}, "level 3" {} } ], "custom" {} } }) response = https request(request) puts response read body import requests import json url = "https //api butterpayments com/recover/payments" payload = json dumps({ "body" { "customer" { "id" "string" }, "subscription" { "id" "string", "start date" "string", "billing" {} }, "invoice" { "id" "string", "created at" "string" }, "transactions" \[ "string", "string", "string\<adyen | braintree | recurly | recharge | stripe | worldpay>", "string", 0, "string", "string\<credit | debit | mixed | paypal | prepaid | uncategorized | unknown>", { "raw response message" "string" }, "string", "string", "string", false, { "level 2" {}, "level 3" {} } ], "custom" {} } }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // request successful { "message" "request submitted for processing", "request id" "2c941653 b229 4528 b576 70fcfd388543 49645839701979566120793328447151049151317978254208401410 000000000000" }// request failed validation { "message" "invalid request body", "errors" \[ {} ] }// invalid api key { "message" "forbidden", "errors" "invalid api key" }// method/path not found { "message" "method/path combination not found " }// unsupported media type { "message" "unsupported media type", "errors" "content type must be application/json" }// server error