commerce
POST /v1/orders/{orderId}/pay
Pay an order that was placed but not charged.
සත්යාපනය
බෙරර් ටෝකනයක් ලෙස API යතුරක් යවන්න. මෙම අන්ත ලක්ෂ්යය පිරිවිතරයේ නිශ්චිත අවසරයක් දක්වා නැත, එබැවින් උපකල්පනය කරනවාට වඩා ඔබේ යතුරට අවශ්ය අවම අවසරය ලබා දී ප්රතිචාරය පරීක්ෂා කරන්න.
මෙම අවසාන ලක්ෂ්යය සඳහා සංවිධාන හැඳුනුම්පතක් (organisation id) අවශ්ය නොවේ. ඔබගේ යතුර මඟින් එය අයත් වන සංවිධානය දැනටමත් හඳුනා ගන්නා අතර, ප්රතිචාරය ඒ වෙත සීමා වේ.
උත්සාහ කරන්න
<අගයන්> සමඟ කෝණික වරහන් තුළ ඇති ඕනෑම දෙයක් සහ ඔබේ උපකරණ පුවරුවෙන් ලබාගත් යතුරක් සමඟ key ස්ථාන දායකය ප්රතිස්ථාපනය කරන්න.
curl -X POST https://api.zinndigital.com/v1/orders/{orderId}/pay \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ }'පද්ධතියට පිවිස සිටිනවාද? ඔබගේ උපකරණ පුවරුවේ ඇති API කොන්සෝලය මඟින් ඔබේ සැබෑ ආයතනික හැඳුනුම්පත සහ ඔබේම යතුර පුරවා, සජීවී API වෙත ඉල්ලීම ක්රියාත්මක කරන බැවින් ඔබට සැබෑ ප්රතිචාරය දැකගත හැක. මෙම අග්රලක්ෂ්යය API කොන්සෝලය තුළ විවෘත කරන්න
විස්තර
Charges an order left `pending_payment` (or retries one that is `payment_failed`), wallet credit first and the remainder on the org's default mandate. This is where the guest funnel's `next: "payment"` step lands: checkout converts the cart when it places the order, so the cart endpoint cannot settle it afterwards and this is the only surface that can. **Idempotent without an `Idempotency-Key`**, unlike checkout. The order already exists and is itself the dedup scope, so a double-submit records the same capture rather than taking a second one. A pay attempt against an already-paid order returns that order unchanged rather than an error. A **declined card answers 200**, not 402: the attempt was processed exactly as asked and the order comes back `payment_failed` for the caller to read. Only the platform being unable to charge at all — no gateway configured, or one an operator has deliberately disabled — is a 503. **Choosing a gateway.** Send `gateway` to settle this order on a specific rail rather than the org's default mandate — the owner's *"settle overdue bills with any gateway they like"*. It must be one of `getOrderPaymentOptions`'s entries, which is why a reseller's client (who has exactly one) cannot be re-routed. Rails that finish in the browser — PayPal approval, a crypto invoice — answer `200` with the order still `pending_payment` and a `customer_action` carrying the URL to send the customer to; the order settles when the gateway's webhook confirms it.
පරාමිතීන්
| නම | වර්ගය | අත්යවශ්යයි | එය කුමක්ද |
|---|---|---|---|
orderId (path) | Uuid | ඔව් | The order's id. |
ඉල්ලුම් පත්ර ශරීරය
| නම | වර්ගය | අත්යවශ්යයි | එය කුමක්ද |
|---|---|---|---|
gateway | string | නැත | The rail to settle on (`stripe`, `paypal`, `nowpayments`). Omit to use the org's nominated payment method. `422` if it is not one of this order's `getOrderPaymentOptions`. |
පsspil
| නම | වර්ගය | අත්යවශ්යයි | එය කුමක්ද |
|---|---|---|---|
id | Uuid | ඔව් | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | ඔව් | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
human_ref | string | ඔව් | Human-friendly order reference. |
status | OrderStatus | ඔව් | An order's lifecycle state (docs/31 §4.3). |
currency | CurrencyCode | ඔව් | ISO 4217 currency code (money is minor units + this code — CLAUDE.md §2.8). |
subtotal_minor | integer | ඔව් | — |
tax_minor | integer | ඔව් | — |
discount_minor | integer | ඔව් | — |
total_minor | integer | ඔව් | — |
billing_country | object | නැත | — |
placed_at | object | නැත | — |
created_at | string | ඔව් | — |
updated_at | string | නැත | — |
lines | OrderLine[] | ඔව් | — |
payments | Payment[] | ඔව් | — |
customer_action | object | නැත | Present only when the attempt needs the customer to finish it in a browser (PayPal approval, a crypto invoice, a 3-D Secure step). Short-lived and never stored — request it agai… |
මෙම අවසාන ලක්ෂ්යය ආපසු ලබා දිය හැකි දෝෂ
401 · 403 · 404 · 422 · 429 · 503