# Receipts

> PDF receipts of paid payments: how to get a signed link and what a receipt contains.

Source: https://rais.app/docs/receipts

Every payment that was paid has a **PDF receipt** for the payer. You can give the payer a link to it, or fetch a signed link yourself to attach the PDF to an e-mail or an order page.

## Which payments have a receipt

A receipt exists for payments with the status `paid`, `partially_refunded` and `refunded`. A pending, failed, cancelled, expired or reversed payment has none.

## The payer's link

Once a payment is paid, its `receipt_url` is set. It is a link to the PDF, on the payer's address (`https://pay.rais.app`, next to the checkout), that works in any browser, with no key, and is the same link as the **Download receipt (PDF)** button of the result page.

~~~json
{
  "id": "5b1c2f4e-9d3a-4c61-8a7e-0f2d6b9e1a33",
  "status": "paid",
  "receipt_url": "https://pay.rais.app/pay/5b1c2f4e-9d3a-4c61-8a7e-0f2d6b9e1a33/receipt.pdf"
}
~~~

The link contains the payment's id, which cannot be guessed, and is the only thing that grants access: share it only with the payer. It is rate limited per client address, so a script cannot hammer it, and it answers `404` for a payment that has no receipt. The `payment.succeeded` webhook carries the same `receipt_url` in `data.object`.

## A signed link for your server

`GET /payments/{id}/receipt` returns a signed link to the PDF, valid for 15 minutes. It needs the `payments:read` scope.


**Request**

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

**Response** (`200`)

~~~json
{
  "object": "receipt",
  "url": "https://files.example.com/receipts/2026/10/5b1c2f4e-9d3a-4c61-8a7e-0f2d6b9e1a33.pdf?X-Amz-Expires=900&X-Amz-Signature=...",
  "expires_at": 1793000900
}
~~~


The `url` is an HTTPS link to the file, signed for 15 minutes. Treat it as opaque: its host and parameters are not part of the contract. Ask for a new link whenever you need one instead of storing it: after `expires_at` it stops working.

| Status | Code | When |
| --- | --- | --- |
| 404 | `payment_not_found` | No such payment for this key, the payment is of the other environment, or it has not been paid. All three look the same. |
| 503 | `gateway_unavailable` | The receipt cannot be produced right now. Retry shortly; the answer has a `Retry-After` header. |

## What a receipt contains

A receipt is an A4 PDF in the language of the payment page: English, French or Arabic, laid out right to left for Arabic.

- The receipt number, the amount paid and the payment date.
- The **merchant**: your store name, the contact e-mail of your store and, when your business is verified, its legal identity (NIF, RC and NIS where known).
- The **payer**: name and e-mail, when you provided them. The name on the card is never printed.
- The **items** with quantity, unit price and amount, or a single line when you sent none.
- The **payment details**: the payment method (always **CIB/Edahabia**), the approval code, the Raïs order ID, the Raïs order number, your reference, the bank response and the currency. No card number is printed, not even its last digits.
- Every **refund** made so far, with its date, reason and amount, and the net amount.
- A QR code and a link to the payment page, and the SATIM support number, 3020.

Give your items clear names and send the payer's details: they go straight onto the receipt.

## After a refund

The receipt is regenerated when a refund succeeds, so a link always shows the refunds made so far. See [Refunds](https://rais.app/docs/refunds.md).

## Sandbox receipts

A receipt of a sandbox payment is a real PDF with the same layout, marked **TEST MODE — NOT A REAL PAYMENT** so that it cannot be mistaken for proof of a live payment.
