Update payment setup
curl --request PATCH \
--url https://b.anny.co/api/v1/payment-setups/{payment_setup_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "payment-setups",
"id": "<string>",
"attributes": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}"
payload = { "data": {
"type": "payment-setups",
"id": "<string>",
"attributes": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'payment-setups', id: '<string>', attributes: {}}})
};
fetch('https://b.anny.co/api/v1/payment-setups/{payment_setup_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'payment-setups',
'id' => '<string>',
'attributes' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://b.anny.co/api/v1/payment-setups/{payment_setup_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/payment-setups/{payment_setup_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "paymentsetups",
"attributes": {
"owner_name": "<string>",
"status": "<string>",
"allow_off_session": true,
"allow_recurring": true,
"provider_data": {},
"last_error": "<string>",
"activity": "<string>",
"last_charged_at": "<string>",
"created_at": "<string>",
"deleted_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"method": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
},
"meta": {
"label": "<string>",
"next_action": {}
}
}
}Payments
Update payment setup
Update attributes of an existing payment setup.
PATCH
/
api
/
v1
/
payment-setups
/
{payment_setup_id}
Update payment setup
curl --request PATCH \
--url https://b.anny.co/api/v1/payment-setups/{payment_setup_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "payment-setups",
"id": "<string>",
"attributes": {}
}
}
'import requests
url = "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}"
payload = { "data": {
"type": "payment-setups",
"id": "<string>",
"attributes": {}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({data: {type: 'payment-setups', id: '<string>', attributes: {}}})
};
fetch('https://b.anny.co/api/v1/payment-setups/{payment_setup_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'payment-setups',
'id' => '<string>',
'attributes' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/payment-setups/{payment_setup_id}"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://b.anny.co/api/v1/payment-setups/{payment_setup_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/payment-setups/{payment_setup_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"payment-setups\",\n \"id\": \"<string>\",\n \"attributes\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "paymentsetups",
"attributes": {
"owner_name": "<string>",
"status": "<string>",
"allow_off_session": true,
"allow_recurring": true,
"provider_data": {},
"last_error": "<string>",
"activity": "<string>",
"last_charged_at": "<string>",
"created_at": "<string>",
"deleted_at": "<string>"
},
"links": {
"self": "<string>"
},
"relationships": {
"method": {
"data": {
"type": "<string>",
"id": "<string>"
},
"links": {
"self": "<string>"
}
}
},
"meta": {
"label": "<string>",
"next_action": {}
}
}
}Autorisierungen
The access token received from the authorization server in the OAuth 2.0 flow.
Header
Bearer Token
Pfadparameter
Payment setup ID or UUID
Abfrageparameter
Organization ID
Body
application/json
Show child attributes
Show child attributes
Antwort
OK
A saved payment method configuration for a customer.
Show child attributes
Show child attributes
⌘I