Payment Method Update
1 min
POST
https://api.butterpayments.com/recover/payment_method_updates
Body Parameters
- bodypayment_method_updaterequired
- customer_idstringrequiredExampleDescription
- psp_customer_idstringExampleDescription
- payment_method_idstringrequiredExampleDescription
- reasonstring<user_added | user_removed | user_updated | network_updated>ExampleDescription
Responses
200
- inline_response_200
- messagestringExampleDefaultRequest submitted for processing
- request_idstringExampleDefault2c941653-b229-4528-b576-70fcfd388543:49645839701979566120793328447151049151317978254208401410:000000000000
400
- inline_response_400
- messagestringExampleDefaultInvalid request body
- errorsobject[]Example
[ { "('subscription', 'start_date')": "Field required" } ]Default{"('subscription', 'start_date')":"Field required"}
403
- inline_response_403
- messagestringExampleDefaultForbidden
- errorsstringExampleDefaultInvalid API Key
404
- inline_response_404
- messagestringExampleDefaultMethod/Path combination not found.
415
- inline_response_415
- messagestringExampleDefaultUnsupported Media Type
- errorsstringExampleDefaultContent-Type must be application/json
500
curl
curl --request POST \
--url https://api.butterpayments.com/recover/payment_method_updates \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"customer_id": "11223344",
"payment_method_id": "pm_12345"
}'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var raw = JSON.stringify({
"customer_id": "11223344",
"payment_method_id": "pm_12345"
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};
fetch("https://api.butterpayments.com/recover/payment_method_updates", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.butterpayments.com/recover/payment_method_updates")
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": "11223344",
"payment_method_id": "pm_12345"
})
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.butterpayments.com/recover/payment_method_updates"
payload = json.dumps({
"customer_id": "11223344",
"payment_method_id": "pm_12345"
})
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
// Request Successful
{
"message": "Request submitted for processing",
"request_id": "2c941653-b229-4528-b576-70fcfd388543:49645839701979566120793328447151049151317978254208401410:000000000000"
}400
// Request Failed Validation
{
"message": "Invalid request body",
"errors": [
{}
]
}403
// Invalid API Key
{
"message": "Forbidden",
"errors": "Invalid API Key"
}404
// Method/Path Not Found
{
"message": "Method/Path combination not found."
}415
// Unsupported Media Type
{
"message": "Unsupported Media Type",
"errors": "Content-Type must be application/json"
}500
// Server Error
This endpoint is used by the merchant to notify Recover of an update to a payment method for a customer. Whenever a payment method has been updated, added, or removed for any reason, that event should be forwarded to this endpoint so that it can be used as a signal to increase Recover's performance.
Add field values in the boxes below to create an example payload on the right side of the screen.