Patungan
Bagi tagihan ke beberapa orang, sudah termasuk service charge dan pajak.
POST /api/v1/split-bill- Versi API
- v1
- Skema output
- 1
Path endpoint selalu /v1. Angka skema di bawah menandai bentuk output tool ini dan berubah terpisah.
Bikin akun gratis →Parameter
| Parameter | Tipe | Wajib | Default |
|---|---|---|---|
| total | number | tidak | 250000 |
| people | number | tidak | 4 |
| service | number | tidak | 0 |
| tax | number | tidak | 0 |
Request
curl -X POST https://sinikoding.dev/api/v1/split-bill \ -H 'content-type: application/json' \ -H 'x-api-key: tk_live_…' \ -d '{"total":250000,"people":4,"service":0,"tax":0}'
Mengembalikan
"output": { "kind": "table", "columns": ["…"], "rows": [["…"]] }
Memanggil endpoint sandbox same-origin, bukan /api/v1. Tanpa key, dibatasi 15 request per menit.
Request
curl -X POST https://sinikoding.dev/api/v1/split-bill \ -H 'content-type: application/json' \ -H 'x-api-key: tk_live_…' \ -d '{"total":"250000","people":"4","service":"0","tax":"0"}'
Response
Kirim request untuk melihat response-nya.