Payments

Dynamic QR

Collect payments via QR codes

Generate QR codes that customers scan with their mobile money app to complete payment.


Create Payment

POST /v1/payments
Authorization: Bearer <api_key>
Content-Type: application/json
Idempotency-Key: unique-request-id-123

Request

{
  "payment_type": "dynamic-qr",
  "details": {
    "amount": 50000,
    "currency": "TZS",
    "redirect_url": "https://yoursite.com/payment/success",
    "cancel_url": "https://yoursite.com/payment/cancel"
  },
  "phone_number": "+255712345678",
  "customer": {
    "firstname": "John",
    "lastname": "Doe",
    "email": "john@example.com"
  },
  "webhook_url": "https://yoursite.com/webhooks/snippe",
  "metadata": {
    "order_id": "ORD-12345",
    "product": "Premium Plan"
  }
}

Response

{
  "status": 201,
  "data": {
    "object": "payment",
    "api_version": "2026-01-25",
    "reference": "pi_a1b2c3d4e5f6",
    "status": "pending",
    "amount": {
      "value": 50000,
      "currency": "TZS"
    },
    "settlement": {
      "gross": { "value": 50000, "currency": "TZS" },
      "fees": { "value": 1000, "currency": "TZS" },
      "net": { "value": 49000, "currency": "TZS" }
    },
    "channel": {
      "type": "dynamic-qr",
      "provider": null
    },
    "customer": {
      "phone": "+255712345678",
      "name": "John Doe",
      "email": "john@example.com"
    },
    "urls": {
      "qr_code": "https://api.snippe.sh/qr/pi_a1b2c3d4e5f6.png"
    },
    "metadata": {
      "order_id": "ORD-12345",
      "product": "Premium Plan"
    },
    "expires_at": "2026-01-24T11:00:00Z",
    "created_at": "2026-01-24T10:00:00Z"
  }
}

Request Parameters

Required Fields

FieldTypeDescription
payment_typestringMust be dynamic-qr
details.amountintegerAmount in smallest currency unit
details.currencystringCurrency code (TZS)

Optional Fields

FieldTypeDescription
phone_numberstringCustomer phone number
customerobjectCustomer information
details.redirect_urlstringURL to redirect after success
details.cancel_urlstringURL to redirect on cancel
webhook_urlstringURL for webhook notifications
metadataobjectCustom key-value data (max 50 keys)

How It Works

  1. You create a payment intent
  2. Display the QR code from urls.qr_code to the customer
  3. Customer scans the QR code with their mobile money app
  4. Customer confirms payment in their app
  5. Snippe sends a webhook notification with the result

On this page