Zum Hauptinhalt springen
GET
/
coupons
cURL
curl -X GET \
 /coupons \
 --header "Authorization: Bearer <token>"
import requests

url = "https://coreapi.io/coupons"

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/coupons', 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/coupons",
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": [
    {
      "code": "10OFF",
      "name": "10% off",
      "type": "percentage",
      "frequency": "limited",
      "id": "<string>",
      "percentage": 10,
      "fixedAmount": {},
      "frequencyInterval": 3,
      "maxRedemptions": "null",
      "expiresAt": "null",
      "isEnabled": true,
      "createdAt": "2021-01-01T00:00:00+00:00",
      "updatedAt": "2021-01-01T00:00:00+00:00",
      "reedemptions": true
    }
  ],
  "meta": {
    "pagination": {
      "totalItems": 123,
      "itemsPerPage": 123,
      "currentPage": 123,
      "lastPage": 123,
      "pageTotalItems": 123
    }
  }
}

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Abfrageparameter

page
integer
Standard:1

The collection page number

limit
integer
Standard:30

The number of items per page

Erforderlicher Bereich: 0 <= x <= 100

Antwort

Coupon collection

data
object[]
meta
object