PementekAPI Reference.

Build local payments and payouts through a consistent, versioned REST API designed for modern server-side integrations.

Use the Pementek API to create transactions, retrieve their current state and receive authoritative transaction updates through signed webhooks.

Base URLhttps://api.pementek.com/v1

Authentication

Pementek API requests must be authenticated using a valid merchant API key.

Send your credential in theAuthorization header using the Bearer authentication scheme.

Authorization: Bearer $PEMENTEK_API_KEY
API keys are private credentials. Never expose them in browser JavaScript, mobile applications, public source code or other client-controlled environments.

Request headers

Authenticated API requests should include the appropriate headers for authorization, request format and safe retries.

Authorization
Required

Merchant API credential using Bearer authentication.

Content-Type
Required for JSON requests

Use application/json when sending a JSON request body.

Idempotency-Key
Required for transaction creation

Provides safe retry behavior for the same logical transaction request.

Endpoints

The core Pementek API exposes consistent resources for payments and payouts.

POST/v1/payments

Create payment

Create a new local payment transaction for a customer.

GET/v1/payments/{payment_id}

Retrieve payment

Retrieve the latest state and details of an existing payment.

POST/v1/payouts

Create payout

Create a merchant-authorized local payout transaction.

GET/v1/payouts/{payout_id}

Retrieve payout

Retrieve the latest state and details of an existing payout.

Create a payment

POST/v1/payments

Create a payment transaction using your own unique merchant reference together with the amount, currency, country and local payment method.

Your merchant reference should identify the transaction in your own system and remain stable when retrying the same logical payment.

Example request

cURL

curl -X POST \
https://api.pementek.com/v1/payments \
-H "Authorization: Bearer $PEMENTEK_API_KEY" \
-H "Idempotency-Key: order-847291-payment-1" \
-H "Content-Type: application/json" \
-d '{
  "merchant_reference": "ORDER-847291",
  "amount": 1500,
  "currency": "BDT",
  "country": "BD",
  "payment_method": "BKASH"
}'

Example response

JSON

{
  "id": "pay_01JQ9AK8P6V4R2T7X5M3N1C9D",
  "merchant_reference": "ORDER-847291",
  "amount": 1500,
  "currency": "BDT",
  "country": "BD",
  "payment_method": "BKASH",
  "status": "CREATED",
  "created_at": "2026-10-09T14:32:11Z"
}

Payment request fields

merchant_referencestring

Your unique reference for the payment transaction.

amountnumber

The transaction amount according to the supported currency rules for the selected market.

currencystring

The supported transaction currency, such asBDT, PKR orINR.

countrystring

The ISO country code for the transaction market, such as BD, PK orIN.

payment_methodstring

The supported local payment method requested for the transaction.

Retrieve a payment

GET/v1/payments/{payment_id}

Retrieve the latest authoritative state of an existing payment using its Pementek payment identifier.

cURL

curl \
https://api.pementek.com/v1/payments/pay_01JQ9AK8P6V4R2T7X5M3N1C9D \
-H "Authorization: Bearer $PEMENTEK_API_KEY"

Create a payout

POST/v1/payouts

Create a payout after your own system has authorized the customer withdrawal or disbursement.

A payout should not be treated as completed until Pementek reports a verified final successful state.

cURL

curl -X POST \
https://api.pementek.com/v1/payouts \
-H "Authorization: Bearer $PEMENTEK_API_KEY" \
-H "Idempotency-Key: withdrawal-58271-payout-1" \
-H "Content-Type: application/json" \
-d '{
  "merchant_reference": "WITHDRAWAL-58271",
  "amount": 2500,
  "currency": "BDT",
  "country": "BD",
  "payment_method": "BKASH",
  "recipient": {
    "account": "CUSTOMER_ACCOUNT"
  }
}'

Idempotency

Financial API requests can be interrupted by network failures, connection timeouts or application restarts. Pementek uses idempotency keys to make supported transaction retries safer.

When retrying the same logical payment or payout request, reuse the original Idempotency-Key.

Do not generate a new idempotency key simply because your application did not receive the original API response. The transaction may already have been accepted.

Transaction status

Payments can move through asynchronous processing and verification states before reaching a final result.

CREATED

The transaction has been created and accepted by Pementek.

ROUTING

Pementek is preparing the transaction for processing.

WAITING_FOR_PROVIDER

The transaction is temporarily waiting for an available processing route.

VERIFYING

Pementek is verifying transaction evidence before determining a final result.

PENDING_RECONCILIATION

The transaction does not yet have enough definitive evidence for a final result and requires additional reconciliation.

SUCCESS

The transaction has been verified successfully and reached a final successful state.

FAILED

The transaction has reached a definitive unsuccessful final state.

PENDING_RECONCILIATION is not an automatic failure. It means that Pementek does not yet have enough definitive evidence to declare a final result.

Webhooks

Use signed Pementek webhooks to receive server-to-server transaction updates when important payment or payout state changes occur.

Your application should verify the webhook signature before processing the event.

Browser redirects and customer-side messages should not be used as authoritative proof that a transaction succeeded.

Read Webhook documentation→

Error responses

Pementek returns structured errors containing a stable error code, human-readable message and request identifier where available.

Example error

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "The request contains invalid fields.",
    "request_id": "req_01JQ9B4T6P2R8M7K5C1X3N9D"
  }
}
View Error Codes→

Integration principles

For reliable payment processing, merchant integrations should follow several important rules.

  • Keep API credentials on trusted server-side systems.
  • Use an idempotency key for supported transaction creation requests.
  • Store your merchant reference together with the Pementek transaction identifier.
  • Verify signed webhook events before processing them.
  • Treat intermediate transaction states as asynchronous processing rather than final failure.
  • Do not rely on browser redirects as proof of payment.
  • Retrieve the current transaction state before making an irreversible decision when the local state is uncertain.

Build with Pementek.

Use the Pementek API to integrate local payment and payout infrastructure through one consistent server-side interface.