> ## Documentation Index
> Fetch the complete documentation index at: /llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Welcome to the Playto Pay External API documentation.

## Authentication

All external API endpoints require authentication using a Merchant API Key. Generate your API key from the Playto Dashboard under **Settings → API**.

Pass the API key in the `X-API-KEY` header for every request.

```bash
X-API-KEY: sk_live_your_api_key_here
```

Older keys start with `pk_live_` / `pk_test_` and keep working.

## Base URLs

| Environment | Base URL |
| - | - |
| **Production** | `https://api.playto.so/v1` |
| **Sandbox** | `https://sandbox-api.playto.so/v1` |

## Sandbox

Sandbox is a full copy of the production API that uses test payment credentials - no real money moves. Your sandbox API key starts with `sk_test_` and is only accepted by the sandbox URL. Live keys are rejected on sandbox, and test keys are rejected on production.

### Test card

To pay in sandbox, use this card on the checkout page:

| Field | Value |
| - | - |
| Card number | `4242 4242 4242 4242` |
| Expiry | Any future date |
| CVV | Any three digits |

> [!NOTE]
>
> This card works in sandbox (test mode) only. No real money moves. It is not for live payments.

## Amounts

Every amount is a whole number in cents (smallest currency unit), on requests and on responses. `amount: 2500` means \$25.00. Convert to a display value on your side.

| Currency | Smallest amount | Largest amount |
| - | - | - |
| `USD` | `85` (\$0.85) | `99999999` (\$999,999.99) |

Only `USD` payments are supported: send `"currency": "USD"` (or leave it out; it defaults to `USD`). An amount outside this range returns a `400` `validation_error`.

> [!WARNING]
>
> Never send decimal amounts. `1200.50` is rejected with a `400`, but `1200.00` (or the string `"1200.00"`) is accepted and read as `1200` cents, which is $12.00, not $1,200.00. To charge \$1,200.00, send `120000`.

## Trailing slash

Every endpoint path ends with `/`, for example `/v1/products/`. A request without it, such as `GET /v1/products` or `POST /v1/products`, is not redirected. It returns an **HTML** `404 Not Found` page, not the JSON error described in [Errors](/api-reference/errors.md), so a client that parses every error as JSON will fail on it.

## Resources

### Products

A **product** is a reusable payment link with a fixed price. Create one and share the `checkout_url` publicly - on your website, in emails, or anywhere else. Any number of customers can pay through it.

Use products when you're selling the same thing repeatedly: a service package, a course, an event ticket.

### Invoices

An **invoice** is a one-time payment request addressed to a specific customer. Unlike a product, it has the customer's name and email pre-filled, carries an auto-generated invoice number, and can have an expiry date. It can only be paid once.

Use invoices when billing a specific person for a specific piece of work.

### Transactions

A **transaction** is a record of a completed payment - whether it came through a product or an invoice. Transactions are read-only; they are created automatically when a payment succeeds.

Use transactions to reconcile revenue, trigger fulfillment, or sync with your own system.

### Customers

A **customer** is anyone who has made a payment through your Playto account. Customer records are created automatically when a payment goes through, or you can create them manually to pre-populate your database from a CRM.

## Errors

Errors come back as JSON in one stable shape, with a `type` and a `code` you can branch on. See [Errors](/api-reference/errors.md) for the shape and a table of every status, type and code.

## Rate Limiting

Each merchant can make 300 requests per minute. Beyond that you receive a `429 Too Many Requests` response (`rate_limit_error`), and the `Retry-After` header tells you how many seconds to wait before retrying.
