# Retrieve the receipt of a payment

> Returns a signed link (valid for 15 minutes) to the PDF receipt of a paid payment of your store: the payer, the items, the card used (masked), the approval code and any refunds.

Source: https://rais.app/docs/api/retrieve-payment-receipt

`GET /v1/payments/{payment_id}/receipt`

Required scope: `payments:read`.

The receipt is in the language of the payment page; a sandbox payment's receipt is clearly marked as a test. Only payments that were paid (`paid`, `partially_refunded`, `refunded`) have a receipt: any other payment, a payment of another store or of the other environment (sandbox vs live) answers 404. The receipt is regenerated after a refund, so the link always shows the current state.

## Request

### Path parameters

- `payment_id` (string, required): The id of the payment.

### Example request

```bash
curl https://api.rais.app/v1/payments/5b1c2f4e-9d3a-4c61-8a7e-0f2d6b9e1a33/receipt \
  -H "Authorization: Bearer rais_sk_test_..."
```

## Response

### 200: A signed link to the receipt.

Returns the [Receipt object](https://rais.app/docs/api/objects/receipt.md).

```json
{
  "object": "receipt",
  "url": "https://files.example.com/storage/receipts/Rais-receipt-1042.pdf?signature=...",
  "expires_at": 1793000900
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 401 | `invalid_api_key` | Invalid API key provided. |
| 403 | `insufficient_scope` | This API key does not have the 'payments:write' permission. |
| 403 | `account_disabled` | This store is suspended or disabled. |
| 403 | `live_mode_not_enabled` | Complete business verification to take live payments. |
| 404 | `payment_not_found` | No such payment. |
| 429 | `rate_limit_exceeded` | Too many requests. Slow down and retry after the delay in the Retry-After header. |
| 500 | `internal_error` | Something went wrong on our side. Quote the request id to support. |
| 503 | `gateway_unavailable` | The payment gateway is temporarily unavailable. Please try again later. |

See [Errors](https://rais.app/docs/errors.md) for every code and how to react.

## Related guides

- [Receipts](https://rais.app/docs/receipts.md)
