> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

# Cookbooks and recipes home

> Use these quick tutorials to integrate Payabli workflows fast

This page contains recipes that are designed to help you use and integrate Payabli. Recipes are short tutorials that cover a workflow.
We've organized these by Payabli product area.

## Browse by product

* [Pay In cookbook](/cookbooks/pay-in) — Recipes for accepting payments, refunds, invoices, and payment links.
* [Pay Out cookbook](/cookbooks/pay-out) — Recipes for ACH, vCard, check, ghost card, and managed payouts.
* [Pay Ops cookbook](/cookbooks/pay-ops) — Recipes for webhooks, notifications, reporting, and back-office operations.

## General recipes

<h3>Recipe: Authentication guide</h3>
/// Step 1: Provision API credentials

In the Payabli Portal, go to **Developers > API Credentials** and create an API Authentication credential. You receive a **client ID** and a **client secret**, scoped to an environment. Store the secret securely — Payabli shows it only once.

/// Step 2: Get an access token

Exchange your client ID and secret at the token endpoint for a short-lived Bearer access token. The token's lifetime is returned in the response's `expires_in` field (in seconds).

```bash
curl -X POST "https://api-sandbox.payabli.com/api/v2/Token/serverside" \
  -H "Content-Type: application/json" \
  -d '{
    "clientId": "YOUR_CLIENT_ID",
    "clientSecret": "YOUR_CLIENT_SECRET"
  }'
```

/// Step 3: Add the token to request headers

Send the access token in the `Authorization` header as a Bearer token. All API requests must be made over HTTPS.

```bash highlight=3
curl -X POST "https://api.payabli.com/api/ExampleEndpoint/authorize" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

/// Step 4: Add idempotency key (recommended)

Include a unique `idempotencyKey` header to prevent duplicate transactions. This key persists for 2 minutes.

```bash highlight=4
curl -X POST "https://api.payabli.com/api/ExampleEndpoint/authorize" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "idempotencyKey: unique-request-id-123"
```

Learn more about credentials, tokens, and idempotency in [OAuth authentication](/developers/oauth-authentication) and the [API overview](/developers/api-reference/api-overview).