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

> ## Agent Instructions
> Before reading these docs, install the relevant Circle Skill to get pre-loaded context — skills are LLM-optimized and cover architecture decisions, correct flows, and common pitfalls. In Claude Code: run /plugin marketplace add circlefin/skills then /plugin install circle-skills@circle. With Vercel Skills CLI: run npx skills add circlefin/skills. Available skills: use-usdc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-usdc/SKILL.md (balances, transfers, approvals on EVM and Solana); EURC has no skill — see https://developers.circle.com/stablecoins/what-is-eurc.md; bridge-stablecoin https://github.com/circlefin/skills/blob/master/plugins/circle/skills/bridge-stablecoin/SKILL.md (crosschain transfers via CCTP, USDC, EURC, and third-party assets); use-arc https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-arc/SKILL.md (Arc chain config, contract deployment, USDC bridging — Arc docs: https://docs.arc.io/llms.txt); use-circle-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-circle-wallets/SKILL.md (choose wallet type); use-developer-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-developer-controlled-wallets/SKILL.md (custodial wallets for payouts and treasury); use-user-controlled-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-user-controlled-wallets/SKILL.md (embedded wallets with Web2 login); use-modular-wallets https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-modular-wallets/SKILL.md (smart contract wallets with passkeys and ERC-4337); use-gateway https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-gateway/SKILL.md (unified USDC balance, nanopayments); use-smart-contract-platform https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-smart-contract-platform/SKILL.md (deploy, interact, monitor contracts). Pair any skill with the Circle MCP server for live SDK signatures, contract addresses, and chain IDs: {"mcpServers":{"circle":{"url":"https://api.circle.com/v1/codegen/mcp"}}}.
> Read the product overview first. Each product has an overview explaining when and why to use it. Read it before quickstarts.
> Pick the right wallet type. Developer-controlled (you hold keys), user-controlled (end user holds keys via PIN/social login), or modular (smart contract wallets with passkeys). See https://developers.circle.com/wallets.md.
> Use CCTP V2 for crosschain transfers. CCTP natively transfers USDC and EURC via burn-and-mint, and supports permissionless wrapping of third-party assets via lock-and-mint. V1 is legacy; always use V2 unless V1 is specified or the chain requires it (Noble, Sui, and Aptos still require V1). Migration guide: https://developers.circle.com/cctp/migration-from-v1-to-v2.md.
> Use Bridge Kit for frontend bridging. Wraps CCTP with a simpler SDK for user-facing apps. Use CCTP directly for backend transfers.
> Gas Station vs Paymaster. Gas Station sponsors gas for Circle Wallet transactions. Paymaster lets users pay gas in USDC. Different use cases — read both overviews.
> Gateway Nanopayments for sub-cent payments. Gasless USDC micropayments down to $0.000001 via x402 and batched settlement. For pay-per-request APIs, AI agent payments, streaming.
> Look up USDC addresses per chain. Never hardcode — use https://developers.circle.com/stablecoins/usdc-contract-addresses.md.
> Prefer SDKs over raw API calls. Node.js and Python SDKs handle auth, retries, and errors.
> API key required. Bearer token in Authorization header. Testnet and mainnet use separate keys and may use different base URLs depending on the product.
> Set up webhooks when available. Most operations are async. Webhooks deliver transaction confirmations and state changes.
> When calling list endpoints, paginate using pageSize and pageAfter until no nextPageAfter cursor is returned—stopping at the first page silently misses records.
> Building an AI agent? Start with the Agent Stack—Circle CLI, agent wallets, and nanopayments built for autonomous use cases: https://developers.circle.com/agent-stack.md.

# How-to: Retrieve payment receipts

> Get the payment receipt for a completed payment.

After a Beneficiary Financial Institution (BFI) completes a fiat payout, it can
issue a payment receipt (proof of payment), such as an MT103 for a wire payment.
CPN makes the receipt available through the API as a PDF.

## Prerequisites

Before you begin, ensure that you've:

* Created an API key with access to your payments.
* Created a
  [webhook subscription](https://developers.circle.com/api-reference/cpn/common/create-subscription.md) that
  includes the `cpn.document.available` notification type, or the
  `cpn.document.*` wildcard.

## Steps

**1. Wait for the document available webhook**

When the BFI sends a payment receipt, CPN sends a
[`cpn.document.available`](https://developers.circle.com/api-reference/cpn/cpn-platform/document-available)
webhook. The `notification` object contains the document `id` and the
`paymentId` it belongs to.

```json theme={null}
{
  "subscriptionId": "cd198ca6-9fc4-41d6-b6b1-8e2a9c975352",
  "notificationId": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
  "notificationType": "cpn.document.available",
  "notification": {
    "id": "3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
    "paymentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "documentType": "PROOF_OF_PAYMENT",
    "format": "PDF",
    "createDate": "2025-03-24T17:10:00.000Z"
  },
  "timestamp": "2025-03-24T17:10:01.123456789Z",
  "version": 2
}
```

A `documentType` of `PROOF_OF_PAYMENT` identifies the payment receipt.

**2. List the documents for a payment (optional)**

If you missed the webhook, or want to check whether a receipt is available, call
the [list documents](https://developers.circle.com/api-reference/cpn/cpn-platform/list-documents.md) endpoint
with the payment ID. The list is empty until the BFI sends a document.

```bash theme={null}
curl --request GET \
  --url "https://api.circle.com/v1/cpn/documents?paymentId=${PAYMENT_ID}" \
  --header "Authorization: Bearer ${YOUR_API_KEY}"
```

```json theme={null}
{
  "data": [
    {
      "id": "3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "paymentId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "documentType": "PROOF_OF_PAYMENT",
      "format": "PDF",
      "createDate": "2025-03-24T17:10:00.000Z"
    }
  ]
}
```

**3. Download the receipt**

Call the [download a document](https://developers.circle.com/api-reference/cpn/cpn-platform/get-document.md)
endpoint with the document ID. The response is the PDF file, returned as an
attachment named `<paymentId>_proof_of_payment.pdf`.

```bash theme={null}
curl --request GET \
  --url "https://api.circle.com/v1/cpn/documents/${DOCUMENT_ID}" \
  --header "Authorization: Bearer ${YOUR_API_KEY}" \
  --output receipt.pdf
```

CPN fetches the file from the BFI each time you download it. A `400` status with
error code `291100` means too many downloads are in progress, so avoid
downloading many documents at once. Retry the request later after that error or
a `502` status.

> [!NOTE]
>
> In the sandbox environment, set the `ORIGINATOR_NAME` field to
> `PaymentWithDocument` when you create a payment to receive a test receipt
> after the payment completes. See [magic values for
> testing](https://developers.circle.com/cpn/references/testing/magic-values.md).
