BitPays Docs

Türkiye · Host-to-host integration

BitPays Türkiye API — HAVALE / TRY

Collect Turkish Lira (TRY) from your customers over HAVALE / EFT P2P bank transfer and pay out to any IBAN. You create an order server-to-server, we return a hosted checkout that shows the customer the exact account to transfer to, and we push a payment.success webhook the moment the transfer clears.

Production live Currency TRY ₺ Method BANK (HAVALE) Base api.bitpays.live
How the flow works Authenticate with API keys → POST /v1/payin/create with currency: "TRY", method: "BANK" → redirect the customer to the returned payment_url (our HAVALE checkout) → they transfer from their banking app → we confirm and fire payment.success with the utr. Everything below is copy-paste ready.
Turkey vs. India This guide is the Türkiye profile. Cards are not offered for Turkey — collections are HAVALE bank transfer only. For the India (INR / UPI) profile see the main API reference. Auth, webhooks, idempotency and disputes are identical across both.

Quickstart

Three calls take you from zero to a live HAVALE collection. These calls create real orders — there is no test mode, and staging is connected to live payment channels too.

1

Get your API keys

From the merchant dashboard → API Keys, copy your client_id (bp_live_…) and client_secret (sk_live_…). The secret is shown once — store it securely.

2

Exchange them for a bearer token

POST /v1/auth/token returns a JWT valid for 1 hour. Send it as Authorization: Bearer … on every other call.

3

Create your first HAVALE payment

POST /v1/payin/create with currency: "TRY" and method: "BANK" returns an order_id and a hosted payment_url. Send the customer there and wait for the webhook.

3 calls · cURL
# 1 — get a token
TOKEN=$(curl -s -X POST https://api.bitpays.live/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"client_id":"bp_live_...","client_secret":"sk_live_..."}' | jq -r .access_token)

# 2 — create a HAVALE collection for ₺500
curl -s -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: $(uuidgen)" \
  -d '{ "amount": 500, "currency": "TRY", "method": "BANK",
       "merchant_order_id": "TR-10001",
       "customer": { "name": "Ahmet Y" } }'

# 3 — redirect the customer to the returned payment_url

Environments

Staging is not a sandbox Staging is a pre-production environment connected to live payment channels. Transactions initiated in staging may move real money. Do not use staging for test payments or payouts.
Production
https://api.bitpays.live

Real money. Real HAVALE transfers clear to your settlement balance.

Staging (pre-production)
https://api.staging.bitpays.live

Same API surface with separate keys. Connected to live payment channels — transactions may move real money.

CurrencyTRY (Turkish Lira, symbol ₺)
Collection methodBANK — HAVALE / EFT P2P bank transfer (card / UPI not applicable to Turkey)
Path prefix/v1 on every endpoint
AmountsWhole TRY — 500 means ₺500. Per-merchant min/max apply (set in your dashboard)
Order lifetime30 minutes — enough time for the customer to complete a manual HAVALE transfer
Content typeapplication/json on all requests
ConsolesMerchant app.bitpays.live · Admin admin.bitpays.live (staging: *.staging.bitpays.live)

Authentication

All API calls are authenticated with a short-lived bearer JWT. Exchange your API keys for a token, then send that token on every request. Tokens live for 1 hour — call /v1/auth/token again (or /v1/auth/refresh) with the same keys to mint a new one.

POST/v1/auth/token
FieldTypeReq.Notes
client_idstringrequiredYour public key, bp_live_…
client_secretstringrequiredYour secret key, sk_live_…
Request
curl -X POST https://api.bitpays.live/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{ "client_id": "bp_live_...", "client_secret": "sk_live_..." }'

Response 200 OK

application/json
{ "access_token": "eyJhbGciOi...", "token_type": "Bearer", "expires_in": 3600 }

Send it on every other call as Authorization: Bearer {access_token}. Bad keys return 401 INVALID_CREDENTIALS; a suspended account returns 403 MERCHANT_SUSPENDED.


Create a payment (HAVALE collect)

Creates a HAVALE collection order in TRY and returns a hosted payment_url you present to the customer. The order expires 30 minutes after creation.

POST/v1/payin/create

Headers: Authorization: Bearer {token} · Content-Type: application/json · x-idempotency-key: {uuid} (recommended)

FieldTypeReq.Rules
amountintegerrequiredWhole TRY. Per-merchant min/max apply
currencystringrequiredMust be TRY for Turkey
methodenumrequiredBANK — HAVALE P2P (the only method for Turkey)
merchant_order_idstringoptional1–100 chars; your reference. Auto-generated if omitted
customerobjectoptionalname, email, phone — all optional
return_urlstringoptionalWhere to send the customer after checkout
metadataobjectoptional≤20 keys; string values ≤500 chars
Request
curl -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: 6f1a2c9e-..." \
  -d '{
    "merchant_order_id": "TR-10001",
    "amount": 500,
    "currency": "TRY",
    "method": "BANK",
    "customer": { "name": "Ahmet Y", "email": "ahmet@example.com" },
    "return_url": "https://shop.example.com/thanks"
  }'

Response 201 Created · 200 on idempotent replay

application/json
{
  "success": true,
  "order_id": "cms7549970004jx01ovs5zktn",
  "merchant_order_id": "TR-10001",
  "status": "pending",
  "amount": 500,
  "currency": "TRY",
  "payment_url": "https://api.bitpays.live/checkout/cms7549970004jx01ovs5zktn",
  "expires_at": "2026-07-30T12:30:00.000Z"
}

Redirect the customer to payment_url. Do not treat the create response as final — always wait for the payment.success webhook (or poll status).


The HAVALE checkout

The payment_url is a hosted, mobile-first checkout we render — you do not build it. When the customer opens it, they see:

Shown to the customerMeaning
Amount ₺500The exact amount to transfer
Recipient account / IBANThe account to send the HAVALE / EFT to (copy button)
Recipient nameThe account holder to enter as the beneficiary
Bank name (when provided)The receiving bank
Live status“Awaiting payment” → “Payment confirmed” once the transfer clears
Customer steps Open banking app → send a HAVALE/EFT of the exact amount to the shown account/IBAN → return to the page. We reconcile the incoming transfer automatically and mark the order success — no manual confirmation needed.
Return & polling After success we redirect to your return_url (if set). Regardless of the browser, the authoritative signal is the payment.success webhook — always credit the customer off the webhook or a status poll, never the redirect alone.

H2H — collect on your own checkout

Prefer to show the bank requisites on your own checkout page instead of redirecting to our hosted HAVALE page? Add "raw_requisites": true to the pay-in create call. We fetch the beneficiary bank details from the provider at creation and return them in a bank_transfer object on the response — no redirect needed. The hosted payment_url is still returned as a fallback.

POST/v1/payin/create

Same endpoint as Create a payment; just add raw_requisites. Applies to Türkiye HAVALE (currency: TRY, method: BANK).

Required: customer full name customer.name is mandatory for H2H and must contain a first and last name (two words), e.g. "Ahmet Yildiz". A missing or single-word name is rejected by the bank rail (error 9701): no bank_transfer is returned and the response falls back to a hosted payment_url. Also send method: "BANK" and, recommended, a stable metadata.account_id per customer.
Request
curl -X POST https://api.bitpays.live/v1/payin/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: {uuid}" \
  -d '{
    "merchant_order_id": "TR-10007",
    "amount": 500,
    "currency": "TRY",
    "method": "BANK",
    "raw_requisites": true,
    "customer": { "name": "Ahmet Yildiz" },
    "metadata": { "account_id": "your-stable-customer-id" }
  }'

customer.email and customer.phone are optional. We forward customer.name to the provider as fullName and metadata.account_id as accountId.

Response 201 Created

application/json
{
  "success": true,
  "order_id": "cms7549970004jx01ovs5zktn",
  "merchant_order_id": "TR-10007",
  "status": "pending",
  "amount": 500,
  "currency": "TRY",
  "payment_url": "https://api.bitpays.live/checkout/cms7549970004jx01ovs5zktn",
  "expires_at": "2026-08-27T15:30:00.000Z",
  "bank_transfer": {
    "beneficiary_iban": "TR33 0006 1005 1978 6457 8413 26",
    "beneficiary_name": "Ahmet Yildiz",
    "bank_name": "Ziraat Bankasi",
    "amount": 500,
    "currency": "TRY"
  }
}
bank_transfer fieldMeaning
beneficiary_ibanThe account / IBAN the customer must send the HAVALE to
beneficiary_nameThe account-holder name to enter as the recipient
bank_nameReceiving bank (when the provider supplies it — may be null)
amount / currencyThe exact amount to transfer (whole TRY)
Show these on your page Display the IBAN, recipient name and amount to your customer, then wait for the payment.success webhook (which carries the utr) to confirm — never credit off the page alone. The order still expires in 30 minutes.
Notes Pass a stable per-customer id via metadata.account_id for best reconciliation. If bank_transfer is omitted and only payment_url comes back, the provider rejected the order at creation — the most common cause is a missing or single-word customer.name; send a full first + last name and retry.

Payment status

Poll an order any time. Use it as a fallback to webhooks — never as the only signal for high-value flows.

GET/v1/payin/status/{order_id}
Request
curl https://api.bitpays.live/v1/payin/status/cms7549970004jx01ovs5zktn \
  -H "Authorization: Bearer {token}"

Response 200 OK

application/json
{
  "success": true,
  "order_id": "cms7549970004jx01ovs5zktn",
  "merchant_order_id": "TR-10001",
  "status": "success",
  "amount": 500,
  "currency": "TRY",
  "utr": "HVL240730AB12CD"
}

Webhooks

Configure a webhook URL in the dashboard → Webhooks. We POST a signed JSON event on every status change; the utr (bank reference) is included on success. Identical mechanics to the India profile.

EventWhen
payment.successHAVALE transfer cleared — includes utr
payment.failedPayment rejected / could not be reconciled
payment.expiredThe 30-minute window elapsed with no transfer
payout.success / payout.failedTerminal state of an IBAN payout
payment.success · POST to your endpoint
{
  "event": "payment.success",
  "delivery_id": "whd_9f3a...",
  "timestamp": "2026-07-30T12:12:40.000Z",
  "order_id": "cms7549970004jx01ovs5zktn",
  "merchant_order_id": "TR-10001",
  "status": "success",
  "amount": 500,
  "currency": "TRY",
  "utr": "HVL240730AB12CD"
}
Verify the signature Each delivery carries an HMAC signature header signed with your webhook secret. Verify it, then acknowledge with 2xx and process asynchronously. Treat events as at-least-once — dedupe on delivery_id. The full signing recipe is in the main reference → Verify signatures.

Payout to an IBAN

Disburse TRY to any Turkish IBAN. For Turkey, a bank payout needs the beneficiary name + iban — no IFSC/branch code.

POST/v1/payout/create

Headers: Authorization: Bearer {token} · Content-Type: application/json · x-idempotency-key: {uuid} (recommended)

FieldTypeReq.Rules
amountintegerrequiredWhole TRY
currencystringrequiredMust be TRY
methodenumrequiredBANK
beneficiary.namestringrequiredAccount holder name
beneficiary.ibanstringrequiredDestination IBAN (Turkey). IFSC is not used
merchant_payout_idstringoptionalYour reference; 1–100 chars
remarksstringoptional≤255 chars
metadataobjectoptionalFree-form JSON
Request
curl -X POST https://api.bitpays.live/v1/payout/create \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "x-idempotency-key: 7a2b-..." \
  -d '{
    "merchant_payout_id": "TRPO-5001",
    "amount": 750,
    "currency": "TRY",
    "method": "BANK",
    "beneficiary": {
      "name": "Ahmet Yilmaz",
      "iban": "TR330006100519786457841326"
    }
  }'

Response 201 Created

application/json
{
  "success": true,
  "order_id": "cms7payoutTR0001",
  "merchant_payout_id": "TRPO-5001",
  "status": "pending",
  "amount": 750,
  "currency": "TRY"
}

Payout status

GET/v1/payout/status/{order_id}
Request
curl https://api.bitpays.live/v1/payout/status/cms7payoutTR0001 \
  -H "Authorization: Bearer {token}"

Returns the current status and, once processed, processed_at. A payout.success / payout.failed webhook fires on the terminal state.


Disputes — raise a UTR query

If a customer says they sent the HAVALE but the order is still pending, submit the UTR (bank reference) for that transaction and we open a dispute. A payment screenshot is optional — when included we store it and return a signed document_url (valid ~7 days).

POST/v1/disputes
FieldTypeReq.Rules
utrstringrequiredThe bank UTR / HAVALE reference
payin_order_idstringone ofOur order_id for the transaction
transaction_refstringone ofYour merchant_order_id
screenshot_base64 / screenshot_urlstringoptionalPayment proof — base64/data: URI or a public URL (image/PDF, ≤10 MB)
amount, description, prioritymixedoptionalDefaults applied when omitted
Request
curl -X POST https://api.bitpays.live/v1/disputes \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "payin_order_id": "cms7549970004jx01ovs5zktn",
    "utr": "HVL240730AB12CD",
    "description": "Customer sent HAVALE but order still pending",
    "screenshot_base64": "data:image/png;base64,iVBORw0KGgo..."
  }'

Response 201 Created

application/json
{
  "success": true,
  "dispute_code": "DISPUTE-F6187697",
  "status": "OPEN",
  "utr": "HVL240730AB12CD",
  "document_url": "https://...s3.../proof.png?X-Amz-...",
  "document_expires_in": 604800
}

Track with GET /v1/disputes, GET /v1/disputes/{id}, and GET /v1/disputes/{id}/attachments/{attachmentId}/url. The dispute also appears in your dashboard and your linked Telegram group. Full reference: main docs → Disputes.


Order statuses

Pay-ins and payouts share one status set. On the wire they are lowercase.

StatusMeaning
created / pendingOrder made; awaiting the customer's HAVALE transfer
processingTransfer detected; reconciling
successCleared. utr populated; payment.success sent
failedRejected / could not be reconciled
expired30-minute window elapsed with no transfer
refunded / cancelledReversed or voided

Errors & limits

HTTPCodeCause
401INVALID_CREDENTIALSBad keys or expired token
403MERCHANT_SUSPENDED / IP_NOT_WHITELISTEDAccount inactive, or source IP not allowed
409IDEMPOTENCY_CONFLICT / DUPLICATE_ORDERReused key with a different payload, or reused merchant_order_id
422VALIDATION_ERRORMissing/invalid field (e.g. amount outside your min/max, non-TRY currency)
503PAYMENT_TEMPORARILY_UNAVAILABLENo provider capacity right now — retry shortly
Limits Amounts are whole TRY; per-merchant min/max are set in your dashboard. HAVALE orders live 30 minutes. The token endpoint is rate-limited to 20 requests / 60s. Send x-idempotency-key on every create and safely retry on network errors.
BitPays Türkiye Payments API · v1 · server-to-server (H2H). Collections via HAVALE / EFT P2P, payouts to IBAN. Amounts in whole TRY. Base URLs — production api.bitpays.live, staging api.staging.bitpays.live (pre-production, live payment channels). Keep API keys and webhook secrets server-side only. · India (INR) docs