Paayed Beta is live! Beta users are by invite only | Thank you for being part of our early access program.

API & Integrations

Everything you need to know about integrating with the Paayed API, connecting third-party tools, and building custom workflows.

The Paayed API lets you integrate payments directly into your application, website, or platform. It follows RESTful conventions, uses JSON for request and response bodies, and authenticates via API keys.

Base URL

All API requests are made to https://api.paayed.com/v1/

What you can do

  • Accept payments: Process card payments, mobile money, and bank transfers
  • Issue refunds: Full or partial refunds on completed transactions
  • Create invoices: Generate and send invoices programmatically
  • Manage customers: Store customer records for repeat billing
  • Set up subscriptions: Automate recurring charges
  • Receive webhooks: Get real-time notifications when events occur

Rate limits

The API allows up to 100 requests per minute per API key. If you exceed this, you will receive a 429 status code. Implement exponential backoff in your retry logic.

API keys authenticate your requests to the Paayed API. You need separate keys for testing and live transactions.

Where to find your keys

  1. Log in to your Paayed dashboard
  2. Go to Settings > API Keys
  3. You will see two key pairs: Sandbox (for testing) and Live (for real transactions)

Key types

  • Public key: Used on the client side (e.g., in your checkout form). Starts with pk_sandbox_ or pk_live_
  • Secret key: Used on the server side only. Starts with sk_sandbox_ or sk_live_. Never expose this in client-side code or commit it to version control.

Rotating keys

If a key is compromised, click Regenerate next to the key. The old key is immediately invalidated. Update your application with the new key before regenerating.

All API requests must include your secret key for authentication.

How to authenticate

Pass your secret key in the Authorization header using Bearer token format:

Authorization: Bearer sk_live_your_secret_key

Example request

A typical authenticated request looks like this:

POST /v1/payments with your Authorization header and a JSON body containing the payment details (amount, currency, source).

Security best practices

  • Store secret keys in environment variables, not in your codebase
  • Use your sandbox key for all development and testing
  • Restrict API key access to specific IP addresses in your dashboard settings
  • Rotate keys periodically and immediately if you suspect a leak

The sandbox environment lets you test your integration without processing real payments.

How sandbox works

Sandbox mirrors the live API exactly. Same endpoints, same request formats, same response structures. The only difference: no real money moves.

Test card numbers

  • 4000 0000 0000 0002: Successful payment
  • 4000 0000 0000 0010: Declined (insufficient funds)
  • 4000 0000 0000 0028: Declined (expired card)
  • 4000 0000 0000 0036: 3D Secure required

Use any future expiry date and any 3-digit CVV.

Switching to live

When you are ready to go live, replace your sandbox API keys with your live keys. No code changes are needed beyond the key swap.

Create a payment by sending a POST request to the payments endpoint.

Endpoint

POST /v1/payments

Required parameters

  • amount: The amount in the smallest currency unit (e.g., 5000 for GHS 50.00)
  • currency: Three-letter ISO currency code (e.g., GHS, NGN, USD)
  • source: The payment token from client-side card tokenisation
  • description: A note describing what the payment is for

Response

A successful request returns a payment object with a unique payment_id, the status (pending, successful, or failed), and a timestamp.

Idempotency

Include an Idempotency-Key header to prevent duplicate charges. If a request with the same key is sent again, the API returns the original response instead of creating a new payment.

Tokenisation lets you collect card details securely without them touching your server.

How it works

  1. Include the Paayed.js library on your checkout page
  2. Create a card input form using the Paayed Elements UI components
  3. When the customer submits, Paayed.js sends the card details directly to Paayed’s servers
  4. Paayed returns a one-time payment token
  5. Send the token to your server and use it in the payment API call

Why tokenisation matters

Card details never pass through your server, which significantly reduces your PCI compliance scope. You only need to complete SAQ A-EP instead of the full SAQ D.

Token expiry

Payment tokens expire after 15 minutes. If the token expires before you use it, ask the customer to re-enter their card details.

Webhooks notify your application in real time when events happen in your Paayed account.

Setting up webhooks

  1. Go to Settings > Webhooks in your dashboard
  2. Click Add Endpoint
  3. Enter your server URL (must be HTTPS)
  4. Select which events you want to receive

Available events

  • payment.successful: A payment was completed
  • payment.failed: A payment attempt failed
  • refund.created: A refund was issued
  • invoice.paid: An invoice was paid
  • subscription.renewed: A recurring payment was charged
  • payout.completed: Funds were settled to your bank

Verifying webhooks

Each webhook includes a X-Paayed-Signature header. Verify this signature using your webhook secret (found in your dashboard) to confirm the request came from Paayed and was not tampered with.

Retry policy

If your endpoint returns a non-2xx status, Paayed retries up to 5 times with exponential backoff over 24 hours.

Issue full or partial refunds on completed payments through the API.

Endpoint

POST /v1/refunds

Required parameters

  • payment_id: The ID of the original payment
  • amount: The refund amount (omit for a full refund)

Refund rules

  • Refunds can only be issued on payments with a successful status
  • Partial refunds are allowed. Multiple partial refunds can be issued until the total refunded equals the original amount.
  • Refunds are processed within 5 to 10 business days depending on the customer’s bank

Refund statuses

  • pending: Refund has been created and is being processed
  • successful: Funds have been returned to the customer
  • failed: The refund could not be processed (e.g., the original payment method is no longer valid)

Create, send, and manage invoices programmatically.

Creating an invoice

POST /v1/invoices

Include: customer_id, line items (description, quantity, unit price), due date, and currency.

Sending an invoice

After creating an invoice, send it to the customer:

POST /v1/invoices/{id}/send

The customer receives an email with a link to view and pay the invoice online.

Invoice statuses

  • draft: Created but not yet sent
  • sent: Delivered to the customer
  • viewed: The customer has opened the invoice
  • paid: Payment has been received
  • overdue: Past the due date with no payment

Automatic reminders

Enable automatic reminders in your invoice settings. Paayed sends reminders at 3 days before, on the due date, and 7 days after the due date.

Store and manage customer records for repeat billing and invoicing.

Creating a customer

POST /v1/customers

Include: name, email, and optionally phone and address.

Storing payment methods

Attach a tokenised card to a customer for future payments:

POST /v1/customers/{id}/payment_methods

This lets you charge the customer later without them re-entering their card details (useful for subscriptions and repeat invoices).

Customer operations

  • GET /v1/customers: List all customers with pagination
  • GET /v1/customers/{id}: Retrieve a single customer
  • PUT /v1/customers/{id}: Update customer details
  • DELETE /v1/customers/{id}: Remove a customer record
  • GET /v1/customers/{id}/payments: List all payments from a customer

Set up automatic recurring charges through the API.

Creating a subscription

POST /v1/subscriptions

Include: customer_id, amount, currency, interval (weekly, monthly, quarterly, annually), and start_date.

Managing subscriptions

  • GET /v1/subscriptions/{id}: Retrieve subscription details
  • PUT /v1/subscriptions/{id}: Update amount or interval
  • POST /v1/subscriptions/{id}/pause: Pause billing
  • POST /v1/subscriptions/{id}/resume: Resume billing
  • POST /v1/subscriptions/{id}/cancel: Cancel the subscription

Failed payment handling

If a recurring payment fails, the API retries after 3 and 7 days. A subscription.payment_failed webhook is sent for each failed attempt.

Hosted checkout is the fastest way to accept payments without building your own payment form.

How it works

  1. Create a checkout session via the API: POST /v1/checkout/sessions
  2. Include: amount, currency, success_url, cancel_url
  3. Redirect the customer to the returned checkout_url
  4. The customer enters their card details on Paayed’s secure page
  5. After payment, the customer is redirected to your success_url

Customisation

The hosted checkout page shows your business name and logo (pulled from your Paayed settings). You can also pass line item descriptions to display on the checkout page.

PCI benefits

Because card details are entered on Paayed’s page, your PCI scope is SAQ A (the simplest level).

Create shareable payment links programmatically.

Creating a payment link

POST /v1/payment_links

Include: amount, currency, description, and optional expiry_date.

Response

Returns a payment link object with a unique url that you can share with customers via email, SMS, or messaging apps.

Link behaviour

When the customer clicks the link, they see a Paayed-hosted payment page with the amount and description. After paying, they see a confirmation screen.

Tracking

Each payment link has a unique ID. When a payment is made through the link, the resulting transaction references the link ID, making it easy to track which link generated which payment.

Connect Paayed to Xero to sync invoices, payments, and settlements automatically.

Connecting

  1. Go to Settings > Integrations
  2. Click Connect Xero
  3. Log in to your Xero account and authorise Paayed
  4. Map your Paayed fee account and settlement account to Xero account codes

What syncs

  • Invoices: Created in Paayed, synced to Xero as sales invoices
  • Payments: Marked as paid in Xero when the customer pays
  • Settlements: Created as bank transactions in Xero
  • Fees: Recorded as expenses against your mapped fee account

Sync frequency

Data syncs every 15 minutes. You can also trigger a manual sync from the integrations page.

Connect Paayed to QuickBooks Online to keep your accounting records in sync.

Connecting

  1. Go to Settings > Integrations
  2. Click Connect QuickBooks
  3. Log in and authorise Paayed
  4. Map your income, fees, and settlement accounts

What syncs

  • Invoices sync as sales receipts or invoices in QuickBooks
  • Payments are matched automatically
  • Processing fees are recorded as expenses
  • Settlements appear as bank deposits

Reconciliation

With the integration active, bank reconciliation in QuickBooks is simplified. Each Paayed settlement matches a single bank deposit with all constituent transactions and fees pre-categorised.

Accept Paayed payments on your WooCommerce store with the official plugin.

Installation

  1. In your WordPress admin, go to Plugins > Add New
  2. Search for “Paayed for WooCommerce”
  3. Click Install and then Activate
  4. Go to WooCommerce > Settings > Payments > Paayed
  5. Enter your API keys (sandbox for testing, live for production)

Features

  • Card payments at checkout (Visa, Mastercard)
  • Apple Pay and Google Pay support
  • 3D Secure authentication
  • Automatic refunds from WooCommerce order page
  • Order status updates when payment succeeds or fails

Customisation

Configure the payment form title, description, and whether to capture payments immediately or authorise only.

Use Paayed as a payment provider on your Shopify store.

Setup

  1. In Shopify admin, go to Settings > Payments
  2. Under Third-party providers, search for Paayed
  3. Click Activate and enter your Paayed API keys
  4. Configure your preferences (capture mode, 3D Secure)

Checkout experience

Customers see Paayed as a payment option at checkout. Card details are collected via Paayed’s secure tokenisation, keeping your store PCI compliant.

Order sync

Successful payments update Shopify order status automatically. Refunds initiated in Shopify are processed through Paayed and reflected in your Paayed dashboard.

Common API error codes and how to resolve them.

HTTP status codes

  • 200 OK: Request succeeded
  • 400 Bad Request: Missing or invalid parameters. Check the error message for details.
  • 401 Unauthorized: Invalid or missing API key
  • 404 Not Found: The requested resource does not exist
  • 422 Unprocessable: The request was valid but could not be processed (e.g., refund exceeds payment amount)
  • 429 Too Many Requests: Rate limit exceeded. Wait and retry with backoff.
  • 500 Server Error: An error on Paayed’s side. Retry the request. If persistent, contact support.

Payment-specific errors

  • card_declined: The card was declined by the issuer
  • insufficient_funds: The card does not have enough balance
  • expired_card: The card has expired
  • invalid_cvv: The CVV does not match

The Paayed API uses versioning to ensure backward compatibility.

Current version

The current API version is v1. All endpoints are prefixed with /v1/.

Versioning policy

Breaking changes are introduced in new major versions only. Non-breaking changes (new fields, new endpoints) are added to the current version without notice.

Deprecation

When a new version is released, the previous version is supported for at least 12 months. Deprecation notices are sent via email and displayed in the dashboard.

Changelog

API changes are documented in the Changelog section of the API documentation at docs.paayed.com. Subscribe to the changelog RSS feed to receive updates automatically.