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.
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.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.
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.
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.
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.
# 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_urlEnvironments
Real money. Real HAVALE transfers clear to your settlement balance.
Same API surface with separate keys. Connected to live payment channels — transactions may move real money.
| Currency | TRY (Turkish Lira, symbol ₺) |
| Collection method | BANK — HAVALE / EFT P2P bank transfer (card / UPI not applicable to Turkey) |
| Path prefix | /v1 on every endpoint |
| Amounts | Whole TRY — 500 means ₺500. Per-merchant min/max apply (set in your dashboard) |
| Order lifetime | 30 minutes — enough time for the customer to complete a manual HAVALE transfer |
| Content type | application/json on all requests |
| Consoles | Merchant 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.
| Field | Type | Req. | Notes |
|---|---|---|---|
client_id | string | required | Your public key, bp_live_… |
client_secret | string | required | Your secret key, sk_live_… |
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
{ "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.
Headers: Authorization: Bearer {token} · Content-Type: application/json · x-idempotency-key: {uuid} (recommended)
| Field | Type | Req. | Rules |
|---|---|---|---|
amount | integer | required | Whole TRY. Per-merchant min/max apply |
currency | string | required | Must be TRY for Turkey |
method | enum | required | BANK — HAVALE P2P (the only method for Turkey) |
merchant_order_id | string | optional | 1–100 chars; your reference. Auto-generated if omitted |
customer | object | optional | name, email, phone — all optional |
return_url | string | optional | Where to send the customer after checkout |
metadata | object | optional | ≤20 keys; string values ≤500 chars |
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"
}'import { randomUUID } from "crypto";
const res = await fetch("https://api.bitpays.live/v1/payin/create", {
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json",
"x-idempotency-key": randomUUID(),
},
body: JSON.stringify({
merchant_order_id: "TR-10001",
amount: 500, currency: "TRY", method: "BANK",
customer: { name: "Ahmet Y" },
}),
});
const order = await res.json();
// → redirect the customer to order.payment_urlResponse 201 Created · 200 on idempotent replay
{
"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 customer | Meaning |
|---|---|
| Amount ₺500 | The exact amount to transfer |
| Recipient account / IBAN | The account to send the HAVALE / EFT to (copy button) |
| Recipient name | The account holder to enter as the beneficiary |
| Bank name (when provided) | The receiving bank |
| Live status | “Awaiting payment” → “Payment confirmed” once the transfer clears |
success — no manual confirmation needed.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.
Same endpoint as Create a payment; just add raw_requisites. Applies to Türkiye HAVALE (currency: TRY, method: BANK).
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.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
{
"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 field | Meaning |
|---|---|
beneficiary_iban | The account / IBAN the customer must send the HAVALE to |
beneficiary_name | The account-holder name to enter as the recipient |
bank_name | Receiving bank (when the provider supplies it — may be null) |
amount / currency | The exact amount to transfer (whole TRY) |
payment.success webhook (which carries the utr) to confirm — never credit off the page alone. The order still expires in 30 minutes.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.
curl https://api.bitpays.live/v1/payin/status/cms7549970004jx01ovs5zktn \
-H "Authorization: Bearer {token}"Response 200 OK
{
"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.
| Event | When |
|---|---|
payment.success | HAVALE transfer cleared — includes utr |
payment.failed | Payment rejected / could not be reconciled |
payment.expired | The 30-minute window elapsed with no transfer |
payout.success / payout.failed | Terminal state of an IBAN payout |
{
"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"
}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.
Headers: Authorization: Bearer {token} · Content-Type: application/json · x-idempotency-key: {uuid} (recommended)
| Field | Type | Req. | Rules |
|---|---|---|---|
amount | integer | required | Whole TRY |
currency | string | required | Must be TRY |
method | enum | required | BANK |
beneficiary.name | string | required | Account holder name |
beneficiary.iban | string | required | Destination IBAN (Turkey). IFSC is not used |
merchant_payout_id | string | optional | Your reference; 1–100 chars |
remarks | string | optional | ≤255 chars |
metadata | object | optional | Free-form JSON |
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
{
"success": true,
"order_id": "cms7payoutTR0001",
"merchant_payout_id": "TRPO-5001",
"status": "pending",
"amount": 750,
"currency": "TRY"
}Payout status
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).
| Field | Type | Req. | Rules |
|---|---|---|---|
utr | string | required | The bank UTR / HAVALE reference |
payin_order_id | string | one of | Our order_id for the transaction |
transaction_ref | string | one of | Your merchant_order_id |
screenshot_base64 / screenshot_url | string | optional | Payment proof — base64/data: URI or a public URL (image/PDF, ≤10 MB) |
amount, description, priority | mixed | optional | Defaults applied when omitted |
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
{
"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.
| Status | Meaning |
|---|---|
| created / pending | Order made; awaiting the customer's HAVALE transfer |
| processing | Transfer detected; reconciling |
| success | Cleared. utr populated; payment.success sent |
| failed | Rejected / could not be reconciled |
| expired | 30-minute window elapsed with no transfer |
| refunded / cancelled | Reversed or voided |
Errors & limits
| HTTP | Code | Cause |
|---|---|---|
| 401 | INVALID_CREDENTIALS | Bad keys or expired token |
| 403 | MERCHANT_SUSPENDED / IP_NOT_WHITELISTED | Account inactive, or source IP not allowed |
| 409 | IDEMPOTENCY_CONFLICT / DUPLICATE_ORDER | Reused key with a different payload, or reused merchant_order_id |
| 422 | VALIDATION_ERROR | Missing/invalid field (e.g. amount outside your min/max, non-TRY currency) |
| 503 | PAYMENT_TEMPORARILY_UNAVAILABLE | No provider capacity right now — retry shortly |
x-idempotency-key on every create and safely retry on network errors.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