# GoKios H2H API v1

Base URL: `https://your-domain.example/api/h2h`

## Authentication

`X-API-KEY`, `X-TIMESTAMP`, `X-SIGNATURE`.

Signature:
`HMAC-SHA256(api_key + "." + ref_id + "." + timestamp, api_secret)`

## cURL

```bash
API_KEY="gk_xxx"
API_SECRET="secret"
REF_ID="ORD-1001"
TS="$(date +%s)"
SIG="$(printf '%s' "$API_KEY.$REF_ID.$TS" | openssl dgst -sha256 -hmac "$API_SECRET" -hex | sed 's/^.* //')"

curl -X POST "https://your-domain.example/api/h2h/order.php" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $API_KEY" \
  -H "X-TIMESTAMP: $TS" \
  -H "X-SIGNATURE: $SIG" \
  -d '{"ref_id":"ORD-1001","buyer_sku_code":"xld25","customer_no":"087800001233"}'
```

## Status

`Pending`, `Success`, `Failed`.

`Pending` tidak boleh direfund hanya karena timeout jaringan. Tunggu webhook/status upstream.
