{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"f14496de-4821-43d4-ad8c-cf47f4353125","name":"Cashonrails Merchant API","description":"## Cashonrails Merchant Developer API\n\nUse the Merchant API to accept payments, create and manage customers, provision reserved accounts, verify transactions, initiate payouts, and receive asynchronous webhooks.\n\nThis documentation is aligned to the current Merchant API implementation. Where examples use placeholders, replace them with values from your Cashonrails dashboard.\n\n### Base URLs\n\n| Environment                                                      | Base URL                          |\n| ---------------------------------------------------------------- | --------------------------------- |\n| Production/Sandbox                                               | `https://api.cashonrails.com`     |\n| Production/Sandbox (Decommissioning Date: `30th September 2026`) | `https://mainapi.cashonrails.com` |\n\nMerchant API endpoints are served under `/api/v1`. For example, initialize a hosted checkout with:\n\n```text\nPOST https://api.cashonrails.com/api/v1/transaction/initialize\n```\n\n### Fastest Safe Integration Path\n\n1. Create a Cashonrails merchant account and enable the products your integration needs.\n2. Generate test keys in **Settings > API Keys and Webhook**.\n3. Send all server-side API requests with `Authorization: Bearer <secret_key>`.\n4. Initialize a test transaction with `POST /api/v1/transaction/initialize`.\n5. Verify the transaction from your backend with `GET /api/v1/transaction/verify/{reference}`.\n6. Configure your webhook URL and verify webhook signatures before updating local order state.\n7. For payouts, upload your RSA public key, sign the exact request body, and use an idempotency key. See [RSA Request Signing](https://developer.cashonrails.com/authentication/rsasigning) for the full setup.\n8. Repeat the same flow with live keys only after test payments, payout failure cases, and webhooks pass QA.\n\n### Core Integration Patterns\n\n| Use case                     | Recommended pattern                                                                                                                      |\n| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |\n| Hosted payment page          | Create a transaction, redirect the customer to `authorization_url`, then verify server-side and wait for webhook confirmation.           |\n| Server-to-server collections | Use `/api/v1/s2s/*` only when your product access is enabled and your backend can handle provider-specific authorization steps.          |\n| Payouts                      | Validate account name first, sign payout creation with RSA, send `Idempotency-Key`, and treat `pending` as the normal initial outcome.   |\n| Reserved accounts            | Create or reuse a customer first, then create a reserved account for that customer.                                                      |\n| Webhooks                     | Verify signatures using the raw request body, persist by event/reference, acknowledge quickly with HTTP 200, and process asynchronously. |\n\n### Source-of-Truth Notes\n\nThe Merchant API currently enforces bearer secret-key authentication, optional merchant IP allowlisting, product access checks, optional AES-256-GCM payload encryption for enrolled businesses, RSA request signing for payout creation when a public key is configured, rate limits, and webhook resend throttles.\n\nSee [API Basics](https://developer.cashonrails.com/authentication/apibasics), [API Keys](https://developer.cashonrails.com/authentication/apikeys), [API Encryption](https://developer.cashonrails.com/authentication/apiencryption), [RSA Request Signing](https://developer.cashonrails.com/authentication/rsasigning), and [API Reference](https://developer.cashonrails.com/api-reference) before building production traffic. The API Reference page also lists a few items we're still confirming against the backend, see its Unresolved Discrepancies section.\n\n## API Basics\n\nAll Merchant API requests must be made from your backend over HTTPS. Do not call secret-key endpoints directly from a browser or mobile app.\n\n### Authentication\n\nSend your test or live secret key as a bearer token:\n\nIf the header is missing, the API returns HTTP `401` with `\"message\": \"Merchant Authorization is required\"`. If the key is not recognised, or has been revoked or has expired, the API returns HTTP `401` with:\n\n```json\n{\n\t\"status\": false,\n\t\"message\": \"Invalid Merchant Authorization\"\n}\n```\n\nThe key determines whether the request runs in test or live mode: keys starting with `sk_test_` run in test mode and keys starting with `sk_live_` run in live mode. Use test keys for test traffic and live keys only after your integration has passed QA. Endpoints that are only available in test mode return HTTP `403` with `\"message\": \"This endpoint is only available with test API keys\"` when called with a live key.\n\n### Product Access\n\nSome endpoints require the corresponding business product to be enabled. For example, checkout endpoints require checkout access, reserved account endpoints require reserved account access, and payout endpoints require payout access.\n\nIf a product has been disabled for your business, the API returns HTTP `403` with `{\"error\": \"Access Denied\"}`. If your business or user account is blocked or not active, the API returns HTTP `403` with `\"status\": false` and a message asking you to contact support.\n\n### IP Allowlisting\n\nEvery business must have an IP allowlist, for both test and live keys. Add your server IP addresses or CIDR ranges on the dashboard before making API calls. Until the allowlist has at least one active entry, requests are rejected with HTTP `403` and `\"message\": \"IP allowlist is required for this business. Add an allowed IP address before making API calls.\"`. Requests from an IP outside the allowlist are rejected with HTTP `403` and `\"message\": \"Unauthorized Access\"`. Both responses use `\"success\": false`.\n\nThe allowlist accepts up to `50` active entries. IPv4 ranges can be no wider than `/8` and IPv6 ranges no wider than `/32`. Changes can take up to five minutes to apply.\n\nFor production, allowlist only stable outbound IPs from your backend or NAT gateway. Avoid routing API calls through developer laptops, browser clients, or dynamic residential networks.\n\n### Request and Response Format\n\nPlain requests and responses use JSON unless AES encryption is enabled for your business. Encrypted responses are returned as `application/octet-stream`; see [API Encryption](https://developer.cashonrails.com/authentication/apiencryption).\n\nMost responses include one of these envelope styles:\n\n```json\n{\n\t\"success\": true,\n\t\"message\": \"Transaction Initialized Successfully\",\n\t\"data\": {}\n}\n```\n\n```json\n{\n\t\"status\": true,\n\t\"message\": \"Verification successful\",\n\t\"data\": {}\n}\n```\n\nWhich key you get, `success` or `status`, depends on the endpoint. Check for either field rather than assuming one.\n\nEmail fields on payment initialization and customer endpoints must be real customer addresses: placeholder domains (`example.com`, `example.org`, `example.net`, `test.com`), `+` aliases and disposable email domains are rejected. Replace the placeholder emails in the examples on these pages with your customer's email.\n\nUse both the HTTP status code and the response body. Some payment and payout status values are business statuses, not HTTP statuses, meaning you can get an HTTP `200` with a body like `\"status\": \"pending\"`, which is not the same as the request having failed.\n\n### Rate Limits\n\nRate limits are enforced server-side and may be tuned per environment. Current implementation defaults include:\n\n| Scope                                                                        | Default limit               | Counted per |\n| ---------------------------------------------------------------------------- | --------------------------- | ----------- |\n| Payout creation (`/api/v1/bank_transfer`) and S2S payment initialization     | `6,000` requests per minute | Secret key  |\n| S2S verify and cancel (`/api/v1/s2s/transaction/verify`, `/cancel`)          | `1,000` requests per minute | Secret key  |\n| All other Merchant API endpoints                                             | `4,000` requests per minute | Client IP   |\n| HMAC signature generation (`/api/hmac_signature`, test keys only)            | `120` requests per minute   | Secret key  |\n| Webhook resend endpoints                                                     | `60` requests per minute    | Secret key  |\n\nStatus endpoints (`transaction/verify`, `s2s/transaction/verify`, `fetch_all_transfers` and `fetch_transfer_details`) can also limit how many calls one secret key runs at the same time.\n\nWhen you receive HTTP `429`, wait for the number of seconds in the `Retry-After` header, retry with exponential backoff and avoid parallel retry storms.\n\n### Common HTTP Responses\n\n| HTTP status | Meaning                 | Typical cause                                                                  |\n| ----------- | ----------------------- | ------------------------------------------------------------------------------ |\n| `200`       | Request processed       | Successful reads and many successful writes.                                   |\n| `400`       | Bad request             | Invalid encrypted payload, invalid type, malformed data.                       |\n| `401`       | Unauthorized            | Missing/invalid secret key or validation failures on some payout endpoints.    |\n| `403`       | Forbidden               | Account blocked, product access denied, IP not allowed, invalid RSA signature. |\n| `404`       | Not found               | Transaction, transfer, customer, or account reference was not found.           |\n| `409`       | Conflict                | `Idempotency-Key` reused with a different payload, or still in progress.       |\n| `422`       | Unprocessable           | Request validation failed on endpoints that use standard validation.           |\n| `429`       | Too many requests       | Rate limit exceeded.                                                           |\n| `503`       | Temporarily unavailable | Downstream payout processing or payment service system unavailable.            |\n\n### Production Checklist\n\n- Store secret keys, encryption keys, webhook keys, and RSA private keys in a secret manager.\n- Generate unique references for every transaction and payout.\n- Send `Idempotency-Key` on payout creation. Without it, the payout `reference` is used as the idempotency key.\n- Add every server IP that calls the API to your IP allowlist before going live.\n- Verify all final states through webhooks and verify endpoints.\n- Log Cashonrails references, your internal order IDs, HTTP status, and response status without logging secrets or full PII payloads.\n- Build retry logic only for network failures, HTTP `429`, and clearly temporary `5xx` responses.\n\n## Using this collection\n\n1. Import the collection and the test or live environment from https://developer.cashonrails.com/extras/postman.\n2. Select the environment and set `secret_key` to your test or live secret key from **Settings > API Keys and Webhook**. The key decides test or live mode; both use the same `baseUrl`.\n3. Every request sends `Authorization: Bearer {{secret_key}}` through the collection auth. The public checkout requests send no key.\n4. Path values such as `:reference` are path parameters. Set them on the request's **Params** tab.\n\nRequests are sent as plain JSON. If your business is enrolled in API encryption, encrypt bodies as described in [API Encryption](https://developer.cashonrails.com/authentication/apiencryption). Payout requests must be signed as described in [RSA Request Signing](https://developer.cashonrails.com/authentication/rsasigning). This collection has no scripts for either.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"60722484","team":47811019,"collectionId":"f14496de-4821-43d4-ad8c-cf47f4353125","publishedId":"2sBYPwZCfn","public":true,"publicUrl":"https://documenter-api.postman.tech/view/60722484/2sBYPwZCfn","privateUrl":"https://go.postman.co/documentation/60722484-f14496de-4821-43d4-ad8c-cf47f4353125","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.12.14","publishDate":"2026-12-04T03:01:04.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"Cashonrails Test","id":"0373b1a1-0a88-43cd-b7d8-6ee1274233ca","owner":"60722484","values":[{"key":"baseUrl","value":"https://api.cashonrails.com","enabled":true,"type":"default"},{"key":"secret_key","type":"secret","enabled":true},{"key":"encryption_key","type":"secret","enabled":true},{"key":"webhook_key","type":"secret","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://postman-image-service.postman.com/api/cloudinary-proxy/postman/image/upload/t_team_logo_pubdoc/v1/team/5ec58f375091e4bcc3989698fcb6130210e75f672fc461e1913c4c03ec3c619c","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Cashonrails Test","value":"60722484-0373b1a1-0a88-43cd-b7d8-6ee1274233ca"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sBYPwZCfn"}