Payments

Card Payments

Collect payments via credit and debit cards

Collect payments from customers using credit and debit cards. Customer is redirected to a secure checkout page to complete payment.

Supported Cards

  • Visa
  • Mastercard
  • Local debit cards

Create Payment

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

Request

{
  "payment_type": "card",
  "details": {
    "amount": 150000,
    "currency": "TZS",
    "redirect_url": "https://yoursite.com/payment/success",
    "cancel_url": "https://yoursite.com/payment/cancel"
  },
  "customer": {
    "firstname": "John",
    "lastname": "Doe",
    "email": "john@example.com",
    "address": "123 Main Street",
    "city": "Dar es Salaam",
    "state": "Dar es Salaam",
    "postcode": "12345",
    "country": "TZ"
  },
  "webhook_url": "https://yoursite.com/webhooks/snippe",
  "metadata": {
    "order_id": "ORD-12345"
  }
}

Response

{
  "status": 201,
  "data": {
    "object": "payment",
    "api_version": "2026-01-25",
    "reference": "pi_a1b2c3d4e5f6",
    "status": "pending",
    "amount": {
      "value": 150000,
      "currency": "TZS"
    },
    "settlement": {
      "gross": { "value": 150000, "currency": "TZS" },
      "fees": { "value": 4500, "currency": "TZS" },
      "net": { "value": 145500, "currency": "TZS" }
    },
    "channel": {
      "type": "card",
      "provider": null
    },
    "customer": {
      "name": "John Doe",
      "email": "john@example.com"
    },
    "urls": {
      "payment": "https://checkout.snippe.sh/pay/pi_a1b2c3d4e5f6",
      "redirect": "https://yoursite.com/payment/success",
      "cancel": "https://yoursite.com/payment/cancel"
    },
    "metadata": {
      "order_id": "ORD-12345"
    },
    "expires_at": "2026-01-24T11:00:00Z",
    "created_at": "2026-01-24T10:00:00Z"
  }
}

Request Parameters

Required Fields

FieldTypeDescription
payment_typestringMust be card
details.amountintegerAmount in smallest currency unit
details.currencystringCurrency code (TZS)

Customer Object (Required for Card)

FieldTypeDescription
firstnamestringCustomer first name
lastnamestringCustomer last name
emailstringCustomer email
addressstringBilling address
citystringBilling city
statestringBilling state/region
postcodestringPostal code
countrystringCountry code (ISO 3166-1 alpha-2)

How It Works

  1. You create a payment intent with customer billing details
  2. Redirect customer to the urls.payment URL
  3. Customer enters card details on secure checkout page
  4. Customer is redirected to your redirect_url or cancel_url
  5. Snippe sends a webhook notification with the result

On this page