Object schemas
Wire API-ийн бүх объектын талбарын бүтэц — нэг хуудсанд.
API-ийн буцаадаг болон хүлээж авдаг бүх объектын талбарын бүтэц — нийт
23 объект. Заавал баганын ✓ нь тухайн талбар заавал байхыг заана.
Хүсэлт, хариу бүрийн бодит жишээг API reference-ийн endpoint
хуудсаас үз.
Envelope of every paginated list.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
object | "list" | ✓ | Always list. |
url | string | ✓ | The path this list was read from. |
has_more | boolean | ✓ | true when more objects exist after this page — request again with starting_after = the last id. |
Returned by delete endpoints.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Id of the deleted object. |
object | string | | Type of the deleted object (webhook_endpoint, operator_connection). |
deleted | true | | Always true. |
Error envelope returned with every non-2xx status.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
error | object | | |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
amount | integer | ✓ | Amount to collect in MNT — whole tögrög, no fractional part (15000 = 15,000 ₮). 1 to 1,000,000,000. An operator may enforce its own minimum. |
currency | "MNT" | | Currency. Only MNT is supported; omit it or send MNT. |
description | string | | Transaction description shown to the payer (e.g. on the invoice / bank statement). Optional; at most 500 bytes (UTF-8 — Cyrillic letters take 2 bytes each). |
automatic_operator | boolean | | true (default): at confirm, Wire routes to the best eligible operator. false: the first entry of allowed_operators is used unless /confirm names an operator — so with false you must send allowed_operators or an explicit operator. |
allowed_operators | string[] | | Optional. Restricts which operators may be used for this intent. Omit it to allow every operator switched on for your project (recommended). Values are operator ids enabled on your account, as shown on the dashboard's Connectors page. An unknown id → 400 operator_unknown with param allowed_operators[i] naming the offending value; more than 10 entries is also refused. |
metadata | object | | Your own key/value strings (e.g. your order id), returned on every read. Up to 50 keys; keys 1–40 characters; values up to 500 characters. Violations → 400 metadata_invalid. |
Optional body for confirm. An empty body (or no body) is valid.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
operator | string | | Operator id to use. Optional — when omitted, routing (or the first allowed_operators entry) decides. Must be in allowed_operators if that list is set. |
return_url | string | | Where the operator should send the buyer after a redirect-type payment. Passed to the operator; ignored by operators that don't redirect. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix pi_. |
object | "payment_intent" | | Always payment_intent. |
amount | integer | | Amount in MNT (whole tögrög). |
currency | string | | Always MNT. |
description | string | | Transaction description shown to the payer. Empty string when not set. |
status | "new" | "requires_payment_method" | "requires_action" | "requires_capture" | "processing" | "succeeded" | "canceled" | | - requires_payment_method — created, waiting to be confirmed (initial state; also returned to after a failed attempt). - requires_action — confirmed; the buyer must act on next_action (scan the QR, approve in a bank app, follow a redirect). - processing — the operator reported the payment; settling. - succeeded — paid. Final. - canceled — canceled by you or expired unpaid. Final. - requires_capture, new — reserved; not produced by current operators. |
client_secret | string | | Random secret generated for the intent (cs_…). Not needed by any /v1 call; do not expose it publicly. |
automatic_operator | boolean | | Whether routing chooses the operator at confirm (see PaymentIntentCreate). |
allowed_operators | string[] | | The operator restriction you set; [] means every operator enabled on the project. |
selected_operator | string | null | | The operator chosen at confirm; null until confirmed. |
next_action | object | | What the buyer must do next. Set when status is requires_action, otherwise null. |
metadata | object | | Your key/value strings; {} when none. |
livemode | boolean | | Always true on this API (the object was created with a live key). |
created | integer | | Creation time, Unix seconds (UTC). |
expires_at | integer | null | | When an unpaid intent expires, Unix seconds (UTC). By default 10 minutes after creation; confirm may replace it with the operator invoice's own expiry. Expired unpaid intents are canceled automatically. |
Operator-agnostic instruction for the buyer. Read type, then the field of the same name.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
type | "qr" | "redirect_to_url" | "loan_app" | "loan_credit_decision" | "poll" | ✓ | - qr — show qr.text as a QR code (or qr.image_url), and offer qr.deeplinks on mobile. - redirect_to_url — send the buyer to redirect_to_url.url. - loan_app — open loan_app.deeplink in the lender's app. - loan_credit_decision — the lender is deciding; just wait. - poll — nothing to show; wait for the result. |
qr | object | | |
redirect_to_url | object | | |
loan_app | object | | |
loan_credit_decision | object | | |
poll | object | | |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
payment_intent | string | ✓ | Id of a PaymentIntent in requires_payment_method (pi_…). |
success_url | string | | Optional. Absolute http(s) URL the buyer returns to after paying. Omit it to show Wire's own completion screen. |
cancel_url | string | | Optional. Absolute http(s) URL the buyer returns to if they abandon the payment. |
allowed_operators | string[] | | Optional. Operator ids to offer on this page; defaults to the intent's allowed_operators, else every operator enabled on the project. Operators without an active connection on the project are never shown. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix cs_. |
object | "checkout_session" | | Always checkout_session. |
payment_intent | string | | The PaymentIntent this page collects. |
status | "open" | "complete" | "expired" | | open — buyer can pay; complete — the intent was paid; expired — the intent expired before payment. |
url | string | | The hosted payment page. Redirect the buyer here. |
success_url | string | | As sent; empty string when not set. |
cancel_url | string | | As sent; empty string when not set. |
allowed_operators | string[] | | As sent; [] when not set. |
created | integer | | Creation time, Unix seconds (UTC). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix ch_. |
object | "charge" | | Always charge. |
payment_intent | string | | The PaymentIntent this charge belongs to. |
operator | string | | Id of the operator that handled the charge. |
operator_charge_id | string | null | | The operator's own reference for this payment (invoice id). Use it when talking to the operator. |
status | "pending" | "succeeded" | "failed" | | pending — waiting for the buyer; succeeded — paid (final); failed — not paid (final). |
amount | integer | | Amount in MNT (whole tögrög). |
fee | integer | | Fee in MNT recorded on this charge. Currently always 0 — operator fees are not reported through this field. |
amount_refunded | integer | | MNT already refunded or reserved by refunds in progress (including manual_required). Refundable remainder = amount − amount_refunded. |
failure_code | string | null | | Why the charge failed; null unless failed. |
failure_message | string | null | | Human-readable failure reason; null unless failed. |
livemode | boolean | | Always true on this API. |
created | integer | | Creation time, Unix seconds (UTC). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
charge | string | ✓ | The succeeded charge to refund (ch_…). Find it with GET /v1/charges?payment_intent=pi_…. |
amount | integer | | MNT to refund. Omit for the full remaining amount. Must not exceed amount − amount_refunded of the charge. |
reason | string | | Optional free-text reason, at most 500 bytes. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix re_. |
object | "refund" | | Always refund. |
charge | string | | The refunded charge. |
amount | integer | | Refunded amount in MNT. |
reason | string | null | | The reason you sent; null when none. |
status | "pending" | "succeeded" | "failed" | "manual_required" | | - succeeded — money returned through the operator. - manual_required — the operator does not support API refunds; recorded and completed by Wire operations outside the API. - pending — accepted by the operator, not finished. - failed — the operator refused; the reserved amount was released. |
operator_refund_id | string | null | | The operator's reference for the refund; null when none. |
livemode | boolean | | Always true on this API. |
created | integer | | Creation time, Unix seconds (UTC). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix evt_. Deduplicate webhook deliveries on it. |
object | "event" | | Always event. |
type | "payment_intent.succeeded" | "payment_intent.payment_failed" | "payment_intent.canceled" | "charge.refunded" | | What happened. See the Webhooks section for each type's data. |
api_version | string | | API version the payload was built with. |
data | EventData | | |
livemode | boolean | | Always true on this API. |
created | integer | | When the event happened, Unix seconds (UTC). |
Snapshot of the affected object. For payment_intent.* events:
id, object (payment_intent), status, amount, currency,
and charge (not on payment_intent.canceled). For
charge.refunded: id (refund), object (refund), charge,
amount, status, refunded_total.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Id of the PaymentIntent (pi_…) or Refund (re_…). |
object | "payment_intent" | "refund" | | Type of id. |
status | string | | The object's status when the event happened. |
amount | integer | | PaymentIntent amount, or refunded amount, in MNT. |
currency | string | | MNT (payment_intent events only). |
charge | string | | The related charge (ch_…). Absent on payment_intent.canceled. |
refunded_total | integer | | Charge's total refunded MNT so far (charge.refunded only). |
Body Wire POSTs to your webhook endpoint. Signed with the
WirePayment-Signature: t=<unix>,v1=<hex> header —
v1 = hex(HMAC_SHA256(whsec_secret, t + "." + raw_body)). Verify
against the raw bytes before parsing.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | ✓ | Event id (evt_…) — same as GET /v1/events/{id}. |
object | "event" | ✓ | Always event. |
type | string | ✓ | Event type. |
created | integer | ✓ | When the event happened, Unix seconds (UTC). |
data | EventData | ✓ | |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
url | string | ✓ | Public http(s) URL that receives events. Not localhost or a private / loopback IP. |
enabled_events | "*" | "payment_intent.succeeded" | "payment_intent.payment_failed" | "payment_intent.canceled" | "charge.refunded"[] | | Events to receive. Defaults to ["*"] (all events). |
Send only the fields to change.
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
url | string | | New URL. On a verified endpoint it is staged until the new URL passes verification in the dashboard. |
enabled_events | "*" | "payment_intent.succeeded" | "payment_intent.payment_failed" | "payment_intent.canceled" | "charge.refunded"[] | | Replaces the subscribed events. |
status | "enabled" | "disabled" | | disabled pauses delivery; enabled resumes it (an unverified endpoint still receives nothing). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix we_. |
object | "webhook_endpoint" | | Always webhook_endpoint. |
url | string | | Where events are delivered. |
enabled_events | string[] | | Subscribed event types; ["*"] = all. |
status | "pending" | "enabled" | "disabled" | | pending — created, not verified yet, receives nothing; enabled — verified and receiving; disabled — paused. |
livemode | boolean | | Always true on this API. |
created | integer | | Creation time, Unix seconds (UTC). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix we_. |
object | "webhook_endpoint" | | Always webhook_endpoint. |
url | string | | Where events are delivered. |
enabled_events | string[] | | Subscribed event types; ["*"] = all. |
status | "pending" | "enabled" | "disabled" | | pending — created, not verified yet, receives nothing; enabled — verified and receiving; disabled — paused. |
livemode | boolean | | Always true on this API. |
created | integer | | Creation time, Unix seconds (UTC). |
secret | string | | Signing secret (whsec_…), returned only at creation. Use it to verify the WirePayment-Signature header. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
operator | string | ✓ | Operator id, as shown on the dashboard's Connectors page. |
mode | "byo" | "reseller" | | Must be byo (your own operator credentials). reseller connections are provisioned by Wire through the dashboard and are refused here with operator_connection_invalid. |
credentials | object | ✓ | Operator-specific credential key/value pairs (must not be empty). Encrypted at rest; never returned. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
id | string | | Unique id, prefix opc_. |
object | "operator_connection" | | Always operator_connection. |
operator | string | | Operator id. |
mode | "byo" | "reseller" | | byo — your credentials; reseller — provisioned by Wire. |
status | "active" | "inactive" | | active — can carry payments (if also switched on for the project); inactive — cannot. |
capabilities | string[] | | What the operator supports, e.g. refund.full, refund.partial, loan.flow. |
created | integer | | Creation time, Unix seconds (UTC). |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
object | "operator_connection_test" | | Always operator_connection_test. |
operator | string | | Operator id. |
status | "ok" | "unreachable" | | ok — the connection is now active; unreachable — the operator did not answer; nothing changed. |
capabilities | string[] | | The operator's capabilities. |
| Талбар | Төрөл | Заавал | Тайлбар |
|---|
object | "routing_preview" | | Always routing_preview. |
selected | string | | The operator routing would pick. |
reason | string | | Human-readable explanation of the choice. |
fallback_chain | string[] | | All eligible operators, best first ([0] = selected). |
scored | object[] | | Score breakdown per eligible operator. |