Recover
...
API Reference
Recover Enterprise API

Payments

1min
code examples curl location 'https //api butterpayments com/recover/payments' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "customer" { "id" "" }, "subscription" { "id" "", "start date" "" }, "invoice" { "id" "", "created at" "" }, "transactions" \[ { "id" "", "psp transaction id" "", "psp" "", "acquirer country" "", "amount" "", "currency" "", "funding source" "", "outcome" { "raw response message" "" }, "payment method id" "", "psp transaction created at" "", "scheme" "", "success" "" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "customer" { "id" "" }, "subscription" { "id" "", "start date" "" }, "invoice" { "id" "", "created at" "" }, "transactions" \[ { "id" "", "psp transaction id" "", "psp" "", "acquirer country" "", "amount" "", "currency" "", "funding source" "", "outcome" { "raw response message" "" }, "payment method id" "", "psp transaction created at" "", "scheme" "", "success" "" } ] }); 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({ "customer" { "id" "" }, "subscription" { "id" "", "start date" "" }, "invoice" { "id" "", "created at" "" }, "transactions" \[ { "id" "", "psp transaction id" "", "psp" "", "acquirer country" "", "amount" "", "currency" "", "funding source" "", "outcome" { "raw response message" "" }, "payment method id" "", "psp transaction created at" "", "scheme" "", "success" "" } ] }) response = https request(request) puts response read body import requests import json url = "https //api butterpayments com/recover/payments" payload = json dumps({ "customer" { "id" "" }, "subscription" { "id" "", "start date" "" }, "invoice" { "id" "", "created at" "" }, "transactions" \[ { "id" "", "psp transaction id" "", "psp" "", "acquirer country" "", "amount" "", "currency" "", "funding source" "", "outcome" { "raw response message" "" }, "payment method id" "", "psp transaction created at" "", "scheme" "", "success" "" } ] }) 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