---
title: Generate Arabic Receipt PDF API
slug: generate-arabic-receipt-pdf
url: https://apyhub.com/odelyo/service/generate-arabic-receipt-pdf
provider: Odelyo
tags: [arabic-receipt, receipt-pdf, thermal-receipt, rtl-pdf, receipt-generation, pdf-generation]
auth: api_key
version: v1
service_type: sync
endpoints: 1
atoms: 10
mcp: true
---

# Generate Arabic Receipt PDF API

Arabic receipt PDF API: send line items as JSON and get a receipt PDF for 80mm or 58mm thermal printers or A4 pages, with totals. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/odelyo/generate-arabic-receipt-pdf/receipts` | What it does Creates a receipt PDF in Arabic, English or both from the sale data you send. It retur… | 10 |

## Endpoint reference

### Receipt PDF

`POST https://api.eu.apyhub.com/odelyo/generate-arabic-receipt-pdf/receipts` · 10 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `date` | body | string | yes | Required. Receipt date, printed as sent. Example: `2026-11-30`. |
| `font` | body | string | no | Font family. One of: naskh, kufi, sans, amiri. Default: `naskh`. Example: `naskh`. |
| `buyer.name` | body | string | yes | Required. Buyer name. Example: `Mohammed Ali`. |
| `buyer.email` | body | string | no | Buyer email. Example: `billing@example.com`. |
| `buyer.phone` | body | string | no | Buyer phone number. Example: `+966 11 000 0000`. |
| `buyer.address` | body | string | no | Buyer address. Example: `Riyadh, Saudi Arabia`. |
| `buyer.name_en` | body | string | no | Buyer name in English, used in bilingual layouts. Example: `Mohammed Ali`. |
| `buyer.cr_number` | body | string | no | Buyer commercial registration (CR) number. Example: `1010000000`. |
| `buyer.tax_number` | body | string | no | Buyer tax or VAT number. Example: `300000000000003`. |
| `lines` | body | array of object | yes | Required. Receipt line items. 1 to 500 items. |
| `lines[].discount` | body | number | no | Flat discount amount in the document currency, not a percent. Must not be more than quantity × unit_price, or the API returns 422 invalid_discount. Example: `10`. |
| `lines[].quantity` | body | number | yes | Required. Quantity. Minimum 0. Example: `2`. |
| `lines[].unit_price` | body | number | yes | Required. Price per unit. Minimum 0. Example: `500`. |
| `lines[].description` | body | string | yes | Required. Line description. Example: `Consulting`. |
| `lines[].tax_percent` | body | number | no | Tax rate for this line in percent, 0 to 100. Example: `15`. |
| `lines[].description_en` | body | string | no | Line description in English, used in bilingual layouts. Example: `Consulting`. |
| `notes` | body | string | no | Free-text notes printed near the bottom. Example: `Thank you for your business.`. |
| `title` | body | string | no | Heading printed on the receipt. Example: `إيصال`. |
| `format` | body | string | no | Page size. `receipt-80mm` and `receipt-58mm` fit thermal printer rolls. One of: A4, A5, Letter, Legal, receipt-80mm, receipt-58mm. Default: `A4`. Example: `receipt-80mm`. |
| `number` | body | string | yes | Required. Receipt number. Example: `R-2001`. |
| `output` | body | string | no | `base64` returns JSON with the PDF as base64. `binary` returns the PDF file itself (application/pdf). One of: base64, binary. Default: `base64`. Example: `base64`. |
| `seller.name` | body | string | yes | Required. Seller name. Example: `Al Nakheel Trading`. |
| `seller.email` | body | string | no | Seller email. Example: `billing@example.com`. |
| `seller.phone` | body | string | no | Seller phone number. Example: `+966 11 000 0000`. |
| `seller.address` | body | string | no | Seller address. Example: `Riyadh, Saudi Arabia`. |
| `seller.name_en` | body | string | no | Seller name in English, used in bilingual layouts. Example: `Al Nakheel Trading`. |
| `seller.cr_number` | body | string | no | Seller commercial registration (CR) number. Example: `1010000000`. |
| `seller.tax_number` | body | string | no | Seller tax or VAT number. Example: `300000000000003`. |
| `qr_text` | body | string | no | Text to encode in a QR code on the document. Example: `INV-1001`. |
| `currency` | body | string | yes | Required. Currency code or label printed next to amounts. Example: `SAR`. |
| `decimals` | body | integer | no | Number of decimal places for amounts, 0 to 3. Example: `2`. |
| `due_date` | body | string | no | Payment due date, printed as sent. Example: `2026-12-30`. |
| `filename` | body | string | no | File name for the PDF. Letters, digits, spaces, dots, dashes and underscores, up to 100 characters. Example: `receipt-2001.pdf`. |
| `language` | body | string | no | Language of the labels. One of: ar, en, bilingual. Example: `bilingual`. |
| `logo_url` | body | string | no | Logo as an http(s) URL or a data:image/ URI. Up to 2,000,000 characters. Example: `https://example.com/logo.png`. |
| `direction` | body | string | no | Text direction. `auto` uses right-to-left when the content has Arabic. One of: auto, rtl, ltr. Default: `auto`. Example: `auto`. |
| `landscape` | body | boolean | no | Render the page in landscape. Example: `false`. |
| `margin_mm` | body | number | no | Page margin in millimetres, 0 to 40. Example: `10`. |
| `footer_html` | body | string | no | Custom HTML for the page footer. Example: `<div>Footer</div>`. |
| `header_html` | body | string | no | Custom HTML for the page header. Example: `<div>Header</div>`. |
| `accent_color` | body | string | no | Accent colour as a hex value. Example: `#0F766E`. |
| `page_numbers` | body | boolean | no | Print page numbers. Example: `true`. |
| `amount_in_words` | body | string | no | Total in words, printed as sent. The API does not write it for you. Example: `ألف ومئة وخمسون ريالاً`. |

#### Quickstart

Create an 80mm thermal receipt for one item with 15% tax.

```bash
curl -X POST "https://api.eu.apyhub.com/odelyo/generate-arabic-receipt-pdf/receipts" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"number":"R-2001","date":"2026-11-30","currency":"SAR","seller":{"name":"Al Ward Cafe"},"lines":[{"description":"Arabic coffee","quantity":2,"unit_price":12,"tax_percent":15}],"format":"receipt-80mm"}'
```

#### What you'll get back

Returns a JSON object with `data` and `meta`. `data` holds the PDF as base64, its size, page count and the worked-out totals.

```json
{
  "data": {
    "pdf_base64": "JVBERi0x...",
    "bytes": 33024,
    "pages": 1,
    "totals": { "subtotal": 24, "tax": 3.6, "total": 27.6 }
  },
  "meta": { "request_id": "req_31710ba752f877f5", "version": "v1" }
}
```

## About

## What it does
The Arabic Receipt PDF API turns sale data sent as JSON into a receipt PDF in Arabic, English or both. Send the receipt number, date, currency, seller and line items. The API returns the PDF with the subtotal, tax and total already worked out.

Set `format` to `receipt-80mm` or `receipt-58mm` for thermal printer rolls, or to `A4`, `A5`, `Letter` or `Legal` for a full page. Long receipts on a full page flow onto more pages. Set `language` to `ar`, `en` or `bilingual`, and `direction` switches to right-to-left when the content has Arabic. Each item in `lines` takes a `quantity`, a `unit_price`, an optional `tax_percent` and an optional flat `discount`, up to 500 lines.

Teams use the Arabic Receipt PDF API to print 80mm receipts at cafes and shops, email a receipt PDF after an online payment, and keep a bilingual copy of each sale. Add a QR code from any text with `qr_text`, or your logo with `logo_url`. Set `output` to `binary` to get the PDF file itself, or keep the default base64 JSON.

The API returns a PDF. It does not print to a device, so send the file to your printer or POS software.

For a layout of your own, use [Convert HTML Content to PDF API](https://apyhub.com/apyhub/service/convert-html-content-to-pdf). For a separate QR image, such as a review link, use [Generate QR Code API](https://apyhub.com/apyhub/service/generate-qr-code).

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/odelyo/service/generate-arabic-receipt-pdf
