---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://truto.one/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Preview a code for one team

> Source: https://truto.one/docs/api-reference/admin/billing/get-promotion-code/

`GET /billing/promotion-code/{code}`

Resource: **Billing**

**What a code gives this team, in plain words, and whether it can redeem it.** Nothing is written. An unknown, paused, expired or used-up code is a `400` with the same codes as the redeem. To preview for the signed-in person across all their teams, use `GET /billing/offer-code/{code}`.

## Path parameters

- **`code`** _(string, required)_

## Query parameters

- **`team_id`** _(string, required)_

## Response body

- **`result`** _(object)_
  - **`code`** _(string)_
  - **`offer_key`** _(string)_
  - **`offer_name`** _(string)_
  - **`description`** _(string)_
    The lines as one paragraph.
  - **`lines`** _(array<string>)_
  - **`credit_cents`** _(integer)_
  - **`discounts`** _(array<object>)_
    - **`name`** _(string)_
    - **`percent_off`** _(integer)_
    - **`amount_off_cents`** _(integer)_
    - **`applies_to`** _(string)_
      Allowed: `pro`, `usage`
    - **`duration`** _(string)_
      Allowed: `once`, `repeating`, `forever`
    - **`duration_months`** _(integer)_
  - **`pro_on`** _(boolean)_
  - **`pro_continue_ask`** _(boolean)_
    Show the "Pro continues after the credits" consent box with the redeem.
  - **`features_off`** _(array<string>)_
  - **`features_on`** _(array<string>)_
  - **`redeemable`** _(boolean)_
  - **`refusal`** _(object)_
    Why the code cannot be redeemed, as the redeem would answer. Null when it can.
    - **`truto_error_code`** _(string)_
    - **`message`** _(string)_

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | The code is unknown, paused, expired or used up (`credit_code_invalid`, `code_expired`, `credit_code_expired`, `credit_code_used_up`). |
| `403` | Forbidden if the caller is not an admin of the team |

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/billing/promotion-code/{code}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/billing/promotion-code/{code}', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/billing/promotion-code/{code}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```
