curl --request POST \
--url https://coreapi.io/api/plans/{id}/checkout-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"couponsAllowed": false,
"isEnabled": true,
"salesChannel": "default"
}
'import requests
url = "https://coreapi.io/api/plans/{id}/checkout-links"
payload = {
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"couponsAllowed": False,
"isEnabled": True,
"salesChannel": "default"
}
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({
planTierId: 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
couponsAllowed: false,
isEnabled: true,
salesChannel: 'default'
})
};
fetch('https://coreapi.io/api/plans/{id}/checkout-links', 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/api/plans/{id}/checkout-links",
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([
'planTierId' => 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
'couponsAllowed' => false,
'isEnabled' => true,
'salesChannel' => 'default'
]),
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": "1280792f-4e23-793d-8e9c-3a1bf36630bd",
"slug": "pro-plan-pro",
"planTierId": "<string>",
"planTierName": "Pro",
"couponsAllowed": true,
"isEnabled": true,
"url": "https://coreapi.io/checkout-link/pro-plan-pro/cart",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"salesChannel": {
"id": "<string>",
"name": "default",
"brandName": "Pro Plan"
}
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "Validation Failed",
"violations": [
{
"propertyPath": "tiers[0].name",
"message": "This value should not be blank.",
"code": "<string>"
}
]
}Create a checkout link
Create a checkout link that sells one tier of the plan. The returned url is the public entry point that creates a cart and redirects the buyer to the customerfront of the sales channel.
curl --request POST \
--url https://coreapi.io/api/plans/{id}/checkout-links \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"couponsAllowed": false,
"isEnabled": true,
"salesChannel": "default"
}
'import requests
url = "https://coreapi.io/api/plans/{id}/checkout-links"
payload = {
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"couponsAllowed": False,
"isEnabled": True,
"salesChannel": "default"
}
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({
planTierId: 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
couponsAllowed: false,
isEnabled: true,
salesChannel: 'default'
})
};
fetch('https://coreapi.io/api/plans/{id}/checkout-links', 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/api/plans/{id}/checkout-links",
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([
'planTierId' => 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
'couponsAllowed' => false,
'isEnabled' => true,
'salesChannel' => 'default'
]),
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": "1280792f-4e23-793d-8e9c-3a1bf36630bd",
"slug": "pro-plan-pro",
"planTierId": "<string>",
"planTierName": "Pro",
"couponsAllowed": true,
"isEnabled": true,
"url": "https://coreapi.io/checkout-link/pro-plan-pro/cart",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"salesChannel": {
"id": "<string>",
"name": "default",
"brandName": "Pro Plan"
}
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "Validation Failed",
"violations": [
{
"propertyPath": "tiers[0].name",
"message": "This value should not be blank.",
"code": "<string>"
}
]
}Autorisierungen
Organisation API token. Send it as Authorization: Bearer api_... The token is scoped to a single Organisation.
Pfadparameter
The plan UUID.
"1280792f-4e23-793d-8e9c-3a1bf36630bd"
Body
UUID of the tier the checkout link sells. Must belong to this plan.
Custom URL slug. When omitted a unique slug is generated.
3 - 64^[a-z0-9]([a-z0-9-]*[a-z0-9])?$Whether buyers may enter a coupon code during checkout.
Whether the link is active and reachable.
Sales channel as a UUID or as a technical name such as default. When omitted the active channel of the request is used, otherwise the Organisation default channel.
Antwort
The created checkout link.
"1280792f-4e23-793d-8e9c-3a1bf36630bd"
"pro-plan-pro"
"Pro"
Public checkout URL that creates a cart and redirects the buyer.
"https://coreapi.io/checkout-link/pro-plan-pro/cart"
Show child attributes
Show child attributes
War diese Seite hilfreich?