Retail
Inquiry Status
Cek status pembayaran Retail.
GET
/direct/v1/payment/status/:referenceCek status pembayaran Indomaret atau Alfamart.
Request
Tanpa body. Endpoint ini berlaku untuk VA, eWallet, QRIS, dan Retail.
Parameter path
| Parameter | Keterangan |
|---|---|
reference | Ganti :reference pada path dengan referensi saat membuat transaksi. |
Gunakan signature legacy v1 dan X-Timestamp (unix detik), berbeda dari endpoint Direct API lainnya. Canonical: body + ":" + timestamp; karena GET ini tanpa body, gunakan ":" + timestamp. Lihat Authentication.
TS=$(date +%s)
# Body kosong untuk GET — canonical = ":" + timestamp
SIG=$(printf ":%s" "$TS" | openssl dgst -sha256 -hmac "$SECRET_KEY" -hex | awk '{print $2}')
curl "${BASE_URL}/direct/v1/payment/status/INV-004" \
-H "X-Api-Key: byr_live_xxx" \
-H "X-Timestamp: $TS" \
-H "X-Signature: $SIG"import crypto from 'node:crypto';
const secret = process.env.SECRET_KEY;
const ts = Math.floor(Date.now() / 1000).toString();
const signature = crypto.createHmac('sha256', secret).update(':' + ts).digest('hex');
const res = await fetch(process.env.BASE_URL + '/direct/v1/payment/status/INV-004', {
headers: {
'X-Api-Key': 'byr_live_xxx',
'X-Timestamp': ts,
'X-Signature': signature,
},
});
console.log(await res.json());import hmac, hashlib, os, time, requests
secret = os.environ["SECRET_KEY"].encode()
ts = str(int(time.time()))
signature = hmac.new(secret, (":" + ts).encode(), hashlib.sha256).hexdigest()
res = requests.get(
os.environ["BASE_URL"] + "/direct/v1/payment/status/INV-004",
headers={
"X-Api-Key": "byr_live_xxx",
"X-Timestamp": ts,
"X-Signature": signature,
},
)
print(res.json())<?php
$secret = getenv('SECRET_KEY');
$ts = (string) time();
$signature = hash_hmac('sha256', ':' . $ts, $secret);
$ch = curl_init(getenv('BASE_URL') . '/direct/v1/payment/status/INV-004');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: byr_live_xxx',
'X-Timestamp: ' . $ts,
'X-Signature: ' . $signature,
],
]);
echo curl_exec($ch);package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"net/http"
"os"
"strconv"
"time"
)
func main() {
secret := os.Getenv("SECRET_KEY")
ts := strconv.FormatInt(time.Now().Unix(), 10)
mac := hmac.New(sha256.New, []byte(secret))
mac.Write([]byte(":" + ts))
sig := hex.EncodeToString(mac.Sum(nil))
req, _ := http.NewRequest("GET", os.Getenv("BASE_URL") + "/direct/v1/payment/status/INV-004", nil)
req.Header.Set("X-Api-Key", "byr_live_xxx")
req.Header.Set("X-Timestamp", ts)
req.Header.Set("X-Signature", sig)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(string(out))
}Response
| Field | Keterangan |
|---|---|
data.reference | Referensi transaksi yang dicek. |
data.status | pending, paid, expired, atau cancelled, sama seperti webhook. paid berarti pembeli sudah membayar tunai/debit di kasir. |
Field transaksi berada langsung di data, seperti pada respons create.
{
"success": true,
"messages": "Status transaksi",
"data": {
"reference": "INV-004",
"transaction_id": "VAR3T4I5L6C0P8N1M2",
"order_id": "INV-004",
"payment_method": "virtual_account",
"payment_channel": "INDOMARET",
"amount": 100000,
"currency": "IDR",
"customer_name": "Budi Santoso",
"customer_email": "[email protected]",
"va_number": "7701234567890",
"status": "paid",
"base_amount": 100000,
"merchant_fee": 0,
"net_credit": 100000,
"fee_bearer": "merchant",
"expired_at": 1767200400
}
}