---
title: "Checkout Purchase Mailboxes"
method: POST
path: "/provider-domains/{domain_id}/checkout-mailboxes"
tags: ["Provider Domains"]
---

# Checkout Purchase Mailboxes

`POST /provider-domains/{domain_id}/checkout-mailboxes`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/provider-domains/{domain_id}/checkout-mailboxes`
- Auth: HTTP bearer

Buy one or more mailboxes on a domain. SPENDS REAL CREDITS — unrestricted,
same as the app; there is no per-key spend cap.

Send an ``Idempotency-Key`` header to make a retry safe. Returns 402 if
the credit hold can't clear, 422 if the org's plan can't fund a purchase
at all, 400 for an unconnected/wrong-platform domain, too many mailboxes,
or a missing username, 404 if ``domain_id`` doesn't belong to this org.

## Path parameters

- `domain_id` integer, required: Provider domain ID (provider_domains.id) — from GET /provider-domains

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- MailboxPurchaseRequest: Buy one or more mailboxes on an already-purchased/connected domain. Spends real credits — see the 402 contract on the route docstring.
  - `mailboxes` MailboxPurchaseItem[], required: Mailboxes to create. Up to 5 per domain for a provider='managed' purchase, and up to 250 per request.
    - `username` string, nullable: Local-part, e.g. 'sales' for sales@domain
    - `email` string, nullable: Full mailbox address, e.g. sales@acme.com
    - `password` string, nullable: Write-only. Never returned by any endpoint.
    - `first_name` string, nullable
    - `last_name` string, nullable: Required (non-empty) for a managed purchase — an empty last name is rejected upstream and stalls provisioning.
  - `enable_warmup` boolean: Enroll each mailbox in warmup immediately after purchase
  - `warmup_settings` object, nullable
  - `provider` 'registrar' | 'managed' | 'pilot'
  - `platform` 'GOOGLE' | 'MICROSOFT', nullable: Mailbox platform. Required when provider='managed'.
  - `warmup_engine` 'instantly' | 'smartlead' | 'managed', nullable: Warmup engine. Omit to use the account default.

## Response `202`

Successful Response

- ApiResponseDict
  - `data` object, required
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
