POST
Report a payment or another customer event

Authorizations

Authorization
string
header
required

Authorization: Bearer vg_live_<32 hex characters>. Keys are issued by Mergen admins and shown once. Missing or invalid key: 401 unauthorized. Suspended account: 403 tenant_suspended.

Headers

Idempotency-Key
string

Optional, 1 to 64 characters, one per event (your payment id works well). The same key again answers 200 and changes nothing. Without it, event_id in the body deduplicates when sent.

Required string length: 1 - 64

Body

application/json

Send external_id or number (or both). Unknown fields are refused (422).

type
enum<string>
required
Available options:
payment,
already_paid,
dispute_resolved
external_id
string | null
Maximum string length: 128
number
string | null
amount_micros
integer | null

The amount paid (payment), INR micros.

Required range: x >= 0
at
string<date-time> | null

When it happened (default now).

campaign_id
string | null

Only this campaign's records, and the amount is credited to it (default every campaign that may still call).

event_id
string

Your id of the event; deduplicates like Idempotency-Key.

Required string length: 1 - 200

Response

The same event again (same Idempotency-Key or event_id); nothing changed.

The event as recorded. records lists every record it matched, with effect: closed (the record was pending and is now closed as paid), pending_close (the record is on a call and closes when the call ends) or none (nothing changed, for example a finished record or an event that is not a payment). duplicate is true when this is the same event again.

id
string
required

cev_ + 32 hex characters.

type
enum<string>
required
Available options:
payment,
already_paid,
dispute_resolved
external_id
string | null
required
number
string | null
required

E.164.

amount_micros
integer | null
required
at
string<date-time> | null
required
campaign_id
string | null
required
matched
integer
required

How many records the event matched.

Required range: x >= 0
records
object[]
required
duplicate
boolean
required
created_at
string<date-time>
required