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

# 5-minute quickstart

> From signup to your first booking flow in cURL

## 1. Sign up for sandbox

<CodeGroup>
  ```bash cURL theme={"theme":"github-dark-dimmed"}
  curl -X POST https://api.safarapi.com/api/partner/v1/auth/signup \
    -H 'Content-Type: application/json' \
    -d '{
      "company_name": "Your Bank",
      "legal_name": "Your Bank S.A.",
      "contact_email": "dev@yourbank.com",
      "contact_phone": "+212600000000",
      "use_case": "Embed travel marketplace in mobile app"
    }'
  ```

  ```http Response theme={"theme":"github-dark-dimmed"}
  HTTP/1.1 201 Created
  Content-Type: application/json

  {
    "partner_id": "1234-...",
    "contact_email": "dev@yourbank.com",
    "message": "Check your inbox — a magic link has been sent. The link expires in 24 hours."
  }
  ```
</CodeGroup>

Within seconds, your inbox receives a magic link. Clicking it lands you in [console.safarapi.com](https://console.safarapi.com) where your sandbox bearer key is **displayed once**. Copy it — we cannot retrieve it for you.

<Warning>
  The bearer token is shown a single time. Lose it and you'll have to revoke and re‑issue a new key from the console.
</Warning>

## 2. Browse the catalogue

```bash theme={"theme":"github-dark-dimmed"}
curl https://api.safarapi.com/api/partner/v1/adventures \
  -H 'Authorization: Bearer sk_test_ABCDWXYZ_<your-secret>'
```

The catalogue is paginated. Every adventure includes title, duration, price already adjusted to your partner pricing rules (zero margin in sandbox by default).

## 3. Get a frozen quote

Take the `slug` and a `rate_packs[].id` from step 2's response — the values
below are illustrative. Sandbox `sk_test_*` keys are exempt from request
signing, so no `X-Timestamp`/`X-Signature` here (production writes require them
— see [Authentication](/introduction/authentication)).

```bash theme={"theme":"github-dark-dimmed"}
curl -X POST https://api.safarapi.com/api/partner/v1/quotes \
  -H 'Authorization: Bearer sk_test_...' \
  -H 'Idempotency-Key: 11111111-1111-1111-1111-111111111111' \
  -H 'Content-Type: application/json' \
  -d '{
    "adventure_slug": "marrakech-3-jours-desert-sandbox",
    "rate_pack_id": "4a7e0f21-9c3d-4b18-8a52-1f6d0e7b2c34",
    "start_date": "2026-07-12",
    "rooms": [{ "adults": 2, "children": [{ "age": 8 }], "extra_beds": 0 }]
  }'
```

The response includes `id` (the `quote_id`), `net_amount` (what you owe SafarAPI), `breakdown` (per‑line detail), and `expires_at` (30 minutes from now).

<Tip>
  The HMAC signature is `hex(HMAC_SHA256(secret, "{timestamp}\n{method}\n{path}\n{body}"))`. Code samples for Node.js, Python, PHP, Java are in [authentication](/introduction/authentication#signing-writes).
</Tip>

## 4. Confirm a booking

Your customer pays in your app's checkout — SafarAPI never touches the card data. Once payment is captured on your side, send the booking:

```bash theme={"theme":"github-dark-dimmed"}
curl -X POST https://api.safarapi.com/api/partner/v1/bookings \
  -H 'Authorization: Bearer sk_test_...' \
  -H 'Idempotency-Key: 22222222-2222-2222-2222-222222222222' \
  -H 'X-Timestamp: '$(date +%s) \
  -H 'X-Signature: <hmac>' \
  -H 'Content-Type: application/json' \
  -d '{
    "quote_id": "...",
    "partner_reference": "YBANK-BOOK-2026-01234",
    "traveler": {
      "first_name": "Ali",
      "last_name": "Benali",
      "email": "test.success@bank.example",
      "phone": "+212600000001",
      "language": "fr",
      "customer_reference": "your-internal-customer-id"
    },
    "payment_confirmation": {
      "bank_payment_ref": "YBANK-PAY-2026-99887",
      "paid_amount_total": "3200.00",
      "paid_amount_net": "2880.00",
      "paid_at": "2026-07-01T14:23:55Z",
      "payment_method": "CARD"
    }
  }'
```

Response includes `booking_number` (format `MV-XXXXXX`), `status: CONFIRMED`, and the immediate voucher.

## 5. Retrieve the voucher

```bash theme={"theme":"github-dark-dimmed"}
curl -L https://api.safarapi.com/api/partner/v1/bookings/MV-ABC123/voucher.pdf \
  -H 'Authorization: Bearer sk_test_...'
```

Returns a 302 redirect to a signed R2 URL valid for 7 days. The voucher is also emailed to the traveller automatically.

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication deep dive" href="/introduction/authentication">
    Bearer + HMAC details, code samples in 4 languages
  </Card>

  <Card title="Sandbox guide" href="/introduction/sandbox">
    Test traveller emails, reset behaviour, rate limits
  </Card>

  <Card title="Webhooks" href="/api-concepts/webhooks">
    Receive and verify booking, settlement and availability events
  </Card>

  <Card title="Troubleshooting" href="/api-concepts/troubleshooting">
    Symptom → cause → fix for the errors integrators hit
  </Card>
</CardGroup>
