Retail

Layanan untuk membuat Retail seperti Indomaret atau Alfamart.

Request Headers

Name
Desc
Note

X-CLIENT-ID

Nilai dari Client ID

Mandatory

X-CLIENT-SECRET

Nilai dari Client Secret

Mandatory

X-SIGNATURE

Hasil nilai signature yang telah dibuat sebelumnya

Mandatory

Request Body

Name
Desc
Note

partner_reference_number

Nomor referensi dari merchant dan bersifat Unik.

Mandatory

retail_code

Kode retail sesuai pada table

Mandatory

amount

Harus lebih besar dari 9999

Mandatory

expired

Format yyyyMMddHHiiss

Mandatory

remark

Catatan transaksi

Optional

customer_id

ID pelanggan dari merchant

Mandatory

customer_name

Nama pelanggan dari merchant

Mandatory

customer_email

Email pelanggan dari merchant

Mandatory

customer_phone

Nomor HP pelanggan dari merchant

Mandatory

redirect_url

URL untuk mengembalikan ke halaman tertentu jika status transaksi berhasil

Optional

callback_url

URL Callback mengembalikan data transaksi ke merchant (khusus untuk sandbox)

Optional

Contoh Kode dalam PHP:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api-sandbox.ipaymax.com/transaction/create/retail',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "partner_reference_number": "TRX12341232144",
    "bank_code": "ALFAMART",
    "amount": 10000,
    "expired": "20241102230000",
    "remark": "Coba kak",
    "customer_id": "31857118",
    "customer_name": "Sahabat Ipaymax",
    "customer_phone": "08123456789",
    "customer_email": "pay@ipaymax.com",
    "redirect_url": ""
}',
  CURLOPT_HTTPHEADER => array(
    'X-CLIENT-ID: 3346754028',
    'X-CLIENT-SECRET: sandbox-ipaymax',
    'X-SIGNATURE: dc1aeb9a2c16f235d47bae5a155d89e183059958b649ee6b59067d4656fecc9f',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Contoh Response Berhasil

{
    "responseCode": "00",
    "responseMessage": "OK",
    "responseData": {
        "reference_number": "REF987654",
        "partner_reference_number": "PARTNER456789",
        "bank_code": "ALFAMART",
        "bank_name": "ALFAMART",
        "amount": 100000,
        "expired_at": "2024-10-30 14:30:00",
        "status": "pending",
        "remark": "Payment for order",
        "redirect_url": "https://example.com/redirect",
        "customer_id": "12",
        "customer_name": "John Doe",
        "customer_phone": "+6281234567890",
        "customer_email": "johndoe@example.com",
        "checkout_url": "https://example.com/checkout"
    }
}

Contoh Response Gagal

{
    "responseCode": "99",
    "responseMessage": "An unexpected error occurred. Please try again later, or contact support if the issue persists."
}

List Kode Bank:

Nama
Kode

ALFAMART

ALFAMART

INDOMARET

INDOMARET

FAQ :

  • Minimal transaksi IDR 10000

  • Maksimum transaksi IDR 2.000.000.000

  • Transaksi berhasil jika responseCode berniali "00"

  • Transaksi gagal jika responseCode bernilai selain dari "00"

  • Status Transaksi : pending/success/failed

Last updated