Txenka
Quick start

Documentation

The essentials to create and confirm your first payment through the Txenka API. A full reference is on the way — meanwhile, this covers the main flow.

Introduction Authentication Create a payment Confirm payment Payment methods Webhooks Errors Help

Introduction

The Txenka API is built around payment_intents — every payment you create and confirm. All requests and responses use JSON, and the base URL is https://api.txenka.com/v1.

Authentication

Every authenticated call uses your API key in the Authorization header. Find your key under Settings → API Keys in the dashboard — use txk_test_… to test without processing real money, and txk_live_… in production.

HTTP Header
Authorization: Bearer txk_test_8f2a3c9d1e...

Create a payment

A payment_intent represents a charge. Amounts are always in cents (2450 = 24.50 MZN).

curl -X POST https://api.txenka.com/v1/payment-intents \
  -H "Authorization: Bearer txk_test_8f2a3c9d1e..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 2450,
    "currency": "MZN",
    "payment_method": "mpesa",
    "customer_phone": "258840000000",
    "description": "Pedido #1042"
  }'
Response
{
  "object": "payment_intent",
  "id": "pi_01hx4k9…",
  "status": "requires_confirmation",
  "amount": 2450,
  "currency": "MZN",
  "payment_method": "mpesa"
}

Confirm the payment

Confirming triggers the request with the chosen method — for example, an STK push request on the customer's phone for M-Pesa/e-Mola.

curl -X POST https://api.txenka.com/v1/payment-intents/pi_01hx4k9…/confirm \
  -H "Authorization: Bearer txk_test_8f2a3c9d1e..."

The returned status can be processing (awaiting customer confirmation), succeeded or failed. For asynchronous methods, subscribe to a webhook to know when the state changes without polling the API.

Payment methods

mpesa M-Pesa — Vodacom mobile wallet
emola e-Mola — Movitel mobile wallet
card Card — Visa and Mastercard
bank_transfer Bank transfer

Webhooks

Configure an endpoint under Settings → Webhooks in the dashboard to receive an HTTP POST notification whenever a payment's status changes — without polling the API.

Main events

payment_intent.succeeded

The payment was confirmed successfully.

payment_intent.failed

The payment failed or was declined.

payment_intent.processing

Awaiting customer confirmation (e.g. STK push sent).

Errors

Errors always follow the same shape, with a stable code you can handle programmatically and a human-readable message.

Response
{
  "error": {
    "code": "payment_method_disabled",
    "message": "O método de pagamento 'mpesa' não está activo para esta conta."
  }
}

Need help integrating?

Our team answers technical questions about the API.

Talk to the team