Home Getting Started

Getting Started

By PalCards
4 articles

Introduction & base URL

The PalCards API lets you — a registered dealer — integrate PalCards into your own system: browse the product catalog with your pricing, check your wallet balance, and place orders (vouchers and top‑ups) programmatically. Base URL Production: https://api.palcards.ps There is also a sandbox for testing — see Sandbox & production. Send Content-Type: application/json on requests with a JSON body. Who can use it The API is for dealers. You authenticate with an API key that you create yourself in the PalCards dealer panel. Every request runs on behalf of your dealer account — with your pricing and your wallet. How authentication works 1. Create an API key in the panel (API keys / مفاتيح API). 2. Add the public IP address(es) of your server to the key's allowlist — this is required. 3. Send your key in the x-api-key header on every request. curl -H "x-api-key: sk_prod_your_key_here" \ "https://api.palcards.ps/user/profile" See Create & manage your API key and Authenticating requests for the details. What you can do | Area | Endpoint | Article | |---|---|---| | Catalog & pricing | GET /product/catalog | Browse the product catalog | | Wallet & balance | GET /user/profile | Wallet & balance | | Place an order | POST /order | Create an order | | Track orders | GET /order, GET /order/{id} | Retrieve orders | | Get notified | notificationUrl callback | Order webhooks | Quick start 1. Create an API key and allowlist your server's IP. 2. Check your balance (GET /user/profile) to confirm the key works. 3. Browse the catalog (GET /product/catalog) to get product IDs. 4. Create an order (POST /order). All responses are JSON. Amounts are returned as { "currency": "USD", "value": 12.5 } objects. For a full copy‑paste walkthrough, see the Quickstart.

Last updated on Jun 07, 2026

Sandbox & production

PalCards provides two environments. Build and test against sandbox, then switch to production. Base URLs | Environment | Base URL | Use it for | |---|---|---| | Sandbox | https://api-sandbox.palcards.ps | Development & testing | | Production | https://api.palcards.ps | Live orders | Keep the base URL in a single config value (e.g. BASE_URL) so you can switch environments without changing code: BASE_URL="https://api-sandbox.palcards.ps" # production: https://api.palcards.ps curl -H "x-api-key: $API_KEY" "$BASE_URL/user/profile" Interactive API explorer (Swagger) A Swagger / OpenAPI reference for the sandbox is available at https://api-sandbox.palcards.ps/docs. It is protected — ask your PalCards account manager for sandbox access and credentials. Go-live checklist Before pointing your integration at production: - [ ] Your flow runs end-to-end in sandbox: catalog → (preflight) → create order → status/webhook. - [ ] You created a production API key and added your production server IP(s) to its allowlist (see Create & manage your API key). - [ ] You switch BASE_URL to https://api.palcards.ps. - [ ] You treat fulfillment as asynchronous and handle every order status (see Order status lifecycle). - [ ] You verify webhook payloads by re-fetching GET /order/{id} — webhooks are unsigned (see Order webhooks). - [ ] Your wallet has a balance in the currency you'll order in (see Wallet & balance). - [ ] You store each order's id and your clientOrderRef for reconciliation.

Last updated on Jun 07, 2026

Quickstart

A complete, copy‑paste path from zero to a working order. Build against the sandbox base URL first (see Sandbox & production). BASE_URL="https://api-sandbox.palcards.ps" # production: https://api.palcards.ps API_KEY="sk_prod_your_key_here" 1. Confirm your key & check your balance curl -H "x-api-key: $API_KEY" "$BASE_URL/user/profile" A 200 with wallets[].balance means your key works and your IP is allowed. A 401 means the key or IP is wrong — see Authenticating requests. 2. Find a product to sell curl -H "x-api-key: $API_KEY" "$BASE_URL/product/catalog?ps=20" Pick a productItems[].id — that is the productItem you'll buy. 3. (Top‑ups only) Validate the account curl -X POST "$BASE_URL/order/top-up/preflight" \ -H "x-api-key: $API_KEY" -H "Content-Type: application/json" \ -d '{ "productItem": 5002, "context": { "accountId": "123456789" } }' 4. Create the order curl -X POST "$BASE_URL/order" \ -H "x-api-key: $API_KEY" -H "Content-Type: application/json" \ -d '{ "productItem": 5001, "customer": { "phone": "+970590000000" }, "clientOrderRef": "ref-0001" }' You get back an order with a status. Orders finalize asynchronously — a 200 means accepted, not yet fulfilled. 5. Get the result — webhook or polling - Pass a notificationUrl on the order and PalCards POSTs you the final order when it's done (see Order webhooks), or - Poll until the status is terminal: curl -H "x-api-key: $API_KEY" "$BASE_URL/order/9001" See Order status lifecycle for which statuses are final and when the voucher (soldItem) is available. 6. Go live Switch BASE_URL to https://api.palcards.ps, use a production API key, and run the go-live checklist in Sandbox & production.

Last updated on Jun 07, 2026