API

Dokumentasi API GoFood Merchant

Endpoint untuk login, cek transaksi terbaru, dan membuat QRIS dinamis.

POST /api/login

Login menggunakan email dan password untuk mendapatkan access token.

POST /api/cek-transaksi

Ambil 20 transaksi terbaru dengan header Authorization Bearer.

POST /api/create-payment

Ubah QRIS statis menjadi dinamis berdasarkan jumlah.

1) Login

curl -X POST https://api-gopar-merch.vercel.app/api/login \
  -H "content-type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "your_password"
  }'
{
  "access_token": "eyJhbGciOi...",
  "refresh_token": "eyJhbGciOi...",
  "dbl_enabled": true
}

2) Cek transaksi terbaru

curl -X POST https://api-gopar-merch.vercel.app/api/cek-transaksi \
  -H "content-type: application/json" \
  -H "authorization: Bearer eyJhbGciOi..."
{
  "scrapedAt": "2026-01-12T10:00:00.000Z",
  "dateRange": "today",
  "totalCount": 20,
  "apiTotal": 20,
  "transactions": [
    {
      "tanggalWaktu": "2026-01-12T10:40:15Z",
      "idPesanan": "QRIS-04202601121040153l4zrADm9LID",
      "idReferensiGopay": "04202601121040153l4zrADm9LID",
      "tipePesanan": "GoFood",
      "tipePembayaran": "qris",
      "penjualanKotor": "Rp 25.000",
      "jumlah": 25000,
      "jumlahCents": 2500000,
      "status": "success",
      "issuer": "DANA",
      "merchantId": "G692242439"
    }
  ]
}
Jika ingin filter jumlah, kirim body {"jumlah":"25.500"}. Jika tidak ditemukan, API akan mengembalikan error "transaksi tidak ditemukan".

3) Create payment (QRIS dinamis)

curl -X POST https://api-gopar-merch.vercel.app/api/create-payment \
  -H "content-type: application/json" \
  -H "authorization: Bearer eyJhbGciOi..." \
  -d '{
    "jumlah": "25.500"
  }'
{
  "jumlah": "25500",
  "qris": "000201010212...",
  "qris_image": "https://api-gopar-merch.vercel.app/qris_string=000201010212..."
}