Preview an order link
Checks a configuration for the order page, prices it as the order page does (monthly, excluding VAT) and answers the link that opens the order page with every choice made. Nothing is created, saved or charged, and the answer is the same for everyone who is signed in.
Body
Upgrades on top of the package, in whole units. A kind that is left out is 0.
Fields
Extra cores. At least 0.
Extra disk, in GB. At least 0.
Extra memory, in GB. At least 0.
The billing period the link opens with. The quote's figures are monthly either way. Defaults to monthly.
monthlyannualThe server type. general is Standard and optimised is Performance, which is refused where the region does not offer it. Defaults to general.
generaloptimisedThe currency to price in. A currency the order page has no prices in at the moment is refused.
GBPUSDEURA package code the order page sells, such as CS4 or CC8. Its first two letters name the line (CS CoreStack, CC CoreCluster).
The platform of a CoreStack site, such as wordpress. Needed for a CoreStack package and ignored for a CoreCluster one.
A region the order page offers to everyone, such as uk, us, nl or aus. The package's line must be orderable there.
Returns
200 The configuration as it was checked, its price, and the link that opens the order page with it.
Fields of the 200 answer
The increment and ceiling of each upgrade for this package.
Fields
Fields
The most the package takes.
The increment the order page takes.
Fields
The most the package takes.
The increment the order page takes.
Fields
The most the package takes.
The increment the order page takes.
What the order page's own summary shows before anything is saved.
Fields
Fields of each item
What the line is, such as package, addon_cores, addon_memory_gb or addon_disk_gb.
The line's monthly price, a decimal number as text.
How many units, on an upgrade's line.
The monthly price of one unit, on an upgrade's line.
The sum of the lines, a decimal number as text.
The prices exclude VAT.
The configuration as it was checked.
Fields
Fields
monthlyannualgeneraloptimisedThe platform of a CoreStack site; null for a CoreCluster.
cs is CoreStack and cc is CoreCluster.
csccThe order page's address with every choice in spec already made. Choices left at their default are not written into it.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/order-links/preview \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"addons": {
"cores": 2,
"disk_gb": 50,
"memory_gb": 8
},
"compute_family": "optimised",
"currency": "GBP",
"package": "CC8",
"region": "uk"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/order-links/preview', [
'addons' => [
'cores' => 2,
'disk_gb' => 50,
'memory_gb' => 8,
],
'compute_family' => 'optimised',
'currency' => 'GBP',
'package' => 'CC8',
'region' => 'uk',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/order-links/preview', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
addons: {
cores: 2,
disk_gb: 50,
memory_gb: 8,
},
compute_family: 'optimised',
currency: 'GBP',
package: 'CC8',
region: 'uk',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/order-links/preview",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"addons": {
"cores": 2,
"disk_gb": 50,
"memory_gb": 8,
},
"compute_family": "optimised",
"currency": "GBP",
"package": "CC8",
"region": "uk",
},
)
data = res.json() if res.content else None{
"addon_steps": {
"cores": {
"max": 8,
"step": 1
},
"disk_gb": {
"max": 102400,
"step": 10
},
"memory_gb": {
"max": 32,
"step": 1
}
},
"quote": {
"currency": "GBP",
"lines": [
{
"key": "package",
"label": "CoreCluster CC8",
"monthly": "720.00"
},
{
"key": "addon_cores",
"label": "2 extra cores",
"monthly": "108.00",
"quantity": 2,
"unit": "54.00"
},
{
"key": "addon_memory_gb",
"label": "8 GB extra memory",
"monthly": "48.00",
"quantity": 8,
"unit": "6.00"
},
{
"key": "addon_disk_gb",
"label": "50 GB extra disk",
"monthly": "12.00",
"quantity": 50,
"unit": "0.24"
}
],
"subtotal_monthly": "888.00",
"vat": "excluded"
},
"spec": {
"addons": {
"cores": 2,
"disk_gb": 50,
"memory_gb": 8
},
"billing": "monthly",
"compute_family": "optimised",
"currency": "GBP",
"package": "CC8",
"platform": null,
"product_line": "cc",
"region": "uk"
},
"url": "https://manage.corefinity.com/order?package=CC8®ion=uk¤cy=GBP&optimised=1&addon_cores=2&addon_memory_gb=8&addon_disk_gb=50"
}{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "invalid",
"errors": {
"addons": [
"Send the upgrades as an object of whole numbers"
]
},
"field": "addons",
"message": "Send the upgrades as an object of whole numbers",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}