# NovaroPay Docs > Take payments through the NovaroPay API: markets, merchant accounts, test and live. Every page of https://docs.dev.novaro.ink, in its menu's order; the index of them is [llms.txt](https://docs.dev.novaro.ink/llms.txt). Requests go to https://api.dev.novaro.ink. --- # Get started › Overview Source: https://docs.dev.novaro.ink/ Take payments through the NovaroPay API: markets, merchant accounts, test and live. The NovaroPay API lets your servers create payments and payouts, and tells you what happened to them. It is a REST API over HTTPS with JSON bodies, and it follows Stripe's conventions: if you have integrated Stripe, the keys, errors, idempotency keys and versions here will look familiar. ## Markets and merchant accounts You work with us as a **merchant**. A merchant has one or more **merchant accounts**, and each account is on one **market**, such as India (`IN`). An account takes payments and pays out in its market's currency, and everything you do through the API is done on one account: its payments, its payouts, its balance. Each account has its own [API keys](https://docs.dev.novaro.ink/api-keys/), and a key names its account's market: `sk_live_in_…` is a live key of an account in India. A key of one account cannot see or change another account's objects, not even another account of the same merchant. ## Test and live Each account has two modes: - **Test**, with `sk_test_…` keys. Use it while you build and in your CI: nothing in test mode moves real money, and test data stays apart from live data. See [Test mode](https://docs.dev.novaro.ink/test-mode/). - **Live**, with `sk_live_…` keys. Real payments, real money. The key decides which mode a request is in. Live keys can be limited to your servers' addresses with an [IP allowlist](https://docs.dev.novaro.ink/security/ip-allowlist/); test keys are not limited by it. ## An example integration [novaropay-integration-example](https://github.com/novaro-pub/novaropay-integration-example) is a small merchant server, in Node.js with no packages, built from these docs alone and run against our production API. It shows both ways to take a UPI payment: the [hosted payment page](https://docs.dev.novaro.ink/payments/hosted-page/), and your own page from the payment's details ([host to host](https://docs.dev.novaro.ink/payments/h2h/)). It also has a signed webhook handler, idempotency keys, `PSP-Version` and the `novaro` CLI. Its guide, `INTEGRATION.md`, walks through every step in order, from test mode to live, with a checklist. Copy from it. ## Where to go next 1. Get your account's keys: [API keys](https://docs.dev.novaro.ink/api-keys/), and build in [test mode](https://docs.dev.novaro.ink/test-mode/) first. 2. Send them with every request: [Authentication](https://docs.dev.novaro.ink/api/authentication/). 3. Handle failures in one place: [Errors](https://docs.dev.novaro.ink/api/errors/). 4. Retry safely: [Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/). 5. Pin your integration to a version: [Versioning](https://docs.dev.novaro.ink/api/versioning/). 6. Send the payer to our page: [Hosted payment page](https://docs.dev.novaro.ink/payments/hosted-page/). Or show the details on your own page or in your app: [Host to host](https://docs.dev.novaro.ink/payments/h2h/). ## Use these docs with an AI tool Give your AI coding tool our docs in one file: [llms.txt](https://docs.dev.novaro.ink/llms.txt) lists every page with a link and a line about it, and [llms-full.txt](https://docs.dev.novaro.ink/llms-full.txt) is the whole text of every page, the API reference included. --- # Get started › API keys Source: https://docs.dev.novaro.ink/api-keys/ Secret keys for test and live mode: where to find them, how to create, rotate and expire them. Every request to the API is authenticated with a **secret key** of a merchant account. The key says which account the request acts on and in which mode, test or live. | Key | Mode | Example prefix | | --- | --- | --- | | `sk_test__…` | Test: no real money moves ([Test mode](https://docs.dev.novaro.ink/test-mode/)) | `sk_test_in_4fQx9aZ2` | | `sk_live__…` | Live: real payments | `sk_live_in_7Hq2LmP0` | The part after the mode is the account's market (`in` for India). The first characters of a key, such as `sk_live_in_7Hq2LmP0`, are its prefix: it is how we show a key, in lists and in our messages to you, so you can tell keys apart without seeing a secret. ## Where your keys live Your account's keys are in the merchant portal, under **Settings › Developers › API keys**. An admin or a developer of the account sees the page and manages the keys. Our support team can also create, rotate or expire a key for you; the list then shows it as done by Support team. The page shows the keys of one mode at a time: switch the portal to Test mode for the test keys. Every key in the list has its name and note, its prefix, who created it and when, when it was **last used** (updated about once a minute), and whether it works: **Working**; **Expires in…** while a rotated key's expiration runs; **Expired**, with the day, once it has passed; or **Revoked**, with the day and who, after Expire key…. **Show expired keys** lists the keys that have stopped as well. A change to the keys, Create, Rotate or Expire, asks you to confirm it's you when you have not signed in recently. ## Creating a key **Create secret key** asks for a name, such as "Production" or "Staging", and an optional note, such as where you will store it. The secret is shown **once**, right after: we keep only a hash of it and cannot show it to you again. Copy it into your secret manager straight away. A key whose secret is lost cannot be recovered: rotate it, or create a new one and expire the old one. **Create secret key** stops at **10 working keys of a mode**: a key that is due to expire still counts, one that has expired does not. At the limit, expire a key before you create another. A rotation is never refused by the limit, as it replaces one key with one, so during its expiration the old key and its replacement both work and both count. **Edit key** changes a key's name and note. They tell keys apart and change nothing about what the key can do. Test keys and live keys are kept apart: the page in **Test mode** lists and creates test keys, which work only in [test mode](https://docs.dev.novaro.ink/test-mode/), and in live mode it lists and creates live keys. An admin or a developer of the account makes both, with no request to us. A test key works as soon as your merchant is in test on the account's market; a live key once we activate your merchant there for live: until then a request with it gets `403` [`market_not_enabled`](https://docs.dev.novaro.ink/api/errors/#market_not_enabled) (see [Authentication](https://docs.dev.novaro.ink/api/authentication/)). A market with no test environment yet says so on the page in Test mode, and has no test keys to create. ## Emails about your keys When a key is created, rotated or expired, every admin of the account gets an email. It says who did it (a person of your team, or Support team), when, and the key's name and prefix; for a rotated or expired key, when it was last used; for a rotation, the new key's prefix and when the old key stops working. It never contains a secret. Editing a key's name or note sends nothing, and neither does expiring the old key of a rotation within a minute of when it stops anyway: the rotation's email already said when. An email you did not expect means someone changed your keys. Check the list by prefix: after a rotation, the new key has the old one's name, so match the new prefix from the email. Expire any key you do not recognise. After a rotation you did not make, expire the new key; the old one still stops when the email says and cannot be rotated again, so create a new key and move your servers to it before then. ## Keeping keys safe A secret key can do everything the API can do on its account, so: - Use it **only on your servers**. Never put it in a mobile app, a web page, or anything else that runs on your customer's device. - Keep it out of your code and repositories: read it from your secret manager or an environment variable. - Do not send it in email or chat. We never ask you for a key. - Allow your live keys only from your own servers with an [IP allowlist](https://docs.dev.novaro.ink/security/ip-allowlist/). A leaked key is then useless anywhere else. ## Rotating a key Rotate keys on a schedule, and at once when someone who had access leaves or a key may have leaked. **Rotate key…** replaces **one key**: it creates a new key with the same name and shows its secret once, and **Expiration** sets when the old key stops working: **Now**, **1 hour**, **24 hours**, **3 days** or **7 days**. The account's other keys are not touched. To rotate without downtime, choose an expiration long enough to deploy: 1. Rotate the key and store the new secret. 2. Deploy the new key to every server that sends the old one. 3. Watch your logs, and the old key's **Last used** (reload the page to read it again), until nothing sends the old key. 4. Let the old key expire, or expire it yourself. A rotation never extends a key: a key is replaced once, and one that is already due to expire cannot be rotated again. Rotate its replacement instead, or expire it. ## Expiring a key **Expire key…** stops a key **at once**, and it cannot be undone: the list shows it as Revoked. Expire a key that has leaked rather than rotating it with an overlap. When the key was used in the last 24 hours, you confirm by typing its name. A request with a key that was revoked with Expire key…, or replaced by a rotation whose expiration has passed, gets `401` with the code [`api_key_expired`](https://docs.dev.novaro.ink/api/errors/#api_key_expired) and the key's prefix in the message, so you can tell which key your server still sends. A key that is wrong or unknown gets `401` with no code (see [Authentication](https://docs.dev.novaro.ink/api/authentication/)). --- # Get started › Test mode Source: https://docs.dev.novaro.ink/test-mode/ Build and test your integration with test keys: the same API and host, its own data, no real money. Every merchant account has a **test mode** beside its live mode. Use it while you build and in your CI: the API is the same, nothing in test mode moves real money, and test data never mixes with live data. ## One host, the key decides There is one API address for both modes. **The key you send decides the mode** of a request: | Key | Mode | | --- | --- | | `sk_test__…` | Test: test data, no real money | | `sk_live__…` | Live: real payments, real money | There is no test host, no test flag and no test parameter: switching your integration to live is switching its key. A request has no other way to choose its mode, so a test key never reaches live data, and a live key never reaches test data. Every object says which mode it was made in: `livemode` is `true` for a payment made with a live key and `false` for one made with a test key. Object ids look the same in both modes. ## What is separate Test mode has its own environment for each market, and in it: - **its own keys**: test keys are made and listed in the merchant portal in **Test mode** ([API keys](https://docs.dev.novaro.ink/api-keys/)), and work only in test mode; - **its own payments**, and its own webhook endpoints and the events they are sent; - **no money and no payer**: the UTR a test payment is confirmed with decides what happens to it. **Magic UTRs** take it to any status you choose; any other UTR leaves it `processing`, as a live payment whose money nobody has seen yet, until its late-payment window closes and it fails ([Testing](https://docs.dev.novaro.ink/payments/testing/)); a test payout (once your market takes payouts) is sent nowhere, and its amount's last two digits, **magic amounts**, take it to `paid`, `failed` or `requires_review` ([Payouts › Test mode](https://docs.dev.novaro.ink/api/payouts/#test-mode)); - **a rate limit**: 25 requests a second per test key, 100 per account ([Rate limits](https://docs.dev.novaro.ink/api/rate-limits/)); - **a retention**: test payments are deleted 90 days after they were made. What is shared: your merchant, its accounts and their ids, your team and their roles, and your payout addresses: both modes list the same ones. Both modes run the same [API versions](https://docs.dev.novaro.ink/api/versioning/), so try a new version in test mode first, with the `PSP-Version` header. The [IP allowlist](https://docs.dev.novaro.ink/security/ip-allowlist/) limits live keys only: test keys work from anywhere, your laptop and CI too. ## Everything else is live A test payment goes through the statuses, amounts and errors a live payment would on the same path, and a test request is checked as strictly as a live one: the same parameters, the same [errors](https://docs.dev.novaro.ink/api/errors/), the same [idempotency](https://docs.dev.novaro.ink/api/idempotent-requests/). An integration that works in test mode works in live mode with its live key. A market with no test environment refuses its test keys with `404` [`resource_missing`](https://docs.dev.novaro.ink/api/errors/#resource_missing). ## Try it The API reference sends real requests to test mode: open an endpoint under **Resources**, choose **Test request**, and paste a test key under Authentication. The key stays in the page and is gone when you close it; the docs refuse a live key before anything is sent. --- # Payments › Hosted payment page Source: https://docs.dev.novaro.ink/payments/hosted-page/ Send the payer to our page: create the payment with checkout, get the payer back, embed the page in an iframe or a WebView. Instead of showing the UPI details yourself ([host to host](https://docs.dev.novaro.ink/payments/h2h/)), send the payer to our **hosted payment page**. You create the payment with one more parameter, `checkout`, and get back the page's address, `checkout.url`. The page runs on your account's own checkout domain in your brand: the payer pays with their UPI app, tells us their UTR, and comes back to your site. You learn what happened from the payment itself, never from the way back. The page works without JavaScript, on a phone and on a desktop, as a whole page, in an iframe on your site, and in your app's WebView. ## Before you start - A key of the account ([API keys](https://docs.dev.novaro.ink/api-keys/)): a test key while you build, which makes test payments with the same page. - The account's **checkout domain**. We give every account its own domain for the page from our pool and rotate it; you never name it in a request, it is in `checkout.url`. An account whose domain is not ready yet gets `503` [`checkout_unavailable`](https://docs.dev.novaro.ink/api/errors/#checkout_unavailable) and no payment is made: ask your account manager. ## Create the payment 1. **Create the payment with `checkout`.** Send `POST /payments` as for any payment, with `checkout.return_url`: where the payer goes back to once they have paid, on any host of yours. Put what you need to find the order again in the URL yourself. To show the page in an [iframe](https://docs.dev.novaro.ink/payments/hosted-page/#in-an-iframe), send `checkout.embed_origin` too: the origin of your page that frames it. A payment with our hosted page: ```sh curl https://api.dev.novaro.ink/payments \ -H "Authorization: Bearer sk_live_in_…" \ -H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \ -H "Content-Type: application/json" \ -d '{ "amount": 200000, "currency": "INR", "payment_method_data": { "type": "upi" }, "merchant_reference": "order_8812", "customer": { "id": "cus_4921" }, "checkout": { "return_url": "https://shop.example/orders/8812/paid" } }' ``` The answer is `201` with the payment: its `channel` is `hosted`, and `checkout` holds the page. ```json title="Response · 201 Created (shortened)" { "id": "pay_in_01J9…", "status": "awaiting_payer", "amount": 200000, "amount_payable": 200000, "currency": "INR", "channel": "hosted", "expires_at": 1760357700, "checkout": { "url": "https://pay-k7m2q.example/c/3fZ…", "status": "not_opened", "opened_at": null, "return_url": "https://shop.example/orders/8812/paid", "embed_origin": null }, "next_action": { "type": "upi_display_details", "upi_display_details": { "vpa": "…", "amount": 200000, "reference_code": "K7M2Q", "upi_uri": "upi://pay?…" } } } ``` `next_action` is there as for any payment: the page shows these details to the payer, and you may show them too. 2. **Send the payer to `checkout.url`.** Redirect them to it, open it as a whole page, in an [iframe](https://docs.dev.novaro.ink/payments/hosted-page/#in-an-iframe) on your site or in your app's [WebView](https://docs.dev.novaro.ink/payments/hosted-page/#in-a-webview). The address holds a token that is the payment's: do not shorten it, cache it or share it between payers. It opens until 24 hours after the payment expires. 3. **Learn the result from the payment.** The page tells the payer; it does not tell you. Read the payment with `GET /payments/{id}` when the payer is back, and until it is final: | `status` | What it means | | --- | --- | | `awaiting_payer` | The payer has not paid yet, or has not said so. | | `processing` | The payer said they paid and gave their UTR. We are looking for the money: it succeeds when we see it, and fails if we have not seen it when the market's late-payment window closes: 24 hours by default, counted from when it became `processing` or from its `expires_at`, whichever is later. | | `succeeded` | Paid. Deliver the order. | | `expired` | The payer did not pay in time. A late payment can still make it succeed. | | `failed` | It will not be paid. One with `failure_code: blocked` was refused by our checks when it was made: don't send the payer to its page, and show them that paying is temporarily unavailable ([Fraud prevention](https://docs.dev.novaro.ink/payments/fraud-prevention/#a-blocked-payment)). | Your [webhook endpoints](https://docs.dev.novaro.ink/webhooks/) get an event for each of these changes: poll the payment only as a fallback. ### The `checkout` parameter | Field | | | --- | --- | | `return_url` | Required. An absolute `https` URL of at most 2048 characters, on any host and port, with no credentials, kept exactly as you sent it. Every mirror of your site can send its own: nothing is set on the account. `http`, a value that is not an absolute URL, one longer than 2048 characters or with characters outside printable ASCII is `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid) with `param` `checkout.return_url`. | | `embed_origin` | Optional. The origin of your page that shows ours in an [iframe](https://docs.dev.novaro.ink/payments/hosted-page/#in-an-iframe): `https`, a host and an optional port, such as `https://shop.example` or `https://shop.example:8443`, with no path (not even `/`), query, fragment or credentials. Only this origin may frame the page, and only it is told the page's state. Left out, the page opens in no frame. A value of another form is `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid) with `param` `checkout.embed_origin`; one without `return_url` is `400` [`parameter_missing`](https://docs.dev.novaro.ink/api/errors/#parameter_missing) for `checkout.return_url`. | | `locale` | Optional: `en`, the only value for now. The page speaks its market's language: English in India. | ### The `checkout` object A payment made with `checkout` carries it in every answer; a payment made without it has `checkout: null`. | Field | | | --- | --- | | `url` | The page. Made anew for every answer: it is the same address each time. | | `status` | `not_opened`: the payer has not opened the page. `opened`: they have seen it. `confirmed`: they sent their UTR on it, from the moment we took it, so the `payment.processing` it sends says `confirmed`. `closed`: it no longer opens. | | `opened_at` | When the payer first opened the page, in seconds since the Unix epoch; `null` until then. | | `return_url` | The `return_url` you sent. | | `embed_origin` | The `embed_origin` you sent, in lower case and without the scheme's default port (`https://Shop.Example:443` reads `https://shop.example`); `null` when you sent none. | The page is for the payer you send there. A payment you show yourself (no `checkout`) still gets `next_action.upi_display_details.hosted_instructions_url`, our page with the same details, for a payer you would rather send there than show them yourself: it has no return. ## What the payer sees - **Pay.** The amount to pay, the UPI ID with a Copy button, a QR code, buttons that open PhonePe and Paytm on the same details, and the time left to pay. Under them a form for the payer's UTR, "I have paid", once they have paid. - **Checking.** The payer sent their UTR: the page says the payment is being checked, with the UTR read-only, and follows the payment on its own. The payment is `processing`. - **Paid.** The payment succeeded. With autoreturn on, the page goes back to `return_url` after a few seconds; otherwise it shows "Back to *your name*". - **Expired.** The time to pay ran out. A payer who paid late can still send their UTR here. - **Not completed.** The payment failed: the page tells the payer to contact you if money left their account. The payer can ask for **another UPI ID** when their app refuses the one shown, and a **Having trouble?** sheet helps with the usual problems; the payment, its amount and its reference code stay the same. The [options](https://docs.dev.novaro.ink/payments/hosted-page/#your-brand-and-the-pages-options) say which of these the page shows. We change the details ourselves when the ones shown can no longer take payments: the page shows the new ones and tells the payer to pay only to them, and you get `payment.instructions_updated`. When no other details are free, the payment fails and you get `payment.failed`. A payer who already said they paid keeps their details. ## Getting the payer back The page sends the payer to `return_url` **exactly as you sent it**, with nothing added: no status, no payment id. Keep your order's id in the URL, read the payment with `GET /payments/{id}`, and show the payer what its `status` says. `processing` is the usual state on the way back: the payer said they paid, and the money is confirmed a little later. - With **autoreturn** on in the account's options, the Paid screen goes back by itself after the seconds you set (1 to 30); with it off, the payer taps "Back to *your name*". Every screen has that link while the payment has a `return_url`. - The payer may **never come back**: they closed the tab, or paid from the app and never returned to the page. Do not wait for the return to deliver: the payment's status is the truth, whichever way you learn it. - A page in an iframe does not move your site: see the next section. ## In an iframe 1. **Name your page's origin in the payment.** Create the payment with `checkout.embed_origin`, the origin of the page that holds the frame, as `window.location.origin` reads it there: ```json title="checkout" { "return_url": "https://shop.example/orders/8812/paid", "embed_origin": "https://shop.example" } ``` The page refuses every other frame: its `Content-Security-Policy` names that origin as `frame-ancestors` (in test mode our merchant portal and back office too, which preview the page), and a browser shows nothing to a frame of another. A payment made without it opens in no frame of yours. Each payment names its own, so every mirror of your site frames its own payments with nothing to set on the account. 2. **Put `checkout.url` in the frame.** Give it the clipboard, so the Copy buttons work inside it; do not sandbox it, or allow forms, scripts, same-origin, popups and top navigation by user activation, which the app buttons and the Back link use. ```html title="The frame" ``` 3. **Listen for the page's messages.** On every screen the page posts a message to its parent, to the payment's `embed_origin` only: ```json title="The message" { "type": "psp.checkout", "status": "succeeded", "height": 612 } ``` `status` is `awaiting_payer`, `processing`, `succeeded`, `expired` or `failed`; `height` is the page's height in CSS pixels, to size the frame. Check the message's origin against the page's, and its type: anything else on your site may post messages too. ```js title="Your site" const frame = document.getElementById("checkout"); const pageOrigin = new URL(frame.src).origin; window.addEventListener("message", (event) => { if (event.origin !== pageOrigin || event.data?.type !== "psp.checkout") return; frame.style.height = `${event.data.height}px`; if (event.data.status === "succeeded" || event.data.status === "expired" || event.data.status === "failed") { // Close the frame and show the order; read the payment from your server first. } }); ``` A page that shows no payment (one that no longer opens, a link that is not a page, or a page asking the payer to wait a moment) holds nothing to act on, and any `https` page may frame it, so the payer in your frame reads it rather than the browser's refusal. Inside a frame the Paid screen does not go back to `return_url` by itself: browsers keep a frame from moving the page around it without a tap. Your site moves on at the `succeeded` message, and the Back link, which opens at the top, stays for the payer. Keep reading the payment from your server as well: a message is lost when the frame fails to load, and the payer may pay from the app without coming back to the frame. ## In a WebView The page tells a WebView from a browser (Android's WebView, iOS's `WKWebView`) and hides the PhonePe and Paytm buttons there: a plain WebView cannot open another app's link and would show the payer an error. The UPI ID, the QR code and the UTR form stay, and "Download QR" becomes a hint to take a screenshot, so the payer can always pay. To show the app buttons in your app, let your WebView hand the apps' links to the system, then turn on **App buttons in WebView** in the account's options. The links use the schemes `upi:`, `phonepe:` and `paytmmp:`; open any link that is not `http` or `https` outside the WebView, and keep the WebView on the page. ```kotlin title="shouldOverrideUrlLoading" webView.webViewClient = object : WebViewClient() { override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean { val url = request.url if (url.scheme == "http" || url.scheme == "https") return false return try { view.context.startActivity(Intent(Intent.ACTION_VIEW, url)) true } catch (e: ActivityNotFoundException) { // The app is not installed: the page stays, and the payer uses the UPI ID or the QR. true } } } ``` ```swift title="WKNavigationDelegate" func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { guard let url = navigationAction.request.url, let scheme = url.scheme?.lowercased(), scheme != "http", scheme != "https" else { decisionHandler(.allow) return } UIApplication.shared.open(url) // nothing happens when the app is not installed decisionHandler(.cancel) } ``` Handle the way back as well: when the WebView navigates to your `return_url`, close it and show the order from the payment's status, as a site does. With the apps' links handled and the option on, the page shows the buttons in your WebView as it does in a browser. ## Your brand and the page's options The page's look and what it shows are the account's checkout settings, in the merchant portal (Settings › Developers › Checkout); our team can change them for you. A change reaches the page within a second, on its next load. | Setting | | | --- | --- | | Name, logo, icon | The name on the page (your merchant name when empty), the logo in its header, the icon in the browser's tab. | | Colours, corners | The background, the buttons and the accent, as `#RRGGBB`; a pair that does not contrast enough (4.5:1) is refused with the nearest colour that does. Corners sharp, rounded or pill. | | Ways to pay | The UPI ID, the QR code, the PhonePe and Paytm buttons and their order. At least one stays on, and a payer who would be left with none (the app buttons hidden in a WebView, or an app's link switched off for the market) sees the UPI ID. | | Download QR | A button that saves the QR as an image, hidden above an amount you set: banks refuse a QR from the gallery for large amounts. | | Timer | The time left to pay, from the payment's `expires_at`. | | UTR form | The field for the payer's UTR. Without it, the payer can only pay; you confirm the payment yourself with [`POST /payments/{id}/confirmations`](https://docs.dev.novaro.ink/api/payments/#confirming-a-payment), or we match the money. | | Get new UPI ID | Lets the payer ask for other details when their app refuses the UPI ID shown. | | Autoreturn | Back to `return_url` by itself after 1 to 30 seconds on the Paid screen. | | App buttons in WebView | Shows the PhonePe and Paytm buttons in a WebView: see [In a WebView](https://docs.dev.novaro.ink/payments/hosted-page/#in-a-webview). | The options shape the page only. The API's `next_action` always carries every way to pay, whatever the page shows. ## Trying it out Create a payment with `checkout` and a [test key](https://docs.dev.novaro.ink/test-mode/): its page looks and behaves as a live payment's, at a URL whose token starts with `t.`. Type a [magic UTR](https://docs.dev.novaro.ink/payments/testing/) into the page's UTR form to take the payment to the status you want to see. The [example integration](https://github.com/novaro-pub/novaropay-integration-example) makes a payment with `checkout`, sends the payer to the page and reads the payment when they are back. It also shows the payment on its own page instead: see [Host to host](https://docs.dev.novaro.ink/payments/h2h/). --- # Payments › Host to host: your own payment page Source: https://docs.dev.novaro.ink/payments/h2h/ Show the UPI details on your own page or in your app: create the payment without checkout, show next_action, pass on the payer's UTR and learn the result. In **host to host (H2H)** you show the payer the UPI details yourself, on your own page or in your app, and the payer sees nothing of ours unless you choose to show it: our QR image, or [our page with the same details](https://docs.dev.novaro.ink/payments/h2h/#our-page-with-the-same-details). You create the payment without `checkout`, show what its `next_action` holds, and pass on the UTR the payer gives you. Everything else is as with the [hosted payment page](https://docs.dev.novaro.ink/payments/hosted-page/): the [API keys](https://docs.dev.novaro.ink/api-keys/), the `Idempotency-Key`, the [`PSP-Version`](https://docs.dev.novaro.ink/api/versioning/), the [webhooks](https://docs.dev.novaro.ink/webhooks/) and [test mode](https://docs.dev.novaro.ink/test-mode/). ## Before you start - A key of the account ([API keys](https://docs.dev.novaro.ink/api-keys/)): a test key while you build. Test payments have the same fields and statuses as live ones. - A page or a screen of yours that shows the details and takes the payer's UTR, and a server that reads the payment for it. Your secret key stays on your server: never send it to the payer's browser or your app. ## Create the payment 1. **Create the payment without `checkout`.** Send `POST /payments` with the amount, the method and your reference: A payment you show yourself: ```sh curl https://api.dev.novaro.ink/payments \ -H "Authorization: Bearer sk_live_in_…" \ -H "PSP-Version: 2026-11-22.acacia" \ -H "Idempotency-Key: order_8812-1:create-payment" \ -H "Content-Type: application/json" \ -d '{ "amount": 49900, "currency": "INR", "payment_method_data": { "type": "upi" }, "merchant_reference": "order_8812-1", "customer": { "id": "cus_4921" } }' ``` `merchant_reference` is unique on your account, and an `Idempotency-Key` answers the same payment again for 24 hours: make both of the **attempt**, not of the order, such as `order_8812-1` for the order's first attempt to pay and `order_8812-2` for its second. 2. **Read the answer.** It is `201` with the payment: its `channel` is `h2h`, `checkout` is `null`, and `next_action.upi_display_details` holds what to show the payer. A payment our checks refused is `201` too, `failed` with `outcome.type: blocked` and no `next_action`: see [A blocked payment](https://docs.dev.novaro.ink/payments/fraud-prevention/#a-blocked-payment). Send what you know of the customer with the payment ([Fraud prevention](https://docs.dev.novaro.ink/payments/fraud-prevention/)): in host to host the payer never opens our page, so `device_id` and `user_agent` matter most here. ```json title="Response · 201 Created (shortened)" { "id": "pay_in_01J9…", "status": "awaiting_payer", "amount": 49900, "amount_payable": 49900, "currency": "INR", "channel": "h2h", "checkout": null, "expires_at": 1760357700, "next_action": { "type": "upi_display_details", "upi_display_details": { "vpa": "pay.store7@okaxis", "amount": 49900, "reference_code": "K7M2Q", "upi_uri": "upi://pay?pa=pay.store7@okaxis&pn=…&am=499.00&cu=INR&tn=K7M2Q", "qr_code": { "data": "upi://pay?pa=pay.store7@okaxis&pn=…&am=499.00&cu=INR&tn=K7M2Q", "image_url_svg": "https://pay-k7m2q.example/c/3fZ…/qr.svg", "image_url_png": "https://pay-k7m2q.example/c/3fZ…/qr.png" }, "app_links": [ { "app": "paytm", "url": "paytmmp://cash_wallet?…" }, { "app": "phonepe", "url": "phonepe://native?…" } ], "hosted_instructions_url": "https://pay-k7m2q.example/c/3fZ…" } }, "confirmation_fields": [{ "name": "utr", "pattern": "^[0-9]{12}$" }] } ``` `next_action` is there while the payment waits for the payer, and `null` in any other status. ## Show the details to the payer | Show | From | | | --- | --- | --- | | The amount to pay | `upi_display_details.amount` | The payment's `amount_payable`, in paise. It is your `amount`, or a little less when your account matches payments by amount: show this one, not your own `amount`. | | The UPI ID | `vpa` | With a Copy button. | | The note | `reference_code` | The payer puts it in the transfer's note. | | A QR code | `qr_code.data` drawn yourself, or the image at `qr_code.image_url_svg` | Load the image in the payer's browser or app, not through your server: it is served from your account's checkout domain, which limits the requests for each payment and from each address. It answers `410` once the payment can no longer be paid: do not cache it. `image_url_png` is the same QR as a file to download, for a Download button. Both are `null` while your account has no checkout domain or its domain was retired, and once the payment's page has closed. | | Open a UPI app | `upi_uri` | A button: any UPI app on the phone opens it. | | Open Paytm, Open PhonePe | `app_links` | A button for each: they open that app with the amount and the note locked where the app allows it. The list can be empty or shorter: show only the buttons it has. | | The time left | `expires_at` | In seconds since the Unix epoch. | | A field for the UTR | `confirmation_fields` | The payer's UTR, the 12 digits their UPI app shows once they paid: [pass it on](https://docs.dev.novaro.ink/payments/h2h/#pass-on-the-payers-utr). | **Read the payment again every time you show the page.** While the payment waits for the payer, its UPI ID and amount may change, and you get `payment.instructions_updated` each time: - the details shown can no longer take payments, and we move the payment to others; - within a minute of its creation, we move the payment to better details than the ones it was first given; - the payer asked for other details on [our page with the same details](https://docs.dev.novaro.ink/payments/h2h/#our-page-with-the-same-details). The `reference_code` stays, and money sent to the earlier details still pays it. When no other details are free, the payment fails and you get `payment.failed`. **Make a new payment for every attempt to pay**, with its own `merchant_reference` and `Idempotency-Key` (`order_8812-2`, and so on), and never show one payment's details for another. ### Our page with the same details For a payer you would rather not show the details yourself, `hosted_instructions_url` is our page with the same details, on your account's checkout domain; it has no way back to you. It is `null` while your account has no checkout domain or its domain was retired, and once the page has closed. ## Pass on the payer's UTR When the payer says they paid, take the UTR they type and pass it on with [`POST /payments/{id}/confirmations`](https://docs.dev.novaro.ink/api/payments/#confirming-a-payment). It is optional, as we match payments without it, but it makes the match faster and settles doubtful cases. The payer's UTR: ```sh curl https://api.dev.novaro.ink/payments/pay_in_01J9…/confirmations \ -H "Authorization: Bearer sk_live_in_…" \ -H "PSP-Version: 2026-11-22.acacia" \ -H "Idempotency-Key: order_8812-1:confirm:412345678901" \ -H "Content-Type: application/json" \ -d '{ "utr": "412345678901" }' ``` - The answer is `200` with the payment: one that was waiting for the payer is now `processing`, and an expired one stays `expired`. That is not proof that it is paid: it succeeds when we see the money, and fails if we do not see it in time. - `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid): the UTR does not match the field's `pattern`. Show the message next to the field and let the payer type it again. - `409` [`reference_already_used`](https://docs.dev.novaro.ink/api/errors/#reference_already_used): this UTR confirms another payment of your account that has not succeeded or failed, or it is the reference of the bank transaction that paid another payment of your account. - `409` [`payment_final`](https://docs.dev.novaro.ink/api/errors/#payment_final): the payment already succeeded or failed. [Confirming a payment](https://docs.dev.novaro.ink/api/payments/#confirming-a-payment) has every rule: the same UTR sent twice, the most values a payment takes, an expired payment, the UTR that paid a payment that succeeded. ## Learn the result You learn what happened from the payment itself, as with the hosted page: | `status` | What it means | | --- | --- | | `awaiting_payer` | The payer has not paid yet, or has not said so. | | `processing` | The payer said they paid and gave their UTR. We are looking for the money: it succeeds when we see it, and fails if we have not seen it when the market's late-payment window closes: 24 hours by default, counted from when it became `processing` or from its `expires_at`, whichever is later. | | `succeeded` | Paid. Deliver the order. | | `expired` | The payer did not pay in time. A late payment can still make it succeed. | | `failed` | It will not be paid. One with `failure_code: blocked` was refused by our checks when it was made, and has no details: show your customer that paying is temporarily unavailable ([Fraud prevention](https://docs.dev.novaro.ink/payments/fraud-prevention/#a-blocked-payment)). | - **Deliver once,** on the `payment.succeeded` [webhook](https://docs.dev.novaro.ink/webhooks/) or on a `GET /payments/{id}` that says `succeeded`, whichever comes first. `payment.succeeded` can come again, with a higher `version`, when our team corrects the payment's confirmation, and its `amount_paid` and `amount_credited` may change with it: do not deliver an order twice, and keep the payment of the highest `version`. - **Keep an expired payment's order open** until it is `succeeded` or `failed`. - **Credit `amount_credited`, not `amount`.** A payer who types the UPI ID by hand types the amount too, and may type another. [What arrived and what to credit](https://docs.dev.novaro.ink/api/payments/#what-arrived-and-what-to-credit) has the fields. - **While the payer waits on your page,** update it from your webhook handler, or read the payment every few seconds. On `payment.instructions_updated`, show the new details from the payment, not only its status. Stop when it is `succeeded` or `failed`. ## In your app or a WebView - **A native app** opens `upi_uri` and the `app_links` with the system: an `Intent.ACTION_VIEW` on Android, `UIApplication.shared.open` on iOS. When no app takes the link, the payer still has the UPI ID and the QR code. - **Your page in a WebView** cannot open another app's link by itself: hand every link that is not `http` or `https` to the system, as [In a WebView](https://docs.dev.novaro.ink/payments/hosted-page/#in-a-webview) shows for our page. The links use the schemes `upi:`, `phonepe:` and `paytmmp:`. Until your WebView does that, hide the app buttons there and keep the UPI ID and the QR code. - **On a desktop** there is no UPI app: show the QR code for the payer's phone, and the UPI ID. ## Hosted page or host to host? | | Hosted page | Host to host | | --- | --- | --- | | Who draws the payment screen | We do, on your checkout domain, in your brand | You do | | Your code | A redirect to `checkout.url` and the way back | The page, the UTR field and the result | | The UTR | The payer types it on our page | You take it and send `POST /payments/{id}/confirmations` | | Details that change while the payer waits | The page follows them | You read the payment again | | In your app without a WebView | No | Yes | ## Trying it out Create a payment with a [test key](https://docs.dev.novaro.ink/test-mode/) and confirm it with a [magic UTR](https://docs.dev.novaro.ink/payments/testing/#magic-utrs): `000000000001` takes it to `succeeded` at once, and `000000000004` to `succeeded` with 1.00 less paid, so you can see `amount_paid`, `amount_credited` and `amount_mismatch` at work. To build your webhook handler, [`novaro listen`](https://docs.dev.novaro.ink/webhooks/test-locally/) sends your test events to your machine, and `novaro trigger` makes them happen. The [example integration](https://github.com/novaro-pub/novaropay-integration-example) takes both paths. Its guide [`H2H.md`](https://github.com/novaro-pub/novaropay-integration-example/blob/main/H2H.md) walks through host to host with a real run in test mode. --- # Payments › Fraud prevention: what to send and why Source: https://docs.dev.novaro.ink/payments/fraud-prevention/ The customer fields that help us tell a scam from an honest customer, what each is for, and what to do when a payment comes back blocked. Our checks look at every payment before its payer is shown where to pay. The more we know of your customer, the better they tell a scam from an honest customer, and the less often an honest one is stopped for nothing. You see things we cannot: where the customer signed in with you from, and, when the payer never opens our page, their device and browser. Send them in `customer` with `POST /payments`. This is how Stripe's Radar works: it [asks for the same kind of data](https://docs.stripe.com/radar/integration), and answers each charge's [`outcome`](https://docs.stripe.com/api/charges/object#charge_object-outcome). ## What to send Every field is optional, and taken in every market: send those you have, and leave out those you do not. We never answer them back, in the payment or in its webhooks. | Field | Type | Why it helps | | --- | --- | --- | | `login_ip` | IPv4 or IPv6 address | Where the customer signed in with you from. It helps us tell when many accounts that sign in from one address are one person, or when a sign-in far from where the customer pays from (`customer.ip`) is an account taken over. | | `device_id` | Text, up to 200 characters | Your id of the customer's device. It helps us tell when one device pays for many customers. It matters most in [host to host](https://docs.dev.novaro.ink/payments/h2h/), where the payer never opens our page and we cannot see their device ourselves. | | `user_agent` | Text, up to 1000 characters | The customer's browser and device, for host to host too: what our page would otherwise read from the payer's browser. | A value outside these limits is `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid) with `param` naming the field, such as `customer.login_ip`, and no payment is made. Any other field in `customer` that is not in the [API reference](https://docs.dev.novaro.ink/api/payments/) is `400` [`parameter_unknown`](https://docs.dev.novaro.ink/api/errors/#parameter_unknown). A payment with what you know of the customer: ```sh curl https://api.dev.novaro.ink/payments \ -H "Authorization: Bearer sk_live_in_…" \ -H "PSP-Version: 2026-11-22.acacia" \ -H "Idempotency-Key: order_8812-1:create-payment" \ -H "Content-Type: application/json" \ -d '{ "amount": 49900, "currency": "INR", "payment_method_data": { "type": "upi" }, "merchant_reference": "order_8812-1", "customer": { "id": "cus_4921", "ip": "203.0.113.24", "login_ip": "203.0.113.24", "device_id": "dev_7f3a91", "user_agent": "Mozilla/5.0 (Linux; Android 14) Mobile" } }' ``` ## The outcome Every payment answers `outcome`, what our checks decided when it was made. It never changes. | `outcome.type` | What it means | | --- | --- | | `authorized` | Our checks passed, and the payment goes on as usual. It says nothing of whether it is paid: its `status` does. | | `blocked` | Our checks refused the payment. It is `failed` from the start. | `outcome.risk_level` and `outcome.reason`, which Stripe's outcome has, are kept for later and not sent yet. New types may be added: treat one you do not know as `authorized`, and go by the payment's `status`. `GET /payments?outcome_type=blocked` lists your blocked payments. ## A blocked payment A blocked payment is no error: `POST /payments` answers `201`, as for any payment it makes, on every [version](https://docs.dev.novaro.ink/api/versioning/). - Its `status` is `failed`, its `failure_code` is `blocked` and its `outcome.type` is `blocked`. Every other payment's `failure_code` is `null`. - It has no details to pay to: `next_action` is `null`. A hosted payment's `checkout.url` opens the page of a payment that is not ready yet: it says the payment is being prepared, then to try again later. Don't send the payer to it. - You get the webhook event `payment.failed`, as for any payment that fails. - We do not say which check refused it. **Show your customer that paying is temporarily unavailable**, and nothing more: do not say the payment was blocked or why. Our page says no more than that either: it never names a block or shows details to pay to. **A blocked payment keeps its `merchant_reference`**, as every payment does: another try needs a new one (`order_8812-2`), as with any [new attempt to pay](https://docs.dev.novaro.ink/payments/h2h/#show-the-details-to-the-payer). Retrying with the same `Idempotency-Key` answers the same blocked payment again. If you think a customer is blocked by mistake, ask our support. --- # Payments › Testing Source: https://docs.dev.novaro.ink/payments/testing/ Magic UTRs: take a test payment to every status, and get every webhook, without a payer. In [test mode](https://docs.dev.novaro.ink/test-mode/) no money moves and there is no payer to pay. Instead, the **UTR** a test payment is confirmed with decides what happens to it next: some UTRs are **magic** and take the payment to a status of your choice, the way test card numbers do at other payment providers. You confirm a test payment as you would a live one: - with [`POST /payments/{id}/confirmations`](https://docs.dev.novaro.ink/api/payments/), passing on the UTR as your payer would give it to you, or - on our [hosted payment page](https://docs.dev.novaro.ink/payments/hosted-page/), typing the UTR into the payer's "I have paid" form. Without a line of code, the portal does both for you: **Developers › Checkout › Open test checkout**, or **Create test payment** over Payments in test mode, makes a test payment, opens your page on it, and its **Simulate** buttons confirm it with each magic UTR below. ## Magic UTRs | UTR | What happens | | --- | --- | | `000000000001` | `processing`, then `succeeded` at once. | | `000000000002` | `processing`, then `failed` the market's late-payment window (24 hours by default) after the confirmation, possibly sooner if it was `processing` already: the money never came. | | `000000000003` | `processing`, then `failed` 5 seconds later. | | `000000000004` | `processing`, then `succeeded` at once, paid **1.00 less** than asked: `amount_paid` and `amount_credited` are what was paid, not `amount_payable`, and `amount_mismatch` is `true`. | | `000000000005` | Stays `awaiting_payer` until it expires, then `expired`, then `succeeded` 5 seconds later: a **late payment**. | | `000000000006` | Stays `awaiting_payer` until it expires, then `expired`, then `failed` 5 seconds later. | | Any other 12 digits | `processing`, and it stays so, as a live payment does while nobody has seen its money: nothing moves it on its own. Our team can mark it paid or failed for you, or it fails when its late-payment window closes: 24 hours by default, counted from when it became `processing` or from its `expires_at`, whichever is later. | "At once" means within a second or two: read the payment again to see it. A test payment that fails in 5 seconds: ```sh curl https://api.dev.novaro.ink/payments/pay_in_01J9…/confirmations \ -H "Authorization: Bearer sk_test_in_…" \ -H "Content-Type: application/json" \ -d '{ "utr": "000000000003" }' ``` The answer is the payment, `processing`; read it again with `GET /payments/{id}` and it is `failed`. ## How they behave - **The first magic UTR decides.** A payment confirmed again after a magic UTR, by you or by the payer, with any UTR, keeps the path of that first one: one that `000000000005` or `000000000006` keeps waiting for the payer stays waiting until it expires, and our page shows the payer their UTR being checked. A payment first confirmed with an ordinary UTR is `processing`, and still takes `000000000001` to `000000000004` afterwards; `000000000005` and `000000000006` change nothing on it, as a processing payment never expires. - **Any number of payments.** A magic UTR is not a real transaction, so you can confirm every test payment with it. Any other UTR is held as in live mode until its payment succeeded or failed: on a second payment it is `409` [`reference_already_used`](https://docs.dev.novaro.ink/api/errors/#reference_already_used). Once that payment succeeded or failed, it can confirm another test payment: no bank transaction paid the first, so nothing ties the UTR to it. Live mode refuses the reference of a transaction that paid a payment. - **Wrong UTRs are refused as in live mode.** One that is not 12 digits is `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid). - **Everything else is real.** The payment's statuses, its amounts and its webhooks are the ones a live payment gets on the same path. A test payment that is never confirmed expires at its `expires_at` and fails when its late-payment window closes, 24 hours by default after it expired, as a live one does. - **Live mode has no magic.** With a live key these are ordinary UTRs, and none of them is paid unless its money arrives. - **Test payments are kept 90 days.** A test payment, and its page, is deleted 90 days after it was created: `GET /payments/{id}` answers `404` from then on. Live payments are kept. ## Rate limits Test mode allows 25 requests a second per test key and 100 per account; a request over either is `429` [`rate_limit`](https://docs.dev.novaro.ink/api/errors/#rate_limit). See [Rate limits](https://docs.dev.novaro.ink/api/rate-limits/). --- # Security › IP allowlist Source: https://docs.dev.novaro.ink/security/ip-allowlist/ Allow your live keys only from your servers' addresses. Let your live API keys work only from your own servers. A key that leaks into a log, a repository or a laptop is then useless anywhere else. Test keys are not limited by it, so your laptop and CI work with them from anywhere ([Test mode](https://docs.dev.novaro.ink/test-mode/)). With no addresses on the list, live keys work from anywhere too. ## Add your servers 1. **Find your servers' public addresses.** The address the internet sees: your NAT gateway's or load balancer's outbound IP, not the server's private one. On each server that calls the API: ```sh curl -4 https://ifconfig.me; curl -6 https://ifconfig.me ``` 2. **Add them in the merchant portal.** Open the account, then Settings › Developers › IP allowlist › Add IP. One address or a range, with a label so you know later whose it is. 3. **Call the API from each server.** Within a second of adding, a live call from there goes through; a call from anywhere else gets `403` with the code `ip_not_allowed`. ## What you can add | | | | --- | --- | | Addresses | IPv4 and IPv6: one address (`203.0.113.7`, `2001:db8::7`) or a range in CIDR (`203.0.113.0/28`, `2001:db8:4f00::/48`). Our API answers on IPv6 too, so add your IPv6 if your servers have one. | | Range size | At most `/24` for IPv4 and `/48` for IPv6. Wider ranges would let in other people's servers. | | Public only | Private and reserved ranges (`10.0.0.0/8`, `192.168.0.0/16`, `::1` …) are refused: calls never come from there. | | How many | Up to 50 per account. Out of room? Use a range. | | Scope | The account: every live key of it, now and later. | ## When a call is refused A live key used from any other address gets `403` with the code [`ip_not_allowed`](https://docs.dev.novaro.ink/api/errors/#ip_not_allowed). The message names the address the call came from, so you know what to add. Response · 403 Forbidden: ```http HTTP/1.1 403 Forbidden {"error": {"type": "invalid_request_error", "code": "ip_not_allowed", "message": "This API key cannot be used from 198.51.100.7. Add the IP to the allowlist of the account.", …}} ``` Your developers get an email at most once an hour per address. The portal's IP allowlist page also lists **Recently blocked** addresses from the last 7 days, each with an Add button: moved to new servers, that list is the quickest way back. ## Who can change it Admins and developers of the account, in the merchant portal; operators do not see the page. Each change asks you to confirm it's you, takes effect within a second, and is emailed to the account's admins. Removing the last address asks to confirm that live keys will then work from any address. Our team can change the list for you too: the account's admins get the same email, and an entry our team added shows NovaroPay as who added it. ## And the other way: webhooks This list is about calls you make to us. To let our webhooks in through your firewall, allow [our IP addresses](https://docs.dev.novaro.ink/security/our-ips/) and check every webhook's signature. --- # Security › Our IP addresses Source: https://docs.dev.novaro.ink/security/our-ips/ The addresses our webhooks come from, by market. Webhooks come only from these addresses. Allow them on your firewall, and check every webhook's signature as well: an address alone does not prove a webhook is ours. Your account's market decides which addresses call you: an account in India gets its webhooks from India's. Test mode's webhooks come from the same list. The addresses, by market, are listed on this page of the docs site; they are not copied here, so open the page for the current ones. ## For your scripts The same lists as files, in the shape of Stripe's: https://docs.dev.novaro.ink/ips_webhooks.json (every market's addresses) and https://docs.dev.novaro.ink/ips_webhooks.txt. ## When they change We announce a change at least **7 days** ahead in the [Changelog](https://docs.dev.novaro.ink/changelog/) and by email to your developers, and list the new addresses beside the old ones until the switch. This list is about calls we make to you. To limit where calls with your own keys may come from, see [IP allowlist](https://docs.dev.novaro.ink/security/ip-allowlist/). --- # Webhooks › Webhooks Source: https://docs.dev.novaro.ink/webhooks/ Events sent to your server as they happen: endpoints, the event object, delivery and what to do with it. A **webhook endpoint** is a URL on your server that we send your account's **events** to as they happen: a payment created, processing, succeeded, failed or expired, or given new payment details. You don't have to ask for a payment's status: the event tells you. Every event is also kept for 30 days and can be read with [`GET /events`](https://docs.dev.novaro.ink/api/events/). ## Add an endpoint Endpoints are set up in the merchant portal, under **Settings › Developers › Webhooks**, by whoever keeps your account's integration, or by your account manager. The API has no endpoints for them. - The URL is an `https` URL on a public host name: no IP address, no user name or password. Its path and query are yours; we send to it as it is. - Its [event types](https://docs.dev.novaro.ink/webhooks/event-types/) are the ones it gets, or all of them, those we add later too. An endpoint gets only the events of the types it listened to when they happened: changing its types later does not send it earlier events. - Each endpoint has its own **signing secret**, `whsec_…`. Keep it: you need it to check that a request is ours ([Signatures](https://docs.dev.novaro.ink/webhooks/signatures/)). Roll it on the endpoint's page in the portal to get a new one; the old one can keep signing for up to 7 days while you deploy the new one. - An account has at most **16 endpoints** in each mode. - A test mode endpoint gets test mode's events, a live one live mode's: the modes never mix. ## What we send Each event is one `POST` to the endpoint, its body the [event object](https://docs.dev.novaro.ink/api/events/) as JSON, shaped in the endpoint's API version (its `api_version`, or your account's default): An event: ```json { "id": "evt_in_01K7…", "object": "event", "account": "macc_01K7…", "api_version": "2026-10-14.acacia", "created": 1760000000, "data": { "object": { "id": "pay_in_01K7…", "object": "payment", "status": "succeeded", "amount": 49900, … } }, "livemode": false, "pending_webhooks": 1, "request": { "id": null, "idempotency_key": null }, "type": "payment.succeeded" } ``` `data.object` is the object as its `GET` answers it, right after the event. `data.previous_attributes` comes only with `payment.instructions_updated` ([Events](https://docs.dev.novaro.ink/api/events/)). A delivery always has `request`: its `id` and `idempotency_key` are those of the API request that caused the event, or `null` when none did (your payer, a bank, or time passing); `GET /events/{id}` answers `"request": null` then. A body larger than 256 KB is sent without `data.object` but its `id` and `object`: read the object with its `GET`. The request's headers: | Header | What it is | | --- | --- | | `PSP-Signature` | `t=,v1=`: proves the request is ours ([Signatures](https://docs.dev.novaro.ink/webhooks/signatures/)) | | `PSP-Event-Id` | The event's `id` | | `PSP-Delivery-Attempt` | Which attempt this is, from 1 | | `Content-Type` | `application/json` | | `User-Agent` | `NovaroPay/1.0 (+https://docs…/webhooks)` | We send from [our IP addresses](https://docs.dev.novaro.ink/security/our-ips/) for your market, if your firewall has to let us in. ## Handle an event 1. **Check the signature** before anything else ([Signatures](https://docs.dev.novaro.ink/webhooks/signatures/)), on the raw body as it came. 2. **Answer `2xx` at once**, within 10 seconds, and do the work after. Anything else, a redirect too, is a failure, and we [try again](https://docs.dev.novaro.ink/webhooks/retries/). 3. **Process each event once.** We send an event at least once: a retry carries the same `id` and is a duplicate if you processed that `id` already. 4. **Don't count on the order.** Events can arrive in another order than they happened. Read `data.object.status`, and `data.object.version`, which grows with every change of a payment you can see: ignore an event whose version is older than one you have. When in doubt, read the payment with `GET /payments/{id}`. ## Turned off and failing An endpoint that is turned off, in the portal or by us, gets nothing, and its retries stop. Events while it is off are **not** sent once it is on again, and no delivery is made of them: read them with `GET /events?created[gte]=`. `delivery_success=false` lists only events whose delivery was tried, so it leaves these out. An endpoint that answered no attempt successfully for 24 hours is **failing**, and whoever keeps your account's integration gets an email; after 72 hours, and 10 failed attempts at least, we turn it off and email them again. A test mode endpoint is marked and turned off the same way, without the emails. Turn it on in the portal when your server is back, and read the events you missed: those whose delivery failed with `GET /events?delivery_success=false`, and those of the time it was off with `created[gte]`. When our support team adds, changes, turns off or on, rolls the signing secret of, rolls back or deletes a live endpoint for you, whoever keeps your account's integration gets an email saying what changed. ## Test mode A test mode endpoint gets the events of your test payments, as live mode's would come, so you can build against them: create a test payment and drive it to the status you need with a [magic UTR](https://docs.dev.novaro.ink/payments/testing/), or a test payout with a [magic amount](https://docs.dev.novaro.ink/api/payouts/#test-mode). Test mode retries less: see [Retries](https://docs.dev.novaro.ink/webhooks/retries/). --- # Webhooks › Event types Source: https://docs.dev.novaro.ink/webhooks/event-types/ Every event type a webhook endpoint can listen to, and what each means. An event's `type` is `resource.event`: `payment.succeeded` is about a payment. Choose the types an endpoint should get when you set it up, or All events for every type, including types we add later. Listening to everything is easy, but your server then gets events it may not need: we suggest naming the types you handle. **Added in** is the release that brought a type. As every addition (see [Versioning](https://docs.dev.novaro.ink/api/versioning/)), a new type reaches every API version at once: an endpoint that listens to it, or to All events, gets it whatever its own version, an older one included, with its object shaped in that version. New types can come at any time, so let your code ignore a type it doesn't know. ### Payments A payment was created, changed status or got new payment details. - `payment.created` (since 2026-10-01.acacia): A payment was created and waits for the payer; the payment details to show are in it. - `payment.processing` (since 2026-10-01.acacia): The payer or you confirmed the payment; we wait for the money to arrive. - `payment.succeeded` (since 2026-10-01.acacia): The money arrived. Sent again, with a higher version, when we correct a confirmed amount. - `payment.failed` (since 2026-10-01.acacia): The payment failed and will not be paid. - `payment.expired` (since 2026-10-01.acacia): Time to pay passed; money that arrives within the late-payment window still makes it succeeded. - `payment.instructions_updated` (since 2026-10-01.acacia): The payer got new payment details for the same amount; the status did not change. ### Payouts Money sent from your balance to a bank account was created, paid, failed, canceled or put under review. Test mode only for now: its magic amounts send every one. - `payout.created` (since 2026-10-24.acacia): A payout was made and waits to be sent; its amount and fee are held from your available balance. - `payout.paid` (since 2026-10-24.acacia): The recipient's bank took the payout. - `payout.failed` (since 2026-10-24.acacia): The payout was not sent, or the bank refused it; failure_code says why, and its amount and fee are back in your balance. - `payout.requires_review` (since 2026-10-24.acacia): We could not tell whether the payout went through, and our team is checking: it ends paid or failed. - `payout.canceled` (since 2026-10-24.acacia): You canceled a pending payout; its amount and fee are back in your balance. ### Settlements Your balance on a market was paid out to you in USDT, or such a payout changed. Live mode only: test mode makes no settlements. - `settlement.created` (since 2026-10-19.acacia): A settlement of your balance was made, by you or by our team, and waits to be sent; its amount is reserved from your available balance. - `settlement.updated` (since 2026-10-19.acacia): A pending settlement's amount, rate or address changed before it was sent, or a paid one was reversed: its amount is back in your balance. - `settlement.paid` (since 2026-10-19.acacia): A settlement was sent; its tx_hash is the TRON transfer. - `settlement.canceled` (since 2026-10-19.acacia): A settlement will not be sent; its amount is back in your balance. ### Reporting A report run your account's API key created is ready to download, or failed. Runs made in the merchant portal send none. - `reporting.report_run.succeeded` (since 2026-11-14.acacia): A report run your key created succeeded: its result is the file, to download with GET /files/{id}/contents. - `reporting.report_run.failed` (since 2026-11-14.acacia): A report run your key created failed: error says why. Create a new run. ## The settlement object The `settlement.*` events carry a settlement in `data.object`: a payout of your balance on a market in USDT, to one of your payout addresses, as Stripe's payout is. It is the same object [`GET /settlements/{id}`](https://docs.dev.novaro.ink/api/settlements/) answers, as it was right after the event; the [Settlements](https://docs.dev.novaro.ink/api/settlements/) page lists its fields. Each of your accounts on that market gets the event, for the settlements you request and for those our team makes for you (`origin`). They are live mode only: test mode makes no settlements, so an endpoint in test mode never gets one. `version` grows with every change of a settlement: ignore an event whose version is lower than one you processed. ## The report run object The `reporting.report_run.*` events carry a report run in `data.object`, as it was when it ended: the same object [`GET /reporting/report_runs/{id}`](https://docs.dev.novaro.ink/api/report-runs/) answers, with its file in `result` once it has succeeded. Only the runs a key created send them, to the endpoints of that key's account; a run your team asked for in the merchant portal sends none. A test key's run sends them to your test mode endpoints, and to [`novaro listen`](https://docs.dev.novaro.ink/webhooks/test-locally/). A run ends in the background, not in an API request, so these events' `request` has `id` and `idempotency_key` `null`, and `GET /events/{id}` answers `"request": null`, as for any event no request caused ([Webhooks](https://docs.dev.novaro.ink/webhooks/)); the `Idempotency-Key` the run was created with is not carried. Tell a run's events apart by `data.object.id`, the run's id that your `POST` answered. --- # Webhooks › Signatures Source: https://docs.dev.novaro.ink/webhooks/signatures/ Check that a webhook request is ours: the PSP-Signature header and how to verify it. Anyone can send a request to your endpoint's URL. Check every request's **signature** before you act on it: it proves the request is ours and that its body is as we sent it. ## The PSP-Signature header Every request carries a `PSP-Signature` header: ```http PSP-Signature: t=1760000000,v1=0ea76beaa2f76da27cbc5947a9772534287156d02b13d0ebb0d290a593cb9ecd ``` - `t` is when we signed the request, in seconds since the Unix epoch. Each attempt is signed anew, so a retry has a new `t`. - `v1` is the signature: HMAC-SHA256, in lowercase hex, of `t`, a `.` and the request's raw body, with your endpoint's signing secret, the whole `whsec_…` string, as the key. - While you roll the secret in the portal, the newest old secret keeps signing until the time you chose has passed: the header then has one `v1` for each secret in force, two at most. A request is ours if any `v1` matches. ## Verify a request 1. Take the body **exactly as it came**, before any JSON parsing: re-serialised JSON is other bytes. 2. Split the header on `,`, each part on its first `=`: keep `t` and every `v1`. 3. Compute the HMAC-SHA256 of `t + "." + body` with your secret, and compare it with each `v1` in **constant time**. 4. Refuse a request whose `t` is more than **5 minutes** from your clock, so a captured request can't be sent again later. Answer a request that fails with `400` and don't act on it. Each example below does the whole check and is tested against a delivery we sign: verify.go: ```go package yourapp import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "errors" "strconv" "strings" "time" ) // Tolerance is how old a delivery's timestamp may be: older ones are // refused, so a captured request can't be replayed later. const Tolerance = 5 * time.Minute // Verify checks the PSP-Signature header of a webhook delivery against the // raw request body, exactly as received, and your endpoint's signing // secret (whsec_…). It returns nil when the body is ours and recent. func Verify(body []byte, header, secret string, now time.Time) error { var timestamp string var signatures []string for _, part := range strings.Split(header, ",") { key, value, ok := strings.Cut(strings.TrimSpace(part), "=") if !ok { continue } switch key { case "t": timestamp = value case "v1": signatures = append(signatures, value) } } t, err := strconv.ParseInt(timestamp, 10, 64) if err != nil || len(signatures) == 0 { return errors.New("no timestamp or v1 signature in PSP-Signature") } if age := now.Sub(time.Unix(t, 0)); age > Tolerance || age < -Tolerance { return errors.New("timestamp outside the tolerance") } mac := hmac.New(sha256.New, []byte(secret)) mac.Write([]byte(timestamp + ".")) mac.Write(body) expected := mac.Sum(nil) // During a secret's roll the header has a v1 for each secret in force: // any one of them that matches is enough. for _, s := range signatures { got, err := hex.DecodeString(s) if err == nil && hmac.Equal(got, expected) { return nil } } return errors.New("no v1 signature matches") } ``` verify.mjs: ```js import { Buffer } from "node:buffer"; import crypto from "node:crypto"; // How old a delivery's timestamp may be, in seconds. const TOLERANCE = 300; // Checks the PSP-Signature header of a webhook delivery against the raw // request body (a Buffer or string, exactly as received) and your // endpoint's signing secret (whsec_…). True when the body is ours and // recent. export function verify(body, header, secret, now = Math.floor(Date.now() / 1000)) { let timestamp = ""; const signatures = []; for (const part of header.split(",")) { const i = part.indexOf("="); if (i < 0) continue; const key = part.slice(0, i).trim(); const value = part.slice(i + 1).trim(); if (key === "t") timestamp = value; if (key === "v1") signatures.push(value); } if (!/^\d+$/.test(timestamp) || signatures.length === 0) return false; if (Math.abs(now - Number(timestamp)) > TOLERANCE) return false; const expected = crypto.createHmac("sha256", secret).update(`${timestamp}.`).update(body).digest(); // During a secret's roll the header has a v1 for each secret in force: // any one of them that matches is enough. return signatures.some((s) => { const got = Buffer.from(s, "hex"); return got.length === expected.length && crypto.timingSafeEqual(got, expected); }); } ``` verify.py: ```python import hashlib import hmac import time from typing import Optional # How old a delivery's timestamp may be, in seconds. TOLERANCE = 300 def verify(body: bytes, header: str, secret: str, now: Optional[int] = None) -> bool: """Checks the PSP-Signature header of a webhook delivery against the raw request body, exactly as received, and your endpoint's signing secret (whsec_...). True when the body is ours and recent.""" timestamp, signatures = "", [] for part in header.split(","): key, sep, value = part.strip().partition("=") if not sep: continue if key == "t": timestamp = value elif key == "v1": signatures.append(value) # ASCII digits only: isdigit() alone takes others, such as superscripts. if not (timestamp.isascii() and timestamp.isdigit()) or not signatures: return False now = int(time.time()) if now is None else now if abs(now - int(timestamp)) > TOLERANCE: return False expected = hmac.new(secret.encode(), timestamp.encode() + b"." + body, hashlib.sha256).digest() # During a secret's roll the header has a v1 for each secret in force: # any one of them that matches is enough. for signature in signatures: try: got = bytes.fromhex(signature) except ValueError: continue # not hex: not a signature of ours if hmac.compare_digest(got, expected): return True return False ``` verify.php: ```php PSP_TOLERANCE) { return false; } $expected = hash_hmac('sha256', $timestamp . '.' . $body, $secret); // During a secret's roll the header has a v1 for each secret in force: // any one of them that matches is enough. foreach ($signatures as $signature) { if (hash_equals($expected, strtolower($signature))) { return true; } } return false; } ``` PspSignature.java: ```java import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.ArrayList; import java.util.HexFormat; import java.util.List; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; public final class PspSignature { // How old a delivery's timestamp may be, in seconds. static final long TOLERANCE = 300; // Checks the PSP-Signature header of a webhook delivery against the raw // request body, exactly as received, and your endpoint's signing secret // (whsec_…). True when the body is ours and recent. public static boolean verify(byte[] body, String header, String secret, long now) throws Exception { String timestamp = ""; List signatures = new ArrayList<>(); for (String part : header.split(",")) { String[] pair = part.trim().split("=", 2); if (pair.length != 2) continue; if (pair[0].equals("t")) timestamp = pair[1]; if (pair[0].equals("v1")) signatures.add(pair[1]); } // At most 18 digits: a timestamp that long fits a long, and a longer // one is no time of ours. if (!timestamp.matches("\\d{1,18}") || signatures.isEmpty()) return false; if (Math.abs(now - Long.parseLong(timestamp)) > TOLERANCE) return false; Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); mac.update((timestamp + ".").getBytes(StandardCharsets.UTF_8)); byte[] expected = mac.doFinal(body); // During a secret's roll the header has a v1 for each secret in force: // any one of them that matches is enough. for (String signature : signatures) { try { if (MessageDigest.isEqual(HexFormat.of().parseHex(signature), expected)) return true; } catch (IllegalArgumentException notHex) { // Not a signature of ours. } } return false; } public static boolean verify(byte[] body, String header, String secret) throws Exception { return verify(body, header, secret, System.currentTimeMillis() / 1000); } } ``` ## Check your code This request is signed with `whsec_8Kq3c2Vb7ZpXyN1mT4rLs6Hd9Jf0GwQe`, and with an older secret in the same header, at `t = 1760000000`: your code should take it at that time, and refuse it with one byte of the body changed. Header: ```http PSP-Signature: t=1760000000,v1=82c2dcc361905743b8690a3041dc1145863f6fe14cd9d9bf0589cdaa99cc3e0b,v1=8eed652a6c69ddf33a232a1fad0be724b3110cc8a0f385b221f705db8782e822 ``` Body: ```json {"id":"evt_in_01K7XAMPLE00000000000000","object":"event","account":"macc_01K7XAMPLE00000000000000","api_version":"2026-10-14.acacia","created":1760000000,"data":{"object":{"id":"pay_in_01K7XAMPLE00000000000000","object":"payment","amount":49900,"currency":"INR","status":"succeeded"}},"livemode":false,"pending_webhooks":1,"request":{"id":null,"idempotency_key":null},"type":"payment.succeeded"} ``` Keep the secret on your server only, never in a browser or an app. If it leaks, roll it at once, with no overlap: the old secret stops straight away. --- # Webhooks › Retries Source: https://docs.dev.novaro.ink/webhooks/retries/ When a delivery counts as received, and how long we try again when it doesn't. A delivery is **received** when your endpoint answers with a `2xx` status within **10 seconds** (3 to connect). Anything else is a failure, and we try again: - any other status, `3xx` included: we don't follow redirects, so point the endpoint at the final URL; - no answer within the time, a connection refused, or TLS older than 1.2; - a URL whose host name resolves to a private or reserved address: we don't connect to it. ## The schedule | Mode | Attempts | When | | --- | --- | --- | | Live | 16 over about 3 days | At once, then after 1, 5, 15 and 30 minutes, then 1, 2, 3, 4, 6, 6, 7, 8, 10, 12 and 12 hours | | Test | 4 over about 2.5 hours | At once, then after 5 minutes, 30 minutes and 2 hours | Each wait varies by up to 10%, so retries of many events don't arrive all at once. Every attempt carries the same event `id` and a new `PSP-Signature`; `PSP-Delivery-Attempt` says which attempt it is. A change of the endpoint applies to the next attempt: a new URL, a new API version (the event is shaped in it), a rolled secret. ## When attempts run out A delivery whose last attempt fails stays **failed**. Read what you missed with [`GET /events`](https://docs.dev.novaro.ink/api/events/)`?delivery_success=false`, or send it again from the endpoint's **Event deliveries** in the merchant portal, for up to 30 days: - **Resend** sends one delivery again, whatever its status, as soon as it can: right away, or just after an automatic attempt of it that is under way or about to start; - **Resend failed** sends again every delivery of the endpoint that failed, or was canceled while the endpoint was off, oldest first, 10 a second, up to 10,000 at a time. From your code, [`POST /events/{id}/retry`](https://docs.dev.novaro.ink/api/events/) with the endpoint's id resends one event, as **Resend** does; so does `novaro events resend` ([Test locally with the CLI](https://docs.dev.novaro.ink/webhooks/test-locally/)). A resend is a new attempt with the same event `id`, shaped in the endpoint's API version when it goes. It doesn't change the schedule: a delivery still being retried keeps its next attempt, and one already canceled that has automatic attempts left goes back on the schedule if the resend fails. An endpoint that is off takes no resend: turn it on first. An endpoint that has received nothing for 24 hours is marked failing, and we email whoever keeps your account's integration (live mode only). After 72 hours, and 10 failed attempts at least, we turn it off: it gets nothing until you turn it on again, and its deliveries waiting for a retry are canceled. Once it is on, **Resend failed** sends them; the events made while it was off have no delivery: read them with `GET /events?created[gte]=…`. ## Rolling back an API version For 72 hours after you change an endpoint's API version, you can roll it back to the one before, from the endpoint's page in the merchant portal. The deliveries that failed since the change, in the new version, go again in the old one: 10 a second, up to 10,000 (send the rest with **Resend failed**); the rest keep their schedule. An endpoint that is off is rolled back and sends nothing. --- # Webhooks › Test webhooks locally with the CLI Source: https://docs.dev.novaro.ink/webhooks/test-locally/ Forward test-mode events to a server on your machine with novaro listen, and make them happen with novaro trigger. The **novaro** CLI sends your account's test-mode events to a server on your machine, signed as your endpoints' are, so you can build and debug your webhook handler before it is on the internet. ## Set it up 1. Install it. Every release is on [github.com/novaro-pub/novaro-cli](https://github.com/novaro-pub/novaro-cli/releases), and these are its only channels: | System | How | | --- | --- | | macOS, Linux | `brew install novaro-pub/tap/novaro` | | Windows | `scoop bucket add novaro https://github.com/novaro-pub/scoop-bucket`, then `scoop install novaro` | | Debian, Ubuntu, Fedora | the `.deb` or `.rpm` package of a release | | Docker | `docker run --rm -it ghcr.io/novaro-pub/novaro version` | | Any other | the archive for your system from a release | `novaro version` prints the version you have; `brew upgrade novaro` or `scoop update novaro` moves to the latest. Each release's `checksums.txt`, which names every archive and package, is signed with [cosign](https://github.com/sigstore/cosign) by the release's own workflow. To check a download, keep `checksums.txt` and `checksums.txt.sigstore.json` from the same release beside it: ```sh cosign verify-blob --bundle checksums.txt.sigstore.json \ --certificate-identity-regexp '^https://github.com/novaro-pub/novaro-cli/' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com checksums.txt shasum -a 256 --check --ignore-missing checksums.txt ``` 2. Pair it with your account. `novaro login` shows a pairing code and opens the merchant portal's **Allow CLI access** page; someone who keeps your account's integration checks the code is the same and confirms. The page offers the accounts of the company you have open in the portal: switch to the right company first, or the key is of another company's account. ```sh novaro login ``` novaro gets a **CLI key** (`rk_test_…`) and keeps it in your system's keychain. It works in test mode only, for 90 days, and may only read events, resend them, and create, read and confirm test payments. The portal lists it under **Developers › API keys › CLI keys** with your machine's name, where you can expire it. In CI, pass a test secret key instead: `--api-key sk_test_…` on any command. novaro calls our API at the address `novaro login` paired with. To call another, such as a local or a staging API, pass `--api-base ` on any command, or set `NOVARO_API_BASE`. ## Forward events to your server `--forward-to` is the address of **your own** webhook handler on your machine: the port your server listens on and the path of its webhook route. `localhost:3000/webhooks` below is an example: put in yours, such as `localhost:8080/api/novaro/webhook` for an Express server on port 8080 with `app.post("/api/novaro/webhook", …)`. ```sh novaro listen --forward-to localhost:3000/webhooks ``` novaro prints this machine's **signing secret** (`whsec_…`) and then each event as it comes, with your server's answer: ```text Ready! Your webhook signing secret is whsec_… (^C to quit) 2026-10-16 12:00:00 --> payment.succeeded [evt_in_…] 2026-10-16 12:00:00 <-- [200] POST http://localhost:3000/webhooks [evt_in_…] ``` - Each event is a `POST` with the same body and headers as a delivery to an endpoint: verify `PSP-Signature` with the secret novaro printed, as the [Signatures](https://docs.dev.novaro.ink/webhooks/signatures/) page shows. The secret is this machine's and stays the same when you run `novaro listen` again; `novaro listen --print-secret` prints it and exits, for your server's configuration. - Your server's answer is the delivery's attempt: a `2xx` within 10 seconds is received. An event sent to novaro is tried once, never retried, and an event made while novaro isn't listening isn't sent to it later: read those with `GET /events`. - While it listens, the portal's Webhooks page (test mode) shows the machine as a **Local listener**. Your endpoints keep getting their events as usual. | Option | What it does | | --- | --- | | `--forward-to ` | Where to send each event. `localhost:3000/webhooks` means `http://localhost:3000/webhooks`. Without it, novaro shows the events and answers each as received. | | `--events ` | Only these types, comma-separated: `payment.succeeded,payment.failed`. All of them when left out. | | `--api-version `, `--latest` | Shape the events in this API version, or in the latest one. Your account's default when left out. | | `--headers "Key: Value, …"` | Headers to add to each forwarded request. | | `--skip-verify` | Accept any certificate of an `https://` `--forward-to`, a self-signed one included. | | `--format json` | Print each event's JSON on a line of its own instead. | ## Make events happen `novaro trigger` creates a test payment with `POST /payments` and, except for `payment.created`, confirms it with a UTR: a [magic one](https://docs.dev.novaro.ink/payments/testing/#magic-utrs) for `payment.succeeded` and `payment.failed`, an ordinary one for `payment.processing`. The event, and every event before it, goes out as from your own integration: to `novaro listen` and to your test endpoints. ```sh novaro trigger payment.succeeded novaro trigger payment.failed --override amount=50000 --override metadata.order=42 ``` | Event | How | | --- | --- | | `payment.created` | A payment waiting for the payer. | | `payment.processing` | Confirmed with an ordinary UTR; it stays `processing`, as a live payment whose money nobody has seen yet, until its late-payment window closes and it fails ([Testing](https://docs.dev.novaro.ink/payments/testing/#magic-utrs)). | | `payment.succeeded` | Confirmed with the magic UTR `000000000001`; it succeeds within a second or two. | | `payment.failed` | Confirmed with the magic UTR `000000000003`; it fails about 5 seconds later. | `--override field=value` sets a field of the payment, `customer.email=…` and `metadata.key=…` included. `novaro trigger --list` lists what it makes. ### Report runs `novaro trigger` makes payments only. A [report run](https://docs.dev.novaro.ink/api/report-runs/) you create with a test secret key (`sk_test_…`) sends `reporting.report_run.succeeded` to `novaro listen` too, as to your test endpoints, once its file is ready; a CLI key (`rk_`) cannot create runs. A failed run cannot be made on purpose in test mode: a run fails only when it cannot be prepared. Build your handler of `reporting.report_run.failed` from the [report run object](https://docs.dev.novaro.ink/webhooks/event-types/#the-report-run-object), whose `status` is `failed` and `error` says why. The [example integration](https://github.com/novaro-pub/novaropay-integration-example) has a webhook handler you can run this against: `npm start`, then `novaro listen --forward-to localhost:3000/webhooks`. ## Read and resend events ```sh novaro events list --type payment.* --limit 5 novaro events retrieve evt_in_… novaro events resend evt_in_… --webhook-endpoint whe_in_… ``` `events list` and `events retrieve` are [`GET /events`](https://docs.dev.novaro.ink/api/events/), `events resend` is `POST /events/{id}/retry`: one more attempt of the event's delivery to that endpoint, as **Resend** in the portal. They read test mode; pass `--live --api-key sk_live_…` for live mode. --- # Reports › Reports Source: https://docs.dev.novaro.ink/reports/ What a report file holds: its types, its columns, how its period is counted and why some values begin with an apostrophe. A report is one CSV file over a period you choose: your payments, your payouts, your settlements, or your balance and its changes. Use it to close a month, reconcile with your balance or load into your accounting. This page tells you what the file holds, so you can read it and join it to your own records. :::note Asking for reports in the merchant portal is on its way. Through the API, a key asks for a report of its account's payments, or of its payouts on a market that has them, with [Report runs](https://docs.dev.novaro.ink/api/report-runs/), and downloads its file with [Files](https://docs.dev.novaro.ink/api/files/): [Get reports through the API](https://docs.dev.novaro.ink/reports/get-reports-through-the-api/) takes you through it, and [Reconcile a month](https://docs.dev.novaro.ink/reports/reconcile-a-month/) joins a month's payments to your balance. This page describes the files they give you. ::: ## Report types Each type's id ends in its version, as Stripe's do. | Type | What a row is | Who gets it | Modes | | --- | --- | --- | --- | | `payments.itemized.1` | A payment of your accounts on the market. | Your team, for the accounts their role covers, or for all of the merchant's accounts on the market when their role reads the market's reports; and an API key, for its own account. | Live and test | | `payouts.itemized.1` | A payout of your accounts on the market. | The same people as payments, and an API key, for its own account. | Live and test, on a market that has payouts | | `settlements.itemized.1` | A settlement of your merchant on the market. | Whoever sees your whole balance, of the whole merchant or of the market. | Live only | | `balance.summary.1` | A line of your balance's summary: what it was at the start of the period, what moved it, and what it was at the end. | Whoever sees your whole balance. | Live only | | `balance_change_from_activity.itemized.1` | A change of your balance: the same lines as the CSV of Balance in the merchant portal. | Whoever sees your whole balance, for every line; whoever sees the balance of some accounts, for those accounts' lines. | Live only | A report covers one market. A payments or payouts report covers the accounts you choose, or every account you read. The payouts report is offered only on a market that has payouts: elsewhere it is not among your report types. A settlement and a balance are the whole merchant's, so a settlements report and a balance summary cover the merchant. A balance changes report covers the merchant, or the accounts you choose. "Whoever sees your whole balance" are the people whose role shows Balance and Settlements in the merchant portal across the merchant, of the whole merchant or of the market. ## The file - **CSV**, UTF-8 with a byte order mark, so a spreadsheet reads ₹ and names in any script. Fields are separated by commas and quoted as RFC 4180 says; lines end with CRLF. - **The first line is the header**: the columns' names, as in the tables below, in the order you chose them. Nothing comes before it. - **Amounts** are in the currency's major units with a dot and no thousands separators: `4999.00`, not `499900`. The currency is a column of its own. - **Times** are ISO 8601 with the offset of the report's time zone: `2026-10-31T23:50:12+05:30`; an offset of zero is written `Z`, as in UTC: `2026-10-31T18:20:12Z`. Columns whose names end in `_utc` are always in UTC, whatever the report's time zone. - **No value** is an empty cell. The file is named `_____.csv`, for example `payments_acme_IN_2026-10-01_2026-10-31_frr_….csv`: - `` is `payments`, `payouts`, `settlements`, `balance_summary` or `balance_changes`, by the report's type; - `` is your merchant's short code, as our team set it up; a merchant with none has its id, `mch_…`, in its place; - `` and `` are the first and the last day of the period, in the report's time zone. ## Payments: `payments.itemized.1` A report comes with its default columns unless you choose others. Columns marked **default** are in it; the others you can add. | Column | What it holds | | | --- | --- | --- | | `payment_id` | The payment's id, `pay_…`. | default | | `parent_id` | Empty: kept for refunds and chargebacks. | default | | `merchant_reference` | Your order id, as you sent it in `POST /payments`. | default | | `customer_id` | Your customer's id, as you sent it in `customer.id`. | default | | `type` | `deposit`. | default | | `traffic_type` | `ftd` or `std`, as you sent it. | default | | `method` | The payment method, e.g. `upi`. | default | | `status` | `created`, `awaiting_payer`, `processing`, `succeeded`, `failed` or `expired`. | default | | `failure_reason` | Why a `failed` or `expired` payment did not succeed (below); empty for any other. | default | | `market` | The market, e.g. `IN`. | | | `channel` | `hosted`: paid on our hosted payment page; `h2h`: on your own page. | | | `utr` | The payment's UTR, as the merchant portal's payment list shows it. | | | `amount_mismatch` | `true` when the payer paid other than `amount_payable`. | | | `metadata` | Your `metadata`, as JSON. | | | `currency` | The currency, e.g. `INR`. | default | | `amount_requested` | The amount you asked for. | default | | `amount_paid` | What arrived from the payer's bank; empty until the payment succeeded. | default | | `fee_pct` | Our percentage fee on it, e.g. `2.50` for 2.5%. | default, fees | | `fee_fixed` | Our fixed fee per payment. | default, fees | | `fee_amount` | Our fee on it. | default, fees | | `amount_payable` | What the payer was asked to pay. | | | `amount_credited` | What was credited to your balance for the payment, before our fee, with the corrections of its confirmation that the date basis counts ([The money of a month](https://docs.dev.novaro.ink/reports/#the-money-of-a-month)). The payment object's `amount_credited` is what to credit your customer, and is always the latest: when our team corrects a payment's confirmation, its `amount_paid` and `amount_credited` are worked out again, and you get `payment.succeeded` again with a higher `version`. A correction we make to your balance alone leaves the payment object as it was, and is not in this column. | | | `net_amount` | `amount_credited` less `fee_amount`: what the payment added to your balance. | fees | | `fee_status` | `posted`: the payment's money is in your balance, and the money columns show it. `not_posted`: it succeeded, but its money is not in your balance yet, and the money columns are empty. Empty for a payment that did not succeed. | fees | | `created_at` | When it was made, in the report's time zone. | default | | `created_at_utc` | `created_at` in UTC, whatever the report's time zone: `2026-10-31T18:20:12Z`. | default | | `status_changed_at` | When its status last changed, in the report's time zone: for a `succeeded`, `failed` or `expired` payment, when it reached that status. | default | | `status_changed_at_utc` | `status_changed_at` in UTC. | default | | `updated_at` | When it last changed, in the report's time zone. | | | `updated_at_utc` | `updated_at` in UTC. | | | `finalized_at` | When it reached its final status: `succeeded`, `failed` or `expired`, in the report's time zone. Empty while it has none. | | | `finalized_at_utc` | `finalized_at` in UTC. | | | `expires_at` | Until when the payer could pay. | | | `merchant_id` | Your merchant's id, `mch_…`. | default | | `merchant_name` | Your merchant's name. | default | | `account_id` | The account the payment is on, `macc_…`. | default | | `account_name` | The account's name. | | `amount_credited`, the fees and `net_amount` are empty for a payment that did not succeed, and for one whose `fee_status` is `not_posted`. The payments' `net_amount` is what payments added to your balance; your balance also moves with settlements, payouts and adjustments. The [balance summary](https://docs.dev.novaro.ink/reports/#balance-summary-balancesummary1) shows every kind of change. ### Who sees the fees The columns marked **fees** (`fee_pct`, `fee_fixed`, `fee_amount`, `net_amount` and `fee_status`) are only for those who see your balance, for the accounts their role covers. A report of someone who does not see it has none of them: its default is the other 19 columns, and asking for a fee column is refused with the column's name. An API key's report has them, for its own account. A report over several accounts has the fees only when its reader sees the balance of each of them. ### `failure_reason` | Value | | | --- | --- | | `expired` | No money came for it in time. | | `not_received` | The payer said they paid, and no money was found for it in time. | | `declined` | The payment provider declined it, and no other attempt could start. | | `marked_failed` | Our team reviewed it and marked it failed. | | `details_unavailable` | The payment details the payer was given stopped taking payments, and no others were free. | | `failed` | Any other way it failed. | A value you do not know yet means the payment did not succeed: treat it as `failed`. ## Payouts: `payouts.itemized.1` The same as your payouts in the API: see [Payouts](https://docs.dev.novaro.ink/api/payouts/). Where a payout went is as the payout object shows it: an account number's last four digits. A report holds no whole account number. | Column | What it holds | | | --- | --- | --- | | `payout_id` | The payout's id, `po_…`. | default | | `merchant_id` | Your merchant's id, `mch_…`. | default | | `merchant_name` | Your merchant's name. | default | | `account_id` | The account whose key made it, `macc_…`. | default | | `currency` | The currency: its three-letter ISO 4217 code. | default | | `amount` | The amount sent to the bank account. | default | | `fee_amount` | Our payout fee on it, as the payout object's `fee`. | default | | `status` | `pending`, `processing`, `requires_review`, `paid`, `failed` or `canceled`. | default | | `failure_code` | Why a `failed` payout failed, as the payout object's `failure_code`; empty for any other. | default | | `description` | Your own words on it. | default | | `created_at` | When it was made. | default | | `finalized_at` | When it ended: `paid`, `failed` or `canceled`. Empty while it has not. | default | | `net_amount` | What it took from your balance: the amount and the fee for a `paid` payout, `0.00` for a `failed` or `canceled` one, which gave them back. Empty while it has not ended. | default, fees | | `destination_type` | The kind of bank account, as the payout object's `destination.type`. | default | | `destination_masked` | Where it went, as the payout object's `destination` shows it: the account number's last four digits, e.g. `0019`. | default | | `recipient_masked` | Empty in the markets open now. | default | | `metadata` | Your `metadata`, as JSON. | | `net_amount` is only for those who see the fees, as in the payments report: [Who sees the fees](https://docs.dev.novaro.ink/reports/#who-sees-the-fees). ## Settlements: `settlements.itemized.1` The same as Settlements in the merchant portal, fees and rates included. Live mode only: a test environment has no settlements. See [Settlements](https://docs.dev.novaro.ink/api/settlements/) for how one is worked out. | Column | What it holds | | | --- | --- | --- | | `settlement_id` | The settlement's id, `st_…`. | default | | `merchant_id` | Your merchant's id, `mch_…`. | default | | `merchant_name` | Your merchant's name. | default | | `origin` | `merchant`: you requested it. `novaropay`: our team made it. As the settlement object's `origin`. | default | | `currency` | The currency of your balance, e.g. `INR`. | default | | `amount` | What left your balance, fee included. | default | | `fee_pct` | The percentage fee, e.g. `3.00` for 3%. | | | `fee_amount` | The percentage fee, in the currency. | default | | `fee_fixed_usdt` | The fixed fee, in USDT. | default | | `exchange_rate` | Units of the currency per 1 USDT. | default | | `usdt_amount` | What your wallet received, in USDT. | default | | `payout_address` | Your wallet it was sent to. | default | | `tx_hash` | The TRON transfer, once paid. | default | | `tronscan_url` | The transfer on Tronscan, once paid. | default | | `status` | `pending`, `paid`, `canceled` or `reversed`. | default | | `cancel_reason` | Why our team canceled it. | default | | `description` | Your own words on your request. | default | | `created_at` | When it was made. | default | | `paid_at` | When it was paid; empty until then. | default | | `canceled_at` | When our team canceled it; empty otherwise. | default | | `reversed_at` | When it was reversed; empty otherwise. | default | ## Balance summary: `balance.summary.1` Your balance on the market over the period, per currency: where it started, what moved it, and where it ended. The same balance as Balance in the merchant portal. Live mode only. | Column | What it holds | | | --- | --- | --- | | `merchant_id` | Your merchant's id, `mch_…`. | default | | `merchant_name` | Your merchant's name. | default | | `currency` | The currency, e.g. `INR`. | default | | `category` | What the row is (below). | default | | `description` | The category in words. | default | | `merchant_account_id` | For `payments_net`, the account the payments were on, `macc_…`; empty on every other row. | default | | `net_amount` | For a balance row, the balance; for a change, how much it moved your available balance. | default | | `fee_amount` | Our fees on the period's changes, those still held too; empty on a balance row. | default | The rows of each currency, in this order: | Category | Description | | | --- | --- | --- | | `opening_balance` | Balance at the start of the period | Your available balance just before the period. | | `payments_net` | Payments, less our fees | What payments moved it by: one row per account. | | `payouts` | Payouts | What payouts took, and gave back when they failed. | | `settlements` | Settlements | What settlements took, and gave back. | | `adjustments` | Adjustments | What our team's adjustments moved. | | `fee_refunds` | Fee refunds | Our fees given back. | | `other` | Other | Any other change: a row only when there is one. | | `closing_balance` | Balance at the end of the period | Your available balance at the period's end. | | `pending` | Held until verified at the end of the period | What was held, not yet available, at the period's end. | `opening_balance` plus every change is `closing_balance`; the closing balance of a month is the opening balance of the next. ## Balance changes: `balance_change_from_activity.itemized.1` Every change of your balance over the period, newest first: the same lines and values as the CSV of Balance in the merchant portal, with `created_at` written as every time in a report is. Live mode only. | Column | What it holds | | | --- | --- | --- | | `created_at` | When the change was written to your balance. | default | | `id` | The change's id, `ltx_…`. | default | | `type` | What kind of change it is (below). | default | | `description` | The change in words, e.g. `Payment`, `Payment released`, `Settlement`, or our team's own words on an adjustment. | default | | `source_id` | What made it: a payment `pay_…`, a payout `po_…`, a settlement `st_…` or an adjustment `adj_…`. | default | | `merchant_account_id` | The account it is on, `macc_…`; empty for a change of the whole merchant's, on no one account. | default | | `currency` | The currency, e.g. `INR`. | default | | `pending` | `true` while the amount is held, not yet available. | default | | `gross` | The amount before our fee. | default | | `fee` | Our fee on it. | default | | `net` | `gross` less `fee`: what it moved your balance by. | default | | `balance_after` | Your balance after it. | default, whole balance | | `fee_rule` | The fee your agreement set for it, e.g. `deposit 2.5% + 5.00 INR` or `deposit: no fee`; empty for a change with no fee rule. | default | `balance_after` is only in a report of every line of your merchant, for whoever sees your whole balance: a report of some accounts' lines has no balance after them. | Type | | | --- | --- | | `payment` | A payment: its credit, its release, a correction. | | `withdrawal` | A payout. | | `settlement` | A settlement. | | `adjustment` | An adjustment by our team. | | `fee_refund` | Our fee given back. | | `other` | Any other change. | ## Which rows are in the period A report's period runs from its start up to, but not including, its end. The balance reports count a line by when it was written to your balance: a line is in the period when it was written in it. They take no date basis. Which payments, payouts and settlements fall in the period is the report's **date basis**: | Date basis | A row is in the period when | | --- | --- | | **Final status date** (`finalized`, the default) | It reached its final status in the period, and is in it now: a payment `succeeded`, `failed` or `expired`; a payout `paid`, `failed` or `canceled`; a settlement `paid`, `canceled` or `reversed`. A payment, payout or settlement still on its way is in no period. | | **Created date** (`created`) | It was made in the period, whatever its status now. | Use the final status date to close a month: each payment is in exactly one month's file, the month it succeeded, failed or expired, and its money with it. Use the created date to see everything made in a period, unfinished ones too. A final status can still change, and the row moves with it: - An `expired` payment paid late, or a `failed` one our team confirms paid, becomes `succeeded`. It leaves the file of the period it expired or failed in, and is in the file of the period it succeeded in. - A `paid` settlement that is reversed leaves the period it was paid in, and is in the period it was reversed in. With the final status date, a status filter takes final statuses only: a report of `processing` payments by their final status date is refused, as such a payment has none. Choose the created date for it. ### The money of a month With the final status date, a succeeded payment's `amount_credited`, fee and `net_amount` are those it got when it succeeded, with the corrections made to it up to the end of the period. A correction made after the period is not in the file: it is in the next period's balance. So once each payment's `fee_status` is `posted`, a month's file shows the same money whenever you make it. A payment that is `not_posted` has its money columns empty, and a later file shows them. A payment's money is written to your balance a moment after it succeeds, sometimes later. A payment that succeeded at 23:59:59 on the last day of a month can be in that month's payments file and in the next month's balance reports. With the created date, the money is as it is now, as the status is: two files of the same period may differ. ## Time zones A report's time zone is an IANA name, such as `Asia/Kolkata`. A report that names no time zone is in UTC (`Etc/UTC`), as Stripe's. The time zone changes how times are written in the file (the `_utc` columns stay in UTC) and the dates in its name, nothing else: the period's start and end are moments, so a report of the same moments holds the same rows in any time zone. To report a calendar month of your market, start and end it at midnight in your market's time zone, e.g. `2026-10-01T00:00:00+05:30`. ## Data as of Every report is fixed at the moment you ask for it, less one minute: its `data_as_of`. What happened after it is not in the file. If preparing the file fails and is tried again, the new try keeps the same `data_as_of`; a report you ask for again later is a new one, with its own. - With the final status date, a payment that reaches its final status after `data_as_of`, while the file is being made too, is not in it: it is in the file of the period of its new status, and never twice in one file. - With the created date, every payment made in the period is in the file, in the status it had when its row was written. - A balance line written after `data_as_of` is not in the file. A period can end no later than one minute ago, and start no earlier than the first row of the report's kind on the market: your first payment, settlement or balance line. ## Values that begin with `'` A spreadsheet runs a cell that begins with `=`, `+`, `-` or `@` as a formula, and so would run one hidden in an order id or a description. So in a report, a text value that begins with `=`, `+`, `-`, `@`, a tab or a carriage return gets an apostrophe, `'`, before it: | Your value | In the file | | --- | --- | | `-1042` | `'-1042` | | `=1+1` | `'=1+1` | | `@order` | `'@order` | It is in the text columns, those with values that you or your customers wrote: `merchant_reference`, `customer_id`, `account_name`, `merchant_name`, `description` and the like. Amounts and times never get one: a negative amount stays a number. To join the file on your order id, take the `'` off again: when a value begins with `'` and its next character is one of `=`, `+`, `-`, `@`, a tab or a carriage return, drop the first character. A value that begins with `'` followed by anything else is as you sent it. One case cannot be told apart: a value of yours that itself begins with `'` and then one of those characters, such as `'=x`, is written as it is, and taking the `'` off gives `=x`. Keep your order ids from beginning with `'` to join them safely. ```python import csv GUARDED = ("=", "+", "-", "@", "\t", "\r") def unguard(value: str) -> str: if len(value) > 1 and value[0] == "'" and value[1] in GUARDED: return value[1:] return value # utf-8-sig reads past the byte order mark. with open("payments_acme_IN_2026-10-01_2026-10-31_frr_….csv", encoding="utf-8-sig", newline="") as f: for row in csv.DictReader(f): order_id = unguard(row["merchant_reference"]) ``` In a spreadsheet, the same for the order id in `B2`, the tab and the carriage return too: ```text =IF(AND(LEFT(B2,1)="'", OR(MID(B2,2,1)="=", MID(B2,2,1)="+", MID(B2,2,1)="-", MID(B2,2,1)="@", MID(B2,2,1)=CHAR(9), MID(B2,2,1)=CHAR(13))), MID(B2,2,LEN(B2)), B2) ``` ## Limits - A period is at most 366 days. - A file is at most 1.5 GB: a larger one fails with "The file is over 1.5 GB: choose a shorter period or fewer columns." - Up to 5 reports of your merchant, and 3 of each person or API key, are prepared at a time; more is refused until one of them is ready or has failed, and a report still unfinished 24 hours after it was asked for no longer holds its place. - A file can be downloaded for 7 days after it is ready. --- # Reports › Get reports through the API Source: https://docs.dev.novaro.ink/reports/get-reports-through-the-api/ Ask for a report of your account's payments, wait for it, and download its file: every step with curl, its errors and test mode. A report is prepared in the background: you ask for it, we make its file, and you download the file when it is ready. Through the API that is four calls of your server: choose the [report type](https://docs.dev.novaro.ink/api/report-types/), create a [report run](https://docs.dev.novaro.ink/api/report-runs/), wait for it, and download its [file](https://docs.dev.novaro.ink/api/files/). This page takes you through them with `curl`; [Reports](https://docs.dev.novaro.ink/reports/) tells you what the file holds. ## Before you start - A **secret key** of the account, `sk_live_…` or `sk_test_…` ([API keys](https://docs.dev.novaro.ink/api-keys/)). A [CLI key](https://docs.dev.novaro.ink/api/authentication/#cli-keys), `rk_…`, gets `403 api_key_permission`. - A key reports on **its own account's payments**: `payments.itemized.1`; and, on a market that has payouts, on **its own account's payouts**: `payouts.itemized.1`. The steps below use payments; a payouts report is asked for the same way. A key cannot ask for the reports of settlements and of the balance: people ask for them in the merchant portal, under **Reports › New report**, which is on its way. Settlements and the balance summary are your whole merchant's; the balance changes are every line for whoever sees your whole balance, and an account's lines for an admin or operator of it. - A [webhook endpoint](https://docs.dev.novaro.ink/webhooks/) that listens to `reporting.report_run.succeeded` and `reporting.report_run.failed`, so you learn when a run ends. Without one, read the run until it ends (step 3). ## Get a report 1. **Choose the report type.** Read the type with its columns and the period its data covers now: The payments report type: ```sh curl https://api.dev.novaro.ink/reporting/report_types/payments.itemized.1 \ -H "Authorization: Bearer sk_test_in_…" ``` ```json title="Response · 200 OK (shortened)" { "id": "payments.itemized.1", "object": "reporting.report_type", "name": "Itemized payments", "version": 1, "default_columns": ["payment_id", "parent_id", "merchant_reference", "…", "merchant_name", "account_id"], "columns": ["payment_id", "parent_id", "merchant_reference", "…", "account_id", "account_name"], "filters": ["status", "method", "traffic_type", "amount_min", "amount_max"], "data_available_start": 1759300000, "data_available_end": 1793520000, "updated": 1793520000, "livemode": false } ``` A run's period must fall within `data_available_start`, when your account's first payment was made, and `data_available_end`, one minute ago. So the period of the month your first payment was made in starts at `data_available_start`, not at the month's start: a run from the month's start is refused. An account with no payment yet has no `data_available_start`, and nothing to report. `columns` are the ones your key may ask for; `GET /reporting/report_types` lists every type your key can ask for. 2. **Create the run.** Send the type and the period, in seconds since the Unix epoch, its end not included. To report a calendar month of your market, start and end it at midnight in its time zone: October 2026 in India is `2026-10-01T00:00:00+05:30` to `2026-11-01T00:00:00+05:30`, `1790793000` to `1793471400` (`date -d '2026-10-01T00:00:00+05:30' +%s` with GNU date, `date -j -f '%Y-%m-%dT%H:%M:%S%z' 2026-10-01T00:00:00+0530 +%s` on macOS). If your first payment was made after the month's start, start at your `data_available_start` instead. A run over October: ```sh curl https://api.dev.novaro.ink/reporting/report_runs \ -H "Authorization: Bearer sk_test_in_…" \ -H "Idempotency-Key: 3f2a1b00-0000-4000-8000-000000000001" \ -H "Content-Type: application/json" \ -d '{ "report_type": "payments.itemized.1", "parameters": { "interval_start": 1790793000, "interval_end": 1793471400, "timezone": "Asia/Kolkata", "date_basis": "finalized", "columns": ["payment_id", "merchant_reference", "account_id", "currency", "status", "finalized_at", "amount_credited", "fee_amount", "net_amount", "fee_status"] } }' ``` ```json title="Response · 201 Created" { "id": "frr_in_01K8RC…", "object": "reporting.report_run", "report_type": "payments.itemized.1", "status": "pending", "parameters": { "interval_start": 1790793000, "interval_end": 1793471400, "timezone": "Asia/Kolkata", "columns": ["payment_id", "merchant_reference", "account_id", "currency", "status", "finalized_at", "amount_credited", "fee_amount", "net_amount", "fee_status"], "date_basis": "finalized", "status": null, "method": null, "traffic_type": null, "amount_min": null, "amount_max": null }, "result": null, "error": null, "livemode": false, "created": 1793520000, "succeeded_at": null, "data_as_of": 1793519940 } ``` Left out, `timezone` is `Etc/UTC`, `date_basis` is `finalized` and `columns` are the type's `default_columns`. The filters `status`, `method`, `traffic_type`, `amount_min` and `amount_max` keep the payments of that value alone ([Report runs](https://docs.dev.novaro.ink/api/report-runs/#creating-one)). The file holds the data as of `data_as_of`, a minute before you asked. Send an `Idempotency-Key`, and the same key when you send the request again after a timeout: if the first request made a run, you get that run, with `Idempotent-Replayed: true`, never a second one ([Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/#endpoints-with-their-own-rules)). A refused request, such as a `409`, made none: the same request sent again makes the run, `201` without `Idempotent-Replayed`. 3. **Wait for the run.** A run is `pending` while its file is made, usually for seconds, longer for a long period. It then ends `succeeded`, with its file in `result`, or `failed`, with `error` saying why. **By webhook.** A run your key created sends `reporting.report_run.succeeded` or `reporting.report_run.failed` to your account's endpoints, with the run in `data.object`: ```json title="reporting.report_run.succeeded (shortened)" { "id": "evt_in_01K8RD…", "object": "event", "type": "reporting.report_run.succeeded", "data": { "object": { "id": "frr_in_01K8RC…", "object": "reporting.report_run", "report_type": "payments.itemized.1", "status": "succeeded", "result": { "id": "file_in_01K8RC…", "object": "file", "purpose": "finance_report_run", "type": "csv", "filename": "payments_acme_IN_2026-10-01_2026-10-31_frr_in_01K8RC….csv", "size": 950, "created": 1793520012, "expires_at": 1794124812, "url": "/files/file_in_01K8RC…/contents" } } }, "livemode": false } ``` Check its [signature](https://docs.dev.novaro.ink/webhooks/signatures/), answer `200` at once, and download the file after that, not inside the request. A run your team asked for, not your key, sends no event. **By reading the run.** Without a webhook, read it until it is no longer `pending`, with a backoff: wait 2 seconds, then twice as long each time, at most a minute apart. Read the run: ```sh curl https://api.dev.novaro.ink/reporting/report_runs/frr_in_01K8RC… \ -H "Authorization: Bearer sk_test_in_…" ``` A run not prepared within 24 hours after you asked fails, with `error` "The report was not prepared within a day: try again." and its `reporting.report_run.failed` event; create a new one. 4. **Download the file.** `result.url` is a path on the API's host: put the API's base URL before it, and call it with your key. The answer is a `302` to the file itself, a link good for 60 seconds, which `-L` follows: Download the file: ```sh curl -L https://api.dev.novaro.ink/files/file_in_01K8RC…/contents \ -H "Authorization: Bearer sk_test_in_…" \ -o payments_october.csv ``` Follow the link at once, and call the URL again for a new one; every download is recorded. curl sends your key to the API's host alone, never to the link's: don't use `--location-trusted`, and in your own HTTP client don't pass the `Authorization` header on to the link. The `Location` may be a path on the API's host rather than a full address: resolve it against the base URL, as curl does. The file is kept for 7 days after the run succeeded, until `result.expires_at`. ## The whole of it in one script The script below does the four steps for a payments report. It reads the type and starts the period no earlier than `data_available_start`; creates the run with one `Idempotency-Key`, and sends it again a minute after a `409`, a `429`, a `5xx` or no answer, five times at most; reads the run with the backoff above, for an hour at most, through a `429` or a `5xx`; and downloads the file under its `filename`, again after a `429` or a `5xx`. Any other error stops it with the API's `code` and `message`. `PSP_TZ` is the time zone of the file's times, `Asia/Kolkata` unless you set it. It needs `curl` and `jq`, and is tested against our API's answers: the report type and runs its test is answered with are the objects our API writes, field for field: get-report.sh: ```sh #!/bin/sh # Get a payments report through the API: read the report type, create a # report run, wait for it with backoff, and download its file. Needs curl # and jq. # # PSP_API=https://api.example PSP_KEY=sk_test_in_… \ # sh get-report.sh 1790793000 1793471400 [file.csv] # # The interval is in seconds since the Unix epoch, its end not included. # PSP_TZ is the time zone of the file's times, Asia/Kolkata unless set. set -eu api=${PSP_API:?set PSP_API to the base URL of the API} key=${PSP_KEY:?set PSP_KEY to your secret key} tz=${PSP_TZ:-Asia/Kolkata} start=${1:?interval_start} end=${2:?interval_end} out=${3:-} run=$(mktemp) got=$(mktemp) trap 'rm -f "$run" "$got"' EXIT # Print the API's error, {"error": {"code", "message"}}, of file $1 and stop; # any other answer, as a proxy's, as it came. fail() { [ -s "$1" ] || { echo "no answer from the API" >&2; exit 1; } jq -er '.error | select(type == "object") | "\(.code // .type): \(.message)"' "$1" >&2 2>/dev/null || cat "$1" >&2 exit 1 } # GET path $1 with your key into $got; its HTTP status in $code, 000 when # there was no answer. get() { : > "$got" code=$(curl -sS -o "$got" -w '%{http_code}' "$api$1" -H "Authorization: Bearer $key") || code=000 } # Whether status $1 is worth trying again: rate limited, or the API could # not answer. again() { case $1 in 429 | 5* | 000) return 0 ;; *) return 1 ;; esac } # 1. Read the report type: a period starts no earlier than your first # payment, data_available_start, so the first month starts there. get /reporting/report_types/payments.itemized.1 [ "$code" = 200 ] || fail "$got" first=$(jq -r '.data_available_start // empty' "$got") if [ -z "$first" ]; then echo "your account has no payment yet: nothing to report" >&2 exit 1 fi if [ "$start" -lt "$first" ]; then echo "starting at $first, your first payment" >&2 start=$first fi body=$(jq -n --argjson start "$start" --argjson end "$end" --arg tz "$tz" '{ report_type: "payments.itemized.1", parameters: { interval_start: $start, interval_end: $end, timezone: $tz, date_basis: "finalized", columns: ["payment_id", "merchant_reference", "account_id", "currency", "status", "finalized_at", "amount_credited", "fee_amount", "net_amount", "fee_status"] } }') # 2. Create the run. One Idempotency-Key for all its tries: a retry after # a timeout gets the run the first try made, never a second one. idem=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid) tries=0 while :; do # Emptied first: an attempt that gets no answer leaves no older body. : > "$run" code=$(curl -sS -o "$run" -w '%{http_code}' "$api/reporting/report_runs" \ -H "Authorization: Bearer $key" \ -H "Idempotency-Key: $idem" \ -H "Content-Type: application/json" \ -d "$body") || code=000 [ "$code" = 201 ] && break # 409: too many of your reports are being prepared, and no run was made; # 429, 5xx, no answer: wait a minute, then send the same request again. # Anything else (report_interval_invalid, parameter_invalid...): change # the request. if [ "$code" = 409 ] || again "$code"; then tries=$((tries + 1)) [ "$tries" -le 5 ] || fail "$run" sleep 60 else fail "$run" fi done id=$(jq -r .id "$run") echo "created $id" >&2 # 3. Wait while it is pending: 2 s, then twice as long each time, at most # a minute apart, for an hour. The reporting.report_run.succeeded webhook # tells you too. wait=2 waited=0 while [ "$(jq -r .status "$run")" = pending ]; do if [ "$waited" -ge 3600 ]; then echo "$id is still pending: read it again later" >&2 exit 1 fi sleep "$wait" waited=$((waited + wait)) wait=$((wait * 2 > 60 ? 60 : wait * 2)) get "/reporting/report_runs/$id" if [ "$code" = 200 ]; then cp "$got" "$run" elif ! again "$code"; then fail "$got" fi done if [ "$(jq -r .status "$run")" != succeeded ]; then echo "$id failed: $(jq -r .error "$run")" >&2 exit 1 fi # 4. Download the file: a 302 to a link good for 60 seconds, which -L # follows. curl sends your key to the API's host alone, never to the link. file=${out:-$(jq -r .result.filename "$run")} tries=0 while :; do : > "$got" code=$(curl -sS -L -o "$got" -w '%{http_code}' "$api$(jq -r .result.url "$run")" \ -H "Authorization: Bearer $key") || code=000 [ "$code" = 200 ] && break # file_expired: create the run again. 429, 5xx: try again. again "$code" && [ "$tries" -lt 5 ] || fail "$got" tries=$((tries + 1)) sleep 60 done cp "$got" "$file" echo "$file" >&2 ``` October's payments report: ```sh PSP_API=https://api.dev.novaro.ink PSP_KEY=sk_test_in_… sh get-report.sh 1790793000 1793471400 ``` The [example integration](https://github.com/novaro-pub/novaropay-integration-example) does the same in Node.js, with no packages: [`REPORTS.md`](https://github.com/novaro-pub/novaropay-integration-example/blob/main/REPORTS.md) walks through it. `npm run report` creates a run and reads it until it ends. With `--wait webhook` it stops once the run is created, and the example's shop downloads the file: soon after `reporting.report_run.succeeded`, or when it next checks the runs it created, every few minutes. It leaves other keys' runs and your team's alone. Both follow the link without the key, read the CSV with its byte order mark and CRLF, and handle the errors below. ## Errors A refused request makes no run. The [error](https://docs.dev.novaro.ink/api/errors/) says what to change: | Error | When | What to do | | --- | --- | --- | | `400` [`report_interval_invalid`](https://docs.dev.novaro.ink/api/errors/#report_interval_invalid) | The period ends before it starts, is longer than 366 days, starts before the type's `data_available_start` or ends after its `data_available_end`. `param` names the end to change. | Read the type again. Start the period no earlier than `data_available_start`, when your account's first payment was made: the month of your first payment starts there. End it no later than `data_available_end`: a month that ended less than a minute ago is not reportable yet. Split a longer period into several runs. | | `409` [`report_runs_in_progress`](https://docs.dev.novaro.ink/api/errors/#report_runs_in_progress) | 3 runs of your key, or 5 of your merchant's, are still being prepared. | Wait for one of them to end, by its webhook or by reading it, then send the same request again: no run was made, so it makes one. Ask for one report at a time. | | `400` [`file_expired`](https://docs.dev.novaro.ink/api/errors/#file_expired) | The file is past its `expires_at`, 7 days after the run succeeded. | Create a new run with the run's `report_type` and `parameters`. Download a file when its run ends, and keep it. | | `400` [`parameter_invalid`](https://docs.dev.novaro.ink/api/errors/#parameter_invalid) | A parameter is wrong, such as a column the type does not have, a time zone that is not an IANA name or a `date_basis` of `finalized` with a status that is not final. `param` names it. | Fix the parameter. | | `400`, type [`idempotency_error`](https://docs.dev.novaro.ink/api/errors/#error-types) | The `Idempotency-Key` was used for another request in the last 24 hours. | Use a new key for a new report; send a retry with exactly the first request's body. | | `404` [`resource_missing`](https://docs.dev.novaro.ink/api/errors/#resource_missing) | The run or file is not your key's account's, or does not exist: a run your team asked for over several accounts too. | Read the runs your key sees with `GET /reporting/report_runs`. | A run that **fails** has `status` `failed` and `error` in words: "The file is over 1.5 GB: choose a shorter period or fewer columns." Create a new run as it says; the one that failed is not tried again. ## Test mode With a test key, `sk_test_…`, every call above works the same way on the test environment: the report holds your test payments, every object has `livemode` `false`, and the run's events go to your test mode endpoints ([Test mode](https://docs.dev.novaro.ink/test-mode/)). - Make test payments of every status with the [magic UTRs](https://docs.dev.novaro.ink/payments/testing/) first: the type's `data_available_start` is when your first test payment was made, so a test report of a month starts there, not at the month's start. - Test payments are deleted 90 days after they were made: a test report holds those still kept. - Test keys share the test mode [rate limit](https://docs.dev.novaro.ink/api/rate-limits/): read a run with the backoff above, not in a tight loop. Switching to live is switching the key: a live key's report holds your live payments. Next: [Reconcile a month](https://docs.dev.novaro.ink/reports/reconcile-a-month/) sums a month's payments report and joins it to your balance. --- # Reports › Reconcile a month Source: https://docs.dev.novaro.ink/reports/reconcile-a-month/ Sum a month's payments report by final status date, and join it to your balance's changes, the payments on the month's edge included. To close a month, you check that the payments it brought are the money your balance got for them. The payments report by **final status date** puts each payment in exactly one month, the month it succeeded, with what it added to your balance, `net_amount`. Your balance counts the same money by when it was **written** to it. The two agree but for the payments on the month's edge, and this page shows how to find them. ## Before you start - A **secret key** of the account, for its payments report ([Get reports through the API](https://docs.dev.novaro.ink/reports/get-reports-through-the-api/)). A live key: the balance reports are of live mode only. - The month's **balance changes**, `balance_change_from_activity.itemized.1`: every change of your balance, with what made it. A key cannot ask for it: it is asked for in the merchant portal, under **Reports › New report › Balance changes**, by whoever sees your whole balance, for every line, or by an admin or operator of your account, for its lines ([Reports](https://docs.dev.novaro.ink/reports/#balance-changes-balance_change_from_activityitemized1)). Either has your account's payment lines, all this page needs. That is on its way: until it is there, a month can be reconciled only once it is. **Balance › Export CSV** in the merchant portal has the same lines, but only over a period that ends now (today, the last 7 or 30 days, this month), so it does not hold a month that has ended. - Wait until the month is over: a period can end no later than one minute ago. ## Reconcile 1. **Ask for the month's payments by their final status date.** Start and end the month at midnight in your market's time zone, and ask for `date_basis` `finalized`, the default, with `net_amount` and `fee_status` among the columns: October 2026's payments, by final status date: ```sh curl https://api.dev.novaro.ink/reporting/report_runs \ -H "Authorization: Bearer sk_live_in_…" \ -H "Idempotency-Key: 3f2a1b00-0000-4000-8000-000000000002" \ -H "Content-Type: application/json" \ -d '{ "report_type": "payments.itemized.1", "parameters": { "interval_start": 1790793000, "interval_end": 1793471400, "timezone": "Asia/Kolkata", "date_basis": "finalized", "columns": ["payment_id", "merchant_reference", "account_id", "currency", "status", "finalized_at", "amount_credited", "fee_amount", "net_amount", "fee_status"] } }' ``` Wait for the run and download its file as in [Get reports through the API](https://docs.dev.novaro.ink/reports/get-reports-through-the-api/), or with its script: `sh get-report.sh 1790793000 1793471400 payments.csv`. payments.csv: ```csv payment_id,merchant_reference,account_id,currency,status,finalized_at,amount_credited,fee_amount,net_amount,fee_status pay_in_01K8RCNVECTOR000000000000A1,order_8812,macc_01K7XAMPLE00000000000000,INR,succeeded,2026-10-05T14:02:11+05:30,1000.00,25.00,975.00,posted pay_in_01K8RCNVECTOR000000000000A2,order_8813,macc_01K7XAMPLE00000000000000,INR,succeeded,2026-10-20T09:15:40+05:30,1900.00,47.50,1852.50,posted pay_in_01K8RCNVECTOR000000000000A3,order_8814,macc_01K7XAMPLE00000000000000,INR,succeeded,2026-10-24T18:44:02+05:30,200.00,5.00,195.00,posted pay_in_01K8RCNVECTOR000000000000A4,order_8815,macc_01K7XAMPLE00000000000000,INR,failed,2026-10-27T11:30:00+05:30,,,, pay_in_01K8RCNVECTOR000000000000A5,order_8816,macc_01K7XAMPLE00000000000000,INR,succeeded,2026-10-31T23:59:58+05:30,500.00,12.50,487.50,posted pay_in_01K8RCNVECTOR000000000000A6,order_8817,macc_01K7XAMPLE00000000000000,INR,succeeded,2026-10-31T23:59:59+05:30,,,,not_posted ``` 2. **Check that every payment is posted.** A succeeded payment whose money is not in your balance yet has `fee_status` `not_posted` and no money in the file. Its money is written a moment after it succeeds, sometimes later: make the report again later, and it has its money. A payment that did not succeed has no `fee_status` and no money. 3. **Sum `net_amount`.** It is what the month's payments added to your balance: what was credited for each, less our fee, with the corrections made to it up to the month's end. Sum it with a decimal type, not a float. Once every payment is posted, the month's report shows the same money whenever you make it: a correction made after the month is in a later month's balance, never in this report. 4. **Take the payments' changes of the same month from your balance.** Get `balance_change_from_activity.itemized.1` over the same moments, the same month in the same time zone. Its lines of `type` `payment` on your account, whose `source_id` is the payment, are what payments moved your available balance by. A line with `pending` `true` is money held, not yet available: count the line that releases it, not the one that holds it. A correction is two lines: the amount before, taken back ("Payment corrected: the amount before"), and the corrected amount ("Payment corrected"). balance_changes.csv: ```csv created_at,id,type,description,source_id,merchant_account_id,currency,pending,gross,fee,net,balance_after,fee_rule 2026-10-30T10:00:00+05:30,ltx_in_01K8RCNVECTOR00000000000BA,settlement,Settlement,st_in_01K8RCNVECTOR0000000000000S1,,INR,false,-2000.00,0.00,-2000.00,7323.00,settlement 1% + 1.00 USDT 2026-10-25T09:00:00+05:30,ltx_in_01K8RCNVECTOR00000000000B9,payment,Payment released,pay_in_01K8RCNVECTOR000000000000A3,macc_01K7XAMPLE00000000000000,INR,false,195.00,0.00,195.00,9323.00, 2026-10-24T18:44:03+05:30,ltx_in_01K8RCNVECTOR00000000000B8,payment,Payment,pay_in_01K8RCNVECTOR000000000000A3,macc_01K7XAMPLE00000000000000,INR,true,200.00,5.00,195.00,,deposit 2.5% 2026-10-22T12:00:00+05:30,ltx_in_01K8RCNVECTOR00000000000B7,payment,Payment corrected,pay_in_01K8RCNVECTOR000000000000A2,macc_01K7XAMPLE00000000000000,INR,false,1900.00,47.50,1852.50,9128.00,deposit 2.5% 2026-10-22T12:00:00+05:30,ltx_in_01K8RCNVECTOR00000000000B6,payment,Payment corrected: the amount before,pay_in_01K8RCNVECTOR000000000000A2,macc_01K7XAMPLE00000000000000,INR,false,-2000.00,-50.00,-1950.00,7275.50,deposit 2.5% 2026-10-20T09:15:41+05:30,ltx_in_01K8RCNVECTOR00000000000B5,payment,Payment,pay_in_01K8RCNVECTOR000000000000A2,macc_01K7XAMPLE00000000000000,INR,false,2000.00,50.00,1950.00,9225.50,deposit 2.5% 2026-10-12T16:20:00+05:30,ltx_in_01K8RCNVECTOR00000000000B4,payment,Payment,pay_in_01K8RCNVECTOR0000000000000X1,macc_01K7OTHERACCOUNT00000000000,INR,false,1000.00,25.00,975.00,7275.50,deposit 2.5% 2026-10-05T14:02:12+05:30,ltx_in_01K8RCNVECTOR00000000000B3,payment,Payment,pay_in_01K8RCNVECTOR000000000000A1,macc_01K7XAMPLE00000000000000,INR,false,1000.00,25.00,975.00,6300.50,deposit 2.5% 2026-10-03T08:10:00+05:30,ltx_in_01K8RCNVECTOR00000000000B2,payment,Payment corrected,pay_in_01K8RCNVECTOR000000000000S9,macc_01K7XAMPLE00000000000000,INR,false,250.00,6.25,243.75,5325.50,deposit 2.5% 2026-10-03T08:10:00+05:30,ltx_in_01K8RCNVECTOR00000000000B1,payment,Payment corrected: the amount before,pay_in_01K8RCNVECTOR000000000000S9,macc_01K7XAMPLE00000000000000,INR,false,-300.00,-7.50,-292.50,5081.75,deposit 2.5% 2026-10-01T00:00:02+05:30,ltx_in_01K8RCNVECTOR00000000000B0,payment,Payment,pay_in_01K8RCNVECTOR000000000000S8,macc_01K7XAMPLE00000000000000,INR,false,300.00,7.50,292.50,5374.25,deposit 2.5% ``` 5. **Join the two by the payment.** The difference between the two sums is the payments whose money is in another month's balance: - **Succeeded in the month, written in the next.** A payment that succeeded at 23:59:58 on 31 October may be written to your balance at 00:00:01 on 1 November. It is in October's report, by its final status date, and in November's balance. - **Succeeded in the month before, written in this one.** The same payment seen from November: in October's report, and in November's balance. - **Corrected after its month.** A correction of a September payment made in October is in October's balance, and in no report's money: September's report holds the corrections up to September's end. - **Held at the month's end, released in the next.** On a market that holds a payment's money until it is verified, a payment that succeeded in October and was still held on 31 October is in October's report, and its release is in November's balance: the held line is not available money. - **A correction written across midnight.** The report counts a correction by when its posting began, the balance by when each of its lines was written. A correction that began at 23:59:59 on 31 October and was written at 00:00:00 on 1 November is in October's report and in November's balance. It is rare, and the script below names it as a payment whose money differs: check the payment's lines in November's balance. So the month's report, less what was written in the next month, plus what was written in this one for earlier payments, is the month's payment lines of your balance. ## The whole of it in one script The script below joins the two files by the payment and names the payments on the month's edge. It exits with `1`, and says why, when: - a payment's money differs between the two: a correction written across midnight, or something to ask us about; - a payment `not_posted` in the report already has its money in the balance: make the report again; - the payments report has a row of another account than the one you name; - the report has payments but the balance changes have no line of that account, an empty file included: there is nothing to compare them with, so ask for the same month's balance changes again (a month with no line of the account in either file says "Nothing to compare" and exits with `0`); - it is not given two files and an account, `macc_…`. It is tested against these files: reconcile.py: ```python """Reconcile a month's payments report with your balance's changes. python3 reconcile.py payments.csv balance_changes.csv macc_… payments.csv is payments.itemized.1 over the month by its final status date (date_basis=finalized) with payment_id, account_id, currency, net_amount and fee_status among its columns; balance_changes.csv is balance_change_from_activity.itemized.1 over the same month; macc_… is the account the payments report is of. It joins them by the payment, and says which payments' money is in another month's balance. Exits 1 when a payment's money differs between the two, and when the report has payments but the balance file has no line of the account: nothing to compare them with. A month with no line of the account in either says so. """ import csv import sys from collections import defaultdict from decimal import Decimal def rows(path): # utf-8-sig reads past the byte order mark. with open(path, encoding="utf-8-sig", newline="") as f: yield from csv.DictReader(f) def money(value): return Decimal(value) if value else Decimal(0) def reconcile(payments_csv, changes_csv, account, out=sys.stdout): # The report: each payment's net_amount, as it succeeded in the month. # A month without payments has no rows, so the account is named, not # read from them. in_file = {} not_posted = [] for r in rows(payments_csv): if r["account_id"] != account: sys.exit(f"{payments_csv} has a payment of {r['account_id']}, not of {account}") if r["fee_status"] == "not_posted": not_posted.append(r["payment_id"]) elif r["fee_status"] == "posted": in_file[r["payment_id"]] = (r["currency"], money(r["net_amount"])) # The balance: what each payment of the same accounts moved your # available balance by in the month. A pending line is held, not yet # available: its release is a line of its own. in_balance = defaultdict(Decimal) currency_of = {} lines = 0 for r in rows(changes_csv): lines += r["merchant_account_id"] == account if r["type"] != "payment" or r["merchant_account_id"] != account or r["pending"] == "true": continue in_balance[r["source_id"]] += money(r["net"]) currency_of[r["source_id"]] = r["currency"] # A balance file without the account's lines (empty, or another # account's) would show every payment as in a later month's balance. if not lines and (in_file or not_posted): sys.exit(f"{changes_csv} has no line of {account}: nothing to compare the report with. " "Ask for the balance changes of the same month, with this account's lines.") if not lines: print(f"Nothing to compare: neither file has a line of {account}.", file=out) return True later = sorted(p for p in in_file if p not in in_balance) earlier = sorted(p for p in in_balance if p not in in_file and p not in not_posted) different = sorted(p for p in in_file if p in in_balance and in_file[p][1] != in_balance[p]) # Posted after the report was made: make the report again. different += sorted(p for p in not_posted if p in in_balance) file_total = defaultdict(Decimal) balance_total = defaultdict(Decimal) for p, (cur, net) in in_file.items(): file_total[cur] += net for p, net in in_balance.items(): balance_total[currency_of[p]] += net def show(title, ids, amount): print(f"{title}: {len(ids)}", file=out) for p in ids: print(f" {p} {amount(p)}".rstrip(), file=out) show("In the report, in a later month's balance", later, lambda p: f"{in_file[p][1]} {in_file[p][0]}") show("In this month's balance, not in its report: succeeded earlier, or corrected in it", earlier, lambda p: f"{in_balance[p]} {currency_of[p]}") show("Not posted yet: no money in the report", sorted(not_posted), lambda p: "") show( "Different in both", different, lambda p: f"report {in_file[p][1] if p in in_file else 'not posted'}, balance {in_balance[p]} {currency_of[p]}", ) for cur in sorted(set(file_total) | set(balance_total)): out_later = sum((in_file[p][1] for p in later if in_file[p][0] == cur), Decimal(0)) in_earlier = sum((in_balance[p] for p in earlier if currency_of[p] == cur), Decimal(0)) print( f"{cur}: report {file_total[cur]} - later {out_later} + earlier {in_earlier}" f" = {file_total[cur] - out_later + in_earlier}; balance {balance_total[cur]}", file=out, ) return not different if __name__ == "__main__": if len(sys.argv) != 4 or not sys.argv[3].startswith("macc_"): sys.exit("usage: python3 reconcile.py payments.csv balance_changes.csv macc_…") sys.exit(0 if reconcile(sys.argv[1], sys.argv[2], sys.argv[3]) else 1) ``` ```sh python3 reconcile.py payments.csv balance_changes.csv macc_01K7XAMPLE00000000000000 ``` Name the account the payments report is of: a month without payments has no rows to read it from. For the October above, it answers: Output: ```text In the report, in a later month's balance: 1 pay_in_01K8RCNVECTOR000000000000A5 487.50 INR In this month's balance, not in its report: succeeded earlier, or corrected in it: 2 pay_in_01K8RCNVECTOR000000000000S8 292.50 INR pay_in_01K8RCNVECTOR000000000000S9 -48.75 INR Not posted yet: no money in the report: 1 pay_in_01K8RCNVECTOR000000000000A6 Different in both: 0 INR: report 3510.00 - later 487.50 + earlier 243.75 = 3266.25; balance 3266.25 ``` - `pay_…A5` succeeded at 23:59:58 on 31 October: its 487.50 is in November's balance. - `pay_…S8` succeeded in September and was written on 1 October: its money is in October's balance, and in September's report. `pay_…S9` is a September payment corrected in October: the correction is in October's balance, and in no report's money. - `pay_…A6` is not posted yet: make October's report again once it is. - `pay_…A3` was held until verified: its held line is left out, and the line that released it is counted. ## The whole balance Your balance moves with settlements, payouts, adjustments and our fee refunds too. The balance summary, `balance.summary.1`, sums every change of the month by kind: its `payments_net` rows, one per account, are the payment lines of step 4, and `opening_balance` plus every change is `closing_balance`; the `pending` row, money held at the period's end, is not a change of your available balance and is not in that sum. October's closing balance is November's opening balance ([Reports](https://docs.dev.novaro.ink/reports/#balance-summary-balancesummary1)). Reconcile with the **final status date**. With the created date, a payment made on 31 October and paid on 1 November is in October's report, and its money in November's balance; and two reports of the same month may differ, as each shows the payments as they are now ([Which rows are in the period](https://docs.dev.novaro.ink/reports/#which-rows-are-in-the-period)). --- # API reference › Introduction Source: https://docs.dev.novaro.ink/api/ The NovaroPay API: REST, JSON, secret keys, Stripe's conventions. The NovaroPay API is a REST API. Requests and responses are JSON over HTTPS, and every request is authenticated with a secret key of a merchant account. It follows Stripe's conventions wherever it can, so the [errors](https://docs.dev.novaro.ink/api/errors/), [idempotency keys](https://docs.dev.novaro.ink/api/idempotent-requests/) and [versions](https://docs.dev.novaro.ink/api/versioning/) work the way you know from Stripe; where we differ, the page says so. ## The address Every market's accounts call the same address. The key tells us which account and market a request is for. Base URL: ```txt https://api.dev.novaro.ink ``` Plain HTTP is not served. The API answers over IPv4 and IPv6. ## The conventions - **Keys** go in the `Authorization` header: [Authentication](https://docs.dev.novaro.ink/api/authentication/). - **Failures** come back as one error object with a conventional HTTP status: [Errors](https://docs.dev.novaro.ink/api/errors/). - **Retries** of a request that changes something carry an `Idempotency-Key`, but for the few that take none: [Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/). - **Lists** answer a page at a time, newest first, with cursors: [Pagination](https://docs.dev.novaro.ink/api/pagination/). - **Versions** are pinned with the `PSP-Version` header: [Versioning](https://docs.dev.novaro.ink/api/versioning/). - **Responses** carry an `X-Request-Id` to quote when you write to us: [Request IDs](https://docs.dev.novaro.ink/api/request-ids/). - **New things appear without a new version**: a new field in a response, a new optional parameter, a new value of a status or an error code. Write your code so that it ignores a field it does not know and handles a value it does not know. ## The resources Payments, Payouts and Status are listed under Resources as their endpoints go live. The [Changelog](https://docs.dev.novaro.ink/changelog/) names every change. --- # API reference › Authentication Source: https://docs.dev.novaro.ink/api/authentication/ Authenticate with your secret key in the Authorization header. Send your account's [secret key](https://docs.dev.novaro.ink/api-keys/) as a bearer token in the `Authorization` header of every request: An authenticated request: ```sh curl https://api.dev.novaro.ink/payments/pay_in_01J9… \ -H "Authorization: Bearer sk_live_in_…" ``` The key decides everything about the request: the merchant account it acts on, its market and its mode. A test key reads and writes only test data, a live key only live data. There is no other way to choose the account: a request carries no account or merchant id of its own. ## When the key is refused A request without a key, or with a key that is wrong, gets `401 Unauthorized` and nothing runs. A test key works only in [test mode](https://docs.dev.novaro.ink/test-mode/), never with live payments; a test key of a market with no test environment gets `404` [`resource_missing`](https://docs.dev.novaro.ink/api/errors/#resource_missing). Response · 401 Unauthorized: ```http HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer realm="psp" {"error": {"type": "invalid_request_error", "message": "Invalid API key provided."}} ``` The response says nothing about the key you sent, so check which one your server read: a test key where you meant live, a key of another account, a stale value in your environment. A key that worked and has ended, revoked or replaced by a [rotation](https://docs.dev.novaro.ink/api-keys/) whose expiry has passed, gets `401` with the code [`api_key_expired`](https://docs.dev.novaro.ink/api/errors/#api_key_expired) and the key's prefix, from any address, so you can tell which key your server still sends: Response · 401 Unauthorized, an ended key: ```http HTTP/1.1 401 Unauthorized WWW-Authenticate: Bearer realm="psp" {"error": {"type": "invalid_request_error", "code": "api_key_expired", "message": "Expired API key provided: sk_live_in_4fQx9aZ2…"}} ``` Put the account's current key in its place: the merchant portal lists them under Settings › Developers › [API keys](https://docs.dev.novaro.ink/api-keys/). A right key used from an address that its account's [IP allowlist](https://docs.dev.novaro.ink/security/ip-allowlist/) does not list gets `403` with the code [`ip_not_allowed`](https://docs.dev.novaro.ink/api/errors/#ip_not_allowed). The key is checked first, so a wrong key gets `401` from any address. A right key can also be refused with `403` for the state of what it belongs to, and nothing runs. This comes after the IP allowlist, so a call from an address the allowlist does not list gets `ip_not_allowed` whatever the state: - [`account_inactive`](https://docs.dev.novaro.ink/api/errors/#account_inactive): its account, or your merchant, is suspended. It works again once they are active. A key of a closed account is refused as a wrong key, with `401`. - [`market_not_enabled`](https://docs.dev.novaro.ink/api/errors/#market_not_enabled): your merchant is not enabled on the account's market for the key's mode: a live key needs the market active, a test key in test or active. Your account manager can tell you why. ## CLI keys `novaro login` makes a **CLI key**, `rk_test__…`, once someone of your account allows it in the merchant portal. It works in test mode only, ends 90 days after it was made, and is never rotated: run `novaro login` again for another. It may make only the calls the CLI makes: read [events](https://docs.dev.novaro.ink/api/events/) and resend them, and create, read and confirm payments. Any other call gets `403` [`api_key_permission`](https://docs.dev.novaro.ink/api/errors/#api_key_permission) and nothing runs: use a secret key for it. An account has at most 10 working CLI keys, apart from its 10 secret keys of each mode. ## Keys in the browser Do not call the API from a browser or a mobile app: the key would be in the hands of everyone who uses it. Call it from your server, and give your front end only what it needs. The one exception is Try it in this API reference, which sends a test key you paste, and only to test mode ([Test mode](https://docs.dev.novaro.ink/test-mode/#try-it)). --- # API reference › Errors Source: https://docs.dev.novaro.ink/api/errors/ The error object, HTTP statuses, error types and every error code. - `account_inactive` (403, invalid_request_error): The API key is right, but its account, or the merchant it belongs to, is suspended: it takes no requests until it is active again. Contact your account manager to find out why. - `amount_too_large` (400, invalid_request_error): The amount is above the most a payment of its method may be: the market's maximum, or your account's own, which the message names with the currency. Ask for at most that amount, or split the payment. - `amount_too_small` (400, invalid_request_error): The amount is below the least a payment of its method may be: the market's minimum, or your account's own, which the message names with the currency. Ask for at least that amount. For a settlement: the amount, less its fee, comes to no USDT past the fixed fee; request more. - `api_key_expired` (401, invalid_request_error): The API key was revoked, or a rotation replaced it and its expiry has passed: it no longer works, and the message shows its prefix ("Expired API key provided: sk_live_in_4fQx9aZ2…"). Use the account's current key, which the merchant portal lists under Settings › Developers › API keys. - `api_key_permission` (403, invalid_request_error): The API key is a CLI key (rk_test_…), made by novaro login: it may read events and resend them, and create, read and confirm payments, in test mode. Use a secret key (sk_) for this request. - `api_version_retired` (400, invalid_request_error): The PSP-Version header names a version that was retired after its end date, and nothing ran. Send a version the Changelog lists as supported, or leave the header out to use your account's default version. - `balance_insufficient` (400, invalid_request_error): The amount is more than your available balance, and nothing was created: the message names what is available. Request at most that, or read GET /balance first. - `checkout_unavailable` (503, api_error): Your account has no hosted payment page right now, so a payment with checkout cannot be made, and nothing was created. We are alerted and are putting it right; a payment without checkout, shown by your own server, works meanwhile. - `confirmation_not_supported` (400, invalid_request_error): The payment's method takes no confirmation: its confirmation_fields are empty. Do not send one for payments of this method; they are matched without it. - `file_expired` (400, invalid_request_error): The report's file was kept for 7 days and has been deleted: the run's result.expires_at says when. Create a new report run with the same parameters. - `idempotency_key_in_use` (409, invalid_request_error): Another request with the same Idempotency-Key is still running. Retry after a moment: once it has finished, the retry gets its answer. - `invalid_api_version` (400, invalid_request_error): The PSP-Version header names no version of the API. Send one of the versions the Changelog lists, exactly as written there, or leave the header out to use your account's default version. - `ip_not_allowed` (403, invalid_request_error): The request came from an IP address that is not on the IP allowlist of the account. A live API key of an account with an allowlist works only from the addresses on it, and only through the API's public host. Add the address to the allowlist, or call the API from an address that is on it. - `livemode_only` (409, invalid_request_error): Settlements are live mode only: a test key cannot request one. Use your live secret key (sk_live_…). - `market_not_enabled` (403, invalid_request_error): The API key is right, but the merchant is not enabled on the account's market for the key's mode: a live key needs the merchant active on the market, a test key in test or active. Contact your account manager to enable the market. - `merchant_reference_already_used` (409, invalid_request_error): Your account already has a payment with this merchant_reference. Each payment needs its own reference; to retry a request whose answer you did not get, send it again with the same Idempotency-Key instead. - `method_not_enabled` (400, invalid_request_error): The payment method is not available in this currency on the market, or not enabled for your account: param names payment_method_data.type. Contact your account manager to enable it. - `parameter_invalid` (400, invalid_request_error): A parameter's value is of the wrong type or format, or the body is not one JSON object: param names the parameter, and message what is wrong. Correct the value. - `parameter_missing` (400, invalid_request_error): A parameter the request needs is absent or blank: param names it. Send it. - `parameter_unknown` (400, invalid_request_error): The request has a parameter the endpoint does not take, or one your market's payments do not: param names it. Remove it; the API reference lists the parameters of each endpoint, and your account manager which of them your market takes. - `payment_final` (409, invalid_request_error): The payment has already succeeded or failed, so a confirmation changes nothing, and none was recorded. Retrieve the payment for its status. - `payout_address_missing` (409, invalid_request_error): You have no default payout address to send the settlement to. Add one in the merchant portal (Settings › Payout addresses): it becomes active 24 hours later. - `payout_address_not_active` (400, invalid_request_error): The payout address is not active: it is still in its first 24 hours, or it was blocked or deleted. Name an active address (GET /payout_addresses lists them), or leave payout_address out to use your default. - `payout_not_cancelable` (409, invalid_request_error): The payout is no longer pending: it is being sent, or it ended, so it cannot be canceled. Read it with GET /payouts/{id}: one being sent ends paid or failed, and a failed one's amount and fee are back in your available balance. - `payout_terms_missing` (409, invalid_request_error): Your agreement sets no payout fee on this market yet, so a payout cannot be made, and nothing was created. Contact your account manager to set it up. - `payouts_not_available` (409, invalid_request_error): Payouts are not open in live mode yet, and nothing was created. They open, market by market, with an announcement in the Changelog. - `rate_limit` (429, rate_limit_error): Too many requests too quickly in test mode: the message names the limit you went over, by default 25 requests a second per test key or 100 per account over all its test keys. Nothing ran. Send the request again after the seconds the Retry-After header gives, and spread your requests out; live mode has no such limit. - `reference_already_used` (409, invalid_request_error): The reference already confirms another payment: a UTR is one transaction, and one transaction pays one payment. param names the field. Check the value with the payer; nothing was recorded. - `report_interval_invalid` (400, invalid_request_error): The report's interval is not one it can cover: interval_start must be before interval_end, at most 366 days apart, and both within the report type's data_available_start and data_available_end. Read the type with GET /reporting/report_types/{id}. - `report_runs_in_progress` (409, invalid_request_error): You have too many reports still being prepared: at most 5 per merchant and 3 per person or key at a time. Wait until one succeeds or fails (reporting.report_run.succeeded or .failed), then create the next. - `resource_missing` (404, invalid_request_error): No object with the id in the request is yours to read: it does not exist, it belongs to another account, or it was made with a key of the other mode. Check the id, and that you use a key of the account and the mode the object was made with. - `settlement_request_pending` (409, invalid_request_error): A settlement you requested is still pending on the market, and you may have one at a time: the message names it. Wait until our team pays or cancels it (settlement.paid or settlement.canceled), then request again. - `settlement_terms_missing` (409, invalid_request_error): Your agreement sets no settlement fee or exchange rate on this market yet, so a settlement cannot be priced, and nothing was created. Contact your account manager to set them up. - `temporarily_unavailable` (503, api_error): We cannot serve the request right now, and nothing was created or changed: no wallet can take the payment, a settlement's terms are not caught up yet, or the request's API version could not be settled while it ran. Retry after a moment, with the same Idempotency-Key; if a settlement keeps getting it, contact your account manager. - `traffic_type_disabled` (400, invalid_request_error): The payment's traffic_type (ftd when it is not sent) is turned off on your account, so the payment was not made. Contact support to turn it on; payments of the other type, if it is on, go through as usual. --- # API reference › Idempotent requests Source: https://docs.dev.novaro.ink/api/idempotent-requests/ Retry a request safely with an Idempotency-Key. A network can fail after we have done what you asked but before you hear back. An **idempotency key** makes it safe to send the same request again: the second time, you get the first answer, and nothing is done twice. One payment is created however many times you retry. Send a key of your choice in the `Idempotency-Key` header of every request that creates or changes something. `POST /payments` requires one: a request without it is `400 parameter_missing`, with `param` `Idempotency-Key`. A request you can retry: ```sh curl https://api.dev.novaro.ink/payments \ -H "Authorization: Bearer sk_live_in_…" \ -H "Idempotency-Key: 5d1f6a0e-3c2b-4f8e-9a77-0c1d2e3f4a5b" \ -d … ``` ## Choosing a key - Make one key per **operation**, not per attempt: a retry of the same operation sends the same key. - Use something that will not repeat, such as a UUID v4, or an id from your own system that names the operation (your order's id and the step). - A key is at most **255 characters**, printable ASCII (a UUID is): any other is `400 parameter_invalid`. - A key belongs to your account and your key's mode: the same key from another account is another request. Within your account it names one request: sent to another endpoint, it is refused like another body. `POST /settlements` and `POST /reporting/report_runs` keep their keys apart, as [below](https://docs.dev.novaro.ink/api/idempotent-requests/#endpoints-with-their-own-rules). ## What a retry gets | You send | You get | | --- | --- | | The same key and the same request, after the first finished | The first request's response, byte for byte and with its status (`201` for `POST /payments`), with the header `Idempotent-Replayed: true`; nothing runs a second time. The payment is as it was then: read it with `GET /payments/{id}` for now | | The same key while the first request is still running | `409 idempotency_key_in_use`: try again shortly | | The same key with another body, or to another endpoint | `400` with type `idempotency_error` and no code: a key names one request | | A key older than **24 hours** | A new request: keys are kept for 24 hours | A request refused for its key, such as one with another body, does not use the key up. Neither does one refused for its parameters (`400`): correct it and send it with the same key. `GET` requests read and change nothing, so they need no key; they are safe to retry as they are. ## Endpoints with their own rules `POST /settlements` requires a key too, and keeps it its own way. A key there belongs to your merchant on the market, across all its accounts and their live keys (a settlement is your merchant's, as your balance is), and is kept for good, not 24 hours. A retry with it answers the settlement as it is now, `201` with `Idempotent-Replayed: true`, and reserves nothing more: it may be `paid` or `canceled` by then. A retry while the first is still running waits for it and gets the same answer. The same key with another `amount`, `payout_address` or `description` is `400 idempotency_error`; a key you used for a payment is another key there. `POST /reporting/report_runs` takes a key and keeps it its own way too. The key is optional: a request without one makes a new run. A key there belongs to your account, whichever of its secret keys sends it, and is kept for 24 hours, as a payment's; but it is kept with the run alone: a key you used on another endpoint is another key there. A retry with it answers the run as it is now, `201` with `Idempotent-Replayed: true`, and makes no new one: it may have succeeded or failed by then. A retry while the first is still running waits for it and gets the same answer, never a `409`. The same key with another `report_type` or `parameters` is `400 idempotency_error`, whether or not they are valid: the key is checked before them, but for a request without `report_type`, `interval_start` or `interval_end`, or with an interval bound that is no time, which is refused for that first. `POST /payments/{id}/confirmations` needs no key either: the same value sent again on the same payment records nothing new and answers the payment as it is now, so a retry is safe as it is. A key sent with it is not used. `POST /events/{id}/retry` takes no key: each request asks for one more attempt of the event's delivery, so a repeat sends the event again, as a resend should. A key sent with it is not used. ## Where we differ from Stripe Stripe's API v1 keeps the result of a first request even when it failed on Stripe's side, a `500` included, and answers every retry with that failure. **We keep only a request that was carried out**, as Stripe's API v2 does not repeat a failure either. A payment and its key are written in one database transaction: when a request fails (a fault of ours, `503 temporarily_unavailable`, or a refusal that depends on the moment, such as a payment that cannot change yet), nothing is written, neither the payment nor the key, and a retry with the same key runs the request again and can succeed. It can never make a second payment: the key is written with the first one. Our [errors](https://docs.dev.novaro.ink/api/errors/) say which failures are worth retrying: `409`, `429` and `5xx`. --- # API reference › Rate limits Source: https://docs.dev.novaro.ink/api/rate-limits/ Test mode's ceiling: 25 requests a second per test key, 100 per account, answered 429 rate_limit with Retry-After. [Test mode](https://docs.dev.novaro.ink/test-mode/) has a ceiling, so a load test against it slows down your own test requests and nobody else's: - **25 requests a second per test key**, and **100 a second per account** over all its test keys. Each has a second's worth to spend at once, so a short burst passes and a steady stream above the rate does not. - **Live mode has no such limit.** A request over either is refused before anything runs: Response · 429 Too Many Requests: ```http HTTP/1.1 429 Too Many Requests Retry-After: 1 {"error": {"type": "rate_limit_error", "code": "rate_limit", "message": "Too many requests in test mode: at most 25 per second per key."}} ``` - The status is `429`, the type `rate_limit_error` and the code [`rate_limit`](https://docs.dev.novaro.ink/api/errors/#rate_limit). The message names the limit you went over, the key's or the account's. - `Retry-After` is the number of seconds to wait before you send it again. - Nothing ran, so the request is safe to retry: send a create again with the same [`Idempotency-Key`](https://docs.dev.novaro.ink/api/idempotent-requests/). ## Handling it - Wait at least `Retry-After` seconds, then retry. Back off further if the next retry is refused too. - Spread a load test over time, not over keys: the account's limit counts every test key of the account together. - In CI, run tests that create payments one after another, or a few at a time, rather than all at once. --- # API reference › Pagination Source: https://docs.dev.novaro.ink/api/pagination/ List endpoints answer a page at a time, newest first, with cursors to the next page and the one before. A list endpoint, such as `GET /payments`, answers a page at a time, the newest first. Every page is a list object: A page of payments: ```json { "object": "list", "url": "/payments", "has_more": true, "data": [ { "id": "pay_in_01J9…", "object": "payment", … }, … ] } ``` `data` holds the page's objects, `[]` when nothing matches. `has_more` says whether more follow past the page. ## Parameters - `limit`: how many objects a page holds, 1 to 100. 10 when you leave it out. - `starting_after`: the id of an object. The page starts right after it, older. Pass the last id of a page to get the next one. - `ending_before`: the id of an object. The page ends right before it, newer. Pass the first id of a page to get the one before. With it, `has_more` says whether more follow before the page's first object. Send at most one of `starting_after` and `ending_before`. An id that names none of your objects, in your key's mode, is `404 resource_missing` with the parameter in `param`. The next page: ```sh curl "https://api.dev.novaro.ink/payments?limit=50&starting_after=pay_in_01J9…" \ -H "Authorization: Bearer sk_live_in_…" ``` A page is read by its cursor, not by its number: an object created while you read the pages does not shift them, and the hundredth page is as fast as the first. A list shows what is already created. A payment is dated when its request starts and listed once it is done, up to a second later, so it can appear behind objects you have already read. Settlements are the same: one our team makes can appear behind ones you have already read. When you poll for new payments, ask for a window of `created` that overlaps the last one you read by a minute, rather than only what is newer than its first object. Once [webhooks](https://docs.dev.novaro.ink/webhooks/) are live, they tell you of each payment as it changes. ## Filters A list endpoint's filters combine: every object listed matches all of them. A range of times takes its bounds in brackets, in seconds since the Unix epoch: `created[gt]`, `created[gte]`, `created[lt]` and `created[lte]`. The payments that succeeded on one day: ```sh curl -G https://api.dev.novaro.ink/payments \ -H "Authorization: Bearer sk_live_in_…" \ -d status=succeeded \ -d "created[gte]=1760054400" \ -d "created[lt]=1760140800" ``` A parameter the endpoint does not take is `400 parameter_unknown`, as in a request body; an empty value, one given twice, or one of the wrong type is `400 parameter_invalid`. See [Errors](https://docs.dev.novaro.ink/api/errors/). --- # API reference › Versioning Source: https://docs.dev.novaro.ink/api/versioning/ Pin your integration to an API version with PSP-Version. Your integration is pinned to an **API version** and keeps working as it is, whatever we change later. When we change the API in a way that could break your code, it is a new version, and you move to it when you choose. This is Stripe's model, with the header `PSP-Version` where Stripe has `Stripe-Version`. The current version is `2026-11-22.acacia`; the switcher at the top of these pages shows the version whose docs you read, by its newest release, and its state. ## A version's name A version is a date and a release name, such as `2026-10-01.acacia`: - A **new name** (`acacia`, then `basil`) starts with changes that can break an integration: a field removed or renamed, a type changed, a parameter made required, a status that means something else. At most two a year. - A **new date under the same name** (`2026-10-01.acacia`, then `2026-11-12.acacia`) adds things only. Moving between them never needs a code change. What we add without a new version, in every version at once: an optional parameter, a field in a response, an event type, a value of a status or an error code, a payment method. Write your code to ignore a field it does not know and to handle a value it does not know. ## Choosing the version of a request Send the version in the `PSP-Version` header: A request pinned to a version: ```sh curl https://api.dev.novaro.ink/payments/pay_in_01J9… \ -H "Authorization: Bearer sk_live_in_…" \ -H "PSP-Version: 2026-11-22.acacia" ``` | Your request | The version it runs in | | --- | --- | | `PSP-Version` names a version | That version | | `PSP-Version` names no version we have, or is sent twice | None: `400` with the code [`invalid_api_version`](https://docs.dev.novaro.ink/api/errors/#invalid_api_version), and nothing runs | | `PSP-Version` names a version that [retired](https://docs.dev.novaro.ink/api/versioning/#a-versions-lifecycle) | None: `400` with the code [`api_version_retired`](https://docs.dev.novaro.ink/api/errors/#api_version_retired), and nothing runs | | No `PSP-Version`, and your account has a default | Your account's default | | No `PSP-Version`, on your account's first request | The current version, which becomes your account's default | | No `PSP-Version`, and its version cannot be settled while it runs, as when your account's default changes during it | None: `503` with the code [`temporarily_unavailable`](https://docs.dev.novaro.ink/api/errors/#temporarily_unavailable), and nothing runs. Send it again | Your account's first request sets its default to the current version, whether or not it sends `PSP-Version`, as Stripe does. A version is matched exactly as written: no spaces, lower-case name. Every response the API runs your request for carries the version it was answered in, in its own `PSP-Version` header. A request refused before that, for its key, its address or its version, runs in no version, and its answer has no `PSP-Version`. Live and [test mode](https://docs.dev.novaro.ink/test-mode/) keep a default each: the first request with a test key sets the test one. Try a new version with the header on a few requests in test mode first. ## A version's lifecycle Every version of one name shares its state: | State | What it means | | --- | --- | | `current` | The newest name. A new account starts on it. | | `supported` | An older name. It works as it always did. | | `deprecated` | An older name with an end date. Requests and webhooks in it work as before, and every response in it carries a `PSP-Deprecation` header with the end date, such as `PSP-Deprecation: 2029-01-01`. | | `retired` | A name past its end date. A request whose `PSP-Version` names it is refused with `400` [`api_version_retired`](https://docs.dev.novaro.ink/api/errors/#api_version_retired). | A name gets an end date at least 24 months after the next name ships, and whoever manages your account's team is emailed at least 90 days before it, when your account uses it: its default version, a webhook endpoint, or its requests of the last 30 days are in it. A name retires only once nothing has called in it or been sent in it for 30 days. Until then the end date moves on 90 days, and they are emailed the new date. When it retires, your account's default version and your webhook endpoints on it move to the newest release of the oldest name that is neither deprecated nor retired, and they are emailed what moved. A request without `PSP-Version` then runs in the new default and is never refused. ## Upgrading 1. Read [What changed](https://docs.dev.novaro.ink/what-changed/) between yours and the new one: the [Changelog](https://docs.dev.novaro.ink/changelog/) of every release between them, and what differs in each resource's endpoints, fields and event types. In the merchant portal, **Settings › Developers › API version** shows it for your account's default and the version you pick, with the breaking changes and an object in both shapes. 2. Send the new version in `PSP-Version` from your test integration, and fix what breaks. 3. Send it from your live integration. Once every request names it, the account's default no longer matters to you. 4. Or switch the account's default on that page, in test mode first: requests without `PSP-Version`, and webhook endpoints without a version of their own, then run in it. For 72 hours **Roll back** gives the version before back, once, and sends again in it the deliveries that failed meanwhile to those endpoints. Whoever keeps an account's integration switches it; our support team can too, at your request, and whoever manages the account's team gets an email. Sending `PSP-Version` on every request is the safest way: your code then says which version it was written for, and a change of the account's default cannot reach it. ## The docs of each version These docs are of the current version. Each older version that is supported or deprecated has its own, as they stood when the next name shipped, at its name's address: `/acacia/api/payments/` for `acacia`. A retired version has none. The switcher at the top of every page lists each version by its newest release and its state (current, supported, or a deprecated one's end date), and opens the page you are on in another version. **Your version** comes first in it: the **API docs ↗** link of the merchant portal's API version page opens the docs of your account's default, and these docs keep it in your browser for your next visit. The docs have no sign-in and know nothing else of your account. What we add to every version reaches its docs too, marked **Added in** with the release that brought it: an endpoint, a parameter, a field, an event type or an error code. ## Webhooks A webhook endpoint can have a version of its own, given when it is created or changed later in the merchant portal; one without a version follows your account's default. Its events are shaped in that version, retries included. --- # API reference › Request IDs Source: https://docs.dev.novaro.ink/api/request-ids/ Every response carries a request ID to quote when you write to us. Every response from your market's API servers, a success or an error, carries an `X-Request-Id` header: the id of that one request in our logs. A response's headers: ```http HTTP/1.1 403 Forbidden X-Request-Id: 9f2c4e1a7b3d48e6a0c5f1d2e3b4a596 Content-Type: application/json ``` A few refusals come from our edge before a request reaches those servers, and carry none: a `401` for a request to an endpoint of the API with no key, a key that is not of the form `sk___…`, or one that names a market we do not have. Nothing past the edge saw those requests; check the key or the address. Log it with every request you make, beside your own ids. When you write to us about a request, a failed one above all, give us its `X-Request-Id`: we find exactly what happened to it, without guessing from times and amounts. --- # Resources › Payments Source: https://docs.dev.novaro.ink/api/payments/ The payments endpoints of the NovaroPay API. ## The hosted payment page Send `checkout` with a `return_url` in `POST /payments` (and an `embed_origin` to show the page in an iframe) and the payment comes with `checkout.url`, our page for the payer on your account's own domain, in your brand. The [Hosted payment page](https://docs.dev.novaro.ink/payments/hosted-page/) guide covers the request, the way back, the iframe and the WebView cases and the page's options. ## The amount `amount` is in the currency's smallest unit (paise for INR). Each payment method has a least and a most amount in your market, and our team may set narrower ones on your account: below is `400 amount_too_small`, above `400 amount_too_large`, with `param: amount` and a message that names the limit and its currency. In India a UPI payment is now at least ₹200.00 (`20000`), unless your account has a higher limit of its own. ## Traffic type Tell us with `traffic_type` in `POST /payments` whose deposit a payment is: `ftd`, the customer's first deposit with you, or `std`, a subsequent one. A payment without it is `ftd`, so mark subsequent deposits `std`. The payment keeps the type for good, answers it in `traffic_type` (in its webhooks too), and `GET /payments?traffic_type=std` lists one type. - Our team can turn either type off on your account, and on again. A payment of a type turned off is `400 traffic_type_disabled` with `param: traffic_type`, and nothing is made. With `ftd` off, a request without `traffic_type` is refused too. - Turning a type off stops new payments only: payments already made, and their hosted pages, carry on. - A value other than `ftd` or `std`, the empty one too, is `400 parameter_invalid`. ## Fraud prevention and the outcome `customer` takes optional fields that help our checks tell a scam from an honest customer, in every market: where the customer signed in with you from (`login_ip`), and their device (`device_id`) and browser (`user_agent`). Every payment answers `outcome.type`, `authorized` or `blocked`, as Stripe's [`charge.outcome`](https://docs.stripe.com/api/charges/object#charge_object-outcome), and `failure_code`, `blocked` on a blocked payment and `null` on any other. A blocked payment is answered `201` and is `failed` from the start. [Fraud prevention](https://docs.dev.novaro.ink/payments/fraud-prevention/) has each field, why it helps, and what to show your customer. ## What arrived and what to credit Once a payment is `succeeded` it says what arrived and what you credit your customer. Each of these is `null` until then. - `amount_paid`: what arrived from the payer's bank, in the smallest unit. - `amount_credited`: what to credit your customer. It is the amount you asked for when the payer paid exactly `amount_payable`, and `amount_paid` otherwise. Credit this. (`amount_received` is the same amount, under its first name.) - `amount_mismatch`: `true` when the payer paid other than `amount_payable`, so `amount_credited` is `amount_paid` rather than the amount you asked for. This is how Stripe has `amount_received` beside `amount`: what arrived can differ from what you asked for. ## The payment's version `version` grows with every change of a payment you can see in it (every event we send you is one) and with every new value you confirm it with, even one that leaves its status as it was, never with a check of ours alone, and it may skip numbers. A hosted payment's `checkout.status` and `checkout.opened_at` follow its page, and change without it. Of two copies of the same payment, the one with the higher `version` is the newer: a [webhook event](https://docs.dev.novaro.ink/webhooks/)'s `data.object` has the version of that event, so an event whose version is lower than one you already processed is an older change, and you can ignore it. ## Confirming a payment When your payer tells you they paid and gives you the transaction's reference (in India, the 12-digit UTR their UPI app shows), you can pass it on with `POST /payments/{id}/confirmations`. It is optional: we match payments without it. We keep what you send with the payment, as your payer's word, for our checks and our team. A payment's `confirmation_fields` name the fields your market takes and the pattern each must match. - A confirmation is not proof. A payment waiting for the payer is `processing` after it and stays `processing` while we look for its money: it succeeds when we see it, and fails if we have not seen it when the market's late-payment window closes: 24 hours by default, counted from when it became `processing` or from its `expires_at`, whichever is later. - The answer is `200` with the payment, whether or not its money arrived yet: a payment that succeeds comes as the webhook event `payment.succeeded`. The same value again on the same payment answers it again and records nothing new, and so does the reference of the bank transaction that paid it, after it succeeded too; another value is kept beside the first. - A UTR is one UPI transaction, so it confirms one payment: a value confirmed on another payment of your account that has not succeeded or failed, or the reference of the bank transaction that paid another payment of your account, is `409 reference_already_used`. One that does not match the field's pattern is `400 parameter_invalid`. - A payment takes at most 3 different values: more is `400 parameter_invalid`. A value you sent holds until its payment succeeded or failed (an expired one holds it too): once it has, it can confirm another payment, unless it is the reference of the transaction that paid it. - An expired payment takes the confirmation and stays `expired`: if the money arrives in time, it still succeeds. A payment that succeeded or failed refuses one: `409 payment_final`. - A method with no `confirmation_fields` takes none: `400 confirmation_not_supported`. ### GET /payments: ListPayments List your account's payments of your key's mode, newest first, a page at a time: pass the last id of a page as starting_after for the next one, or the first as ending_before for the one before. Filters combine: every payment listed matches all of them. - `merchant_reference` (query): (OPTIONAL) Only the payment with this reference of yours. - `customer_id` (query): (OPTIONAL) Only the payments of the customer you sent as customer.id. - `status` (query): (OPTIONAL) Only the payments in this status: awaiting_payer, processing, succeeded, failed or expired. - `traffic_type` (query): (OPTIONAL) Only the payments of this traffic type: ftd or std. - `outcome_type` (query): (OPTIONAL) Only the payments with this outcome type: authorized or blocked. - `created[gt]` (query): (OPTIONAL) After this time. - `created[gte]` (query): (OPTIONAL) At this time or after. - `created[lt]` (query): (OPTIONAL) Before this time. - `created[lte]` (query): (OPTIONAL) At this time or before. - `limit` (query): (OPTIONAL) How many payments a page holds, 1 to 100; 10 when left out. - `starting_after` (query): (OPTIONAL) The id of the payment the page starts after: the last of the page before. - `ending_before` (query): (OPTIONAL) The id of the payment the page ends before: the first of the page after. At most one of starting_after and ending_before. ### POST /payments: CreatePayment Create a payment: the payer is shown where to pay at once. Send an Idempotency-Key header with every request, and the same key when you retry: you get the first answer back, and no second payment is made. The answer is 201 with the payment, its details to pay to included. - `Idempotency-Key` (header, required): A key of your choice, unique to the request: a retry with the same key gets the first answer back, and nothing runs twice. See Idempotent requests. - `amount` (body): The amount to ask for, in the currency's smallest unit (paise): a positive whole number, within the method's limits in your market and your account's own, if narrower. Outside them the payment is not made: amount_too_small or amount_too_large, naming the limit. - `checkout` (body): (OPTIONAL) Send the payer to our hosted payment page: the payment is made with channel hosted and its checkout.url is the page, on your account's checkout domain. Without it you show the payer the details yourself (channel h2h). - `currency` (body): Three-letter ISO 4217 code, upper case: INR. - `customer` (body): (OPTIONAL) Who pays. Which of the payer's own fields (id, name, email, phone, ip) a payment needs is the market's: in India, your id of the customer; the rest are optional. A payer field your market's payments do not take is parameter_unknown. The fraud prevention fields (login_ip, device_id, user_agent) are optional and taken in every market. - `merchant_reference` (body): Your own reference for the payment, unique on your account: a second payment with it is refused. - `metadata` (body): (OPTIONAL) Your own key-value pairs, answered back as you sent them: at most 50 keys of up to 40 characters, values of up to 500. - `payment_method_data` (body): How the payer pays, and the method's own fields. - `traffic_type` (body): (OPTIONAL) Whose deposit this is: ftd, the customer's first deposit with you, or std, a subsequent one; ftd when left out. Any other value, the empty one too, is parameter_invalid. A type turned off on your account refuses the payment with traffic_type_disabled, and nothing is made. ### GET /payments/{id}: GetPayment Retrieve a payment by its id. You read only your account's payments, of your key's mode: any other id is not found. - `id` (path, required): The payment's id, e.g. pay_in_01J9…. ### POST /payments/{id}/confirmations: ConfirmPayment Confirm a payment with what its payer told you, if they did: the payment's confirmation_fields name the fields your market takes (in India, utr). The call is optional: we match the payment without it too; when you make it, send the fields. A confirmation is not proof: a payment waiting for the payer is processing after it, and succeeds only when its money is seen. The same value again on the same payment answers it again, unchanged; a value already confirmed on another payment is refused. The answer is 200 with the payment. - `id` (path, required): The payment's id, in the path. - `utr` (body): The UPI transaction's reference the payer sees in their app: 12 digits. Required for a payment whose confirmation_fields name utr: without it the call is parameter_missing. --- # Resources › Events Source: https://docs.dev.novaro.ink/api/events/ The events endpoints of the NovaroPay API. An event is something that happened to an object of your account: a payment created, succeeded, failed. It is the same event your [webhook endpoints](https://docs.dev.novaro.ink/webhooks/) are sent, and it is kept for **30 days**. - `data.object` is the object right after the event, shaped in your request's API version (its `PSP-Version`, or your account's default). Keys inside it may come in another order than in a delivery's body; their values are the same. - `pending_webhooks` counts the endpoints that haven't received it yet, failed and turned-off ones included. - `GET /events?delivery_success=false` lists the events whose delivery to one of your endpoints hasn't succeeded: what to process after your server was down. An event made while an endpoint was turned off has no delivery to it, so this leaves it out: read those by `created`. - `type=payment.*` lists every type of a resource. Filters combine, and the list pages like every list ([Pagination](https://docs.dev.novaro.ink/api/pagination/)). - `POST /events/{id}/retry` with `webhook_endpoint` sends an event to one of your endpoints again, now: one more attempt of its delivery there, as **Resend** in the merchant portal. The endpoint must have been sent the event and be turned on: one turned off is `400 parameter_invalid`, and an event it wasn't sent `404 resource_missing` on `webhook_endpoint`. A delivery still being retried keeps its schedule. It takes no `Idempotency-Key`: the same request again sends the event once more. - A test key reads test mode's events, a live key live mode's. ### GET /events: ListEvents List your account's events of your key's mode from the last 30 days, newest first, a page at a time: pass the last id of a page as starting_after for the next one, or the first as ending_before for the one before. Filters combine: every event listed matches all of them. - `type` (query): (OPTIONAL) Only the events of this type, e.g. payment.succeeded; payment.* for every type of a resource. - `created[gt]` (query): (OPTIONAL) After this time. - `created[gte]` (query): (OPTIONAL) At this time or after. - `created[lt]` (query): (OPTIONAL) Before this time. - `created[lte]` (query): (OPTIONAL) At this time or before. - `delivery_success` (query): (OPTIONAL) false: only the events at least one of your endpoints has not been sent successfully yet (still retrying, failed, or canceled); true: only the events every endpoint they were sent to has received. An event made while an endpoint was turned off was not sent to it, so it counts as received here: read those by created. - `limit` (query): (OPTIONAL) How many events a page holds, 1 to 100; 10 when left out. - `starting_after` (query): (OPTIONAL) The id of the event the page starts after: the last of the page before. - `ending_before` (query): (OPTIONAL) The id of the event the page ends before: the first of the page after. At most one of starting_after and ending_before. ### GET /events/{id}: GetEvent Retrieve an event by its id: one of your account's, of your key's mode, from the last 30 days. Any other id is not found. - `id` (path, required): The event's id, evt_…. ### POST /events/{id}/retry: RetryEvent Send an event to one of your webhook endpoints again: one more attempt of its delivery there, now, as Resend in the dashboard makes. The endpoint must have been sent the event and be turned on; the automatic retries of a delivery still failing go on as they were. Answers the event. A novaro listen session is not an endpoint here. - `id` (path, required): The event's id, evt_…. - `webhook_endpoint` (body): The id of the webhook endpoint to send it to, whe_…, as the dashboard shows it. --- # Resources › Payouts Source: https://docs.dev.novaro.ink/api/payouts/ Send money from your balance to a bank account you name. A payout sends money from your available [balance](https://docs.dev.novaro.ink/api/balance/) to a bank account you name, as Stripe's payouts do. ## How a payout works 1. You create a payout with `POST /payouts`. Its amount and the payout fee of your agreement are held from your available balance at once, and the payout is `pending`. You get the [webhook event](https://docs.dev.novaro.ink/webhooks/event-types/) `payout.created`. 2. We send it from one of our accounts. While it is being sent it is `processing`. 3. It ends `paid` once the recipient's bank took it, or `failed`; then you get `payout.paid` or `payout.failed`. A failed payout's amount and fee are back in your available balance, and `failure_code` says why. Rarely we cannot tell at once whether a transfer went through: the payout is then `requires_review`, you get `payout.requires_review`, and our team checks it with the bank. It ends `paid` or `failed`, and nothing is sent twice. A payout belongs to the merchant account whose key made it: another account's key does not see it, and an Idempotency-Key is the account's. **Payouts are not open yet.** A live key's `POST /payouts` is `409 payouts_not_available`, and nothing is held. In test mode no destination type is taken yet in India either: a test `POST /payouts` is refused with `400`, and nothing is held. Payouts open, market by market, with an announcement in the [Changelog](https://docs.dev.novaro.ink/changelog/) that names the destination types they take. ## Its life | Status | | | --- | --- | | `pending` | Created: the amount and fee are held. Not sent yet; you may cancel it. | | `processing` | Being sent. | | `paid` | The recipient's bank took it. The fee is taken. | | `failed` | Not sent, or refused by the bank: `failure_code` says why. The amount and fee are back in your available balance. | | `requires_review` | Our team is checking whether it went through. It ends `paid` or `failed`. | | `canceled` | You canceled it while it was pending. The amount and fee are back in your available balance. | New statuses may be added: treat one you do not know as not paid. ## Making one Create a payout: ```sh curl https://api.dev.novaro.ink/payouts \ -H "Authorization: Bearer sk_test_…" \ -H "Idempotency-Key: 3f2b8c1e-7d4a-4b9e-9a6c-2e1d5f4c3b2a" \ -H "Content-Type: application/json" \ -d '{ "amount": 2500000, "currency": "", "destination": { "type": "", "": "…" }, "description": "Withdrawal 4821", "metadata": { "user_id": "u_4821" } }' ``` - `amount` is what the recipient's account receives, in the currency's smallest unit. The payout fee is held beside it: more than you have available is `400 balance_insufficient`, and nothing is made. - `destination` is the account: its `type` and that field alone. Which types your market's payouts take is announced in the [Changelog](https://docs.dev.novaro.ink/changelog/) when payouts open there. A destination that is not one of its type is `400 parameter_invalid` with `param: destination`; a type your market's payouts do not take, `param: destination.type`. - Send an `Idempotency-Key`. The same key again answers the same payout, `Idempotent-Replayed: true`, and holds nothing more; the key with other parameters is `400 idempotency_error`. `503 temporarily_unavailable` made no payout: retry in a moment with the same key. An amount it reserved before it was cut off goes back to your available balance within minutes. The answer is `201` with the payout: ```json { "id": "po_…", "object": "payout", "status": "pending", "market": "…", "amount": 2500000, "currency": "…", "fee": 25000, "destination": { "type": "…", "last4": "0017" }, "failure_code": null, "description": "Withdrawal 4821", "metadata": { "user_id": "u_4821" }, "created": 1761213600, "ended_at": null, "livemode": false, "version": 1 } ``` A payout answers its destination back by the account number's last four digits. ## Canceling one `POST /payouts/{id}/cancel` cancels a payout that is still `pending`: its amount and fee are back in your available balance, and you get `payout.canceled`. One that is being sent or has ended is `409 payout_not_cancelable`. Canceling a canceled payout answers it as it is. ## Why a payout fails | `failure_code` | | | --- | --- | | `recipient_account_not_found` | No account has that number. | | `transfer_rejected` | The bank refused the transfer. | More codes may be added. ## Test mode Once your market takes payouts, a test key makes test payouts from your test balance, as live ones are made, and none is ever sent anywhere. Instead, the **last two digits of the amount** (in the currency's smallest unit) decide what happens to it, the way [magic UTRs](https://docs.dev.novaro.ink/payments/testing/) do a test payment's. Each change is the one a live payout gets on that path: its status, its balance lines and its webhook events. | Amount ends in | What happens | | --- | --- | | `01` (e.g. `2500001`) | `processing`, then `paid` at once. | | `02` | `processing`, then `failed` at once: `recipient_account_not_found`. | | `03` | `processing`, then `failed` at once. | | `04` | `processing`, then `failed` at once: `transfer_rejected`. | | `05` | `processing`, then `requires_review` at once, then `paid` 5 seconds after it was made. | | `06` | Stays `pending` until you cancel it. | | Anything else | `processing` at once, then `paid` 5 seconds after it was made. | "At once" means within a second or two: read the payout again, or wait for its events. A failed test payout's amount and fee are back in your test balance, as a live one's are. A test payout that cannot be sent in the test environment stays `pending`, or, once on its way, fails with `transfer_rejected`. Live mode has no magic amounts. ### GET /payouts: ListPayouts List your payouts on your key's market, newest first, a page at a time: pass the last id of a page as starting_after for the next one, or the first as ending_before for the one before. Filters combine. - `status` (query): (OPTIONAL) Only the payouts in this status: pending, processing, paid, failed, requires_review or canceled. - `created[gt]` (query): (OPTIONAL) After this time. - `created[gte]` (query): (OPTIONAL) At this time or after. - `created[lt]` (query): (OPTIONAL) Before this time. - `created[lte]` (query): (OPTIONAL) At this time or before. - `limit` (query): (OPTIONAL) How many payouts a page holds, 1 to 100; 10 when left out. - `starting_after` (query): (OPTIONAL) The id of the payout the page starts after: the last of the page before. - `ending_before` (query): (OPTIONAL) The id of the payout the page ends before: the first of the page after. At most one of starting_after and ending_before. ### POST /payouts: CreatePayout Create a payout: the amount and its fee are held from your available balance at once, and the payout is pending until it is sent. Send an Idempotency-Key header, and the same key when you retry: you get the payout back, and nothing more is held. The answer is 201 with the payout. - `Idempotency-Key` (header, required): A key of your choice, unique to the request: a retry with the same key answers the payout as it is now, and holds nothing more. See Idempotent requests. - `amount` (body): What the recipient's account receives, in the currency's smallest unit: a positive whole number. The payout fee is held beside it. - `currency` (body): Three-letter ISO 4217 code of your balance's currency. - `description` (body): (OPTIONAL) Your own words on it, up to 100 characters: answered back. - `destination` (body): The bank account it is sent to. - `metadata` (body): (OPTIONAL) Your own key-value pairs, answered back as sent: up to 50 keys of up to 40 characters, values of up to 500. ### GET /payouts/{id}: GetPayout Retrieve a payout by its id. - `id` (path, required): The payout's id, e.g. po_ar_01J9…. ### POST /payouts/{id}/cancel: CancelPayout Cancel a payout that is still pending: its amount and fee go back to your available balance. One that is being sent, or has ended, cannot be canceled: payout_not_cancelable. - `id` (path, required): The payout's id, e.g. po_ar_01J9…. --- # Resources › Balance Source: https://docs.dev.novaro.ink/api/balance/ Your balance on the market: what you can settle now, and what is still on its way. Your balance is kept per merchant and market: all your merchant accounts on the India market add to, and draw from, the same INR balance, and any of their keys reads it. A test key reads the test environment's balance, with `livemode` false. | Field | | | --- | --- | | `available` | Funds you can pay out or [settle](https://docs.dev.novaro.ink/api/settlements/) now. | | `pending` | Succeeded deposits, net of our fee, that are not available yet under your settlement schedule. | | `reserved` | Funds held for payouts that are pending or in transit, and for settlements that are pending. | Each is a list of `{ amount, currency }`, one entry per currency of the market, in the currency's smallest unit (paise); `[]` before your first payment. A succeeded deposit adds its amount, net of our fee, to `pending`, and moves to `available` on its availability date. A settlement moves its amount from `available` to `reserved` when it is requested, and leaves the balance when it is paid; a canceled one returns it to `available`. ### GET /balance: GetBalance Retrieve your balance on your key's market: what you can pay out or settle now, what is still on its way, and what pending payouts and settlements hold. --- # Resources › Settlements Source: https://docs.dev.novaro.ink/api/settlements/ Withdraw your balance in USDT on TRON to your own wallet. A settlement withdraws money from your [balance](https://docs.dev.novaro.ink/api/balance/) to your own wallet in USDT on TRON (TRC20), at the exchange rate and fee of your agreement. ## How a settlement works 1. An admin or finance person of the whole merchant adds a USDT wallet in the merchant portal (Settings › Payout addresses). It becomes active 24 hours later: see [Payout addresses](https://docs.dev.novaro.ink/api/payout-addresses/). 2. You request a settlement with `POST /settlements`, or with Request settlement in the merchant portal. Its amount is reserved from your available balance at once, and the settlement is `pending`. 3. Our finance team sends the USDT to the settlement's address and marks it `paid` with the TRON transaction's hash. You get the [webhook event](https://docs.dev.novaro.ink/webhooks/event-types/) `settlement.paid`. Settlements are carried out by our team, not instantly: rely on `settlement.paid`, not on an expected time. Your account manager can also make a settlement for you; it then has `origin` `novaropay`, and `GET /settlements` lists it beside yours. Settlements are live mode only: a test key's request is `409 livemode_only`, and the test environment has none to list. ## Its life | Status | | | --- | --- | | `pending` | Requested: the amount is reserved from your available balance. Our team has not sent it yet. | | `paid` | The USDT was sent: `tx_hash` and `tronscan_url` show the transfer on TRON. | | `canceled` | Canceled by our team; `cancel_reason` says why. The amount is back in your available balance. | | `reversed` | Rare: a paid settlement that did not reach you, taken back after review. The amount is back in your available balance. | **One request at a time.** While a settlement you requested is pending on the market, a new request is `409 settlement_request_pending`, and its message names the pending one. You cannot cancel a request yourself: ask your account manager, who cancels it with a reason. ## How the USDT is worked out The fee and the rate come from your agreement and are fixed on the settlement when you request it: ```text fee = round(amount × fee_percent) in INR usdt_amount = floor6((amount − fee) / exchange_rate) − fee_fixed_usdt ``` For ₹98,000 at a 3% fee, a fixed fee of 1 USDT and 109.50 INR per USDT: ₹98,000 − ₹2,940 = ₹95,060, which is 868.127853 USDT, less 1: 867.127853 USDT. An amount that comes to zero USDT or less is `400 amount_too_small`. While a settlement is pending, our team may update its exchange rate to the current one before sending it; you then get `settlement.updated` with the new `exchange_rate` and `usdt_amount`. The amount and the address of your request never change. ## Requesting one Request a settlement: ```sh curl https://api.dev.novaro.ink/settlements \ -H "Authorization: Bearer sk_live_in_…" \ -H "Idempotency-Key: 0b7e5c1a-2f4d-4a9e-8c3b-6d5e4f3a2b1c" \ -H "Content-Type: application/json" \ -d '{ "amount": 9800000, "currency": "INR", "description": "October week 2" }' ``` `amount` is what leaves your available balance, fee included; `payout_address` names an active address of yours, your default when you leave it out. `Idempotency-Key` is required: a retry with it answers the same settlement and reserves nothing more (see [Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/)). Nothing is made, and nothing reserved, when a request is refused: | Answer | When | | --- | --- | | `409 livemode_only` | A test key. | | `400 balance_insufficient` | `amount` is more than your available balance; the message names what is available. | | `409 settlement_request_pending` | A settlement you requested is still pending on the market. | | `409 payout_address_missing` | No `payout_address`, and you have no default address. | | `400 payout_address_not_active` | The address is still in its first 24 hours, or was blocked or deleted. | | `404 resource_missing` | `payout_address` names none of your addresses. | | `400 amount_too_small` | The amount comes to zero USDT or less. | | `503 temporarily_unavailable` | Your terms are being updated, or the request took too long on our side: retry in a moment with the same key. An amount it reserved before it was cut off goes back to your available balance within minutes. | | `409 idempotency_key_in_use` | Another settlement of yours was being made at the same moment: retry with the same key. | | `400 idempotency_error` | The key was used for another request: see [Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/). | | `409 settlement_terms_missing` | Your agreement sets no settlement fee or rate on the market yet. | | `400 parameter_invalid` | `currency` is not your balance's currency, or `amount` is too large to work out. | ## The settlement object | Field | | | --- | --- | | `id` | Unique id, `st__…`. | | `status` | `pending`, `paid`, `canceled` or `reversed`. Treat a status you do not know as not paid. | | `origin` | `merchant`: you requested it, by API or in the merchant portal. `novaropay`: our team made it. | | `market` | The market it pays out of, e.g. `IN`. | | `amount`, `currency` | What leaves your balance, fee included, in the smallest unit. | | `fee` | The percentage fee, in the smallest unit. | | `fee_fixed_usdt` | The fixed fee in micro-USDT (6 decimal places): `1000000` is 1 USDT. | | `exchange_rate` | Units of the currency per 1 USDT, as a decimal string, e.g. `"109.5000"`. | | `usdt_amount` | What your wallet receives, in micro-USDT: `867127853` is 867.127853 USDT. | | `payout_address` | A copy of the wallet it is sent to, taken when it was made: `{ id, network, asset, address }`. | | `tx_hash`, `tronscan_url` | The TRON transfer once paid; `null` before. | | `cancel_reason` | Why our team canceled it; `null` otherwise. | | `description` | Your own words on your request, up to 100 characters; `null` when none. | | `created`, `paid_at`, `canceled_at`, `reversed_at` | In seconds since the Unix epoch; `null` until then. | | `livemode` | Always `true`. | | `version` | Grows with every change: of two copies, the higher is the newer. | | `rate`, `usdt`, `address` | The same as `exchange_rate`, `usdt_amount` and `payout_address.address`: their names in `2026-10-19.acacia`, kept for integrations that read them. | The [`settlement.*` webhook events](https://docs.dev.novaro.ink/webhooks/event-types/) carry the same object. ### GET /settlements: ListSettlements List your settlements on your key's market, newest first, both origins, a page at a time: pass the last id of a page as starting_after for the next one, or the first as ending_before for the one before. Filters combine. - `status` (query): (OPTIONAL) Only the settlements in this status: pending, paid, canceled or reversed. - `created[gt]` (query): (OPTIONAL) After this time. - `created[gte]` (query): (OPTIONAL) At this time or after. - `created[lt]` (query): (OPTIONAL) Before this time. - `created[lte]` (query): (OPTIONAL) At this time or before. - `limit` (query): (OPTIONAL) How many settlements a page holds, 1 to 100; 10 when left out. - `starting_after` (query): (OPTIONAL) The id of the settlement the page starts after: the last of the page before. - `ending_before` (query): (OPTIONAL) The id of the settlement the page ends before: the first of the page after. At most one of starting_after and ending_before. ### POST /settlements: CreateSettlement Request a settlement of your balance: its amount is reserved from your available balance at once, and the settlement is pending until our team sends it. Live keys only. Send an Idempotency-Key header, and the same key when you retry: you get the settlement back, and nothing more is reserved. One request of yours is pending at a time. The answer is 201 with the settlement. - `Idempotency-Key` (header, required): A key of your choice, unique to the request: a retry with the same key answers the settlement as it is now, and reserves nothing more. See Idempotent requests. - `amount` (body): What to take from your available balance, fee included, in the currency's smallest unit (paise): a positive whole number. More than is available is balance_insufficient; one that comes to no USDT past the fixed fee is amount_too_small. - `currency` (body): Three-letter ISO 4217 code of your balance's currency: INR. - `description` (body): (OPTIONAL) Your own words on it, up to 100 characters: answered back, and shown in the merchant portal. - `payout_address` (body): (OPTIONAL) The id of an active payout address of yours (pa_…); your default address when left out. ### GET /settlements/{id}: GetSettlement Retrieve a settlement by its id, whoever made it: you or our team. - `id` (path, required): The settlement's id, e.g. st_in_01J9…. --- # Resources › Payout addresses Source: https://docs.dev.novaro.ink/api/payout-addresses/ Your USDT wallets that settlements are sent to. A payout address is a USDT wallet of yours on TRON (TRC20) that [settlements](https://docs.dev.novaro.ink/api/settlements/) are sent to. Whoever keeps your whole merchant's payout addresses adds them in the merchant portal, under Settings › Payout addresses, where every change asks them to confirm it's them; the API only reads them. A new address is active 24 hours after it is added, and they all get an email with a Block button in the meantime. `GET /payout_addresses` lists the active ones, your default first: settlements that name no address go to it. ### GET /payout_addresses: ListPayoutAddresses List your active payout addresses, the default first. --- # Resources › Report types Source: https://docs.dev.novaro.ink/api/report-types/ The kinds of report your key can ask for, with their columns and the period their data covers. A report type is a kind of [report](https://docs.dev.novaro.ink/reports/): what a row is, which columns the file can have, and the period its data covers now. Its id ends in its version, as Stripe's do: `payments.itemized.1`. A key lists the types it can ask for. A key is of one merchant account, so it gets the types of an account's data: `payments.itemized.1`, and `payouts.itemized.1` on a market that has payouts. The settlements and balance reports are the whole merchant's, and are asked for in the merchant portal. Report types take a secret key (`sk_`); a [CLI key](https://docs.dev.novaro.ink/api/authentication/#cli-keys) (`rk_`) gets `403 api_key_permission`. ## The report type object | Field | | | --- | --- | | `id` | The type, e.g. `payments.itemized.1`. | | `object` | `reporting.report_type`. | | `name` | The type in words. | | `version` | The number its id ends in. | | `default_columns` | The columns a run has when it names none. | | `columns` | Every column a run of your key may name. | | `filters` | The filters a run may set. | | `data_available_start` | The earliest time a run's `interval_start` may be: your account's first payment. `null` before it has one. | | `data_available_end` | The latest time a run's `interval_end` may be: one minute ago. | | `updated` | When the data was last updated: the same as `data_available_end`. | | `livemode` | `true` for a live key, `false` for a test key. | Times are in seconds since the Unix epoch. A type your key cannot ask for, or one that does not exist, is `404 resource_missing` with `param` `id`, from `GET /reporting/report_types/{id}`; the list leaves it out. ### GET /reporting/report_types: ListReportTypes List the report types your key may ask for. A balance's types are your whole merchant's, so no key gets them: ask for them in the merchant portal. ### GET /reporting/report_types/{id}: GetReportType Retrieve a report type, with the period its data covers for your key's account now. - `id` (path, required): The type's id, e.g. payments.itemized.1. --- # Resources › Report runs Source: https://docs.dev.novaro.ink/api/report-runs/ Ask for a report file of your account over a period, and download it when it is ready. A report run is one [report](https://docs.dev.novaro.ink/reports/) file over a period you choose. You create it, it is prepared in the background, and you download its file when it has `succeeded`: wait for the [webhook event](https://docs.dev.novaro.ink/webhooks/event-types/) `reporting.report_run.succeeded`, or read the run again. A run your key creates covers your key's account. Your key also reads the runs of its account that your team asked for in the merchant portal over that account alone; a run over several accounts, and anything our team made, is not your key's to read: it is `404 resource_missing`, as for a run that does not exist. A test key's run is of the test environment's data, with `livemode` false. Report runs take a secret key (`sk_`); a [CLI key](https://docs.dev.novaro.ink/api/authentication/#cli-keys) (`rk_`) gets `403 api_key_permission`. ## Its life | Status | | | --- | --- | | `pending` | Created, and being prepared. | | `succeeded` | Ready: `result` is its file. | | `failed` | It could not be prepared: `error` says why. Create a new run. | Only a run your key created sends `reporting.report_run.succeeded` or `reporting.report_run.failed`, to the webhook endpoints of your key's account. ## Creating one `report_type` and `parameters[interval_start]` and `parameters[interval_end]`, in seconds since the Unix epoch, are required. The period runs from its start up to, but not including, its end, at most 366 days, within the type's `data_available_start` and `data_available_end`: read them with `GET /reporting/report_types/{id}`. The other parameters are optional: | Parameter | | | --- | --- | | `timezone` | An IANA time zone, such as `Asia/Kolkata`, for the times in the file and the dates in its name. `Etc/UTC` when absent. | | `columns` | The file's columns, in their order. The type's `default_columns` when absent. | | `date_basis` | `finalized`, the default, or `created`: see [Which rows are in the period](https://docs.dev.novaro.ink/reports/#which-rows-are-in-the-period). | | `status`, `method`, `traffic_type` | Only the rows with this value: `status` a status of the type's rows (a payment's `created`, `awaiting_payer`, `processing`, `succeeded`, `failed` or `expired`); `method` a payment method of your market (`upi` in India); `traffic_type` `ftd` or `std`. A type's `filters` name those it takes; any other value is `400 parameter_invalid`. | | `amount_min`, `amount_max` | Only the payments of at least, or at most, this amount, in major units as a string, e.g. `"1000.00"`. | `Idempotency-Key` is optional: a retry with the same key answers the same run, with the header `Idempotent-Replayed: true`, and makes no new one (see [Idempotent requests](https://docs.dev.novaro.ink/api/idempotent-requests/)). As a payment's, the key is your account's, whichever of its secret keys sends it, and is kept for 24 hours: after them the same key makes a new run. It is kept with the run alone: a key you used on another endpoint is another key here. A retry sent while the first is still being created waits for it and gets the same run, with `Idempotent-Replayed: true`. Nothing is made when a request is refused: | Answer | When | | --- | --- | | `400 parameter_missing` | `report_type`, `parameters` or one end of the interval is absent. | | `400 parameter_unknown` | The body has a parameter the request does not take, such as `parameters[foo]`: `param` names it. | | `400 parameter_invalid` | `report_type` is not one your key can ask for, or a parameter is wrong: `param` names it, a parameter of `parameters` in brackets, `parameters[columns]`. An `Idempotency-Key` that is not one is too: see [Choosing a key](https://docs.dev.novaro.ink/api/idempotent-requests/#choosing-a-key). | | `400 report_interval_invalid` | The interval ends before it starts, is longer than 366 days, or falls outside the type's data. `param` names the end to change: `parameters[interval_start]` when it is not before the end or is before `data_available_start`, `parameters[interval_end]` when it is after `data_available_end` or the interval is too long. | | `409 report_runs_in_progress` | Too many reports are still being prepared: 3 of your key's, or 5 of your merchant's. | | `400 idempotency_error` | The key was used for another request in the last 24 hours. It is checked before the parameters: another request with a wrong parameter gets this, not `parameter_invalid`. | ## Downloading the file A succeeded run's `result` is its file. Its `url` is a path on the API's host, `/files/{id}/contents`, not a full address: put the [base URL](https://docs.dev.novaro.ink/api/#the-address) before it, `https://api.dev.novaro.ink/files/{id}/contents`. Call it with your key: the answer is a `302` to the file itself, a link good for 60 seconds. Follow the redirect at once, without your key, and call the URL again for a new link; with curl, `-L` follows it. Its `Location` may be a path on the API's host rather than a full address: resolve it against the base URL, as a browser and curl do. Every download is recorded. The file is kept for 7 days after the run succeeds, until `result.expires_at`; after it, the download is `400 file_expired`, and you create a new run with the same parameters. ## The report run object | Field | | | --- | --- | | `id` | Unique id, `frr__…`. | | `object` | `reporting.report_run`. | | `report_type` | The type of the run. | | `status` | `pending`, `succeeded` or `failed`. | | `parameters` | What the run was asked for, its defaults filled in. | | `result` | Its file once it has `succeeded`; `null` before. | | `error` | Why it failed; `null` otherwise. | | `data_as_of` | The moment the data is fixed at: see [Data as of](https://docs.dev.novaro.ink/reports/#data-as-of). | | `created`, `succeeded_at` | In seconds since the Unix epoch; `succeeded_at` is `null` until it has succeeded. | | `livemode` | `true` for a live key's run, `false` for a test key's. | The file object, `result`: | Field | | | --- | --- | | `id` | Unique id, `file__…`. | | `object` | `file`. | | `purpose` | `finance_report_run`. | | `type` | `csv`. | | `filename` | The file's name. | | `size` | In bytes. | | `created`, `expires_at` | When it was made, and until when it can be downloaded. | | `url` | `/files/{id}/contents`: a path on the API's host, to call after the [base URL](https://docs.dev.novaro.ink/api/#the-address) with your key. | The [`reporting.report_run.*` webhook events](https://docs.dev.novaro.ink/webhooks/event-types/) carry the same run object. ### GET /reporting/report_runs: ListReportRuns List your key's account's report runs, newest first, a page at a time: those your account's keys created, and those your team created in the merchant portal over this account alone. - `created[gt]` (query): (OPTIONAL) After this time. - `created[gte]` (query): (OPTIONAL) At this time or after. - `created[lt]` (query): (OPTIONAL) Before this time. - `created[lte]` (query): (OPTIONAL) At this time or before. - `limit` (query): (OPTIONAL) How many runs a page holds, 1 to 100; 10 when left out. - `starting_after` (query): (OPTIONAL) The id of the run the page starts after: the last of the page before. - `ending_before` (query): (OPTIONAL) The id of the run the page ends before: the first of the page after. At most one of starting_after and ending_before. ### POST /reporting/report_runs: CreateReportRun Create a report run over your key's account. It is pending until its file is ready; at most 3 of your key's and 5 of your merchant's may be pending at once. The answer is 201 with the run. Send an Idempotency-Key, and the same key when you retry: you get the same run back. The key is your account's and is kept for 24 hours. - `Idempotency-Key` (header): Optional. A key of your choice, unique to the request: a retry with the same key answers the run as it is now, and makes no new one; a request without a key makes a new run. See Idempotent requests. - `parameters` (body): The period and what the file holds. - `report_type` (body): The report type, e.g. payments.itemized.1. ### GET /reporting/report_runs/{id}: GetReportRun Retrieve a report run by its id. - `id` (path, required): The run's id, e.g. frr_in_01J9…. --- # Resources › Files Source: https://docs.dev.novaro.ink/api/files/ Download a file we made for you, such as a report run's. A file is one we made for you: a [report run's](https://docs.dev.novaro.ink/api/report-runs/) `result`. Download it with your key from its `url`, `/files/{id}/contents`: a path on the API's host, not a full address, so put the [base URL](https://docs.dev.novaro.ink/api/#the-address) before it, `https://api.dev.novaro.ink/files/{id}/contents`. The answer is a `302` to the file itself, a link good for 60 seconds, and never cached: follow the redirect at once, without your key, and call the URL again for a new link. Its `Location` may be a path on the API's host rather than a full address: resolve it against the base URL, as a browser and curl do. Every download is recorded. Files take a secret key (`sk_`); a [CLI key](https://docs.dev.novaro.ink/api/authentication/#cli-keys) (`rk_`) gets `403 api_key_permission`. A file of another account, or of a run your key cannot read, is `404 resource_missing`, as for a file that does not exist. A file past its `expires_at` is `400 file_expired`. ### GET /files/{id}/contents: GetFileContents Download a file: the answer is 302 to a link that serves it for 60 seconds, so follow the redirect (curl -L). Send your secret key, as to any request; the link itself takes none, and the next download asks for a new one. A file is kept 7 days: one past its expires_at is 400 file_expired. - `id` (path, required): The file's id, e.g. file_in_01J9…. --- # Resources › Status Source: https://docs.dev.novaro.ink/api/status/ The status endpoints of the NovaroPay API. These endpoints are coming soon. The Changelog will list them when they are live. --- # More › Changelog Source: https://docs.dev.novaro.ink/changelog/ Changes to the API and to our IP addresses, by version. Every new API version is listed here with what changed in it, newest first. A change that can break an integration comes only with a new [version](https://docs.dev.novaro.ink/api/versioning/), and your integration stays on its own version until you move it. A change to [our IP addresses](https://docs.dev.novaro.ink/security/our-ips/) is announced here at least 7 days ahead, and by email to your developers. ### 2026-11-22.acacia - Payments: POST /payments takes fraud prevention fields in customer, each optional and taken in every market: login_ip, device_id (up to 200 characters) and user_agent (up to 1000). A value outside these is 400 parameter_invalid on its field. They are never answered back. Fraud prevention: what to send and why says what each is for. - Payments: every payment has outcome { type }, as Stripe's charge.outcome: authorized, our checks passed (it says nothing of whether it is paid), or blocked. It never changes; risk_level and reason are kept for later and not sent yet. failure_code says why a failed payment failed: blocked, or null. GET /payments takes outcome_type, authorized or blocked; another value is 400 parameter_invalid. - Payments: on every version, POST /payments can answer 201 with a payment that is failed from the start: outcome.type blocked, failure_code blocked, no details to pay to, and payment.failed is sent. Its merchant_reference stays taken, so a new attempt takes a new one. Show your customer that paying is temporarily unavailable. ### 2026-11-15.acacia - Reporting: on a market that has payouts, GET /reporting/report_types also lists payouts.itemized.1, and POST /reporting/report_runs takes it: your key's account's payouts, by when they ended (paid, failed or canceled) or when they were made, with the filter status. Where a payout went is as the payout object shows it (destination last4, or the alias); who received it is masked. On any other market the type is not listed, and a run of it is 400 parameter_invalid. - Reporting: payouts.itemized.1's name in GET /reporting/report_types is Itemized payouts; it was empty. - Reporting: payments.itemized.1 has created_at_utc, updated_at_utc, finalized_at_utc and status_changed_at_utc, always in UTC whatever the run's timezone; created_at, updated_at, finalized_at and status_changed_at stay in the run's timezone. Its columns are in a new order, by group: the payment, its money, its times (each beside its UTC twin), the merchant; its default_columns are, in every version: payment_id, parent_id, merchant_reference, customer_id, type, traffic_type, method, status, failure_reason, currency, amount_requested, amount_paid, fee_pct, fee_fixed, fee_amount, created_at, created_at_utc, status_changed_at, status_changed_at_utc, merchant_id, merchant_name, account_id. account_name, amount_credited, net_amount, updated_at and finalized_at are no longer default; you can still ask for them, and for updated_at_utc and finalized_at_utc. ### 2026-11-14.acacia - Reporting: GET /reporting/report_types and /reporting/report_types/{id} list the reports your key may ask for (payments.itemized.1), each with its default_columns, columns, filters and the period its data covers for your key's account (data_available_start, data_available_end). POST /reporting/report_runs asks for one over your key's account: report_type and parameters { interval_start, interval_end, timezone, columns, date_basis, status, method, traffic_type, amount_min, amount_max }; the answer is 201 with the run pending, and an Idempotency-Key, optional, answers the same run again: your account's, whichever of its keys sends it, for 24 hours. An interval past data_available_end, or longer than 366 days, is 400 report_interval_invalid; more than 3 of your key's or 5 of your merchant's runs being prepared at once is 409 report_runs_in_progress. GET /reporting/report_runs and /reporting/report_runs/{id} read your account's runs: your keys', and those your team made in the merchant portal over this account alone. - Files: a succeeded report run's result is a file object { id file_…, filename, size, type csv, expires_at, url }. GET /files/{id}/contents with your secret key answers 302 to a link that serves the CSV for 60 seconds (curl -L follows it); every download is recorded. A file is kept 7 days: one past its expires_at is 400 file_expired. - Events: reporting.report_run.succeeded and reporting.report_run.failed carry the run, sent to your account's endpoints for the runs your account's keys created; runs made in the merchant portal send none. ### 2026-11-13.acacia - Versions: a release name can be deprecated with an end date, at least 24 months after the next name ships; your account's admins are emailed at least 90 days ahead when your account uses it. Until the date it works as before, and every response in it carries a PSP-Deprecation header with the end date. On every version. - Versions: a deprecated name retires once nothing has called in it or been sent in it for 30 days past its end date; until then the date moves on 90 days, with a new email. A request whose PSP-Version names a retired version is refused with 400 api_version_retired. Your account's default and your webhook endpoints on it move to the newest release of the oldest name that is neither deprecated nor retired, with an email; a request without PSP-Version is never refused for it. On every version. ### 2026-11-12.acacia - Errors: 503 temporarily_unavailable is also the answer to a request whose API version could not be settled while it ran, as when your account's default version changed during it: nothing ran, so send it again. On every version. ### 2026-11-10.acacia - Test mode: a test payment confirmed with a UTR that is not magic stays processing, as a live one does while nobody has seen its money, until our team marks it paid or failed, or its window closes 24 hours later; it no longer succeeds 5 seconds later. The magic UTRs are unchanged. A payment first confirmed with an ordinary UTR still takes 000000000001 to 000000000004 afterwards; 000000000005 and 000000000006, which wait for an expiry, change nothing on a processing payment. On every version. ### 2026-11-07.acacia - Payments: a payment's version moves only with a change you can see in it: our own check of a bank's statement no longer moves it, so GET /payments/{id} and the list no longer answer a version no event or change of yours had. On every version. - Payments: a hosted payment's checkout.status is confirmed as soon as the payer sends their UTR on the page, so the payment.processing it sends says confirmed, not opened; it no longer waits for the page to show Checking. On every version. ### 2026-11-04.acacia - Payments: checkout.return_url is any absolute https URL, on any host and port, kept as you sent it: nothing on your account lists the hosts it may name any more, and 400 return_url_not_allowed is never answered. http, or a value that is not an absolute URL, is 400 parameter_invalid with param checkout.return_url. - Payments: POST /payments takes checkout.embed_origin, the https origin of your page that shows ours in an iframe (https://shop.example, no path): only it may frame the payment's page (in test mode our merchant portal and back office too), and only it is told the page's state (psp.checkout messages). Without it the page opens in no frame. Another form is 400 parameter_invalid with param checkout.embed_origin. The account's embed hosts are gone: a page you frame needs embed_origin on its payment, whatever version you are on. - Payments: a hosted payment's checkout has return_url and embed_origin, as its request sent them (embed_origin in lower case, without the scheme's default port; null when not sent). ### 2026-10-25.acacia - Payments: a payment no longer has verification, and the payment.verified event is no longer sent: whether a bank's statement showed a payment's money is ours to check. Credit amount_credited on payment.succeeded. On every version: a payment pinned to an earlier one has no verification either. - Webhook endpoints: payment.verified is taken out of the event types an endpoint listens to, and is no longer one you can pick: the portal does not offer it, and novaro listen --events payment.verified is refused. One that listened to it alone stays as it is and is sent nothing: pick other event types for it. A payment.verified delivery still waiting is canceled; events already sent stay in GET /events for their 30 days. ### 2026-10-24.acacia - Payouts: POST /payouts sends money from your available balance to a bank account you name. The amount and the payout fee of your agreement are held at once; the payout is pending, then processing, and ends paid or failed (failure_code says why; the amount and fee come back), or requires_review while we check an unknown outcome. Idempotency-Key required; more than available is 400 balance_insufficient. GET /payouts and /payouts/{id} read your account's payouts; POST /payouts/{id}/cancel cancels a pending one (409 payout_not_cancelable once it is being sent or ended). Test mode only for now: a live key is 409 payouts_not_available, and a test payout's amount takes it to paid, failed or requires_review (magic amounts, see Payouts › Test mode). - Events: payout.created, payout.paid, payout.failed, payout.requires_review and payout.canceled carry the payout; in test mode, magic amounts send each of them. ### 2026-10-23.acacia No change for the markets open now: it answers as the version before it. ### 2026-10-22.acacia No change for the markets open now: it answers as the version before it. ### 2026-10-21.acacia No change for the markets open now: it answers as the version before it. ### 2026-10-20.acacia - Balance: GET /balance reads your balance on your key's market, per currency: available (what you can pay out or settle now), pending (deposits not available yet) and reserved (held for pending payouts and settlements). All your merchant accounts on the market share it, and any of their keys reads it; a test key reads the test environment's, livemode false. - Settlements: POST /settlements requests a settlement of your balance in USDT on TRON, live keys only, with an Idempotency-Key: 201 with the settlement pending, its amount reserved from your available balance; a retry with the key answers it again and reserves nothing more. A test key is 409 livemode_only; more than available 400 balance_insufficient; another request of yours still pending 409 settlement_request_pending; no default payout address 409 payout_address_missing; an address not active 400 payout_address_not_active; an amount that comes to no USDT 400 amount_too_small; no settlement terms on your agreement yet 409 settlement_terms_missing. GET /settlements lists your settlements on the market, yours and those our team made (origin novaropay), newest first, filtered by status and created; GET /settlements/{id} reads one. - Payout addresses: GET /payout_addresses lists your active payout addresses, the default first. They are still added, made default and blocked in the merchant portal only. - Events: the settlement in settlement.* events is the API's settlement object, which adds exchange_rate, usdt_amount and payout_address { id, network, asset, address }, with the values of rate, usdt and address (which stay), and origin, fee_fixed_usdt, tronscan_url, description and livemode. settlement.created is sent for a settlement you request, as for one our team makes. ### 2026-10-19.acacia - Payments: POST /payments/{id}/confirmations with the UTR of the bank transaction that paid the payment answers 200 with the payment and records nothing, as the same value sent again does, after the payment succeeded too; it was 409 payment_final. Any other value on a payment that succeeded or failed is still 409 payment_final. - Payments: a payment has amount_paid (what arrived from the payer's bank), amount_credited (what to credit your customer: the amount you asked for when the payer paid exactly amount_payable, else amount_paid; amount_received is the same amount), amount_mismatch (the payer paid other than amount_payable) and verification (unverified, or verified once the bank's statement shows the money; gone on every version since 2026-10-25.acacia), each null until the payment succeeded; webhook events' data.object has them as at the event. - Events: payment.verified, when the bank's statement shows a succeeded payment's money; its verification is verified. Sent whether the statement came after an SMS or was the first to show the money. In test mode a test payment a UTR succeeded is verified 5 seconds later. No longer sent since 2026-10-25.acacia. - Events: settlement.created, settlement.updated, settlement.paid and settlement.canceled, when a settlement of your balance is made, changed before it is sent, sent (its tx_hash is the TRON transfer) or canceled. data.object is the settlement: id, status, market, amount and fee in the market's currency, rate, usdt in micro-USDT, address, tx_hash, cancel_reason, created, paid_at, canceled_at and version. Each of your accounts on the market gets them. - Events: a paid settlement taken back sends settlement.updated with status reversed and reversed_at: its amount is back in your balance. reversed_at is null on every other settlement. ### 2026-10-16.acacia - Events: POST /events/{id}/retry with webhook_endpoint (whe_…) sends an event to one of your webhook endpoints again, now: one more attempt of its delivery there, as Resend in the merchant portal, answered with the event. The endpoint must have been sent the event and be turned on; one turned off is 400 parameter_invalid, and an event not sent to it 404 resource_missing naming webhook_endpoint. The automatic retries of a delivery still failing go on as they were. It takes no Idempotency-Key: the same request again sends the event once more. - CLI keys may also resend an event (novaro events resend). Coming with the novaro CLI: novaro listen forwards your test-mode events to a server on your machine, ready with the latest API version on --latest, and novaro trigger makes them happen; see Test webhooks locally with the CLI. ### 2026-10-14.acacia - Test mode is open: an sk_test_ key works on the same host as a live one, in a test environment of its market with its own keys and payments (livemode false), magic UTRs and no real money; a market with no test environment answers its test keys 404 resource_missing. Test keys created before keep their secret. Try it in the API reference sends test requests with a pasted test key. - Events: GET /events lists your account's events of the last 30 days, newest first, filtered by type (payment.* for a resource's every type), created and delivery_success; GET /events/{id} reads one. An event has data.object, the object right after it, previous_attributes for payment.instructions_updated, request and pending_webhooks. The events are kept 30 days and sent to the webhook endpoints that listen to their type, signed with PSP-Signature, with retries. Webhook endpoints are set up in the merchant portal (its Webhooks page is coming soon; until then, your account manager sets them up). - CLI keys (coming with the novaro CLI): novaro login makes an rk_test_ key, allowed by someone of your account in the merchant portal: test mode only, 90 days, never rotated; it may read events and create, read and confirm payments, and any other call is 403 api_key_permission. - Payments: a payment has version, which grows with every change of it: of two copies of a payment, the one with the higher version is the newer, and a webhook event's data.object has the version of that event. - Payments: send traffic_type on POST /payments, ftd for a customer's first deposit with you or std for a subsequent one; ftd when left out, any other value, the empty one too, 400 parameter_invalid. Every payment carries traffic_type, and GET /payments filters by it. A type turned off on your account is 400 traffic_type_disabled, and nothing is made; payments made before keep going. ### 2026-10-01.acacia - The first version. Payments: retrieve a payment with GET /payments/{id}; a payment of another account is 404 resource_missing. - Payments: create a payment with POST /payments, answered 201 with the details to pay to; metadata is kept and answered back. An Idempotency-Key is required: a retry with it gets the first answer and the header Idempotent-Replayed, another body under it is 400 idempotency_error, and while the first runs 409 idempotency_key_in_use. - Payments: list your payments with GET /payments, newest first, a page at a time (limit, starting_after, ending_before; see Pagination), filtered by merchant_reference, customer_id, status and created[gt|gte|lt|lte]; an unknown cursor is 404 resource_missing. - A request's parameters, in its body or its query, are checked as Stripe checks them: parameter_unknown, parameter_missing and parameter_invalid name the parameter; an amount outside the limits is amount_too_small or amount_too_large, naming the limit; a method not available is method_not_enabled; a merchant reference used before is 409 merchant_reference_already_used; and 503 temporarily_unavailable creates nothing. - Payments: the limits of an amount are the method's in your market, which may be narrower than the method allows elsewhere, and your account's own; outside either, POST /payments answers amount_too_small or amount_too_large with the limit, and no payment is made. - PSP-Version: every response names the version it ran in, your account is pinned to the current version on its first request, and an unknown version is 400 invalid_api_version. - A working key refused for its account's or market's state is 403 account_inactive or market_not_enabled; a wrong key stays 401. Test keys work only in test mode. - A key that was revoked, or replaced by a rotation whose expiry has passed, is 401 api_key_expired with the key's prefix in the message, from any address; a wrong key stays 401 with no code. - Payments: send checkout with a return_url to show the payer our hosted payment page: the payment has channel hosted and checkout { url, status, opened_at }, the page on your account's checkout domain. A return_url off your account's return hosts is 400 return_url_not_allowed; an account with no checkout domain is 503 checkout_unavailable, and nothing is made. - Payments: every payment has channel (h2h or hosted), and its UPI details the hosted page with them, hosted_instructions_url, and qr_code { data, image_url_svg, image_url_png }; the URLs are null while your account has no checkout domain. - Payments: upi_uri carries pn, the name the VPA is registered under, and the UPI details list app_links [{ app, url }], links that open Paytm and PhonePe on the same details with the amount and the note locked where the app allows it: every app we have not switched off for your market because its link broke, [] with no VPA. - Payments: confirm a payment with what its payer told you, POST /payments/{id}/confirmations with the fields its confirmation_fields name (utr in India): 200 with the payment, processing if it waited for the payer, never succeeded; the same value again answers it again. A value confirmed on another payment is 409 reference_already_used, a payment that succeeded or failed 409 payment_final, a method with no confirmation fields 400 confirmation_not_supported. A payment processing on your confirmation alone fails if no money is seen 24 hours after it. - Payments: the UPI details of a payment waiting for the payer may change, and with them its amount_payable when your account matches payments by amount, its reference code kept: the payer asked the hosted page for others, or we moved the payment to better details within a minute of its creation. GET /payments/{id} reads the current ones; money sent to the earlier details still pays the payment. - Test mode: a test key may send at most 25 requests a second, and an account 100 over all its test keys; a request over either is 429 rate_limit, type rate_limit_error, with a Retry-After header in seconds, and nothing runs. Live mode has no such limit. - Hosted page: the page goes back to return_url as you sent it, with nothing added, and the payment's status says what happened; in a frame on your account's embed hosts it posts { type: "psp.checkout", status, height } to the frame's page and does not go back by itself; in a WebView it hides the app buttons until your app opens their links and the account's option is on. The guide Hosted payment page covers all three. --- # More › What changed Source: https://docs.dev.novaro.ink/what-changed/ What changed between two API versions: the Changelog of the releases between them and each resource's endpoints, fields and event types. Pick two versions. You get the [Changelog](https://docs.dev.novaro.ink/changelog/) of every release after the older one up to the newer one, and what differs between their API reference, resource by resource: endpoints, parameters, the fields of what the endpoints answer, and the event types. Each resource links to its reference in both versions. The releases of one name only add, so between two of them the reference is the same, and the Changelog says what was added. What we add to every version is in both versions' reference, marked **Added in** in the older one's, so it is not a difference here. The comparison itself is drawn on this page of the docs site, from each version's API reference; open the page to compare two versions. --- # More › Attributions Source: https://docs.dev.novaro.ink/legal/attributions/ Data from others that our service uses, and the credit their licences ask for. ## Where an IP address is To tell where a payer or a device connects from (its country, region, city and network), we use DB-IP's free databases: IP to Country Lite, IP to City Lite and IP to ASN Lite, under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). [IP Geolocation by DB-IP](https://db-ip.com)