> List your checkouts with their slugs and every price each one sells, to build buy buttons or find the checkout for a price.

Source: https://plandalf.com/docs/api/offers

API and webhooks

# Offers

An offer is a checkout. List them to get each one's `slug`, the value `plandalf.present()` and `data-plandalf-present` take, and the prices it can sell. Offers are created and designed in the dashboard; see [Create a checkout](https://plandalf.com/docs/checkouts/create).

## Example

```bash
curl "https://admin.plandalf.dev/api/v1/offers?status=published" \
  -H "Authorization: Bearer $PLANDALF_API_KEY"
```

```json
{
  "data": [
    {
      "id": "8Di1dEf1LTe",
      "slug": "gold-membership-8Di1dEf1LTe",
      "name": "Gold membership",
      "status": "published",
      "test_mode": false,
      "checkout_url": "https://admin.plandalf.dev/o/gold-membership-8Di1dEf1LTe",
      "price_lookup_keys": ["gold-monthly", "gold-yearly"],
      "price_ids": [1, 2]
    }
  ]
}
```

The list holds your 200 most recent offers, newest first. `status` is `draft`, `published` or `archived`. Each offer lists the `price_ids` and `price_lookup_keys` it sells, so to find the checkout for one of your synced prices, look for its lookup key there. `checkout_url` is the checkout's hosted link.

## Endpoint

### List offers

GET `/api/v1/offers`

The organization's 200 most recent offers, newest first, each with every price it can sell. `slug` is what `plandalf.present()` and `data-plandalf-present` take. Use `price_lookup_keys` or `price_ids` to find the offers that sell one of your synced prices.

#### Parameters

Name

In

Type

What it is

`status` optional

query

`"draft" | "published" | "archived"`

```bash
curl https://admin.plandalf.dev/api/v1/offers \
  -H "Authorization: Bearer $PLANDALF_API_KEY"
```

#### Response

```json
{
  "data": [
    {
      "id": "string",
      "slug": "string",
      "name": "string",
      "status": "string",
      "test_mode": true,
      "checkout_url": "string",
      "price_lookup_keys": [
        "string"
      ],
      "price_ids": [
        0
      ]
    }
  ]
}
```

#### Errors

Status

When

`401`

The API key or OAuth token is missing or invalid.

`422`

The request failed validation; `errors` lists the problems by field.

Something wrong or missing? Email [hello@plandalf.com](mailto:hello@plandalf.com).
