Zum Hauptinhalt springen
GET
/
api
/
plans
List plans
curl --request GET \
  --url https://coreapi.io/api/plans \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://coreapi.io/api/plans"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://coreapi.io/api/plans', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "data": [
    {
      "id": "1280792f-4e23-793d-8e9c-3a1bf36630bd",
      "code": "pro-plan",
      "name": "Pro Plan",
      "currency": "EUR",
      "tierCount": 3,
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "meta": {
    "count": 123,
    "total": 123
  },
  "pagination": {
    "cursor": "<string>",
    "hasMore": true,
    "nextCursor": "<string>",
    "prevCursor": "<string>",
    "limit": 20,
    "totalItems": 123,
    "itemsPerPage": 123,
    "currentPage": 123,
    "totalPages": 123,
    "pageTotalItems": 123
  }
}
{
"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."
}

Autorisierungen

Authorization
string
header
erforderlich

Organisation API token. Send it as Authorization: Bearer api_... The token is scoped to a single Organisation.

Abfrageparameter

status
enum<string>

Lifecycle status. A plan is created as draft, becomes active once you activate it, and can later be archived. Only active plans can be sold or switched into.

Verfügbare Optionen:
draft,
active,
archived
code
string

Filter by a code substring.

sort
enum<string>
Verfügbare Optionen:
updatedAt,
createdAt,
code,
name
order
enum<string>
Verfügbare Optionen:
asc,
desc
cursor
string
limit
integer
Standard:20
page
integer

Switches to page based pagination.

Antwort

A paginated list of plans.

data
object[]
meta
object
pagination
object

Pagination metadata. Cursor based fields are present for the default cursor mode, page based fields are present when you pass page or offset.