{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"5a010caa-b72e-434d-805b-aa5825fb1b9e","name":"Payment API","description":"## Introduction\n\nWelcome to the Payment API Collection. This collection provides a streamlined interface for interacting with our payment processing API, with special focus on subscription management. A powerful pre-request script handles template management, request formatting, and signature generation automatically.\n\n## Key Features\n\n- **Automatic Template Application**: Pre-configured subscription templates for different scenarios\n    \n- **Request Signing**: Automatic SHA-256 signature generation\n    \n- **ID Generation**: Optional automatic generation of transaction and customer IDs\n    \n- **Field Formatting**: Automatic stringification of complex objects\n    \n- **Environment Integration**: Seamless use of environment variables for credentials and URLs\n    \n\n## Getting Started\n\n### 1\\. Set Up Your Environment\n\nBefore making any requests, create an environment with these variables:\n\n| Variable | Description |\n| --- | --- |\n| `MERCHANT-NO` | Your merchant identifier |\n| `APPID` | Your application ID |\n| `SECRET` | Your API secret key |\n| `RETURN-URL` | URL for redirecting users after payment |\n| `WEBHOOK-ENDPOINT` | URL for receiving payment notifications |\n\n### 2\\. Configure Collection Variables (Optional)\n\nFor advanced customization, you can set these collection variables:\n\n| Variable | Description | Default |\n| --- | --- | --- |\n| `debugMode` | Enable detailed console logging | `false` |\n| `enableRequestSigning` | Enable automatic request signing | `true` |\n| `autoGenerateIds` | Auto-generate transaction and customer IDs | `false` |\n| `fieldsToStringify` | Additional fields to stringify (comma-separated) | \\- |\n| `subscription_type` | Default subscription type | `ONERWAY` |\n| `default_product_name` | Default product name for subscriptions | `Payment Subscription` |\n\n### 3\\. Customize Subscription Templates (Optional)\n\nFor subscription operations, you can customize these templates:\n\n| Template Variable | Used For |\n| --- | --- |\n| `onerway_subscription_template` | Auto-debit subscriptions (customer-initiated) |\n| `merchant_subscription_template` | Merchant-initiated subscriptions |\n| `merchant_renewal_template` | Subscription renewal requests |\n\n## Advanced Usage\n\n### Controlling ID Generation\n\nThe script automatically generates IDs when `autoGenerateIds` is set to `true`:\n\n- `merchantTxnId` will be generated as a UUID\n    \n- `merchantCustId` will be generated in format `CustId-XXXX-XXXX`\n    \n\n#### Skipping merchantCustId Generation\n\nFor requests where you need to use your own `merchantCustId` values while still auto-generating `merchantTxnId`, you can:\n\n1. **Add a header**: Include `X-Skip-MerchantCustId-Generation` header (with any value) in your request\n    \n2. **Add a body flag**: Include `\"skipMerchantCustIdGeneration\": true` in your request body (this flag will be automatically removed before sending)\n    \n\nThis is useful for:\n\n- Customer update operations where you need to use an existing customer ID\n    \n- Requests where you want to manually specify the customer ID\n    \n- Testing specific customer ID formats or values\n    \n\n### Skipping Request Signing\n\nTo skip request signing for a specific request:\n\n1. Add header `X-Skip-Signing` with any value, or\n    \n2. Add `\"sign\": \"skip_sign\"` to your request body\n    \n\n### Custom Field Stringification\n\nTo stringify additional fields, set `fieldsToStringify` collection variable:\n\n```\nCopybillingInformation,customField1,customField2\n\n ```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **\"Invalid signature\" error**:\n    \n    - Verify your `SECRET` environment variable is correct\n        \n    - Check that request signing is enabled\n        \n2. **Template not applying**:\n    \n    - Verify template variables are properly formatted JSON strings\n        \n    - Enable `debugMode` to see detailed logs\n        \n3. **Missing required fields**:\n    \n    - When `debugMode` is enabled, check console for validation warnings\n        \n4. **Customer ID issues**:\n    \n    - If you need to use your own customer IDs, use the `X-Skip-MerchantCustId-Generation` header\n        \n    - Check if `autoGenerateIds` is enabled when you expect IDs to be generated\n        \n\n### Debugging\n\n1. Set collection variable `debugMode` to `true`\n    \n2. Open Postman Console (View > Show Postman Console)\n    \n3. Send your request\n    \n4. Review the detailed logs showing template application and request processing\n    \n\n## Reference\n\n### Subscription Types\n\n| Type | `selfExecute` Value | Description |\n| --- | --- | --- |\n| ONERWAY | \"1\" | Auto-debit subscription with automatic renewals |\n| MERCHANT | \"2\" | Merchant-initiated subscription requiring manual renewal |\n\n### Frequency Types\n\n| Type | Description | Example |\n| --- | --- | --- |\n| D | Days | \"30\" = Every 30 days |\n| W | Weeks | \"2\" = Every 2 weeks |\n| M | Months | \"1\" = Monthly |\n| Y | Years | \"1\" = Yearly |\n\n### Request Types\n\n| Value | Description |\n| --- | --- |\n| \"0\" | New subscription creation |\n| \"1\" | Subscription renewal |\n\n### Control Headers\n\n| Header | Purpose |\n| --- | --- |\n| `X-Skip-Signing` | Skip request signing for this request |\n| `X-Skip-MerchantCustId-Generation` | Skip auto-generation of merchantCustId while still generating merchantTxnId |\n\n---","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"42640412","team":6825377,"collectionId":"5a010caa-b72e-434d-805b-aa5825fb1b9e","publishedId":"2sAYkBu2dA","public":true,"publicUrl":"https://postman.onerway.com","privateUrl":"https://go.postman.co/documentation/42640412-5a010caa-b72e-434d-805b-aa5825fb1b9e","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":"Onerway API documentation"}],"appearance":{"default":"system_default","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.10.1","publishDate":"2025-03-27T06:50:12.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Onerway API documentation","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"Sandbox","id":"09272f2e-0a15-4600-9dd0-8cc147038d77","owner":"42640412","values":[{"key":"baseUrl","value":"https://sandbox-acq.onerway.com","enabled":true,"type":"default"},{"key":"MERCHANT-NO","value":"Merchant ID assigned during onboarding","enabled":true,"type":"default"},{"key":"APPID","value":"Application identifier for merchant integration","enabled":true,"type":"default"},{"key":"SECRET","value":"Signature key for API authentication","enabled":true,"type":"default"},{"key":"RETURN-URL","value":"Redirect URL after payment completion","enabled":true,"type":"default"},{"key":"WEBHOOK-ENDPOINT","value":"Webhook URL for payment notifications","enabled":true,"type":"default"}],"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://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/5ca5a6746c21f8ca674ca93d1f4b635664e05400c9a8ea8d6454ac1ee3bd8db0","favicon":"https://onerway.com/favicon.ico"},"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":"Sandbox","value":"42640412-09272f2e-0a15-4600-9dd0-8cc147038d77"}],"canonicalUrl":"https://postman.onerway.com/view/metadata/2sAYkBu2dA"}