curl -X PUT \
/checkout-links/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"afterCheckout": {
"url": "https:\/\/example.com\/checkout\/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https:\/\/example.com\/checkout\/confirmation"
},
"options": {
"trialDays": "14",
"allowCoupons": "",
"quantityEditable": "",
"forceCompany": ""
},
"isEnabled": "1",
"items": [
[]
]
}'import requests
url = "https://coreapi.io/checkout-links/{id}"
payload = {
"afterCheckout": {
"url": "https://example.com/checkout/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https://example.com/checkout/confirmation"
},
"options": { "trialDays": 14 },
"isEnabled": True,
"items": [
{
"type": "product",
"product": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"quantity": 1,
"plan": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"price": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
afterCheckout: {
url: 'https://example.com/checkout/confirmation',
confirmationMessage: 'Thank you for your order!',
action: 'redirect',
backToProviderUrl: 'https://example.com/checkout/confirmation'
},
options: {trialDays: 14},
isEnabled: true,
items: [
{
type: 'product',
product: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
quantity: 1,
plan: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
price: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
periods: [{contractPeriod: '1M', cancellationPeriod: '1M'}]
}
]
})
};
fetch('https://coreapi.io/checkout-links/{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://coreapi.io/checkout-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'afterCheckout' => [
'url' => 'https://example.com/checkout/confirmation',
'confirmationMessage' => 'Thank you for your order!',
'action' => 'redirect',
'backToProviderUrl' => 'https://example.com/checkout/confirmation'
],
'options' => [
'trialDays' => 14
],
'isEnabled' => true,
'items' => [
[
'type' => 'product',
'product' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'quantity' => 1,
'plan' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'price' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'periods' => [
[
'contractPeriod' => '1M',
'cancellationPeriod' => '1M'
]
]
]
]
]),
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": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"afterCheckout": {
"url": "https://example.com/checkout/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https://example.com/checkout/confirmation"
},
"options": {
"trialDays": 14,
"allowCoupons": true,
"quantityEditable": true,
"forceCompany": true
},
"slug": "my-checkout-slug",
"isEnabled": true,
"items": [
{
"type": "product",
"product": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"quantity": 1,
"plan": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
},
"price": {
"type": "flat_fee",
"currencyCode": "EUR",
"price": {
"amount": 123,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"tenantId": "<string>"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"internalName": "Exclusive pricing for partners.",
"status": "active",
"salesChannel": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>"
},
"applyTrial": true,
"payInAdvance": true,
"proRata": true,
"freeUnits": 1,
"billingInterval": "1M",
"showPricePerInterval": "1M",
"custom": true,
"charge": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productSetOption": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"product": "<unknown>",
"customer": "<unknown>",
"inUse": true,
"checkoutLinkIds": [
"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
]
},
"periods": [
{
"contractPeriod": {},
"cancellationPeriod": {}
}
]
}
],
"url": "https://example.com/checkout/my-checkout-slug"
}Update a checkout link
Update a checkout link by its ID
Required permissions:checkout-link:writecurl -X PUT \
/checkout-links/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"afterCheckout": {
"url": "https:\/\/example.com\/checkout\/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https:\/\/example.com\/checkout\/confirmation"
},
"options": {
"trialDays": "14",
"allowCoupons": "",
"quantityEditable": "",
"forceCompany": ""
},
"isEnabled": "1",
"items": [
[]
]
}'import requests
url = "https://coreapi.io/checkout-links/{id}"
payload = {
"afterCheckout": {
"url": "https://example.com/checkout/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https://example.com/checkout/confirmation"
},
"options": { "trialDays": 14 },
"isEnabled": True,
"items": [
{
"type": "product",
"product": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"quantity": 1,
"plan": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"price": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
afterCheckout: {
url: 'https://example.com/checkout/confirmation',
confirmationMessage: 'Thank you for your order!',
action: 'redirect',
backToProviderUrl: 'https://example.com/checkout/confirmation'
},
options: {trialDays: 14},
isEnabled: true,
items: [
{
type: 'product',
product: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
quantity: 1,
plan: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
price: 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
periods: [{contractPeriod: '1M', cancellationPeriod: '1M'}]
}
]
})
};
fetch('https://coreapi.io/checkout-links/{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://coreapi.io/checkout-links/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'afterCheckout' => [
'url' => 'https://example.com/checkout/confirmation',
'confirmationMessage' => 'Thank you for your order!',
'action' => 'redirect',
'backToProviderUrl' => 'https://example.com/checkout/confirmation'
],
'options' => [
'trialDays' => 14
],
'isEnabled' => true,
'items' => [
[
'type' => 'product',
'product' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'quantity' => 1,
'plan' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'price' => 'ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b',
'periods' => [
[
'contractPeriod' => '1M',
'cancellationPeriod' => '1M'
]
]
]
]
]),
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": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"afterCheckout": {
"url": "https://example.com/checkout/confirmation",
"confirmationMessage": "Thank you for your order!",
"action": "redirect",
"backToProviderUrl": "https://example.com/checkout/confirmation"
},
"options": {
"trialDays": 14,
"allowCoupons": true,
"quantityEditable": true,
"forceCompany": true
},
"slug": "my-checkout-slug",
"isEnabled": true,
"items": [
{
"type": "product",
"product": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"quantity": 1,
"plan": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
},
"price": {
"type": "flat_fee",
"currencyCode": "EUR",
"price": {
"amount": 123,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"tenantId": "<string>"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"internalName": "Exclusive pricing for partners.",
"status": "active",
"salesChannel": {
"id": "<string>",
"name": "<string>",
"brandName": "<string>"
},
"applyTrial": true,
"payInAdvance": true,
"proRata": true,
"freeUnits": 1,
"billingInterval": "1M",
"showPricePerInterval": "1M",
"custom": true,
"charge": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productSetOption": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"product": "<unknown>",
"customer": "<unknown>",
"inUse": true,
"checkoutLinkIds": [
"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
]
},
"periods": [
{
"contractPeriod": {},
"cancellationPeriod": {}
}
]
}
],
"url": "https://example.com/checkout/my-checkout-slug"
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
CheckoutLink identifier
Body
The updated CheckoutLink resource
The action to perform after checkout.
Show child attributes
Show child attributes
The options for the checkout link.
Show child attributes
Show child attributes
{ "trialDays": 14 }Whether the checkout link is enabled or not.
true
1Show child attributes
Show child attributes
Antwort
CheckoutLink resource updated
The unique identifier of the checkout link.
"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
The action to perform after checkout.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The name of the checkout link.
"my-checkout-slug"
Whether the checkout link is enabled or not.
true
Show child attributes
Show child attributes
The URL of the checkout link.
"https://example.com/checkout/my-checkout-slug"
War diese Seite hilfreich?