cURL
curl -X POST \
/payment-methods/link \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"customer": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"sendEmail": "1"
}'import requests
url = "https://coreapi.io/payment-methods/link"
payload = {
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"allowedPaymentMethodTypes": "card",
"sendEmail": True,
"redirectUrl": "https://example.com/done"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: 'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a',
allowedPaymentMethodTypes: 'card',
sendEmail: true,
redirectUrl: 'https://example.com/done'
})
};
fetch('https://coreapi.io/payment-methods/link', 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://coreapi.io/payment-methods/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => 'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a',
'allowedPaymentMethodTypes' => 'card',
'sendEmail' => true,
'redirectUrl' => 'https://example.com/done'
]),
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;
}{
"link": "https://my.customerfront.app/self-service/payment-method-link/abc123def456"
}Payment Method
Create payment method link
Create a link to request the customer to add a new payment method. The link can be sent to the customer via email.
Required permissions:payment-method:addPOST
/
payment-methods
/
link
cURL
curl -X POST \
/payment-methods/link \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"customer": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"sendEmail": "1"
}'import requests
url = "https://coreapi.io/payment-methods/link"
payload = {
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"allowedPaymentMethodTypes": "card",
"sendEmail": True,
"redirectUrl": "https://example.com/done"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer: 'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a',
allowedPaymentMethodTypes: 'card',
sendEmail: true,
redirectUrl: 'https://example.com/done'
})
};
fetch('https://coreapi.io/payment-methods/link', 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://coreapi.io/payment-methods/link",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'customer' => 'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a',
'allowedPaymentMethodTypes' => 'card',
'sendEmail' => true,
'redirectUrl' => 'https://example.com/done'
]),
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;
}{
"link": "https://my.customerfront.app/self-service/payment-method-link/abc123def456"
}Autorisierungen
Body
application/jsontext/html
The new PaymentMethod resource
Request body for creating a link to request the customer to add a new payment method.
War diese Seite hilfreich?