Active Products + Order + Status + Kode Bayar + Webhook

๐Ÿš€ Quick Start

Flow partner yang dipakai sekarang:

1) Ambil produk aktif user
2) Opsional: cek harga 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 URLhttps://cutiezy.id/zy-pay/api/h2h/# Auth HeaderX-H2H-Key: your_h2h_key# Ambil produk aktifcurl -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.

โœ… 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.

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": [ { "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
buyer_sku_codestringโœ…Kode produk
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 "buyer_sku_code=dana1" \ -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

POST /api/h2h/order.php
Partner boleh langsung order tanpa cek harga. Namun jika ingin memastikan harga terbaru, gunakan endpoint h2h-price.php terlebih dahulu.
FieldTypeRequiredDescription
buyer_sku_codestringโœ…Kode produk
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 "buyer_sku_code=dana1" \ -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" } ]}

๐Ÿงพ Postpaid Products

GET /api/h2h/postpaid-products.php

Endpoint ini digunakan untuk mengambil daftar layanan pascabayar. Produk postpaid digunakan untuk flow cek tagihan, bayar, lalu cek status.

Param Type Required Description
brand string โŒ Filter brand pascabayar.
kategori string โŒ Filter kategori pascabayar.
q string โŒ Cari berdasarkan kode, nama, brand, atau kategori.
limit integer โŒ Opsional. Tidak ada batas maksimal dari sisi zy-pay. Jika dikosongkan, endpoint tidak mengirim parameter limit ke pusat.
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" } ]}

๐Ÿ” Postpaid Check / Inquiry

POST /api/h2h/postpaid-check.php

Endpoint ini digunakan untuk cek tagihan pascabayar. Tahap ini belum memotong saldo dan belum membuat transaksi pembayaran.

Simpan inquiry_token dari response. Token tersebut dipakai untuk endpoint pembayaran postpaid-pay.php.
Field Type Required Description
buyer_sku_code string โœ… Kode produk pascabayar.
customer_no string โœ… Nomor pelanggan / ID pelanggan.
trx_no string โŒ ID inquiry dari partner. Jika kosong akan dibuat otomatis.
amount integer โŒ Opsional untuk produk tertentu yang membutuhkan nominal.
year integer โŒ Opsional untuk produk tertentu yang membutuhkan tahun.
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": "64-character-token", "trx_no": "TRXH2H-POST-0001", "buyer_sku_code": "plnpostpaid", "customer_no": "530000000001", "customer_name": "BUDI", "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": [] }}

๐Ÿ’ณ Postpaid Pay

POST /api/h2h/postpaid-pay.php

Endpoint ini digunakan untuk membayar tagihan dari hasil inquiry. Pembayaran hanya bisa dilakukan menggunakan inquiry_token yang masih aktif.

Jangan hit endpoint pay tanpa inquiry. Partner wajib cek tagihan dulu agar mendapatkan inquiry_token.
Field Type Required Description
inquiry_token string โœ… Token dari hasil postpaid-check.
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=64-character-token"
{ "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 }}

๐Ÿ“Œ Postpaid Status

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

Endpoint ini digunakan untuk mengecek status transaksi pascabayar berdasarkan trx_no.

Param / Field Type Required Description
trx_no string โœ… ID transaksi postpaid.
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 sukses", "data": { "result": true, "trxid": "TRXH2H-POST-0001", "status": "success" }}

๐Ÿท๏ธ 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;