cURL
curl -X POST \
/payment-methods/{id}/document \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"id": "",
"customer": "https:\/\/example.com\/",
"gatewayName": "",
"type": "",
"referenceId": "",
"customerReferenceId": "",
"default": "",
"status": "active",
"source": "api",
"enabled": "",
"isInternal": "",
"name": "",
"data": [
""
],
"creationDate": "",
"expirationDate": "",
"notifications": [
"https:\/\/example.com\/"
],
"webhookResults": [
"https:\/\/example.com\/"
],
"gateway": "",
"internal": "",
"expired": "",
"verified": "",
"gatewayData": [
""
],
"card": {
"brand": "Visa",
"last4": "4242",
"expMonth": "12",
"expYear": "2022",
"cardHolder": "Max Mustermann"
},
"sepaDebit": {
"iban": "DE8937*********3232",
"bic": "COBADEFFXXX",
"mandateReference": "MNDT-2021-123456",
"signingDate": "2021-01-01T00:00:00+00:00"
},
"paypal": {
"email": "max@mustermann.de",
"billingAgreementId": "I-1J5gqz2eZvKYlo2C2X2X2X2X"
},
"expirationInDays": "",
"tenantId": ""
}'import requests
url = "https://coreapi.io/payment-methods/{id}/document"
payload = {
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"referenceId": "<string>",
"customerReferenceId": "<string>",
"default": True,
"status": "active",
"source": "api",
"enabled": True,
"isInternal": False,
"name": "Visa (4242)",
"data": ["<string>"],
"expirationDate": "2026-12-31T23:59:59+00:00",
"notifications": ["ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a"],
"webhookResults": ["ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a"],
"gatewayData": ["<string>"]
}
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',
referenceId: '<string>',
customerReferenceId: '<string>',
default: true,
status: 'active',
source: 'api',
enabled: true,
isInternal: false,
name: 'Visa (4242)',
data: ['<string>'],
expirationDate: '2026-12-31T23:59:59+00:00',
notifications: ['ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'],
webhookResults: ['ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'],
gatewayData: ['<string>']
})
};
fetch('https://coreapi.io/payment-methods/{id}/document', 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/{id}/document",
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',
'referenceId' => '<string>',
'customerReferenceId' => '<string>',
'default' => true,
'status' => 'active',
'source' => 'api',
'enabled' => true,
'isInternal' => false,
'name' => 'Visa (4242)',
'data' => [
'<string>'
],
'expirationDate' => '2026-12-31T23:59:59+00:00',
'notifications' => [
'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'
],
'webhookResults' => [
'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'
],
'gatewayData' => [
'<string>'
]
]),
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;
}{
"id": "c1a2b3c4-d5e6-4f7a-8b9b-0c1d2e3f4a5b",
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"gatewayName": "wallet",
"type": "sepa_debit",
"referenceId": "<string>",
"default": true,
"status": "active",
"source": "api",
"enabled": true,
"name": "Visa (4242)",
"data": [
"<string>"
],
"creationDate": "2024-01-15T10:30:00+00:00",
"expirationDate": "2026-12-31T23:59:59+00:00",
"sepaMandate": {
"id": "ad8f0b9c-0b1a-4e1a-8b0a-0b1a4e1a8b0a",
"status": "active",
"creditorIdentifier": "<string>",
"mandateReference": "MNDT-2021-0001",
"bankAccount": {
"id": "ad8f0b9c-4b1e-4e0e-8b9c-4b1e4e0e8b9c",
"iban": "DE12500105170648489890",
"bic": "PBNKDEFFXXX",
"accountHolder": "Max Mustermann",
"bankName": "Commerzbank"
},
"sequenceType": "FRST",
"sepaType": "core"
},
"card": {
"brand": "Visa",
"last4": "4242",
"expMonth": 12,
"expYear": 2022,
"cardHolder": "Max Mustermann"
},
"sepaDebit": {
"iban": "DE8937*********3232",
"bic": "COBADEFFXXX",
"mandateReference": "MNDT-2021-123456",
"signingDate": "2021-01-01T00:00:00+00:00"
},
"paypal": {
"email": "max@mustermann.de",
"billingAgreementId": "I-1J5gqz2eZvKYlo2C2X2X2X2X"
},
"expirationInDays": 365
}Payment Method
Upload a document for a payment method
Upload a document for a payment method, e.g. a signed sepa mandate
Required permissions:payment-method:writePOST
/
payment-methods
/
{id}
/
document
cURL
curl -X POST \
/payment-methods/{id}/document \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"id": "",
"customer": "https:\/\/example.com\/",
"gatewayName": "",
"type": "",
"referenceId": "",
"customerReferenceId": "",
"default": "",
"status": "active",
"source": "api",
"enabled": "",
"isInternal": "",
"name": "",
"data": [
""
],
"creationDate": "",
"expirationDate": "",
"notifications": [
"https:\/\/example.com\/"
],
"webhookResults": [
"https:\/\/example.com\/"
],
"gateway": "",
"internal": "",
"expired": "",
"verified": "",
"gatewayData": [
""
],
"card": {
"brand": "Visa",
"last4": "4242",
"expMonth": "12",
"expYear": "2022",
"cardHolder": "Max Mustermann"
},
"sepaDebit": {
"iban": "DE8937*********3232",
"bic": "COBADEFFXXX",
"mandateReference": "MNDT-2021-123456",
"signingDate": "2021-01-01T00:00:00+00:00"
},
"paypal": {
"email": "max@mustermann.de",
"billingAgreementId": "I-1J5gqz2eZvKYlo2C2X2X2X2X"
},
"expirationInDays": "",
"tenantId": ""
}'import requests
url = "https://coreapi.io/payment-methods/{id}/document"
payload = {
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"referenceId": "<string>",
"customerReferenceId": "<string>",
"default": True,
"status": "active",
"source": "api",
"enabled": True,
"isInternal": False,
"name": "Visa (4242)",
"data": ["<string>"],
"expirationDate": "2026-12-31T23:59:59+00:00",
"notifications": ["ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a"],
"webhookResults": ["ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a"],
"gatewayData": ["<string>"]
}
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',
referenceId: '<string>',
customerReferenceId: '<string>',
default: true,
status: 'active',
source: 'api',
enabled: true,
isInternal: false,
name: 'Visa (4242)',
data: ['<string>'],
expirationDate: '2026-12-31T23:59:59+00:00',
notifications: ['ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'],
webhookResults: ['ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'],
gatewayData: ['<string>']
})
};
fetch('https://coreapi.io/payment-methods/{id}/document', 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/{id}/document",
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',
'referenceId' => '<string>',
'customerReferenceId' => '<string>',
'default' => true,
'status' => 'active',
'source' => 'api',
'enabled' => true,
'isInternal' => false,
'name' => 'Visa (4242)',
'data' => [
'<string>'
],
'expirationDate' => '2026-12-31T23:59:59+00:00',
'notifications' => [
'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'
],
'webhookResults' => [
'ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a'
],
'gatewayData' => [
'<string>'
]
]),
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;
}{
"id": "c1a2b3c4-d5e6-4f7a-8b9b-0c1d2e3f4a5b",
"customer": "ad8f3b9e-1b1a-4b9a-9b9a-9b9a9b9a9b9a",
"gatewayName": "wallet",
"type": "sepa_debit",
"referenceId": "<string>",
"default": true,
"status": "active",
"source": "api",
"enabled": true,
"name": "Visa (4242)",
"data": [
"<string>"
],
"creationDate": "2024-01-15T10:30:00+00:00",
"expirationDate": "2026-12-31T23:59:59+00:00",
"sepaMandate": {
"id": "ad8f0b9c-0b1a-4e1a-8b0a-0b1a4e1a8b0a",
"status": "active",
"creditorIdentifier": "<string>",
"mandateReference": "MNDT-2021-0001",
"bankAccount": {
"id": "ad8f0b9c-4b1e-4e0e-8b9c-4b1e4e0e8b9c",
"iban": "DE12500105170648489890",
"bic": "PBNKDEFFXXX",
"accountHolder": "Max Mustermann",
"bankName": "Commerzbank"
},
"sequenceType": "FRST",
"sepaType": "core"
},
"card": {
"brand": "Visa",
"last4": "4242",
"expMonth": 12,
"expYear": 2022,
"cardHolder": "Max Mustermann"
},
"sepaDebit": {
"iban": "DE8937*********3232",
"bic": "COBADEFFXXX",
"mandateReference": "MNDT-2021-123456",
"signingDate": "2021-01-01T00:00:00+00:00"
},
"paypal": {
"email": "max@mustermann.de",
"billingAgreementId": "I-1J5gqz2eZvKYlo2C2X2X2X2X"
},
"expirationInDays": 365
}Autorisierungen
Body
application/jsontext/html
The new PaymentMethod resource
Represents a payment method attached to a customer, such as a credit card, SEPA direct debit, PayPal, or bank transfer.
Antwort
PaymentMethod resource created
Payment method details returned when reading a payment method.
War diese Seite hilfreich?