Payment ยท PPOB ยท H2H โ€” mendukung product_id pendek untuk bot
H2H Diagnostic Tool

โšก Tes Koneksi & Cek IP Terblokir Server

Gunakan fitur ini untuk mengecek apakah server/VPS bot H2H Anda dapat menjangkau server Cutiezy atau terblokir firewall. Masukkan IP VPS/bot Anda untuk diuji.

*Jika dikosongkan, sistem otomatis menguji IP yang saat ini digunakan untuk menembak API (koneksi browser/perangkat Anda).
Status Blokir Server
Menunggu Pengujian...
IP Penembak (Caller)
-
IP penembak request API
IP yang Dicek (Target)
-
Target verifikasi
Latency / HTTP Code
-
โš ๏ธ PENTING UNTUK BOT / SERVER H2H:
Pengujian browser di atas hanya mengecek IP perangkat Anda saat ini. Bot H2H dan reseller script Anda dieksekusi dari server VPS / hosting Anda. Jika bot Anda gagal request atau timeout, yang terblokir firewall adalah IP VPS server bot Anda. Silakan uji langsung dari VPS dengan panduan di bawah:

๐Ÿ“ก Tes Koneksi dari Terminal SSH VPS / Server Bot

curl -i -s "https://cutiezy.id/zy-pay/api/ping.php"

๐Ÿ’ป Skrip Tes PHP cURL (Jalankan di Server VPS Bot Anda)

<?php
$ch = curl_init("https://cutiezy.id/zy-pay/api/ping.php");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 15,
    CURLOPT_SSL_VERIFYPEER => true
]);
$res = curl_exec($ch);
$http = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$err  = curl_error($ch);
curl_close($ch);

if ($err) {
    echo "โŒ KONEKSI GAGAL / TIMEOUT: " . $err . "\n";
    echo "Segera hubungi Admin WhatsApp Cutiezy untuk unblock IP VPS Anda.\n";
} elseif ($http === 403 || $http >= 400) {
    echo "โŒ KONEKSI DITOLAK / TERBLOKIR FIREWALL (HTTP $http):\n" . $res . "\n";
    echo "๐Ÿ‘‰ IP server Anda (" . ($_SERVER['SERVER_ADDR'] ?? 'server') . ") diblokir oleh Firewall Server. Segera kirimkan IP & Request ID di atas ke Admin WhatsApp Cutiezy untuk unblock.\n";
} else {
    echo "โœ… KONEKSI BERHASIL (HTTP $http):\n" . $res . "\n";
}
?>

โšก Skrip Tes JavaScript / Node.js (Panel Pterodactyl / Bot H2H / VPS)

// Skrip tes koneksi Node.js (Untuk Bot Panel Pterodactyl, Baileys, Discord, VPS)
// Pilihan A: Menggunakan Fetch (Node.js 18+ bawaan tanpa library luar)
async function testZyPayPing() {
  try {
    const res = await fetch("https://cutiezy.id/zy-pay/api/ping.php", {
      headers: { "Accept": "application/json" },
      signal: AbortSignal.timeout(15000)
    });
    const data = await res.json();
    console.log("โœ… KONEKSI BERHASIL (HTTP " + res.status + "):", data);
    console.log("๐Ÿ‘‰ IP Penembak Bot / Node Pterodactyl Anda:", data.ip_penembak || data.client_ip);
    console.log("๐Ÿ‘‰ Status Proteksi Server:", data.status_ip);
  } catch (err) {
    console.error("โŒ KONEKSI GAGAL / IP BOT DIBLOKIR FIREWALL:", err.message);
    console.error("๐Ÿ‘‰ Jika pakai Panel Pterodactyl, IP yang diblokir adalah IP Node server Pterodactyl Anda.");
    console.error("๐Ÿ‘‰ Segera kirimkan IP ke Admin WhatsApp Cutiezy untuk di-unblock.");
  }
}
testZyPayPing();

/* Pilihan B: Menggunakan Axios (npm i axios)
const axios = require('axios');
axios.get("https://cutiezy.id/zy-pay/api/ping.php", { timeout: 15000 })
  .then(res => console.log("โœ… KONEKSI SUKSES:", res.data))
  .catch(err => console.error("โŒ KONEKSI GAGAL / IP TERBLOKIR:", err.message));
*/

๐Ÿ Skrip Tes Python

import requests

try:
    res = requests.get("https://cutiezy.id/zy-pay/api/ping.php", timeout=15)
    print("Status HTTP:", res.status_code)
    print(res.json())
except Exception as e:
    print("โŒ KONEKSI GAGAL / IP TERBLOKIR:", e)
    print("Hubungi Admin WhatsApp Cutiezy untuk unblock IP server Anda.")
IP VPS Bot Anda Terblokir?

Cek IP VPS via curl -s ifconfig.me lalu kirimkan ke Admin WhatsApp Cutiezy untuk unblock seketika.

๐Ÿ’ฌ Chat Admin WhatsApp Unblock

๐Ÿš€ Quick Start

Flow partner yang dipakai sekarang:

1) Ambil produk aktif user dan simpan product_id untuk bot
2) Opsional: cek harga memakai product_id ke h2h-price.php
3) Order ke order.php
4) Cek status ke status.php
5) Untuk kode bayar: cek provider/menu โ†’ cek produk โ†’ generate kode_bayar โ†’ cek status
6) Opsional: terima webhook update status
# Base URL
https://cutiezy.id/zy-pay/api/h2h/

# Auth Header
X-H2H-Key: your_h2h_key

# Ambil produk aktif
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/products_active.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"

๐Ÿ” Authentication

Semua endpoint wajib memakai header:

X-H2H-Key: your_h2h_key
Jangan taruh H2H Key di frontend public. Gunakan backend / server-to-server.

๐Ÿ’ฐ Cek Saldo Cutiezy

Cek saldo dan status akun Cutiezy yang terhubung dengan akun H2H Anda (berdasarkan ID Card).

GET /api/h2h/balance.php
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/balance.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"

Contoh Response Sukses (200 OK):

{
  "success": true,
  "status": true,
  "message": "OK",
  "data": {
    "user_id": 1,
    "username": "johndoe",
    "cutiezy_connected": true,
    "cutiezy_card": "41680512",
    "cutiezy_username": "cutiezy_user",
    "cutiezy_name": "John Doe",
    "cutiezy_level": "Basic",
    "balance": 150000,
    "balance_formatted": "Rp 150.000",
    "currency": "IDR",
    "settlement_balance": 25000,
    "settlement_balance_formatted": "Rp 25.000"
  },
  "timestamp": "2026-09-15 05:30:00"
}

Contoh Response Belum Terhubung (400 Bad Request):

{
  "success": false,
  "error": "ID Card Cutiezy belum dihubungkan pada akun H2H ini. Hubungkan ID Card di menu Profile.",
  "timestamp": "2026-09-15 05:30:00"
}

โœ… Active Products

GET /api/h2h/products_active.php

Ambil daftar produk aktif milik user berdasarkan API key. Endpoint ini hanya menampilkan produk yang sudah diaktifkan untuk akun H2H tersebut.

ID Bot: field product_id / db_id adalah h2h_user_products.id milik user. Ini yang disarankan untuk bot karena pendek. Field code tetap tersedia untuk integrasi lama.
Param Type Required Description
type Optional string โŒ Filter tipe produk, contoh: e-money, game, pulsa.
kategori Optional string โŒ Filter kategori produk, contoh: Umum, MLG.
brand Optional string โŒ Filter brand/operator produk, contoh: DANA, OVO, Mobile Legends.
q Optional string โŒ Cari berdasarkan code, name, type, kategori, atau brand.
limit Optional integer โŒ Opsional. Tidak ada batas maksimal dari sisi zy-pay. Jika dikosongkan, endpoint mengirim semua produk yang cocok filter.
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/products_active.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/products_active.php?brand=DANA" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
{
  "success": true,
  "bridge": "zy-pay",
  "user": {
    "id": 2,
    "username": "wahyu"
  },
  "filters": {
    "type": "",
    "kategori": "",
    "brand": "DANA",
    "q": "",
    "limit": 100
  },
  "total": 2,
  "data": [
    {
      "id": 34115,
      "product_id": 34115,
      "db_id": 34115,
      "price_list_id": 812,
      "code": "dana1k",
      "name": "DANA 1.000",
      "type": "e-money",
      "kategori": "Umum",
      "brand": "DANA",
      "price": 1058,
      "base_price": 1058,
      "status": "available",
      "updated_at": "2026-04-25 10:11:58"
    }
  ]
}

๐Ÿ’ฐ Price Check

POST /api/h2h-price.php

Endpoint ini opsional. Partner boleh cek harga terlebih dahulu sebelum order, atau langsung order.

Catatan: h2h-price.php hanya untuk cek harga. Endpoint ini tidak membuat transaksi.
FieldTypeRequiredDescription
product_idintegerSalah satuID Bot lokal. Disarankan.
buyer_sku_code / codestringSalah satuKode produk untuk kompatibilitas lama
extrastringโŒOpsional: 0, 1, 2, atau 3. Default 0
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/h2h-price.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "product_id=34115" \
  -d "extra=0"
{
  "success": true,
  "bridge": "zy-pay",
  "code": "dana1",
  "extra": 0,
  "price": 1007,
  "selected": {
    "extra": 0,
    "price": 1007
  },
  "options": [
    {
      "extra": 0,
      "price": 1007
    },
    {
      "extra": 1,
      "price": 1010
    }
  ]
}

๐Ÿงพ Order (Khusus Prabayar / Prepaid)

POST /api/h2h/order.php
โš ๏ธ PERHATIAN KHUSUS PRODUK PASCABAYAR:
Endpoint /api/h2h/order.php ini HANYA untuk produk Prabayar (Prepaid) dengan nominal/harga tetap (pulsa, kuota, e-money, voucher game, dll).
Produk Pascabayar (PLN Pascabayar, BPJS Kesehatan, PDAM, Indihome/Telkom, HP Pascabayar, dll.) TIDAK BISA dipesan langsung melalui endpoint ini dan akan otomatis ditolak dengan status postpaid_flow_required.
Untuk produk pascabayar, Anda wajib mengikuti Alur Pre-Order 2 Langkah: Cek Tagihan / Inquiry terlebih dahulu di postpaid-check.php, lalu bayar menggunakan inquiry_token di postpaid-pay.php.
Partner boleh langsung order tanpa cek harga. Namun jika ingin memastikan harga terbaru, gunakan endpoint h2h-price.php terlebih dahulu.

Saat client memakai product_id, Zy-Pay hanya memakainya untuk lookup produk milik user. Request ke pusat tetap menggunakan buyer_sku_code asli.
FieldTypeRequiredDescription
product_idintegerSalah satuID Bot lokal dari products_active.php. Disarankan.
buyer_sku_code / codestringSalah satuKode produk, tetap didukung
customer_nostringโœ…Target / tujuan
trx_nostringโŒID transaksi partner. Jika kosong akan dibuat otomatis
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/order.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "product_id=34115" \
  -d "customer_no=089680810645" \
  -d "trx_no=TRXH2H-INV-0001"

๐Ÿ”Ž Status Check

GET /api/h2h/status.php

Ambil status transaksi terbaru dari pusat. Pencarian utama berdasarkan q atau wid.

ParamTypeRequiredDescription
q OptionalstringโŒCari berdasarkan WID/code/target/status/note
wid OptionalstringโŒCari exact/fuzzy berdasarkan WID
code OptionalstringโŒFilter code produk
limit OptionalintegerโŒOpsional. Tidak ada batas maksimal dari sisi zy-pay. Jika dikosongkan, semua status yang cocok dikirim.
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/status.php?q=TRXH2H-1776960677597" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
{
  "success": true,
  "source": "center_trx",
  "user": {
    "id": 2,
    "username": "wahyu"
  },
  "total": 1,
  "data": [
    {
      "wid": "TRXH2H-1776960677597",
      "code": "dana1",
      "customer_no": "089680810645",
      "product_name": "CEK DANA",
      "note": "nama:DNID NXX WAHXX HIDXXXX/nominal:1/admin:0/total:61/reff:-",
      "price": 7,
      "status": "success",
      "user": "Cutie-SVJ7JSF"
    }
  ]
}
PANDUAN ALUR PASCABAYAR

โšก Alur Pascabayar: Mekanisme Pre-Order (Cek Tagihan โž” Baru Bayar)

Produk Pascabayar (seperti PLN Pascabayar, BPJS Kesehatan, PDAM, Telkom/Indihome, HP Pascabayar, PBB, Multifinance, dll.) memiliki skema kerja yang berbeda total dari produk Prabayar (Prepaid).

๐ŸŸข Produk Prabayar (Prepaid)

  • Alur: 1 Langkah Langsung (Direct Order).
  • Nominal / Harga: Tetap & tercantum di katalog daftar harga.
  • Pemotongan Saldo: Saldo langsung terpotong saat hit /api/h2h/order.php.
  • Contoh: Pulsa reguler, Paket Data, Token Listrik PLN, Topup E-Money (Dana, Ovo, ShopeePay), Diamond Game.

๐Ÿ”ต Produk Pascabayar (Pre-Order 2-Langkah)

  • Alur: Wajib 2 Langkah (Inquiry / Cek Tagihan โž” Konfirmasi Bayar).
  • Nominal Tagihan: Dinamis sesuai pemakaian pelanggan, denda, dan periode bulan.
  • Pemotongan Saldo: TIDAK dipotong saat Cek Tagihan. Saldo baru dipotong saat hit postpaid-pay.php.
  • Contoh: Tagihan Listrik Bulanan (PLN Pascabayar), BPJS Kesehatan, PDAM Air Bersih, Indihome/Telkom.
๐Ÿ’ก Mengapa Pascabayar Wajib Pre-Order?
Karena tagihan pelanggan tidak bisa ditebak nominalnya sebelum dicek ke biller. Langkah inquiry memastikan nama pelanggan valid, rincian lembar tagihan akurat, dan memberi kesempatan bagi bot/aplikasi Anda untuk menampilkan jumlah bayar ke pembeli sebelum saldo dipotong.

๐Ÿ”„ Skema 3 Langkah Integrasi Pascabayar:

1๏ธโƒฃ Langkah 1 (Pre-Order / Cek Tagihan):
Kirim buyer_sku_code & customer_no ke POST /api/h2h/postpaid-check.php.
Zy-Pay akan merespon rincian tagihan (nama, periode, tagihan, admin, cashback, dll) serta sebuah inquiry_token.
โžก๏ธ SALDO BELUM DIPOTONG pada tahap ini.

2๏ธโƒฃ Langkah 2 (Bayar Tagihan / Payment):
Setelah pembeli mengonfirmasi, kirim inquiry_token ke POST /api/h2h/postpaid-pay.php.
โžก๏ธ Saldo akun Anda BARU DIPOTONG sebesar total tagihan bersih, dan transaksi diproses ke biller.

3๏ธโƒฃ Langkah 3 (Cek Status / Webhook):
Pantau status transaksi via GET /api/h2h/postpaid-status.php?trx_no=... atau tunggu Webhook otomatis.

๐Ÿงพ Postpaid Products

GET /api/h2h/postpaid-products.php

Endpoint ini digunakan untuk mengambil katalog layanan pascabayar yang tersedia. Gunakan buyer_sku_code dari endpoint ini untuk memanggil endpoint Cek Tagihan (Inquiry).

Param Type Required Description
brand string โŒ Filter brand pascabayar (misal: PLN, BPJS, PDAM).
kategori string โŒ Filter kategori pascabayar.
q string โŒ Cari berdasarkan kode, nama, brand, atau kategori.
limit integer โŒ Opsional pembatasan jumlah data yang dikembalikan.
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/postpaid-products.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
{
  "success": true,
  "bridge": "zy-pay",
  "type": "pascabayar",
  "total": 1,
  "data": [
    {
      "id": 1,
      "type": "pascabayar",
      "brand": "PLN",
      "kategori": "TAGIHAN LISTRIK",
      "buyer_sku_code": "plnpostpaid",
      "code": "plnpostpaid",
      "name": "PLN Pascabayar",
      "note": "",
      "status": "available"
    }
  ]
}

๐Ÿ” Langkah 1: Pre-Order / Cek Tagihan (Inquiry)

POST /api/h2h/postpaid-check.php

Endpoint ini digunakan untuk Pre-Order / Cek Tagihan pelanggan. Tahap ini BELUM memotong saldo dan belum melakukan pembayaran.

Penting: Simpan nilai inquiry_token dari respon. Token ini merupakan tiket pembayaran unik yang wajib dikirimkan ke endpoint postpaid-pay.php untuk mengeksekusi pelunasan tagihan.
Field Type Required Description
buyer_sku_code string โœ… Kode produk pascabayar (contoh: plnpostpaid, bpjspostpaid).
customer_no string โœ… Nomor pelanggan / ID pelanggan / nomor meter.
trx_no string โŒ ID inquiry unik dari partner. Jika kosong akan dibuatkan otomatis.
amount integer โŒ Opsional untuk produk tertentu yang membutuhkan nominal dinamis.
year integer โŒ Opsional untuk produk tertentu yang membutuhkan tahun (seperti PBB).
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/postpaid-check.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "buyer_sku_code=plnpostpaid" \
  -d "customer_no=530000000001" \
  -d "trx_no=TRXH2H-POST-0001"
{
  "success": true,
  "bridge": "zy-pay",
  "trx_no": "TRXH2H-POST-0001",
  "status": "available",
  "message": "Inquiry berhasil.",
  "data": {
    "can_pay": true,
    "inquiry_token": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2",
    "trx_no": "TRXH2H-POST-0001",
    "buyer_sku_code": "plnpostpaid",
    "customer_no": "530000000001",
    "customer_name": "BUDI SANTOSO",
    "service_name": "PLN Pascabayar",
    "brand": "PLN",
    "periode": "202606",
    "tagihan": 100000,
    "admin": 2500,
    "total": 102500,
    "cashback": 1000,
    "expired_at": "2026-06-03 23:59:59",
    "desc": [
      {
        "periode": "202606",
        "nilai_tagihan": 100000,
        "admin": 2500,
        "denda": 0
      }
    ]
  }
}

๐Ÿ’ณ Langkah 2: Bayar Tagihan (Pay / Eksekusi)

POST /api/h2h/postpaid-pay.php

Endpoint ini digunakan untuk membayar tagihan dari hasil Pre-Order Inquiry sebelumnya. Pembayaran hanya bisa dilakukan menggunakan inquiry_token yang masih aktif dan valid.

Perhatian: Pada pemanggilan endpoint inilah SALDO AKUN ANDA AKAN DIPOTONG. Jangan memanggil endpoint ini tanpa melakukan Cek Tagihan terlebih dahulu karena parameter inquiry_token bersifat wajib.
Field Type Required Description
inquiry_token string โœ… Token verifikasi yang didapatkan dari respon postpaid-check.php.
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/postpaid-pay.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "inquiry_token=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2"
{
  "success": true,
  "bridge": "zy-pay",
  "trx_no": "TRXH2H-POST-0001",
  "status": "processing",
  "price": 102500,
  "data": {
    "result": true,
    "message": "Pesanan pascabayar berhasil dibuat dan sedang diproses.",
    "trxid": "TRXH2H-POST-0001",
    "status": "processing",
    "price": 102500
  }
}

๐Ÿ“Œ Langkah 3: Cek Status Transaksi Pascabayar

GET /api/h2h/postpaid-status.php
POST /api/h2h/postpaid-status.php

Endpoint ini digunakan untuk mengecek status pemrosesan transaksi pascabayar secara realtime berdasarkan trx_no.

Param / Field Type Required Description
trx_no string โœ… ID transaksi pembayaran pascabayar (contoh: TRXH2H-POST-0001).
curl -X GET "https://cutiezy.id/zy-pay/api/h2h/postpaid-status.php?trx_no=TRXH2H-POST-0001" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
{
  "success": true,
  "bridge": "zy-pay",
  "trx_no": "TRXH2H-POST-0001",
  "status": "success",
  "message": "Transaksi berhasil.",
  "data": {
    "result": true,
    "trxid": "TRXH2H-POST-0001",
    "status": "success",
    "buyer_sku_code": "plnpostpaid",
    "customer_no": "530000000001",
    "service_name": "PLN Pascabayar",
    "price": 102500,
    "sn": "0123456789/PLN/LUNAS"
  }
}

๐Ÿท๏ธ Kode Bayar

Flow: Providers โ†’ Menu/Products โ†’ Order Kode Bayar โ†’ Status

Kode Bayar digunakan untuk menampilkan pilihan paket operator tertentu dan membuat kode_bayar yang dapat dipakai customer untuk menyelesaikan pembelian melalui channel operator. Endpoint ini hanya melewati bridge zy-pay; detail pusat, URL internal, API internal, dan response mentah tidak ditampilkan ke partner.

Provider/produk yang didokumentasikan: Tri Cuanmax, Telkomsel Omni, XL Axis Cuanku, ByU Promo, dan Indosat OnlyFor4U. Gunakan nilai provider sesuai tabel provider di bawah.
Brand / Program Nilai provider Catatan
Tri Cuanmax TRI Gunakan nomor Tri. Menu dapat berisi PASTI_UNTUNG, PAKET, TLP SMS, GAME, dan PULSA.
Telkomsel Omni TELKOMSEL Gunakan nomor Telkomsel. Jika provider belum membuka order, gunakan endpoint products untuk cek menu/paket terlebih dahulu.
XL Axis Cuanku XL Gunakan nomor XL/Axis sesuai produk yang muncul dari menu.
ByU Promo BYU Gunakan nomor ByU.
Indosat OnlyFor4U INDOSAT Gunakan nomor Indosat/IM3.

๐Ÿ“ก Kode Bayar Providers

GET /api/h2h/kodebayar-providers.php

Endpoint ini digunakan untuk melihat provider kode bayar yang tersedia di bridge. Response hanya menampilkan kode provider dan label aman untuk partner.

curl -X GET "https://cutiezy.id/zy-pay/api/h2h/kodebayar-providers.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json"
{
  "success": true,
  "bridge": "zy-pay",
  "type": "kode-bayar",
  "total": 5,
  "data": [
    {
      "provider": "TRI",
      "name": "Tri Cuanmax"
    },
    {
      "provider": "TELKOMSEL",
      "name": "Telkomsel Omni"
    },
    {
      "provider": "XL",
      "name": "XL Axis Cuanku"
    },
    {
      "provider": "BYU",
      "name": "ByU Promo"
    },
    {
      "provider": "INDOSAT",
      "name": "Indosat OnlyFor4U"
    }
  ]
}

๐Ÿ“ฆ Kode Bayar Products

POST /api/h2h/kodebayar-products.php

Endpoint ini memiliki dua fungsi. Jika jenis kosong, response berisi menu/jenis produk. Jika jenis diisi dari menu, response berisi daftar produk/paket yang bisa dipilih.

FieldTypeRequiredDescription
providerstringโœ…Contoh: TRI, TELKOMSEL, XL, BYU, INDOSAT.
customer_nostringโœ…Nomor pelanggan/operator yang ingin dicek.
jenisstringโŒDiisi setelah mendapatkan menu. Contoh untuk Tri: PASTI_UNTUNG.
noreffstringโŒNomor referensi dari menu bila tersedia. Jika kosong, boleh dikosongkan.

Step 1: Ambil Menu / Jenis Produk

curl -X POST "https://cutiezy.id/zy-pay/api/h2h/kodebayar-products.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "provider=TRI" \
  -d "customer_no=089680810645"
{
  "success": true,
  "bridge": "zy-pay",
  "type": "kode-bayar",
  "step": "menu",
  "provider": "TRI",
  "customer_no": "089680810645",
  "total": 5,
  "data": [
    {
      "jenis": "PASTI_UNTUNG",
      "name": "PASTI UNTUNG",
      "noreff": ""
    },
    {
      "jenis": "RITA_PACKAGE",
      "name": "PAKET",
      "noreff": ""
    },
    {
      "jenis": "RITA_BILLING_PACKAGE",
      "name": "TLP SMS",
      "noreff": ""
    },
    {
      "jenis": "VAS_PRODUCTS",
      "name": "GAME",
      "noreff": ""
    },
    {
      "jenis": "RITA_TOPUP",
      "name": "PULSA",
      "noreff": ""
    }
  ]
}

Step 2: Ambil Produk / Paket dari Menu

Untuk kode produk yang mengandung karakter +, /, atau =, gunakan --data-urlencode saat order agar code tidak rusak.
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/kodebayar-products.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "provider=TRI" \
  -d "customer_no=089680810645" \
  -d "jenis=PASTI_UNTUNG" \
  -d "noreff="
{
  "success": true,
  "bridge": "zy-pay",
  "type": "kode-bayar",
  "step": "products",
  "provider": "TRI",
  "customer_no": "089680810645",
  "jenis": "PASTI_UNTUNG",
  "total": 1,
  "data": [
    {
      "code": "op7LvQyigwygWKrnUYAx8HhDZDQ2RU9iWDd0Sy9Ba2prMmx6Nnc9PQ==",
      "name": "8GB 3hari",
      "price": 13000,
      "kategori": "PASTI UNTUNG",
      "masa_aktif": "3",
      "description": "Kuota 8GB 3hari",
      "detail": [
        {
          "nama": "Kuota bisa digunakan di semua area",
          "kuota": "",
          "masa_aktif": ""
        }
      ]
    }
  ]
}

๐Ÿงพ Kode Bayar Order

POST /api/h2h/kodebayar-order.php

Endpoint ini digunakan untuk membuat atau menampilkan kode_bayar berdasarkan produk yang dipilih dari kodebayar-products.php.

FieldTypeRequiredDescription
providerstringโœ…Provider kode bayar.
customer_nostringโœ…Nomor pelanggan/operator.
jenisstringโœ…Jenis/menu dari step menu.
codestringโœ…Kode produk dari step products. Untuk base64 gunakan --data-urlencode.
noreffstringโŒNomor referensi jika ada dari menu.
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/kodebayar-order.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "provider=TRI" \
  -d "customer_no=089680810645" \
  -d "jenis=PASTI_UNTUNG" \
  --data-urlencode "code=op7LvQyigwygWKrnUYAx8HhDZDQ2RU9iWDd0Sy9Ba2prMmx6Nnc9PQ==" \
  -d "noreff="
{
  "success": true,
  "bridge": "zy-pay",
  "message": "Kode bayar berhasil dibuat",
  "provider": "TRI",
  "customer_no": "089680810645",
  "jenis": "PASTI_UNTUNG",
  "code": "op7LvQyigwygWKrnUYAx8HhDZDQ2RU9iWDd0Sy9Ba2prMmx6Nnc9PQ==",
  "kode_bayar": "1234567890",
  "noreff": "",
  "status_text": "Sukses"
}

๐Ÿ”Ž Kode Bayar Status

GET /api/h2h/kodebayar-status.php
POST /api/h2h/kodebayar-status.php

Endpoint ini digunakan untuk mengecek status kode_bayar atau nomor referensi yang sudah dibuat. Gunakan sesuai data yang dikembalikan dari endpoint order.

Param / FieldTypeRequiredDescription
providerstringโœ…Provider kode bayar.
customer_nostringโŒNomor pelanggan/operator, jika dibutuhkan.
kode_bayarstringโœ…/โŒKode bayar dari response order. Wajib jika tidak memakai noreff.
noreffstringโœ…/โŒNomor referensi. Wajib jika tidak memakai kode_bayar.
curl -X POST "https://cutiezy.id/zy-pay/api/h2h/kodebayar-status.php" \
  -H "X-H2H-Key: your_h2h_key" \
  -H "Accept: application/json" \
  -d "provider=TRI" \
  -d "customer_no=089680810645" \
  -d "kode_bayar=1234567890"
{
  "success": true,
  "bridge": "zy-pay",
  "provider": "TRI",
  "customer_no": "089680810645",
  "kode_bayar": "1234567890",
  "status": "success",
  "message": "Kode bayar aktif"
}

๐Ÿ”„ Webhooks

Webhook dipakai untuk menerima update status transaksi secara otomatis tanpa polling manual.

Webhook dikirim ke users.webhook_h2h_url jika:
- webhook_h2h_enabled = 1
- status transaksi berubah
- bridge sync mendeteksi perubahan

Headers

HeaderDescription
Content-Typeapplication/json
X-H2H-SignatureHMAC SHA256 dari raw body menggunakan webhook_h2h_secret

Payload Example

{
  "event": "trx_status_update",
  "wid": "TRXH2H-1776960677597",
  "code": "dana1",
  "target": "089680810645",
  "status": "success",
  "price": 7,
  "product_name": "CEK DANA",
  "updated_at": "2026-04-23 23:59:00"
}

Verify Signature (PHP)

<?php
$secret = 'your_webhook_secret';
$raw = file_get_contents('php://input');
$sig = $_SERVER['HTTP_X_H2H_SIGNATURE'] ?? '';

$expected = hash_hmac('sha256', $raw, $secret);

if (!hash_equals($expected, $sig)) {
  http_response_code(401);
  echo json_encode(['ok'=>false,'error'=>'INVALID_SIGNATURE']);
  exit;
}

http_response_code(200);
echo json_encode(['ok'=>true]);

Webhook Test Manual

RAW='{"event":"trx_status_update","wid":"TRXH2H-TEST-001","code":"dana1","target":"089680810645","status":"success","price":7,"product_name":"CEK DANA","updated_at":"2026-04-23 23:59:00"}'
SIG=$(php -r "echo hash_hmac('sha256', '$RAW', 'your_webhook_secret');")

curl -X POST "https://your-domain.com/webhook-receiver.php" \
  -H "Content-Type: application/json" \
  -H "X-H2H-Signature: $SIG" \
  -d "$RAW"

โšก Examples

PHP: Ambil Produk Aktif

<?php
$h2hKey = 'your_h2h_key';
$url = 'https://cutiezy.id/zy-pay/api/h2h/products_active.php';

$ch = curl_init($url);
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "X-H2H-Key: $h2hKey",
    "Accept: application/json"
  ],
  CURLOPT_TIMEOUT => 25,
  CURLOPT_SSL_VERIFYPEER => false,
  CURLOPT_SSL_VERIFYHOST => false
]);

$resp = curl_exec($ch);
curl_close($ch);

echo $resp;

PHP: Cek Status

<?php
$h2hKey = 'your_h2h_key';
$q = 'TRXH2H-1776960677597';
$url = 'https://cutiezy.id/zy-pay/api/h2h/status.php?q=' . urlencode($q);

$ch = curl_init($url);
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    "X-H2H-Key: $h2hKey",
    "Accept: application/json"
  ],
  CURLOPT_TIMEOUT => 25,
  CURLOPT_SSL_VERIFYPEER => false,
  CURLOPT_SSL_VERIFYHOST => false
]);

$resp = curl_exec($ch);
curl_close($ch);

echo $resp;