Getting started

Five minutes to your first 200 OK

A single endpoint drives the Payment Service API. You choose what to do with a transaction flag plus a handful of fields. Here's the shortest path from zero to a successful test request.

API reference menu

Base URL

Every request goes to the same host:

https://accounts.paytia.com/api/payment_service

There's no separate sandbox domain. Sandbox vs live is decided by the API key you send — a sandbox key only ever touches test gateways and test cards, a live key moves real money. That keeps your integration code identical across environments.

Authentication

Pass your key in the X-API-KEY request header. Full detail in Authentication.

Request format

The Payment Service API accepts multipart form-data. The URL POST API takes the same fields as URL query parameters instead. Either way, fields are flat key-value pairs — no nested JSON.

Your first request

A minimal payment link. Replace YOUR_API_KEY with the sandbox key we send you and run:

curl --location --request POST 'https://accounts.paytia.com/api/payment_service' \
  --header 'X-API-KEY: YOUR_API_KEY' \
  --form 'transaction_flag=7' \
  --form 'amount=10.00' \
  --form 'reference_number=TEST-001' \
  --form 'firstname=Alex' \
  --form 'lastname=Example' \
  --form 'email_address=test@example.com' \
  --form 'webhook_url=https://webhook.site/your-uuid' \
  --form 'merchantcode=YOUR_GATEWAY_PROFILE'

Good response: an HTTP 200 with a linktopay_url you can open in a browser. Bad response: an error code you can look up in the error codes table.

What changed is the transaction flag

transaction_flag=7 is a payment link. Swap that for a different value and the same endpoint handles MOTO, recurring, QR, bank capture, and so on. Every flow page has the right flag plus the fields it expects. Example walkthroughs live at:

Webhooks

You almost always want to know the outcome of a payment. Supply a webhook_url on the request and Paytia POSTs the result back to you when the payment completes, fails, or times out. Webhook reference →

Sandbox keys

We issue sandbox credentials on request — no commitment, no sales call required. You can read these docs, try every flow in the explorer, and evaluate the API end to end before anyone asks you for a purchase order. Request a sandbox key →

Ready to build with Paytia?

The docs are open. Keys are gated — drop us a line and we'll issue sandbox credentials so you can try every flow against a real endpoint.