{"info":{"_postman_id":"024923c1-41a1-4264-a28c-cdc7ad727769","name":"Scion BaaS API (v2.1)","description":"<html><head></head><body><h2 id=\"welcome-to-the-scion-api\">Welcome to the Scion API</h2>\n<p>The <strong>Scion BaaS API (SFAPI)</strong> is fully RESTful API set. Our API uses standard HTTP response codes, authentication, and verbs, and delivers JSON responses for all calls.</p>\n<p><em>Scion is the fintech extension of Medici Bank, an API designed to build on the bank’s core strengths while enabling new digital innovation. In this documentation, references to</em> <em><strong>MB</strong></em> <em>are shorthand for Medici Bank.</em></p>\n<p>The <strong>SFAPI</strong> allows clients to:</p>\n<ul>\n<li><p>Create &amp; Manage Customers</p>\n</li>\n<li><p>Create &amp; Manage Customer Accounts and Balances</p>\n</li>\n<li><p>View Customer Account Transactions</p>\n</li>\n<li><p>Instantaneously Transfer Between Client-owned Accounts</p>\n</li>\n<li><p>Get Realtime Notifications on all Customer or Account Activity</p>\n</li>\n</ul>\n<p>Let's get started...</p>\n<hr>\n<h1 id=\"getting-started\">Getting Started</h1>\n<h2 id=\"sign-up-for-a-client-api-account\">Sign Up for a Client API Account</h2>\n<p>In order to use our API, you will need to sign up for a Scion Client API Account. Please contact us for more information.</p>\n<h2 id=\"using-your-api-keys\">Using Your API Keys</h2>\n<p>Once you have your API keys, you can begin testing immediately. All keys are initially created in our Staging <code>STAG</code> environment. After you have finished testing and are satisfied with your integration, you can request keys for our Production <code>PROD</code> environment.</p>\n<h2 id=\"api-endpoints\">API Endpoints</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Environment</th>\n<th>Link</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>STAG</td>\n<td><a href=\"https://staging.api.medicibank.io\">https://staging.api.scionfi.io</a></td>\n</tr>\n<tr>\n<td>PROD</td>\n<td><a href=\"https://api.medicibank.io\">https://api.scionfi.io</a></td>\n</tr>\n</tbody>\n</table>\n</div><p>Next, we will take a look at how to authenticate your API calls...</p>\n<h3 id=\"requesting-sandbox-access\">Requesting Sandbox Access</h3>\n<p>Access to our sandbox is for potential partners and clients. If you would like to have access to our API, please contact our Operations department <a href=\"https://mailto:operations@medicibank.us\"><b>operations@scionfi.com</b></a></p>\n<hr>\n<h1 id=\"authentication\">Authentication</h1>\n<p>The <strong>MBAPI</strong> uses three main forms of credential verification for secure authentication.</p>\n<ol>\n<li><p>API Keys</p>\n</li>\n<li><p>HMAC Signatures</p>\n</li>\n</ol>\n<h2 id=\"api-keys\">API Keys</h2>\n<p>When you sign up for an account, you will be granted your own unique set of API credentials. The two main credentials you will need is the <strong>API Key</strong> <code>MBAPI-KEY</code> and the <strong>API Secret</strong> <code>MBAPI-SECRET</code>.</p>\n<p>Your <strong>API Key</strong> (<code>MBAPI-KEY</code>) is public and should be passed along within your API call headers. Your <strong>API Secret</strong> (<code>MBAPI-SECRET</code>) is private and should not be passed along (or exposed) in any public setting. Failure to do so can allow for a hacker to create API requests on your behalf. Your account will be suspended if a breach or unexpected activity is detected on your account.</p>\n<h2 id=\"hmac-signature\">HMAC Signature</h2>\n<p>In order to secure each request, we enforce that each call be sent as a <strong>Hash-based Message Authentication Code</strong> or <strong>HMAC Signature</strong>. For more on how to construct the HMAC signature, go to <strong>Making Requests</strong> section.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Authorization: Bearer MBAPI-AUTHTOKEN\n\n</code></pre><p>Next, we will look at the API Methods we allow...</p>\n<hr>\n<h1 id=\"http-verbs\">HTTP Verbs</h1>\n<p>All requests are regulated to the following <strong>API Methods</strong>. Any method used outside of these will be rejected by the API with a <code>403 Forbidden</code> status code.</p>\n<table><tbody><tr><td><div><b>Method</b></div><div><div><div><div></div></div></div><div></div></div></td><td><div><b>Usage</b></div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>GET</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Requests that retrieve information concerning a data representation.</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>POST</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Requests that create a new data representation. Information can be passed back based on the type of request.</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>PUT</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Requests that update partial information of a current data representation.</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>DELETE</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Requests that remove (or archive) a data representation.</div><div><div><div><div></div></div></div><div></div></div></td></tr></tbody></table>\n\n<p>Next, we will take a look at all the statuses the API will respond with, including successful and unsuccessful (error) responses...</p>\n<hr>\n<h1 id=\"http-responses\">HTTP Responses</h1>\n<p>Below is a full list of possible status codes. In the case of an error code, we will respond with additional information if more details about an error is provided.</p>\n<h2 id=\"2xx---successful\">2xx - Successful</h2>\n<p>These are codes that mean that your API request was correct and without errors. Some calls are <strong>Idempotent</strong>. For more information on what means, visit the</p>\n<p><a href=\"/introduction/standardDataStructures\">Standard Data Structures</a></p>\n<p>section.</p>\n<table><tbody><tr><td><div>Code</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Reason</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Description</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>2xx</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Successful</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Your request was right!\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>200</div><div><div><div><div></div></div></div><div></div></div></td><td><div>OK</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The call was successful\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>201</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Created</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The resource was created\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>202</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Accepted</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The resource was updated successfully\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>204</div><div><div><div><div></div></div></div><div></div></div></td><td><div>No Content</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The resource was deleted successfully\"</div><div><div><div><div></div></div></div><div></div></div></td></tr></tbody></table>\n\n<h2 id=\"4xx---client-side-errors\">4xx - Client-Side Errors</h2>\n<table><tbody><tr><td><div>Code</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Reason</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Description</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>4xx</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Client Error</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Your request is wrong!\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>400</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Bad Request</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Your syntax is incorrect\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>401</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Unauthorized</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"You have wrong API credentials\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>403</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Forbidden</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Your credentials don't have the permissions to allow this request\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>404</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Not Found</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The resources/endpoint is invalid\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>405</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Method Not Allowed</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Content-type method is not allowed\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>429</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Too Many Requests</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Rate limit reached for this request\"</div><div><div><div><div></div></div></div><div></div></div></td></tr></tbody></table>\n\n<h2 id=\"5xx---server-side-errors\">5xx - Server-Side Errors</h2>\n<table><tbody><tr><td><div>Code</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Reason</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Description</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>5xx</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Server Error</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"We are wrong!\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>500</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Internal Server Error</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Server error on our side\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>502</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Bad Gateway</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"Invalid response from the server\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>503</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Service Unavailable</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"An internal service is unavailable\"</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>504</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Gateway Time-out</div><div><div><div><div></div></div></div><div></div></div></td><td><div>\"The request took too long to process on the server\"</div><div><div><div><div></div></div></div><div></div></div></td></tr></tbody></table>\n\n<hr>\n<h1 id=\"making-requests\">Making Requests</h1>\n<p>To secure all requests, we require all requests to include a specific set of HEADERS.</p>\n<h2 id=\"headers\">HEADERS</h2>\n<table><tbody><tr><td><div>MBAPI-KEY</div><div><div><div><div></div></div></div><div></div></div></td><td><div>Your unique PUBLIC API key</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>MBAPI-TIMESTAMP</div><div><div><div><div></div></div></div><div></div></div></td><td><div>The user generated timestamp for the request. Must be number of seconds since Unix Epoch</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>MBAPI-SIGNATURE</div><div><div><div><div></div></div></div><div></div></div></td><td><div>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. See below for an example of how to construct the HMAC signed request</div><div><div><div><div></div></div></div><div></div></div></td></tr><tr><td><div>MBAPI-NONCE</div><div><div><div><div></div></div></div><div></div></div></td><td><div>A unique string that identifies this request and prevents the replaying of a past request. Please see below on how to construct this nonce</div><div><div><div><div></div></div></div><div></div></div></td></tr></tbody></table>\n\n<p><strong>Please note: For POST requests, you should JSON.stringify the body to avoid a mismatch in formatting for the signed request.</strong></p>\n<h2 id=\"hmac\">HMAC</h2>\n<blockquote>\n<p>In cryptography, an HMAC (sometimes expanded as either keyed-hash message authentication code or hash-based message authentication code) is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key. </p>\n</blockquote>\n<p>In regular terms, HMAC is the process of using a key, in this case, your <strong>MBAPI-SECRET</strong>, and encrypting a concatenated string version of your entire API request. By encrypting the entire request, we can not only hide the contents of that request, but we can also ensure that all information can only be decrypted by those who have key permissions to do so.</p>\n<p>Signing your API request is straightforward.<br>Below is an example of how to do so:<br>Node.js Example</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">var hash = crypto.createHmac(‘sha512’, {Your MBAPI SECRET}); // your MBAPI-SECRET e.g. “dONgcyGwBVupn/U2y8AdONGWkjfGomJqiKXk2BYaK4sd”\nhash.update(\"Your MBAPI Key\"); // your MBAPI-KEY e.g. \"1234567-ABCD-234RT-98yuT-8YHTjkUtf8klJF9m\"\nhash.update(\"API Request Method\"); // e.g. GET\nhash.update(\"API Path/URL\"); // encoded API request URL e.g. \"https://api.mb.io/dev/transfers\"\nhash.update(\"Unix Timestamp\"); // e.g. \"1574184580246\"\nhash.update(\"JSON.stringify(API Request Body)\"); // your request body\nvar hmacSignedRequest = hash.digest('base64');\n\n</code></pre>\n<h2 id=\"mbapi-nonce\">MBAPI-NONCE</h2>\n<p>A <strong>Nonce</strong> is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against <em>Replay Attacks</em> and some <em>Man-in-the-Middle Attacks</em>.</p>\n<p>There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The <strong>MBAPI-NONCE</strong> should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a <code>base64_encoded</code> hash. <em>Very similar to the process of creating your HMAC signed request</em>.</p>\n<p>Below is an example of how to do so:<br>Node.js Example</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">var hash = crypto.createHash(‘sha512’);\nhash.update(\"Your MBAPI-KEY\");\nhash.update(\"Your MBAPI-TIMESTAMP\");\nhash.update(\"Your Random 32 Character String\");\nvar MBAPI-NONCE = hash.digest('base64');\n\n</code></pre>\n<blockquote>\n<p><strong>HTTPS Only!</strong> </p>\n</blockquote>\n<hr>\n<h1 id=\"standard-data-structures\">Standard Data Structures</h1>\n<p>Below are a list of standards that we enforce for our data structures.</p>\n<h2 id=\"content-type\">Content-Type</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">Content-type: application/json\n\n</code></pre>\n<p>Any content request (even if valid) that is not <code>application/json</code> will return a <code>400 Bad Request</code> HTTP status code with <code>errorMessage: \"Invalid request headers\"</code></p>\n<h2 id=\"timestamps\">Timestamps</h2>\n<p>All timestamps are returned in ISO 8601 format:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>YYYY-MM-DDTHH:MM:SSZ\n\n</code></pre><h2 id=\"idempotent-requests\">Idempotent Requests</h2>\n<p>An <em>Idempotent Request</em> is a request that may change the state of the resource once, but will not continue to change if that identical request is sent again.</p>\n<p>For example, a <code>PUT</code> request will update some (or all) of the information on a resource, based on what is being asked to be changed. But once the resource has been changed, sending in another request, that is identical to the first request, will not result in anything changing. Because no new information was changed.</p>\n<p>This is the same for <code>DELETE</code> requests. Once a resource is deleted, it can not be re-deleted.</p>\n<h2 id=\"standard-response-structure\">Standard Response Structure</h2>\n<h4 id=\"an-array-of-data\">An Array of Data</h4>\n<p>Response 200 (application/json)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"total\":2,\n    \"data\": [\n        {\"field\":\"value1\"},\n        {\"field\":\"value2\"}\n    ],\n    \"url\":\"the URL used in the API call\",\n    \"status\":\"The HTTP Status Code\",\n    \"timestamp\":\"the timestamp of the API call\",\n    \"links\": {\n        \"first\":\"link to the first available paginated resource\",\n        \"next\":\"link to next available paginated resource\",\n        \"prev\":\"link to previously available paginated resource\",\n        \"last\":\"link to the last available paginated resource\"\n        }\n}\n\n</code></pre>\n<h4 id=\"single-data-object\">Single Data Object</h4>\n<p>Response 200 (application/json)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n        \"field\":\"value\" \n    },\n    \"url\":\"the URL used in the API call\",\n    \"status\":\"The HTTP Status Code\",\n    \"timestamp\":\"the timestamp of the API call\"\n}\n\n</code></pre>\n<h4 id=\"example-error-response\">Example Error Response</h4>\n<p>Response 404 (application/json)</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"error\": {\n        \"status\": \"Bad Request\",\n        \"reason\": \"Missing Requirements\",\n        \"description\": \"The following parameters are missing: ['name']\"\n    }\n}\n\n</code></pre>\n<p><em>Please note: the \"links\" and \"total\" fields are not used when errors are returned</em></p>\n<h3 id=\"shortcut-response\">Shortcut Response</h3>\n<p>Some of our responses are \"shortcut\" responses and will only return a short data set. For example, the <code>Get Account Balance</code> route only returns the Balance and the Available Balance</p>\n<h2 id=\"sorting-and-filtering\">Sorting and Filtering</h2>\n<p>Every API result that produces a collection of data can be manually sorted and/or filtered. By default, collections of data are sorted by the <code>createdAt</code> timetsamp <code>DESC</code>. This means the newest record in that data collection is first on the list (and the oldest is last).</p>\n<h4 id=\"sorting\">Sorting</h4>\n<p>You can dictate sorting by passing the <code>sort=</code> parameter in any route and detailing the field (or fields) by which you'd like to sort.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/example?sort=['name':'ASC']\n\n</code></pre><h4 id=\"filtering\">Filtering</h4>\n<h5 id=\"limit\">Limit</h5>\n<p>To manually change number of records returned in a single API call, use the <code>limit=</code> parameter. By default, value of <code>limit</code> is set to <code>50</code>. If you do not provide <code>limit</code> parameter or do not modify its default value then <code>50</code> records are returned.<br>For example, to return <em>60</em> records per page, you would do the following:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/example/?limit=60\n\n</code></pre><p><code>limit</code> parameter works with <code>page</code> parameter. Also refer <strong>PAGE</strong> section for more details.</p>\n<h5 id=\"page\">Page</h5>\n<p>Every API result that produces a collection of data is automatically paginated. The default number of records <em>per page</em> is 50. This <code>page</code> and <code>limit</code> parameters works with each other. Value of <code>limit</code> parameter determines the number of records contained in one page.<br>By default, if no <code>page</code> and <code>limit</code> parameters are specified then <code>page=1</code> and <code>limit=50</code> is considered and so record from 1 to 50 are returned in first page.</p>\n<p>For example, if you want to retrieve 51 to 100 records then specify <code>page=2</code></p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>/example/?page=2 (would return results from 51 to 100, provided records are available)\n\n</code></pre><hr>\n<h1 id=\"prerequisites\">Prerequisites</h1>\n<p>You must have below available with you before making any of MBAPI call.</p>\n<h4 id=\"mb-api-keys\">MB API Keys</h4>\n<ul>\n<li>Valid pair of <code>MBAPI-KEY</code> and <code>MBAPI-SECRET</code> issued to you.</li>\n</ul>\n<p><em>Please contact Scion to get your MBAPI-KEY and MBAPI-SECRET pair</em></p>\n<p>You are now ready to start using our API. We look forward to seeing what great financial applications you will be able to create with us and we appreciate your business.</p>\n<hr>\n<h1 id=\"webhooks\">Webhooks</h1>\n<h4 id=\"webhooks-are-a-way-for-the-api-to-notify-your-application-of-events-in-real-time-when-an-event-occurs-the-api-sends-an-http-post-request-to-your-configured-webhook-url-with-event-details-this-document-outlines-the-supported-webhooks-their-payloads-and-integration-guidelinesendfragment\">Webhooks are a way for the API to notify your application of events in real time. When an event occurs, the API sends an HTTP POST request to your configured webhook URL with event details. This document outlines the supported webhooks, their payloads, and integration guidelines.EndFragment</h4>\n<h2 id=\"integration-guidelines\"><strong>Integration Guidelines</strong></h2>\n<ul>\n<li><p><strong>Webhook Setup:</strong></p>\n<ul>\n<li><p>Register your webhook endpoint but submitting this to us.</p>\n</li>\n<li><p>Use HTTPS endpoints for secure communication.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Request Authentication:</strong></p>\n<ul>\n<li>The API includes an <code>Authorization</code> header with every webhook request. Validate this header to ensure the request’s authenticity.</li>\n</ul>\n</li>\n<li><p><strong>Response Handling:</strong></p>\n<ul>\n<li><p>Respond with a 200 HTTP status code within 10 seconds.</p>\n</li>\n<li><p>Any non-200 response will trigger a retry mechanism.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p><strong>Webhook Secret Rotation:</strong></p>\n<h3 id=\"rotate-secrets-periodically-for-enhanced-security\">Rotate secrets periodically for enhanced security.**</h3>\n<p>Customers**</p>\n<ul>\n<li><p><strong>Customer Created</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a new customer profile is created.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>customer.created</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"customer.created\",\n  \"data\": {\n    \"customer_id\": \"67890\",\n    \"name\": \"John Doe\",\n    \"email\": \"john.doe@example.com\",\n    \"timestamp\": \"2024-12-19T10:00:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Customer Update</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a the customer info is updated.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>customer.updated</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"eventnt\": \"customer.updated\",\n  \"data\": {\n    \"customer_id\": \"67890\",\n    \"name\": \"John Doe\",\n    \"email\": \"john.doe@newdomain.com\",\n    \"timestamp\": \"2024-12-19T11:00:00Z\"\n  }\n}\n\n</code></pre>\n<h3 id=\"businesses\"><strong>Businesses</strong></h3>\n<ul>\n<li><p><strong>Business Created</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a new business is created.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>business.created</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"eventnt\": \"business.created\",\n  \"data\": {\n    \"business_id\": \"67890\",\n    \"name\": \"ACME Business\",\n    \"email\": \"john.doe@newdomain.com\",\n    \"timestamp\": \"2024-12-19T11:00:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Business Updated</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when the business info is updated.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>business.created</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"eventnt\": \"business.updated\",\n  \"data\": {\n    \"business_id\": \"67890\",\n    \"name\": \"ACME Business\",\n    \"email\": \"john.doe@newdomain.com\",\n    \"timestamp\": \"2024-12-19T11:00:00Z\"\n  }\n}\n\n</code></pre>\n<h3 id=\"accounts\"><strong>Accounts</strong></h3>\n<ul>\n<li><p><strong>Account Created</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a new account is created for a customer.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>account.created</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"account.created\",\n  \"data\": {\n    \"account_id\": \"13579\",\n    \"customer_id\": \"67890\",\n    \"type\": \"savings\",\n    \"balance\": 0.00,\n    \"currency\": \"USD\",\n    \"timestamp\": \"2024-12-19T09:00:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Account Updated</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when an account’s details are updated.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>account.updated</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"account.updated\",\n  \"data\": {\n    \"account_id\": \"13579\",\n    \"balance\": 500.00,\n    \"currency\": \"USD\",\n    \"timestamp\": \"2024-12-19T12:30:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Account Closed:</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when an account is closed.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>account.closed</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"account.closed\",\n  \"data\": {\n    \"account_id\": \"13579\",\n    \"customer_id\": \"67890\",\n    \"timestamp\": \"2024-12-19T16:00:00Z\"\n  }\n}\n\n</code></pre>\n<h3 id=\"transactions\"><strong>Transactions</strong></h3>\n<ul>\n<li><p><strong>Transaction Created</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a new transaction is initiated.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>transaction.created</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"transaction.created\",\n  \"data\": {\n    \"transaction_id\": \"24680\",\n    \"amount\": 250.00,\n    \"currency\": \"USD\",\n    \"status\": \"pending\",\n    \"timestamp\": \"2024-12-19T14:30:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Transaction Settled</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a transaction is settled.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>transaction.settled</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"transaction.settled\",\n  \"data\": {\n    \"transaction_id\": \"24680\",\n    \"amount\": 250.00,\n    \"currency\": \"USD\",\n    \"status\": \"settled\",\n    \"timestamp\": \"2024-12-19T15:30:00Z\"\n  }\n}\n\n</code></pre>\n<ul>\n<li><p><strong>Reversed</strong></p>\n<ul>\n<li><p><strong>Description:</strong> Triggered when a transaction is reversed.</p>\n</li>\n<li><p><strong>Event Code:</strong> <code>transaction.reversed</code></p>\n</li>\n<li><p><strong>Payload Example:</strong></p>\n</li>\n</ul>\n</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"event\": \"transaction.reversed\",\n  \"data\": {\n    \"transaction_id\": \"24680\",\n    \"amount\": 250.00,\n    \"currency\": \"USD\",\n    \"status\": \"reversed\",\n    \"timestamp\": \"2024-12-19T16:30:00Z\"\n  }\n}\n\n</code></pre>\n<h1 id=\"nomenclature\">Nomenclature</h1>\n<p>To ensure clarity, our naming convention and meanings are as follows:</p>\n<ul>\n<li><p><strong>Clients</strong> are business entities that have contracted with Scion for its Banking as a Service offering.</p>\n</li>\n<li><p><strong>Programs</strong> are distinct offerings offered by Clients to their own prospects and customers. For example, a wallet program or a prepaid card program or a credit card program. Clients and Programs are established outside the API. Programs are operated via the API.</p>\n</li>\n<li><p><strong>Customers</strong> represents individuals who have User Profiles with a Client’s Program. These Customers can be Applicants, Owners of Accounts, Owners of Entities, Users of Accounts, or some combination thereof (for example, a business owner would be a Customer but not necessarily a User of the Account whereas an employee might be a Customer that is authorized as a User of the Account but is not necessarily an Owner of the entity.</p>\n</li>\n<li><p><strong>Accounts</strong> are bank accounts that are always attached to a Customer.</p>\n</li>\n<li><p><strong>Entities</strong> are organizations, such as a business, that are always attached to one or more Customers and, upon Bank approval, can have one or more Accounts. Customers do not have Entity accounts; Customers may have Entities and Entities may have Accounts.</p>\n</li>\n<li><p><strong>Send Money</strong> effects external transfers, including Customer or Business payments (eg via wire or ACH) to their own account elsewhere, and payments to others, either at other banks or other Programs.</p>\n</li>\n<li><p><strong>Transfers</strong> are book-entry, or ledger, transfers either between a Customer’s own Accounts or between the Accounts of separate Customers within the same Program and do not use the Wire or ACH payment networks. Note that while money transfers across Programs sponsored by Scion might be executed as book transfers by the Bank, they are invoked via the Send Money calls.</p>\n</li>\n<li><p><strong>Transactions</strong> are any type of debit or credit that has already occurred and ledgered on the system.</p>\n</li>\n</ul>\n<h1 id=\"api-reference\">API Reference</h1>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Getting Started","slug":"getting-started"},{"content":"Authentication","slug":"authentication"},{"content":"HTTP Verbs","slug":"http-verbs"},{"content":"HTTP Responses","slug":"http-responses"},{"content":"Making Requests","slug":"making-requests"},{"content":"Standard Data Structures","slug":"standard-data-structures"},{"content":"Prerequisites","slug":"prerequisites"},{"content":"Webhooks","slug":"webhooks"},{"content":"Nomenclature","slug":"nomenclature"},{"content":"API Reference","slug":"api-reference"}],"owner":"706490","collectionId":"024923c1-41a1-4264-a28c-cdc7ad727769","publishedId":"UVXgMxfD","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2026-06-02T21:30:57.000Z"},"item":[{"name":"Introduction","item":[{"name":"ping","id":"d1b6d4c6-c8cb-414c-ae7b-4873d252b3ec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"{{baseURL}}/ping","description":"<h4 id=\"ping-endpoint\"><strong>Ping Endpoint</strong></h4>\n<p>The Ping endpoint is used to verify that the system is accessible and operational. Think of this as a quick \"heartbeat\" check to confirm your connection to the API.</p>\n","urlObject":{"path":["ping"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"0b516d27-a380-41cc-8c3e-b70aa4274dcc","name":"ping","originalRequest":{"method":"GET","header":[],"url":"{{baseURL}}/ping"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"message\": \"Pong\"\n    },\n    \"url\": \"/ping\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-01T19:40:21Z\"\n}"}],"_postman_id":"d1b6d4c6-c8cb-414c-ae7b-4873d252b3ec"},{"name":"info","event":[{"listen":"prerequest","script":{"id":"7a4c85db-44ba-42ce-9430-7507a7da1a87","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract the path and query string from the URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPathWithQuery(); // Includes the query string\r","\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body ? JSON.stringify(pm.request.body.raw || '') : '';\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r",""],"type":"text/javascript","packages":{}}}],"id":"6e239836-9768-4196-a251-92c8e3a3b539","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"}],"url":"{{baseURL}}/info","description":"<h4 id=\"info-endpoint\"><strong>Info Endpoint</strong></h4>\n<p>The Info endpoint is designed for testing your API keys and validating your HMAC signature creation process. This call allows clients to confirm their authentication setup is correct and their keys are properly configured.</p>\n<hr />\n<h4 id=\"next-steps\"><strong>Next Steps</strong></h4>\n<p>After confirming system accessibility with the Ping endpoint and validating your API keys with the Info endpoint, you’re ready to explore the full range of API functionality. Use the provided documentation to integrate additional features, such as managing customers, uploading documents, and more.</p>\n","urlObject":{"path":["info"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"0a7afa8d-3b93-4204-a7a7-fce560a9b924","name":"info","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"}],"url":"{{baseURL}}/info"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"name\": \"Medici Bank\",\r\n        \"client_id\": \"CLIDXXXXXXXXXXXXXXX\",\r\n        \"createdAt\": \"2024-12-31 00:10:27\"\r\n    },\r\n    \"url\": \"/info\",\r\n    \"status\": 200,\r\n    \"timestamp\": \"2025-01-03T05:08:10Z\"\r\n}"}],"_postman_id":"6e239836-9768-4196-a251-92c8e3a3b539"}],"id":"8593a8e3-ca47-4601-b3d5-0bdbed26e14c","description":"<h3 id=\"introduction-to-the-api\">Introduction to the API</h3>\n<p>Welcome to the API documentation! This guide will help you get started with using our API to integrate seamlessly with your systems. Our platform is designed to be robust, secure, and easy to use, offering tools to validate connectivity and test your integration.</p>\n<hr />\n","_postman_id":"8593a8e3-ca47-4601-b3d5-0bdbed26e14c"},{"name":"Customers","item":[{"name":"Create Customer","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"ee584bfa-e6eb-4e71-b344-3ad635311189","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"firstName\": \"Anna2\",\r\n    \"lastName\": \"Smith\",\r\n    \"email\": \"annera.smith@example.com\",\r\n    \"mobile\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n    \"DOB\": \"1998-03-28\",\r\n    \"residential_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"600-10-1111\",\r\n    \"taxPayer_id_type\": \"TFN\",\r\n    \"primaryCitizenship\": \"AUS\",\r\n    \"isPEP\": false,\r\n    \"isUS\": false,\r\n    \"isSeniorPolFig\": false,\r\n    \"isFamilySeniorPolFig\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/customers","description":"<h2 id=\"create-customer\"><strong>Create Customer</strong></h2>\n<p>The Create Customer API allows clients to register a new customer in the system. A customer must be associated with a specific client, and the provided information must meet all validation requirements.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>POST</strong> <code>/customers</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API creates a new customer profile with all relevant details, including personal information, contact details, residential and mailing addresses, and compliance-related fields.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>firstName</strong> (in body) – The first name of the customer.</p>\n</li>\n<li><p><strong>lastName</strong> (in body) – The last name of the customer.</p>\n</li>\n<li><p><strong>email</strong> (in body) – The email address of the customer.</p>\n</li>\n<li><p><strong>mobile</strong> (in body) – An object containing:</p>\n<ul>\n<li><p><strong>number</strong> – The mobile phone number.</p>\n</li>\n<li><p><strong>countryCode</strong> – The country code of the mobile number.</p>\n</li>\n<li><p><strong>country</strong> – The country associated with the phone number.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>DOB</strong> (in body) – The date of birth of the customer (YYYY-MM-DD format).</p>\n</li>\n<li><p><strong>residential_address</strong> (in body) – An object containing:</p>\n<ul>\n<li><p><strong>addressLine1</strong> – The primary address line.</p>\n</li>\n<li><p><strong>cityLocale</strong> – The city or locale.</p>\n</li>\n<li><p><strong>stateRegion</strong> – The state or region.</p>\n</li>\n<li><p><strong>postalCode</strong> – The postal code.</p>\n</li>\n<li><p><strong>country</strong> – The country of residence.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>mailing_address</strong> (in body) – Same structure as residential_address.</p>\n</li>\n<li><p><strong>taxPayer_id</strong> (in body) – The customer's taxpayer identification number.</p>\n</li>\n<li><p><strong>taxPayer_id_type</strong> (in body) – The type of taxpayer ID.</p>\n</li>\n<li><p><strong>primaryCitizenship</strong> (in body) – The country of primary citizenship.</p>\n</li>\n<li><p><strong>isPEP</strong> (in body) – Boolean flag indicating if the customer is a Politically Exposed Person (PEP).</p>\n</li>\n<li><p><strong>isUS</strong> (in body) – Boolean flag indicating if the customer is a U.S. citizen.</p>\n</li>\n<li><p><strong>isSeniorPolFig</strong> (in body) – Boolean flag indicating if the customer is a senior political figure.</p>\n</li>\n<li><p><strong>isFamilySeniorPolFig</strong> (in body) – Boolean flag indicating if the customer has a family member who is a senior political figure.</p>\n</li>\n</ul>\n<h4 id=\"optional-parameters\"><strong>Optional Parameters</strong></h4>\n<ul>\n<li><p><strong>middleName</strong> – Middle name of the customer.</p>\n</li>\n<li><p><strong>maidenName</strong> – Maiden name (if applicable).</p>\n</li>\n<li><p><strong>suffix</strong> – Name suffix (e.g., Jr., Sr.).</p>\n</li>\n<li><p><strong>nickname</strong> – Nickname or preferred name.</p>\n</li>\n<li><p><strong>homePhone</strong> – Home phone number.</p>\n</li>\n<li><p><strong>workPhone</strong> – Work phone number.</p>\n</li>\n<li><p><strong>birthplace</strong> – City or country where the customer was born.</p>\n</li>\n<li><p><strong>nationality</strong> – Additional nationality details.</p>\n</li>\n<li><p><strong>occupation</strong> – Customer's occupation.</p>\n</li>\n<li><p><strong>secondaryCitizenship</strong> – Secondary citizenship if applicable.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>All required fields must be present.</p>\n</li>\n<li><p>Email must be a valid email format.</p>\n</li>\n<li><p>Mobile number must follow proper formatting.</p>\n</li>\n<li><p>DOB must be in YYYY-MM-DD format.</p>\n</li>\n<li><p>The taxPayer_id must match the format based on taxPayer_id_type.</p>\n</li>\n<li><p>Citizenship-related flags must be boolean (<code>true</code> or <code>false</code>).</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If any required fields are missing, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the email format is invalid, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the taxPayer_id does not match its expected format, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the customer already exists in the system, a <strong>409 Conflict</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"taxpayer-id-types-documentation\">Taxpayer ID Types Documentation</h3>\n<p>When creating or managing customers, a taxpayer ID is required to ensure compliance with regulatory and taxation requirements. Below is a detailed explanation of the supported taxpayer ID types:</p>\n<h4 id=\"supported-taxpayer-id-types\"><strong>Supported Taxpayer ID Types</strong></h4>\n<ul>\n<li><p><strong>SSN</strong> (Social Security Number)<br />  A unique nine-digit number assigned to individuals by the United States Social Security Administration. The format is <code>XXX-XX-XXXX</code> and is used primarily for tax and identification purposes within the U.S.</p>\n</li>\n<li><p><strong>EIN</strong> (Employer Identification Number)<br />  A unique nine-digit number assigned by the IRS to businesses operating in the United States. The format is <code>XX-XXXXXXX</code> and is used for tax filings and employer-related activities.</p>\n</li>\n<li><p><strong>ETIN</strong> (Electronic Taxpayer Identification Number)<br />  A unique identifier issued for specific electronic tax filing purposes. It is typically assigned by the IRS or equivalent authorities. There is no standardized format, as it can vary depending on its use.</p>\n</li>\n<li><p><strong>TIN</strong> (Taxpayer Identification Number)<br />  A generic term that encompasses various taxpayer ID types (e.g., SSN, EIN, ITIN) issued for tax-related identification.</p>\n</li>\n<li><p><strong>ITIN</strong> (Individual Taxpayer Identification Number)<br />  A nine-digit number issued by the IRS to individuals who are not eligible for an SSN but need to file U.S. taxes. The format is <code>9XX-XX-XXXX</code>.</p>\n</li>\n<li><p><strong>NINO</strong> (National Insurance Number)<br />  A nine-character alphanumeric identifier issued by the United Kingdom for tax and social security purposes. The format is <code>XX999999X</code>.</p>\n</li>\n<li><p><strong>GSTIN</strong> (Goods and Services Taxpayer Identification Number)<br />  A 15-character alphanumeric identifier assigned to businesses in India under the GST regime.</p>\n</li>\n<li><p><strong>ABN</strong> (Australian Business Number)<br />  An 11-digit identifier assigned to businesses operating in Australia. It is used for tax and other business-related purposes.</p>\n</li>\n<li><p><strong>PAN</strong> (Permanent Account Number)<br />  A ten-character alphanumeric identifier issued by the Indian Income Tax Department. The format is <code>XXXXX9999X</code>.</p>\n</li>\n<li><p><strong>NIF</strong> (Número de Identificación Fiscal)<br />  A tax identification number used in Spain. The format is nine characters, typically starting with a letter and ending with a letter or number (e.g., <code>X9999999T</code>).</p>\n</li>\n<li><p><strong>CPF</strong> (Cadastro de Pessoas Físicas)<br />  An 11-digit tax identification number issued to individuals in Brazil. The format is <code>XXX.XXX.XXX-XX</code>.</p>\n</li>\n<li><p><strong>CNPJ</strong> (Cadastro Nacional da Pessoa Jurídica)<br />  A 14-digit identifier for businesses in Brazil. The format is <code>XX.XXX.XXX/0001-XX</code>.</p>\n</li>\n<li><p><strong>OTHER</strong><br />  Used for taxpayer ID types not explicitly listed above. Additional context should be provided to ensure proper identification and processing.</p>\n</li>\n</ul>\n<h4 id=\"key-points\"><strong>Key Points</strong></h4>\n<ol>\n<li><p>The <strong>taxPayer_id_type</strong> must match one of the supported types listed above.</p>\n</li>\n<li><p>The <strong>taxPayer_id</strong> must conform to the specific format for the chosen type.</p>\n</li>\n<li><p>Use the <strong>OTHER</strong> type only when the taxpayer ID does not fall into any predefined categories.</p>\n</li>\n</ol>\n","urlObject":{"path":["customers"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"c6451406-fdff-4380-9d55-b643b9fe159f","name":"Create Customer - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"firstName\": \"Anna\",\r\n    \"lastName\": \"Smith\",\r\n    \"email\": \"anna.smith@example.com\",\r\n    \"mobile\": {\r\n        \"number\": \"9988771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n    \"DOB\": \"1998-03-28\",\r\n    \"residential_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"600-10-1111\",\r\n    \"taxPayer_id_type\": \"TFN\",\r\n    \"primaryCitizenship\": \"AUS\",\r\n    \"isPEP\": false,\r\n    \"isUS\": false,\r\n    \"isSeniorPolFig\": false,\r\n    \"isFamilySeniorPolFig\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/customers"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"id\": 4,\r\n        \"cid\": \"CID250103052624-YXXDNB-6NJCG6\",\r\n        \"status\": \"PND\",\r\n        \"firstName\": \"Anna\",\r\n        \"middleName\": null,\r\n        \"lastName\": \"Smith\",\r\n        \"maidenName\": null,\r\n        \"suffix\": null,\r\n        \"nickname\": null,\r\n        \"email\": \"anna.smith@example.com\",\r\n        \"DOB\": \"1998-03-28T00:00:00.000Z\",\r\n        \"birthplace\": null,\r\n        \"nationality\": null,\r\n        \"occupation\": null,\r\n        \"taxPayer_id\": \"600-10-1111\",\r\n        \"taxPayer_id_type\": \"TFN\",\r\n        \"primaryCitizenship\": \"AUS\",\r\n        \"secondaryCitizenship\": null,\r\n        \"isPEP\": false,\r\n        \"isUS\": false,\r\n        \"isSeniorPolFig\": false,\r\n        \"isFamilySeniorPolFig\": false,\r\n        \"isDeleted\": false,\r\n        \"createdAt\": \"2025-01-03T00:07:48.000Z\",\r\n        \"updatedAt\": \"2025-01-03T05:26:25.000Z\",\r\n        \"client_id\": \"CLID2412310510476RFCR3\",\r\n        \"mobile\": 15,\r\n        \"homePhone\": null,\r\n        \"workPhone\": null,\r\n        \"residential_address\": 13,\r\n        \"mailing_address\": 14\r\n    },\r\n    \"url\": \"/customers\",\r\n    \"status\": 201,\r\n    \"timestamp\": \"2025-01-03T05:26:25Z\"\r\n}"},{"id":"77c025dc-859b-43e4-9bdd-49b6967b2d8f","name":"Create Customer - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"firstName\" : \"Steve\",\r\n    \"middleName\" : null,\r\n    \"lastName\" : \"Williams\",\r\n    \"maidenName\" : null,\r\n    \"suffix\" : null,\r\n    \"nickname\" : \"\",\r\n    \"email\" : \"steve@medici.bank\",\r\n    \"mobile\" : \"18001231245\",\r\n    \"homePhone\" : null,\r\n    \"workPhone\" : null,\r\n    \"DOB\" : \"2000-10-25\",\r\n    \"birthplace\" : null,\r\n    \"nationality\" : null,\r\n    \"residential_address\": {\r\n        \"id\" : 1,\r\n        \"addressLine1\" : \"100 Mockingbird Lane\",\r\n        \"addressLine2\" : \"Apt. 43\",\r\n        \"cityLocale\" : \"New York City\",\r\n        \"stateRegion\" : \"AK\",\r\n        \"postalCode\" : \"11001\",\r\n        \"country\" : \"USA\",\r\n        \"createdAt\" : \"2019-11-08 12:18:05\",\r\n        \"updatedAt\" : \"2019-11-08 12:18:05\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"id\" : 10,\r\n        \"addressLine1\" : \"100 Mockingbird Lane\",\r\n        \"addressLine2\" : \"Apt. 43\",\r\n        \"cityLocale\" : \"New York City\",\r\n        \"stateRegion\" : \"AK\",\r\n        \"postalCode\" : \"11001\",\r\n        \"country\" : \"USA\",\r\n        \"createdAt\" : \"2019-11-08 12:18:05\",\r\n        \"updatedAt\" : \"2019-11-08 12:18:05\"\r\n    },\r\n    \"occupation\" : null,\r\n    \"taxPayer_id\" : \"100-20-1111\",\r\n    \"taxPayer_id_type\" : \"SSN\",\r\n    \"secondaryCitizenship\" : null,\r\n    \"internetGambling\" : false,\r\n    \"isPEP\" : false,\r\n    \"isUS\" : true,\r\n    \"isSeniorPolFig\" : false,\r\n    \"isFamilySeniorPolFig\" : false\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/customers"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": false,\r\n    \"error\": {\r\n        \"status\": \"Bad Request\",\r\n        \"reason\": \"Missing Required\",\r\n        \"description\": \"You are missing the following parameters: ['lastName']\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:56\"\r\n}"}],"_postman_id":"ee584bfa-e6eb-4e71-b344-3ad635311189"},{"name":"List Customers","event":[{"listen":"prerequest","script":{"id":"a80df12e-6476-4a28-b052-a77cea51af6d","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract the path and query string from the URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPathWithQuery(); // Includes the query string","","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH'].includes(method)) {","    body = pm.request.body ? JSON.stringify(pm.request.body.raw || '') : '';","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });",""],"type":"text/javascript","packages":{}}}],"id":"3ae194f6-4e58-491b-a7f0-61d224381ac7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"application/json","description":"<p>Indicates the media type of the resource. Valid values are: <code>application/json</code></p>\n","type":"text"}],"url":"{{baseURL}}/customers?sort=firstName:ASC","description":"<h2 id=\"list-customers\"><strong>List Customers</strong></h2>\n<p>The List Customers API allows clients to retrieve a paginated list of all customers associated with their client account.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>GET</strong> <code>/customers</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API retrieves all customers for the authenticated client. The response is paginated, and clients can filter results, set limits, and specify sorting preferences.</p>\n<h4 id=\"query-parameters\"><strong>Query Parameters</strong></h4>\n<ul>\n<li><p><strong>sort</strong> (optional) – Defines sorting field and direction.</p>\n<ul>\n<li>Example: <code>sort=firstName:ASC</code></li>\n</ul>\n</li>\n<li><p><strong>limit</strong> (optional) – Number of records to return per page. Default is <strong>50</strong>.</p>\n</li>\n<li><p><strong>page</strong> (optional) – Page number for pagination. Default is <strong>1</strong>.</p>\n</li>\n<li><p><strong>filter</strong> (optional) – Allows filtering by specific fields.</p>\n</li>\n</ul>\n<h4 id=\"response-fields\"><strong>Response Fields</strong></h4>\n<ul>\n<li><p><strong>total</strong> – Total number of customers found.</p>\n</li>\n<li><p><strong>data</strong> – Array of customer records.</p>\n</li>\n<li><p><strong>url</strong> – The request URL.</p>\n</li>\n<li><p><strong>next</strong> – The URL for the next page if available.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <strong>sort</strong> parameter must specify a valid field and direction (ASC/DESC).</p>\n</li>\n<li><p>The <strong>limit</strong> parameter must be a positive integer.</p>\n</li>\n<li><p>The <strong>page</strong> parameter must be a positive integer.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the sorting field or direction is invalid, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers"],"host":["{{baseURL}}"],"query":[{"key":"sort","value":"firstName:ASC"}],"variable":[]}},"response":[{"id":"48dc8ce0-0e53-4ec1-b375-f663846fcdf5","name":"List Customers - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"url":{"raw":"{{baseURL}}/customers?fields=[customer_id,business_id,consumer_id,status,firstName,lastName,email,isEmailVerified,mobile,isMobileVerified,DOB,taxPayer_id,hasCompanyControl,isSeniorPolFig,isFamilySeniorPolFig,isMarried,isVerified]&limit=25&order=[firstName:DESC,lastName:ASC]&page=1","host":["{{baseURL}}"],"path":["customers"],"query":[{"key":"fields","value":"[customer_id,business_id,consumer_id,status,firstName,lastName,email,isEmailVerified,mobile,isMobileVerified,DOB,taxPayer_id,hasCompanyControl,isSeniorPolFig,isFamilySeniorPolFig,isMarried,isVerified]","description":"Use this to filter the fields to return in the response. For example `fields=[firstName,lastName]` will return only the `firstName` and `lastName` in the response. Ensure to order `Query Parameters` in alphabetical order e.g. `?fields=[firstName,lastName]&limit=50&order=[firstName:ASC]&page=1`"},{"key":"limit","value":"25","description":"Return a certain number of records. For example `?limit=10` will only return **10 Records**"},{"key":"order","value":"[firstName:DESC,lastName:ASC]","description":"Use this parameter to return records in a specific order. This parameter takes an array where each comma-delimited string is seperated by a colon. The first part of the string in the following format `field`:`order` For example: `?order=[firstName:DESC,lastName:ASC]`"},{"key":"page","value":"1","description":"Use this parameter to retrieve records from specific page. By default, it returns 50 records per page and considers page=1. For example, page=2 returns 51 to 100 records assuming default items per page is 50."}]}},"code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"total\": 1,\r\n    \"data\": [\r\n        {\r\n            \"customer_id\" : \"CID6987833272193515520\",\r\n            \"business_id\" : \"BID6908133968411885568\",\r\n            \"consumer_id\": \"\",\r\n            \"privilege\" : \"EXE\",\r\n            \"role\" : \"CLVL\",\r\n            \"status\" : \"LVE\",\r\n            \"firstName\" : \"Steve\",\r\n            \"middleName\" : \"\",\r\n            \"lastName\" : \"Williams\",\r\n            \"maidenName\" : \"\",\r\n            \"suffix\" : \"\",\r\n            \"nickname\" : \"\",\r\n            \"email\" : \"steve@medici.bank\",\r\n            \"isEmailVerified\" : 1,\r\n            \"mobile\" : \"18001231245\",\r\n            \"isMobileVerified\" : 1,\r\n            \"homePhone\" : null,\r\n            \"workPhone\" : null,\r\n            \"DOB\" : \"2000-10-25\",\r\n            \"birthplace\" : \"\",\r\n            \"nationality\" : \"\",\r\n            \"residential_address\": {\r\n                \"id\" : 1,\r\n                \"addressLine1\" : \"100 Mockingbird Lane\",\r\n                \"addressLine2\" : \"Apt. 43\",\r\n                \"cityLocale\" : \"New York City\",\r\n                \"stateRegion\" : \"AK\",\r\n                \"postalCode\" : \"11001\",\r\n                \"country\" : \"USA\",\r\n                \"createdAt\" : \"2019-11-08 12:18:05\",\r\n                \"updatedAt\" : \"2019-11-08 12:18:05\"\r\n            },\r\n            \"mailing_address\": {\r\n                \"id\" : 10,\r\n                \"addressLine1\" : \"100 Mockingbird Lane\",\r\n                \"addressLine2\" : \"Apt. 43\",\r\n                \"cityLocale\" : \"New York City\",\r\n                \"stateRegion\" : \"AK\",\r\n                \"postalCode\" : \"11001\",\r\n                \"country\" : \"USA\",\r\n                \"createdAt\" : \"2019-11-08 12:18:05\",\r\n                \"updatedAt\" : \"2019-11-08 12:18:05\"\r\n            },\r\n            \"occupation\" : \"\",\r\n            \"taxPayer_id\" : \"100-20-1111\",\r\n            \"taxPayer_id_type\" : \"OTHER\",\r\n            \"secondaryCitizenship\" : null,\r\n            \"internetGambling\" : 0,\r\n            \"annualIncome\" : null,\r\n            \"isPEP\" : 0,\r\n            \"isUS\" : 0,\r\n            \"isCitizen\" : 0,\r\n            \"hasCompanyControl\" : 1,\r\n            \"isSeniorPolFig\" : 0,\r\n            \"isFamilySeniorPolFig\" : 0,\r\n            \"isMarried\" : 0,\r\n            \"isVerified\" : 1,\r\n            \"createdAt\" : \"2022-10-17 13:54:39\",\r\n            \"updatedAt\" : \"2022-11-08 15:51:10\"\r\n        }\r\n    ],\r\n    \"url\": \"/customers\",\r\n    \"status\": 200,\r\n    \"timestamp\": \"2022-01-01 13:15:40\"\r\n}"},{"id":"d084ccf9-fa43-40af-b414-306983408dde","name":"List Customers - 200 (No Data)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"url":{"raw":"{{baseURL}}/customers?fields=[customer_id,business_id,consumer_id,status,firstName,lastName,email,isEmailVerified,mobile,isMobileVerified,DOB,taxPayer_id,hasCompanyControl,isSeniorPolFig,isFamilySeniorPolFig,isMarried,isVerified]&limit=25&order=[firstName:DESC,lastName:ASC]&page=1","host":["{{baseURL}}"],"path":["customers"],"query":[{"key":"fields","value":"[customer_id,business_id,consumer_id,status,firstName,lastName,email,isEmailVerified,mobile,isMobileVerified,DOB,taxPayer_id,hasCompanyControl,isSeniorPolFig,isFamilySeniorPolFig,isMarried,isVerified]","description":"Use this to filter the fields to return in the response. For example `fields=[firstName,lastName]` will return only the `firstName` and `lastName` in the response. Ensure to order `Query Parameters` in alphabetical order e.g. `?fields=[firstName,lastName]&limit=50&order=[firstName:ASC]&page=1`"},{"key":"limit","value":"25","description":"Return a certain number of records. For example `?limit=10` will only return **10 Records**"},{"key":"order","value":"[firstName:DESC,lastName:ASC]","description":"Use this parameter to return records in a specific order. This parameter takes an array where each comma-delimited string is seperated by a colon. The first part of the string in the following format `field`:`order` For example: `?order=[firstName:DESC,lastName:ASC]`"},{"key":"page","value":"1","description":"Use this parameter to retrieve records from specific page. By default, it returns 50 records per page and considers page=1. For example, page=2 returns 51 to 100 records assuming default items per page is 50."}]}},"code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": [],\r\n    \"url\": \"/customers\",\r\n    \"status\": 200,\r\n    \"timestamp\": \"2022-01-01 13:15:40\",\r\n    \"total\": 0\r\n}"}],"_postman_id":"3ae194f6-4e58-491b-a7f0-61d224381ac7"},{"name":"Get Customer Details","event":[{"listen":"prerequest","script":{"id":"a80df12e-6476-4a28-b052-a77cea51af6d","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract the path and query string from the URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPathWithQuery(); // Includes the query string","","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH'].includes(method)) {","    body = pm.request.body ? JSON.stringify(pm.request.body.raw || '') : '';","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });",""],"type":"text/javascript","packages":{}}}],"id":"13bc5621-f6a7-4bbe-af94-5e564c2d0392","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"application/json","description":"<p>Indicates the media type of the resource. Valid values are: <code>application/json</code></p>\n","type":"text"}],"url":"{{baseURL}}/customers/CID250103061236-6AT5DW-KSGN24","description":"<h2 id=\"get-customer-details\"><strong>Get Customer Details</strong></h2>\n<p>The Get Customer Details API allows clients to retrieve detailed information about a specific customer, including their profile information and any associated accounts.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>GET</strong> <code>/customers/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API fetches all available details of a specific customer, including their personal details, addresses, and phone numbers. Additionally, it retrieves any accounts associated with the customer.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>customer_id</strong> (in path) – The unique identifier of the customer whose details are being retrieved.</li>\n</ul>\n<h4 id=\"response-fields\"><strong>Response Fields</strong></h4>\n<ul>\n<li><p><strong>customer</strong> – Contains all personal details of the customer.</p>\n</li>\n<li><p><strong>accounts</strong> – A list of accounts associated with the customer.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <code>customer_id</code> parameter is required.</p>\n</li>\n<li><p>The customer must belong to the authenticated client.</p>\n</li>\n<li><p>The customer record must not be deleted.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the <code>customer_id</code> is missing or invalid, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the customer does not exist or is deleted, a <strong>404 Not Found</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers","CID250103061236-6AT5DW-KSGN24"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"65a6b6de-e253-4be3-a8e1-40a045b75fe7","name":"Get Customer Details - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":""}]}},"code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"cid\": \"CID250103052624-YXXDNB-6NJCG6\",\r\n        \"status\": \"PND\",\r\n        \"firstName\": \"Anna\",\r\n        \"middleName\": null,\r\n        \"lastName\": \"Smith\",\r\n        \"maidenName\": null,\r\n        \"suffix\": null,\r\n        \"nickname\": null,\r\n        \"email\": \"anna.smith@example.com\",\r\n        \"DOB\": \"1998-03-28T00:00:00.000Z\",\r\n        \"birthplace\": null,\r\n        \"nationality\": null,\r\n        \"occupation\": null,\r\n        \"taxPayer_id\": \"600-10-1111\",\r\n        \"taxPayer_id_type\": \"TFN\",\r\n        \"primaryCitizenship\": \"AUS\",\r\n        \"secondaryCitizenship\": null,\r\n        \"isPEP\": false,\r\n        \"isUS\": false,\r\n        \"isSeniorPolFig\": false,\r\n        \"isFamilySeniorPolFig\": false,\r\n        \"isDeleted\": false,\r\n        \"createdAt\": \"2025-01-03T00:07:48.000Z\",\r\n        \"updatedAt\": \"2025-01-03T05:26:25.000Z\",\r\n        \"client_id\": \"CLID2412310510476RFCR3\",\r\n        \"mobile\": {\r\n            \"id\": 15,\r\n            \"number\": \"9988771234\",\r\n            \"countryCode\": \"61\",\r\n            \"country\": \"AUS\",\r\n            \"type\": \"M\",\r\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\"\r\n        },\r\n        \"homePhone\": null,\r\n        \"workPhone\": null,\r\n        \"residential_address\": {\r\n            \"id\": 13,\r\n            \"addressLine1\": \"42 Wallaby Way\",\r\n            \"addressLine2\": null,\r\n            \"cityLocale\": \"Sydney\",\r\n            \"stateRegion\": \"NSW\",\r\n            \"postalCode\": \"2000\",\r\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\",\r\n            \"updatedAt\": \"2025-01-03T05:26:24.000Z\",\r\n            \"country\": \"AUS\"\r\n        },\r\n        \"mailing_address\": {\r\n            \"id\": 14,\r\n            \"addressLine1\": \"42 Wallaby Way\",\r\n            \"addressLine2\": null,\r\n            \"cityLocale\": \"Sydney\",\r\n            \"stateRegion\": \"NSW\",\r\n            \"postalCode\": \"2000\",\r\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\",\r\n            \"updatedAt\": \"2025-01-03T05:26:25.000Z\",\r\n            \"country\": \"AUS\"\r\n        }\r\n    },\r\n    \"url\": \"/customers/CID250103052624-YXXDNB-6NJCG6\",\r\n    \"status\": 200,\r\n    \"timestamp\": \"2025-01-03T05:56:42Z\"\r\n}"}],"_postman_id":"13bc5621-f6a7-4bbe-af94-5e564c2d0392"},{"name":"Update Customer","event":[{"listen":"prerequest","script":{"id":"b059f4de-1704-44d8-9082-6174a910c5c8","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"c297f7ba-0382-4d7a-b2f2-0b40bed6ccd8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI_TIMESTAMP}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"application/json","description":"<p>Indicates the media type of the resource. Valid values are: <code>application/json</code></p>\n","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"firstName\": \"Shania\",\r\n    \"residential_address\": {\r\n        \"addressLine2\": \"Suite 54\"\r\n    }\r\n}"},"url":"{{baseURL}}/customers/:customer_id","description":"<h2 id=\"update-customer\"><strong>Update Customer</strong></h2>\n<p>The Update Customer API allows clients to modify an existing customer's details. Only non-ID fields can be updated, ensuring that unique identifiers remain unchanged.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/customers/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to update customer details selectively. Only the fields provided in the request body will be modified, and all changes will be logged.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>customer_id</strong> (in path) – The unique identifier of the customer to be updated.</li>\n</ul>\n<h4 id=\"optional-parameters\"><strong>Optional Parameters</strong></h4>\n<ul>\n<li><p><strong>firstName</strong> – The updated first name of the customer.</p>\n</li>\n<li><p><strong>lastName</strong> – The updated last name of the customer.</p>\n</li>\n<li><p><strong>email</strong> – The updated email address of the customer.</p>\n</li>\n<li><p><strong>mobile</strong> – An object containing updated mobile details:</p>\n<ul>\n<li><p><strong>number</strong> – The new mobile number.</p>\n</li>\n<li><p><strong>countryCode</strong> – The updated country code.</p>\n</li>\n<li><p><strong>country</strong> – The updated country name.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>residential_address</strong> – An object containing updated residential address fields.</p>\n</li>\n<li><p><strong>mailing_address</strong> – An object containing updated mailing address fields.</p>\n</li>\n<li><p><strong>occupation</strong> – The updated occupation of the customer.</p>\n</li>\n<li><p><strong>taxPayer_id</strong> – The updated taxpayer ID.</p>\n</li>\n<li><p><strong>taxPayer_id_type</strong> – The updated taxpayer ID type.</p>\n</li>\n<li><p><strong>primaryCitizenship</strong> – The updated primary citizenship.</p>\n</li>\n<li><p><strong>secondaryCitizenship</strong> – The updated secondary citizenship (if applicable).</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <strong>customer_id</strong> must exist in the system.</p>\n</li>\n<li><p>The <strong>email</strong> must follow a valid email format.</p>\n</li>\n<li><p>The <strong>mobile number</strong> must follow proper formatting.</p>\n</li>\n<li><p>The <strong>taxPayer_id</strong> must adhere to the correct format for its type.</p>\n</li>\n<li><p>The <strong>residential_address</strong> and <strong>mailing_address</strong> fields must include valid address components if provided.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the customer is not found, a <strong>404 Not Found</strong> error is returned.</p>\n</li>\n<li><p>If the email format is invalid, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the taxPayer_id format is incorrect, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers",":customer_id"],"host":["{{baseURL}}"],"query":[],"variable":[{"type":"any","value":"","key":"customer_id"}]}},"response":[{"id":"8a2a2a54-85f9-4583-b151-855ca325a5e3","name":"Update Customer - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"firstName\": \"Shania\",\r\n    \"residential_address\": {\r\n        \"addressLine2\": \"Suite 54\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"cid\": \"CID250103052624-YXXDNB-6NJCG6\",\n        \"status\": \"PND\",\n        \"firstName\": \"Shania\",\n        \"middleName\": null,\n        \"lastName\": \"Smith\",\n        \"maidenName\": null,\n        \"suffix\": null,\n        \"nickname\": null,\n        \"email\": \"anna.smith@example.com\",\n        \"DOB\": \"1998-03-28T00:00:00.000Z\",\n        \"birthplace\": null,\n        \"nationality\": null,\n        \"occupation\": null,\n        \"taxPayer_id\": \"600-10-1111\",\n        \"taxPayer_id_type\": \"TFN\",\n        \"primaryCitizenship\": \"AUS\",\n        \"secondaryCitizenship\": null,\n        \"isPEP\": false,\n        \"isUS\": false,\n        \"isSeniorPolFig\": false,\n        \"isFamilySeniorPolFig\": false,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-03T00:07:48.000Z\",\n        \"updatedAt\": \"2025-01-03T06:17:41.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"mobile\": {\n            \"id\": 15,\n            \"number\": \"9988771234\",\n            \"countryCode\": \"61\",\n            \"country\": \"AUS\",\n            \"type\": \"M\",\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\"\n        },\n        \"homePhone\": null,\n        \"workPhone\": null,\n        \"residential_address\": {\n            \"id\": 13,\n            \"addressLine1\": \"500 Mockingbird Lane\",\n            \"addressLine2\": \"Suite 54\",\n            \"cityLocale\": \"Sydney\",\n            \"stateRegion\": \"NSW\",\n            \"postalCode\": \"2000\",\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\",\n            \"updatedAt\": \"2025-01-03T06:17:40.000Z\",\n            \"country\": \"AUS\"\n        },\n        \"mailing_address\": {\n            \"id\": 14,\n            \"addressLine1\": \"42 Wallaby Way\",\n            \"addressLine2\": null,\n            \"cityLocale\": \"Sydney\",\n            \"stateRegion\": \"NSW\",\n            \"postalCode\": \"2000\",\n            \"createdAt\": \"2025-01-03T00:26:24.000Z\",\n            \"updatedAt\": \"2025-01-03T05:26:25.000Z\",\n            \"country\": \"AUS\"\n        }\n    },\n    \"url\": \"/customers/CID250103052624-YXXDNB-6NJCG6\",\n    \"status\": 202,\n    \"timestamp\": \"2025-01-03T06:17:41Z\"\n}"},{"id":"0aa1ecb7-3424-41bf-bc54-132517d6f83a","name":"Update Customer - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{{mbRequestBody}}"},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": false,\r\n    \"error\": {\r\n        \"status\": \"Bad Request\",\r\n        \"reason\": \"Customer Not Found\",\r\n        \"description\": \"The customer you are trying to update does not exist\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:56\"\r\n}"}],"_postman_id":"c297f7ba-0382-4d7a-b2f2-0b40bed6ccd8"},{"name":"Activate Customer","event":[{"listen":"prerequest","script":{"id":"b059f4de-1704-44d8-9082-6174a910c5c8","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"96817a6f-2cd2-4edb-b3ff-b6bc24e67987","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI_TIMESTAMP}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"application/json","description":"<p>Indicates the media type of the resource. Valid values are: <code>application/json</code></p>\n","type":"text"}],"url":"{{baseURL}}/customers/CID250103061236-6AT5DW-KSGN24/activate","description":"<h2 id=\"update-customer\"><strong>Update Customer</strong></h2>\n<p>The Update Customer API allows clients to modify an existing customer's details. Only non-ID fields can be updated, ensuring that unique identifiers remain unchanged.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/customers/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to update customer details selectively. Only the fields provided in the request body will be modified, and all changes will be logged.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>customer_id</strong> (in path) – The unique identifier of the customer to be updated.</li>\n</ul>\n<h4 id=\"optional-parameters\"><strong>Optional Parameters</strong></h4>\n<ul>\n<li><p><strong>firstName</strong> – The updated first name of the customer.</p>\n</li>\n<li><p><strong>lastName</strong> – The updated last name of the customer.</p>\n</li>\n<li><p><strong>email</strong> – The updated email address of the customer.</p>\n</li>\n<li><p><strong>mobile</strong> – An object containing updated mobile details:</p>\n<ul>\n<li><p><strong>number</strong> – The new mobile number.</p>\n</li>\n<li><p><strong>countryCode</strong> – The updated country code.</p>\n</li>\n<li><p><strong>country</strong> – The updated country name.</p>\n</li>\n</ul>\n</li>\n<li><p><strong>residential_address</strong> – An object containing updated residential address fields.</p>\n</li>\n<li><p><strong>mailing_address</strong> – An object containing updated mailing address fields.</p>\n</li>\n<li><p><strong>occupation</strong> – The updated occupation of the customer.</p>\n</li>\n<li><p><strong>taxPayer_id</strong> – The updated taxpayer ID.</p>\n</li>\n<li><p><strong>taxPayer_id_type</strong> – The updated taxpayer ID type.</p>\n</li>\n<li><p><strong>primaryCitizenship</strong> – The updated primary citizenship.</p>\n</li>\n<li><p><strong>secondaryCitizenship</strong> – The updated secondary citizenship (if applicable).</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <strong>customer_id</strong> must exist in the system.</p>\n</li>\n<li><p>The <strong>email</strong> must follow a valid email format.</p>\n</li>\n<li><p>The <strong>mobile number</strong> must follow proper formatting.</p>\n</li>\n<li><p>The <strong>taxPayer_id</strong> must adhere to the correct format for its type.</p>\n</li>\n<li><p>The <strong>residential_address</strong> and <strong>mailing_address</strong> fields must include valid address components if provided.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the customer is not found, a <strong>404 Not Found</strong> error is returned.</p>\n</li>\n<li><p>If the email format is invalid, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If the taxPayer_id format is incorrect, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers","CID250103061236-6AT5DW-KSGN24","activate"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"de196c65-a934-41ea-80db-419be40d0419","name":"Activate Customer - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI_TIMESTAMP}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"url":"{{baseURL}}/customers/CID250103061236-6AT5DW-KSGN24/activate"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"181"},{"key":"ETag","value":"W/\"b5-PCUTgd07xGDMotLsWKC+ZThRal8\""},{"key":"X-Response-Time","value":"545.725ms"},{"key":"Date","value":"Wed, 15 Jan 2025 16:29:26 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Validation Error\",\n        \"description\": \"Customer is already active.\"\n    },\n    \"timestamp\": \"2025-01-15T16:29:26Z\"\n}"}],"_postman_id":"96817a6f-2cd2-4edb-b3ff-b6bc24e67987"},{"name":"Remove Customer","event":[{"listen":"prerequest","script":{"id":"b059f4de-1704-44d8-9082-6174a910c5c8","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"b89a0e3c-1892-44f7-85a3-ff0bcc7a4044","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"This customer is being removed due to closing their parent account\"\r\n}"},"url":"{{baseURL}}/customers/CID250103052624-YXXDNB-6NJCG6","description":"<h2 id=\"remove-customer\"><strong>Remove Customer</strong></h2>\n<p>The Remove Customer API allows clients to deactivate a customer record by setting the <code>isDeleted</code> flag to <code>true</code>. This ensures that customer data remains in the system but is no longer considered active.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>DELETE</strong> <code>/customers/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API marks a customer as removed without physically deleting their record. The removal action must include a reason for tracking purposes.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>customer_id</strong> (in path) – The unique identifier of the customer to be removed.</p>\n</li>\n<li><p><strong>notes</strong> (in body) – The reason for removing the customer.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <strong>customer_id</strong> must exist in the system.</p>\n</li>\n<li><p>The <strong>notes</strong> field is required and must contain a valid reason.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the customer does not exist, a <strong>404 Not Found</strong> error is returned.</p>\n</li>\n<li><p>If the notes field is missing, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers","CID250103052624-YXXDNB-6NJCG6"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"ab5ae414-d52f-49cf-a26d-8f95b8abe412","name":"Remove Customer - 204 (No Content)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{{mbRequestBody}}"},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"No Content","code":204,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":""},{"id":"3620b20a-4254-47b0-9e58-d42e8c543ff5","name":"Remove Customer - 400 (Bad Request)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{{mbRequestBody}}"},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": false,\r\n    \"error\": {\r\n        \"status\": \"Bad Request\",\r\n        \"reason\": \"Customer Not Found\",\r\n        \"description\": \"Customer with id :customer_id not found or has already been deleted.\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:56\"\r\n}"}],"_postman_id":"b89a0e3c-1892-44f7-85a3-ff0bcc7a4044"},{"name":"Reinstate Customer","event":[{"listen":"prerequest","script":{"id":"b059f4de-1704-44d8-9082-6174a910c5c8","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"5292760a-54ef-4125-837f-44920da7d29c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"This customer reactivated thier account\"\r\n}"},"url":"{{baseURL}}/customers/:customer_id/reinstate","description":"<h2 id=\"reinstate-customer\"><strong>Reinstate Customer</strong></h2>\n<p>The Reinstate Customer API allows clients to reactivate a previously removed customer by setting the <code>isDeleted</code> flag back to <code>false</code>.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/customers/:customer_id/reinstate</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API restores a deactivated customer record, allowing the customer to become active again. A reason must be provided to track the reinstatement action.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>customer_id</strong> (in path) – The unique identifier of the customer to be reinstated.</p>\n</li>\n<li><p><strong>notes</strong> (in body) – The reason for reinstating the customer.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <strong>customer_id</strong> must exist in the system and be in a removed state (<code>isDeleted: true</code>).</p>\n</li>\n<li><p>The <strong>notes</strong> field is required and must contain a valid reason.</p>\n</li>\n</ul>\n<h4 id=\"error-handling\"><strong>Error Handling</strong></h4>\n<ul>\n<li><p>If the customer does not exist or is not removed, a <strong>404 Not Found</strong> error is returned.</p>\n</li>\n<li><p>If the notes field is missing, a <strong>400 Bad Request</strong> error is returned.</p>\n</li>\n<li><p>If an unexpected error occurs, a <strong>500 Internal Server Error</strong> is returned.</p>\n</li>\n</ul>\n","urlObject":{"path":["customers",":customer_id","reinstate"],"host":["{{baseURL}}"],"query":[],"variable":[{"type":"any","value":"","key":"customer_id"}]}},"response":[{"id":"503b94c0-872e-40b3-9f0b-860b27cc9260","name":"Reinstate Customer - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{{mbRequestBody}}"},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"message\": \"Customer:customer_id successfully reinstated.\"\n    },\n    \"url\": \"/customers/:customer_id/reinstate\",\n    \"status\": 202,\n    \"timestamp\": \"2025-01-03T15:44:31Z\"\n}"},{"id":"624f70a7-454b-402c-8e1d-8d8cad0ae617","name":"Reinstate Customer - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{{mbRequestBody}}"},"url":{"raw":"{{baseURL}}/customers/:customer_id","host":["{{baseURL}}"],"path":["customers",":customer_id"],"variable":[{"key":"customer_id","value":"CID000000123456789","description":"Update details of this `customer_id`"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": false,\r\n    \"error\": {\r\n        \"status\": \"Bad Request\",\r\n        \"reason\": \"Customer Not Found\",\r\n        \"description\": \"The customer you are trying to update does not exist\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:56\"\r\n}"}],"_postman_id":"5292760a-54ef-4125-837f-44920da7d29c"},{"name":"Upload KYC Document","event":[{"listen":"prerequest","script":{"id":"50dbf2cd-ea76-4acb-b914-fbe48321889b","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","\r","// Handle request body\r","let body = '';\r","if (pm.request.body && pm.request.body.mode === 'raw') {\r","    body = pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : '';\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","console.log('HMAC Authentication Details:', {\r","    apiKey,\r","    timestamp,\r","    randomString,\r","    nonce,\r","    stringToSign,\r","    signature\r","});\r","\r","console.log('String to Sign (Postman):', stringToSign);\r",""],"type":"text/javascript","packages":{}}}],"id":"183d0a08-4f38-4aa4-a08a-e6d6eb992852","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{reqMBAuthToken}}"}]},"isInherited":false},"method":"POST","header":[{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"multipart/form-data","description":"<p>Indicates the media type of the resource. Valid values are: <code>multipart/form-data</code></p>\n","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"file","type":"file","description":"<p>File to upload i.e GIF, PNG, JPG, PDF, max size 6 MB</p>\n","src":"postman-cloud:///1efc95d5-a9c0-42d0-8abf-239a781694ea"},{"key":"customer_id","value":"CID250101234154-YJ2VP4-XA52UL","description":"<p>CustomerID for which to upload the document</p>\n","type":"text"},{"key":"document_type","value":"PASSPORT","description":"<p>This is the type of document you are uploading for the customer. The optional values are: 'DRIVERSL, 'PASSPORT', 'GOVERNID', 'OTHER'</p>\n","type":"text"}]},"url":"{{baseURL}}/documents","description":"<p><strong>KYC Doc Statuses:</strong></p>\n<ul>\n<li><p>PND - Pending</p>\n</li>\n<li><p>APR - Approved</p>\n</li>\n<li><p>REJ - Rejected</p>\n</li>\n</ul>\n<p><strong>Document Types:</strong></p>\n<ul>\n<li><p>DRIVERSL - Driver's License</p>\n</li>\n<li><p>PASSPORT - Passport</p>\n</li>\n<li><p>GOVERNID - Official Government ID</p>\n</li>\n<li><p>OTHER - Other</p>\n</li>\n</ul>\n","urlObject":{"path":["documents"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"19e90287-09de-49a4-a67e-6ed634609e2e","name":"Upload KYC Document","originalRequest":{"method":"POST","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"multipart/form-data","description":"Indicates the media type of the resource. Valid values are: `multipart/form-data`","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"file","type":"file","description":"File to upload i.e PNG, JPG, PDF, max size 4 MB","value":null},{"key":"customer_id","value":"CIDXXXXXXXXXX","description":"CustomerID for which to upload the document","type":"text"},{"key":"document_type","value":"","description":"This is the type of document you are uploading for the customer. The optional values are: 'DRIVERSL, 'PASSPORT', 'GOVERNID', 'OTHER'","type":"text"}]},"url":"{{baseURL}}/documents"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"doc_id\": \"0193e4dc-16bd-75b6-923b-24dce8f371ea\",\n        \"doc_type\": \"PASSPORT\",\n        \"original_fileName\": \"my_passpowrd.jpg\",\n        \"mime_type\": \"JPG\",\n        \"status\": \"PND\",\n        \"uploadedAt\": \"2022-01-01 13:14:54\",\n        \"updatedAt\": \"2022-01-01 13:14:54\"\n    },\n    \"timestamp\": \"2022-01-01 13:14:54\"\n}"}],"_postman_id":"183d0a08-4f38-4aa4-a08a-e6d6eb992852"},{"name":"Get KYC Document","event":[{"listen":"prerequest","script":{"id":"3ae72654-b0cd-4ce1-9400-632876da0468","exec":["// *** START ***","var uuid = require('uuid');","// get values for 'MBAPI-KEY' and 'MBAPI-SECRET' from PM environment variables","var mbAPIKey = pm.environment.get('mbAPIKey');","var mbAPISecret = pm.environment.get('mbAPISecret');","// create and set MBAPI-TIMESTAMP value","var mbAPITimeStamp = Date.now().toString();","postman.setEnvironmentVariable(\"mbAPITimeStamp\", mbAPITimeStamp);","// get http-method used in this request","var httpMethod = pm.request.method;","// create and set MBAPI-NOUNCE value","var mbAPINonce = uuid.v4();","postman.setEnvironmentVariable(\"mbAPINonce\", mbAPINonce);","// use just 'baseUrl' and 'resourcePath' to form full-url for this request","var baseURL = pm.environment.get('baseURL');","var resPath = String(pm.request.url).toLowerCase();","const resPathList = String(resPath).split('/');","var fullURl = String(baseURL).concat('/').concat(resPathList[1]).concat('/').concat(resPathList[2]).concat('/').concat(resPathList[3]);","var mbEncodedRequestURL = encodeURIComponent(fullURl).toLowerCase();","// create and set HMAC signature","var payload = mbAPIKey+httpMethod+mbEncodedRequestURL+mbAPITimeStamp; // without nonce and mbRequestBody","var signatureBytes = CryptoJS.HmacSHA512(payload, mbAPISecret);","var mbSignatureBase64String = CryptoJS.enc.Base64.stringify(signatureBytes);","postman.setEnvironmentVariable(\"mbHmacSig\", mbSignatureBase64String);","// *** END ***"],"type":"text/javascript","packages":{}}}],"id":"6736a97b-26f0-4cee-9844-714b8330627e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"<p>Your unique PUBLIC API Key.</p>\n","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"<p>The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.</p>\n","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"<p>A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your <code>MBAPI-KEY</code> + <code>MBAPI-TIMESTAMP</code> + <code>A random 32-character string</code>. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.</p>\n","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"<p>The user generated message signature. The <code>MBAPI-SIGNATURE</code> header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your <code>MBAPI-SECRET</code> as the secret key. The message is a concatenated string containing the following, in this order: <code>Your MBAPI-KEY</code> + <code>http request method in all caps</code> + <code>encoded path of requested url in all lower case</code> + <code>MBAPI-TIMESTAMP</code> + <code>body</code> (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).</p>\n","type":"text"},{"key":"Content-Type","value":"application/json","description":"<p>Indicates the media type of the resource. Valid values are: <code>application/json</code></p>\n","type":"text"}],"url":"{{baseURL}}/documents/:customer_id/:doc_id","description":"<p>This will return the KYC doc information with status. The actual file will not be returned.</p>\n","urlObject":{"path":["documents",":customer_id",":doc_id"],"host":["{{baseURL}}"],"query":[],"variable":[{"description":{"content":"<p>The unique customer ID</p>\n","type":"text/plain"},"type":"any","value":"","key":"customer_id"},{"type":"any","value":"","key":"doc_id"}]}},"response":[{"id":"b3a1dca4-ea50-4801-a2ef-4f829850ceb8","name":"Get KYC Document","originalRequest":{"method":"GET","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"url":{"raw":"{{baseURL}}/documents/:customer_id/:doc_id","host":["{{baseURL}}"],"path":["documents",":customer_id",":doc_id"],"variable":[{"key":"customer_id","value":"","description":"The unique customer ID\n"},{"key":"doc_id","value":""}]}},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"doc_id\": \"0193e4dc-16bd-75b6-923b-24dce8f371ea\",\r\n        \"doc_type\": \"PASSPORT\",\r\n        \"original_fileName\": \"my_passpowrd.jpg\",\r\n        \"mime_type\": \"JPG\",\r\n        \"status\": \"APR\",\r\n        \"uploadedAt\": \"2022-01-01 13:14:54\",\r\n        \"updatedAt\": \"2022-01-01 13:14:54\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:54\"\r\n}"}],"_postman_id":"6736a97b-26f0-4cee-9844-714b8330627e"}],"id":"87a3d4b9-16c6-4b6b-9e52-f9641e399bb9","description":"<p><strong>Customers</strong> are equivalent to Accountholders who have access to accounts. When creating a Customer, you are essentially creating a user profile. Customers can (and should be) vetted (KYC/KYB) before requesting the opening of an account for that Customer.</p>\n","_postman_id":"87a3d4b9-16c6-4b6b-9e52-f9641e399bb9"},{"name":"Customer Authentication","item":[{"name":"Create Authentication Access","event":[{"listen":"prerequest","script":{"id":"cb8a89f4-9de8-4825-a463-24facbcb958e","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"e601c426-e64a-4750-b43f-105e14f5ada1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"password\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/create/CID250103014042-RAFVZE-98TWFD","description":"<h2 id=\"create-customer-access\"><strong>Create Customer Access</strong></h2>\n<p>The Create Customer Access API allows clients to establish authentication credentials for a customer, enabling them to log in to the system. This API ensures that a customer access record is created only once; if access has been removed, the user must use the Restore Access API instead.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>POST</strong> <code>/authentication/create/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API is used to create an authentication record for a customer. A customer can only have one authentication record; if the record already exists, a new one cannot be created. If access was previously removed, the customer must restore access instead of creating a new record.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>customer_id</strong> (in path) – The unique identifier of the customer whose access is being created.</p>\n</li>\n<li><p><strong>password</strong> (in body) – The password to be set for the customer.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>A customer access record cannot be created if one already exists.</p>\n</li>\n<li><p>If access was previously removed, this API will return an error instructing the client to use the Restore Access API.</p>\n</li>\n<li><p>Password must meet complexity requirements:</p>\n<ul>\n<li><p>At least 8 characters long</p>\n</li>\n<li><p>Must contain at least one uppercase letter</p>\n</li>\n<li><p>Must contain at least one lowercase letter</p>\n</li>\n<li><p>Must contain at least one number</p>\n</li>\n<li><p>Must contain at least one special character</p>\n</li>\n<li><p>Cannot contain spaces</p>\n</li>\n</ul>\n</li>\n</ul>\n","urlObject":{"path":["authentication","create","CID250103014042-RAFVZE-98TWFD"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"fb9b25c1-d3f4-4328-a7ca-dddd048b6c86","name":"Create Authentication Access - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"password\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/create/CID250103061236-6AT5DW-KSGN24"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n        \"username\": \"john.doe@example.com\"\r\n    },\r\n    \"status\": 201,\r\n    \"timestamp\": \"2025-01-04T01:41:51Z\"\r\n}"},{"id":"efff555e-ab74-4021-8eaf-faba82d0e3ce","name":"Create Authentication Access - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer_id\": \"CID000000123456789\",\n    \"password_new\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/create/CID250103061236-6AT5DW-KSGN24"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Duplicate Record\",\n        \"description\": \"An access record already exists for customer CID250103061236-6AT5DW-KSGN24.\"\n    },\n    \"timestamp\": \"2025-01-04T01:36:33Z\"\n}"}],"_postman_id":"e601c426-e64a-4750-b43f-105e14f5ada1"},{"name":"Remove Authentication Access","event":[{"listen":"prerequest","script":{"id":"cb8a89f4-9de8-4825-a463-24facbcb958e","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"09678787-fa21-496a-8d1c-05f8f73077d1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/authentication/remove/CID250103014042-RAFVZE-98TWFD","description":"<h2 id=\"remove-customer-access\"><strong>Remove Customer Access</strong></h2>\n<p>The Remove Customer Access API allows clients to disable authentication for a specific customer. This does not delete the authentication record but marks it as inactive.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>DELETE</strong> <code>/authentication/remove/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API is used to remove access for a customer. Once access is removed, the customer will no longer be able to log in. Access can be reinstated using the Restore Access API.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>customer_id</strong> (in path) – The unique identifier of the customer whose access is being removed.</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The customer must have an existing authentication record.</p>\n</li>\n<li><p>If the customer access is already removed, this API will return an error.</p>\n</li>\n</ul>\n","urlObject":{"path":["authentication","remove","CID250103014042-RAFVZE-98TWFD"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"a1b0bc93-f998-4816-a926-4247c44ebf68","name":"Remove Authentication Access - 204 (No Content)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/authentication/remove/CID250103014042-RAFVZE-98TWFD"},"status":"No Content","code":204,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null},{"id":"48580908-897f-46e5-b2b6-700facf3eb8b","name":"Remove Authentication Access  - 400 (Bad Request)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer_id\": \"CID000000123456789\",\n    \"password_new\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/password"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": false,\r\n    \"error\": {\r\n        \"status\": 404,\r\n        \"reason\": \"Not Found\",\r\n        \"description\": \"No active access found for customer CID250103014042-RAFVZE-98TWFD.\"\r\n    },\r\n    \"timestamp\": \"2025-01-04T02:21:00Z\"\r\n}"}],"_postman_id":"09678787-fa21-496a-8d1c-05f8f73077d1"},{"name":"Restore Authentication Access","event":[{"listen":"prerequest","script":{"id":"cb8a89f4-9de8-4825-a463-24facbcb958e","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"13b67d44-2f06-4d7e-a28c-5cae5cc0a18c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/authentication/restore/CID250103014042-RAFVZE-98TWFD","description":"<h2 id=\"restore-customer-access\"><strong>Restore Customer Access</strong></h2>\n<p>The Restore Customer Access API allows clients to reinstate authentication for a customer whose access was previously removed.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/authentication/restore/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API is used to restore access for a customer after it was previously removed. It reactivates the authentication record, allowing the customer to log in again.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>customer_id</strong> (in path) – The unique identifier of the customer whose access is being restored.</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The customer must have an existing authentication record that was previously removed.</p>\n</li>\n<li><p>If the customer’s access is already active, this API will return an error.</p>\n</li>\n</ul>\n","urlObject":{"path":["authentication","restore","CID250103014042-RAFVZE-98TWFD"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"c140b9fd-1eb6-4e27-9525-42b1086a201a","name":"Restore Authentication Access - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"customer_id\": \"CID000000123456789\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:54\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/authentication/restore/CID250103014042-RAFVZE-98TWFD"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"status\": 202,\r\n    \"timestamp\": \"2025-01-04T02:26:34Z\"\r\n}"},{"id":"1d03aa59-d714-439f-aee2-07289b41eaf9","name":"Restore Authentication Access - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer_id\": \"CID000000123456789\",\n    \"password_new\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/restore/CID250103014042-RAFVZE-98TWFD"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"13b67d44-2f06-4d7e-a28c-5cae5cc0a18c"},{"name":"Change Authentication Password","event":[{"listen":"prerequest","script":{"id":"cb8a89f4-9de8-4825-a463-24facbcb958e","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"648c051d-cc17-48ca-b5da-e8924e29df0e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"password_old\": \"04x$?S84p!IFHk\",\r\n    \"password_new\": \"04x$?S84p!IFHke\"\r\n}"},"url":"{{baseURL}}/authentication/changePwd/CID250103014042-RAFVZE-98TWFD","description":"<h2 id=\"change-customer-password\"><strong>Change Customer Password</strong></h2>\n<p>The Change Customer Password API allows a customer to update their password while maintaining their authentication credentials.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/authentication/changePwd/:customer_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables a customer to change their password by providing their current password and a new password. The old password must match the existing record for the change to be successful.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>customer_id</strong> (in path) – The unique identifier of the customer whose password is being changed.</p>\n</li>\n<li><p><strong>password_old</strong> (in body) – The current password.</p>\n</li>\n<li><p><strong>password_new</strong> (in body) – The new password to be set.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The current password must match the stored password.</p>\n</li>\n<li><p>The new password must meet complexity requirements:</p>\n<ul>\n<li><p>At least 8 characters long</p>\n</li>\n<li><p>Must contain at least one uppercase letter</p>\n</li>\n<li><p>Must contain at least one lowercase letter</p>\n</li>\n<li><p>Must contain at least one number</p>\n</li>\n<li><p>Must contain at least one special character</p>\n</li>\n<li><p>Cannot contain spaces</p>\n</li>\n</ul>\n</li>\n<li><p>The new password cannot be the same as the old password.</p>\n</li>\n</ul>\n","urlObject":{"path":["authentication","changePwd","CID250103014042-RAFVZE-98TWFD"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"78f120cb-ef92-4adb-8668-6046c0dfaf5f","name":"Change Authentication Password - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"success\": true,\r\n    \"data\": {\r\n        \"customer_id\": \"CID000000123456789\"\r\n    },\r\n    \"timestamp\": \"2022-01-01 13:14:54\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/authentication/changePwd/CID250103014042-RAFVZE-98TWFD"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\r\n    \"success\": true,\r\n    \"status\": 202,\r\n    \"timestamp\": \"2025-01-04T02:26:34Z\"\r\n}"},{"id":"a8d6cba0-ef02-40ca-9a02-54c87a733e59","name":"Change Authentication Password - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-KEY","value":"{{mbAPIKey}}","description":"Your unique PUBLIC API Key.","type":"text"},{"key":"MBAPI-TIMESTAMP","value":"{{mbAPITimeStamp}}","description":"The user generated timestamp for the request. Must be the number of seconds since Unix Epoch. In addition, requests will be rejected if the timestamp used isn't close to the real time.","type":"text"},{"key":"MBAPI-NONCE","value":"{{mbAPINonce}}","description":"A Nonce is a number or string, that can be used only once. The reason for using a nonce in API requests, is to ensure that once a request has been sent, regardless of whether that request is successful, it still cannot be used (or resent) again. This guards against Replay Attacks and some Man-in-the-Middle Attacks. There are a number of ways to create a nonce. However, we ask that you create this nonce in a specific way. The MBAPI-NONCE should be constructed using your `MBAPI-KEY` + `MBAPI-TIMESTAMP` + `A random 32-character string`. Then taking that string and creating a base64_encoded hash. Very similar to the process of creating your HMAC signed request.","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{mbHmacSig}}","description":"The user generated message signature. The `MBAPI-SIGNATURE` header is generated by creating a SHA512 HMAC message digest with base64 encoding, using your `MBAPI-SECRET` as the secret key. The message is a concatenated string containing the following, in this order: `Your MBAPI-KEY` + `http request method in all caps` + `encoded path of requested url in all lower case` + `MBAPI-TIMESTAMP` + `body` (where + represents string concatenation). The body is the requested body string and should be omitted if there is no request body (this is typical for GET and DELETE requests).","type":"text"},{"key":"Content-Type","value":"application/json","description":"Indicates the media type of the resource. Valid values are: `application/json`","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"customer_id\": \"CID000000123456789\",\n    \"password_new\": \"04x$?S84p!IFHk\"\n}"},"url":"{{baseURL}}/authentication/changePwd/CID250103014042-RAFVZE-98TWFD"},"status":"Bad Request","code":400,"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"648c051d-cc17-48ca-b5da-e8924e29df0e"}],"id":"f9abdc3d-0415-4d44-896f-37eaf044274a","_postman_id":"f9abdc3d-0415-4d44-896f-37eaf044274a","description":""},{"name":"Businesses","item":[{"name":"Create Business","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"cddd0640-3846-4e99-a4d8-c07cd72d3697","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\r\n    \"name\": \"ACME Corporation\",\r\n    \"description\": \"This is construction company located in the midwest\",\r\n    \"country\": \"USA\",\r\n    \"industry\":  40,\r\n    \"email\": \"acme@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"99-9999999\",\r\n    \"taxPayer_id_type\": \"EIN\",\r\n    \"compliance_inForeignPol\": false,\r\n    \"compliance_takingCharity\": false,\r\n    \"compliance_moneyTransmitter\": false,\r\n    \"compliance_thirdPartyTxs\": false,\r\n    \"compliance_onlineGambling\": false,\r\n    \"compliance_ownATMs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses","description":"<h2 id=\"create-business\"><strong>Create Business</strong></h2>\n<p>The <strong>Create Business</strong> API allows a client to register a business entity associated with a specific customer. A business cannot exist independently; it must be linked to a customer. This API ensures compliance by requiring key details such as business description, industry, tax information, and compliance-related disclosures.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>POST /businesses</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API creates a new business entity linked to an existing customer. The request requires a valid <strong>customer_id</strong>, which must be active (<code>ACT</code>) and belong to the authenticated <strong>client_id</strong>.</p>\n<p><strong>Mandatory fields include:</strong></p>\n<ul>\n<li><p><strong>Business Name</strong> and <strong>Description</strong></p>\n</li>\n<li><p><strong>Taxpayer ID</strong> (with type)</p>\n</li>\n<li><p><strong>Industry Type</strong></p>\n</li>\n<li><p><strong>Compliance-related questions</strong></p>\n</li>\n<li><p><strong>Main Address</strong> and <strong>Mailing Address</strong> (both required)</p>\n</li>\n</ul>\n<p><strong>All requests must comply with ISO standards for country codes (ISO 3166-1 alpha-3).</strong></p>\n<hr />\n<h2 id=\"required-parameters\"><strong>Required Parameters</strong></h2>\n<h3 id=\"general-business-information\"><strong>General Business Information</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The ID of the customer associated with this business. Must be an <strong>active customer</strong> belonging to the client.</td>\n</tr>\n<tr>\n<td><strong>name</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The official name of the business.</td>\n</tr>\n<tr>\n<td><strong>DBA</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The \"Doing Business As\" name if different from the legal name.</td>\n</tr>\n<tr>\n<td><strong>description</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>A brief description of the business operations.</td>\n</tr>\n<tr>\n<td><strong>industry</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The industry in which the business operates. <strong>See industry list below.</strong></td>\n</tr>\n<tr>\n<td><strong>yearsInOperation</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>Number of years the business has been in operation.</td>\n</tr>\n<tr>\n<td><strong>numberOfEmployees</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The number of employees working in the business.</td>\n</tr>\n<tr>\n<td><strong>estimatedYearlyRevenue</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The estimated annual revenue of the business.</td>\n</tr>\n<tr>\n<td><strong>phone</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The contact phone number of the business.</td>\n</tr>\n<tr>\n<td><strong>email</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The official email address of the business.</td>\n</tr>\n<tr>\n<td><strong>website</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The website URL of the business.</td>\n</tr>\n<tr>\n<td><strong>country</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The country where the business operates, in <strong>ISO3 format</strong> (e.g., <code>USA</code>, <code>GBR</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"tax-information\"><strong>Tax Information</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>taxPayer_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The business taxpayer identification number. <strong>Encrypted in storage.</strong></td>\n</tr>\n<tr>\n<td><strong>taxPayer_id_type</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The type of taxpayer identification. <strong>See allowed values below.</strong></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"business-compliance-questions\"><strong>Business Compliance Questions</strong></h3>\n<p>Each of these fields is <strong>required</strong> and must be either <code>true</code> or <code>false</code>.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>compliance_inForeignPol</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Does this business operate in foreign politics?</td>\n</tr>\n<tr>\n<td><strong>compliance_takingCharity</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Does this business accept charity donations?</td>\n</tr>\n<tr>\n<td><strong>compliance_moneyTransmitter</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Is this business involved in money transmission activities?</td>\n</tr>\n<tr>\n<td><strong>compliance_thirdPartyTxs</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Does this business process transactions for third parties?</td>\n</tr>\n<tr>\n<td><strong>compliance_onlineGambling</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Is this business involved in online gambling?</td>\n</tr>\n<tr>\n<td><strong>compliance_ownATMs</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Does this business own and operate ATMs?</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"addresses-main--mailing\"><strong>Addresses (Main &amp; Mailing)</strong></h3>\n<p>Both <strong>main_address</strong> and <strong>mailing_address</strong> are <strong>mandatory</strong> and must be valid objects with the following structure:</p>\n<h4 id=\"address-object-format\"><strong>Address Object Format</strong></h4>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"123 Business Street\",\n  \"addressLine2\": \"Suite 200\",\n  \"cityLocale\": \"New York\",\n  \"stateRegion\": \"NY\",\n  \"postalCode\": \"10001\",\n  \"country\": \"USA\"\n}\n\n</code></pre>\n<h4 id=\"required-fields-for-addresses\"><strong>Required Fields for Addresses</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>addressLine1</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The primary address line.</td>\n</tr>\n<tr>\n<td><strong>cityLocale</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The city where the business operates.</td>\n</tr>\n<tr>\n<td><strong>stateRegion</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The state or region of operation.</td>\n</tr>\n<tr>\n<td><strong>postalCode</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The postal code (ZIP Code).</td>\n</tr>\n<tr>\n<td><strong>country</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The country (ISO3 format, e.g., <code>USA</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"supported-taxpayer-id-types\"><strong>Supported Taxpayer ID Types</strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Description</th>\n<th>Expected Format</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>SSN</strong></td>\n<td>Social Security Number (U.S.)</td>\n<td>XXX-XX-XXXX</td>\n</tr>\n<tr>\n<td><strong>EIN</strong></td>\n<td>Employer Identification Number (U.S.)</td>\n<td>XX-XXXXXXX</td>\n</tr>\n<tr>\n<td><strong>ITIN</strong></td>\n<td>Individual Taxpayer Identification Number (U.S.)</td>\n<td>9XX-XX-XXXX</td>\n</tr>\n<tr>\n<td><strong>NINO</strong></td>\n<td>National Insurance Number (UK)</td>\n<td>XX999999X</td>\n</tr>\n<tr>\n<td><strong>GSTIN</strong></td>\n<td>Goods and Services Taxpayer Identification Number (India)</td>\n<td>15 Alphanumeric Characters</td>\n</tr>\n<tr>\n<td><strong>ABN</strong></td>\n<td>Australian Business Number</td>\n<td>11 Digits</td>\n</tr>\n<tr>\n<td><strong>PAN</strong></td>\n<td>Permanent Account Number (India)</td>\n<td>XXXXX9999X</td>\n</tr>\n<tr>\n<td><strong>NIF</strong></td>\n<td>Número de Identificación Fiscal (Spain)</td>\n<td>X9999999T</td>\n</tr>\n<tr>\n<td><strong>CPF</strong></td>\n<td>Cadastro de Pessoas Físicas (Brazil)</td>\n<td>XXX.XXX.XXX-XX</td>\n</tr>\n<tr>\n<td><strong>CNPJ</strong></td>\n<td>Cadastro Nacional da Pessoa Jurídica (Brazil)</td>\n<td>XX.XXX.XXX/0001-XX</td>\n</tr>\n<tr>\n<td><strong>TIN</strong></td>\n<td>Generic Taxpayer ID</td>\n<td>No format restriction</td>\n</tr>\n<tr>\n<td><strong>ETIN</strong></td>\n<td>Electronic Taxpayer Identification Number</td>\n<td>No format restriction</td>\n</tr>\n<tr>\n<td><strong>OTHER</strong></td>\n<td>Any other taxpayer ID type</td>\n<td>No format restriction</td>\n</tr>\n</tbody>\n</table>\n</div><h4 id=\"allowed-values-for-industry\"><strong>Allowed Values for</strong> <strong><code>industry</code></strong></h4>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>ID</th>\n<th>Industry</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>39</strong></td>\n<td>Aerospace</td>\n</tr>\n<tr>\n<td><strong>40</strong></td>\n<td>Agriculture</td>\n</tr>\n<tr>\n<td><strong>41</strong></td>\n<td>Automotive</td>\n</tr>\n<tr>\n<td><strong>42</strong></td>\n<td>Broadcasting</td>\n</tr>\n<tr>\n<td><strong>43</strong></td>\n<td>Chemical</td>\n</tr>\n<tr>\n<td><strong>44</strong></td>\n<td>Computer</td>\n</tr>\n<tr>\n<td><strong>45</strong></td>\n<td>Construction</td>\n</tr>\n<tr>\n<td><strong>46</strong></td>\n<td>Defense &amp; Arms</td>\n</tr>\n<tr>\n<td><strong>47</strong></td>\n<td>Education</td>\n</tr>\n<tr>\n<td><strong>48</strong></td>\n<td>Electrical Power</td>\n</tr>\n<tr>\n<td><strong>49</strong></td>\n<td>Electronics</td>\n</tr>\n<tr>\n<td><strong>50</strong></td>\n<td>Energy</td>\n</tr>\n<tr>\n<td><strong>51</strong></td>\n<td>Entertainment</td>\n</tr>\n<tr>\n<td><strong>52</strong></td>\n<td>Film</td>\n</tr>\n<tr>\n<td><strong>53</strong></td>\n<td>Financial</td>\n</tr>\n<tr>\n<td><strong>54</strong></td>\n<td>Fishing</td>\n</tr>\n<tr>\n<td><strong>55</strong></td>\n<td>Food</td>\n</tr>\n<tr>\n<td><strong>56</strong></td>\n<td>Healthcare</td>\n</tr>\n<tr>\n<td><strong>57</strong></td>\n<td>Hospitality</td>\n</tr>\n<tr>\n<td><strong>58</strong></td>\n<td>Information Services</td>\n</tr>\n<tr>\n<td><strong>59</strong></td>\n<td>Insurance</td>\n</tr>\n<tr>\n<td><strong>60</strong></td>\n<td>Internet</td>\n</tr>\n<tr>\n<td><strong>61</strong></td>\n<td>Manufacturing</td>\n</tr>\n<tr>\n<td><strong>62</strong></td>\n<td>Mining</td>\n</tr>\n<tr>\n<td><strong>63</strong></td>\n<td>Music</td>\n</tr>\n<tr>\n<td><strong>64</strong></td>\n<td>News Media</td>\n</tr>\n<tr>\n<td><strong>65</strong></td>\n<td>Petroleum</td>\n</tr>\n<tr>\n<td><strong>66</strong></td>\n<td>Pharmaceutical</td>\n</tr>\n<tr>\n<td><strong>67</strong></td>\n<td>Publishing</td>\n</tr>\n<tr>\n<td><strong>68</strong></td>\n<td>Shipbuilding</td>\n</tr>\n<tr>\n<td><strong>69</strong></td>\n<td>Software</td>\n</tr>\n<tr>\n<td><strong>70</strong></td>\n<td>Steel</td>\n</tr>\n<tr>\n<td><strong>71</strong></td>\n<td>Telecommunications</td>\n</tr>\n<tr>\n<td><strong>72</strong></td>\n<td>Timber, Pulp &amp; Paper</td>\n</tr>\n<tr>\n<td><strong>73</strong></td>\n<td>Tobacco</td>\n</tr>\n<tr>\n<td><strong>74</strong></td>\n<td>Transportation</td>\n</tr>\n<tr>\n<td><strong>75</strong></td>\n<td>Water</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><strong>Customer must be active (<strong><strong><code>ACT</code></strong></strong>)</strong> and belong to the authenticated client.</p>\n</li>\n<li><p><strong>Country must be in ISO 3166-1 alpha-3 format</strong> (<code>USA</code>, <code>GBR</code>, etc.).</p>\n</li>\n<li><p><strong>Main Address and Mailing Address are both required</strong> and must contain valid fields.</p>\n</li>\n<li><p><strong>All compliance fields must be explicitly</strong> <strong><code>true</code></strong> <strong>or</strong> <strong><code>false</code></strong> (no null/empty values).</p>\n</li>\n<li><p><strong>Phone must reference an existing phone number record</strong> in the <code>phoneNumbers</code> model.</p>\n</li>\n<li><p><strong>Industry must be one of the predefined values listed above</strong>.</p>\n</li>\n</ul>\n<hr />\n<h2 id=\"error-handling\"><strong>Error Handling</strong></h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Country must be in ISO3 format.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>Required fields are missing from the request.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Invalid Address</td>\n<td>Address fields are missing or incorrectly formatted.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Customer Not Active</td>\n<td>The customer associated with this business is not active.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"28a53124-5bb1-44e8-b0b9-d84b8a130787","name":"Create Business - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\r\n    \"name\": \"ACME Corporation\",\r\n    \"description\": \"This is construction company located in the midwest\",\r\n    \"country\": \"USA\",\r\n    \"industry\":  40,\r\n    \"email\": \"acme@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"99-9999999\",\r\n    \"taxPayer_id_type\": \"EIN\",\r\n    \"compliance_inForeignPol\": false,\r\n    \"compliance_takingCharity\": false,\r\n    \"compliance_moneyTransmitter\": false,\r\n    \"compliance_thirdPartyTxs\": false,\r\n    \"compliance_onlineGambling\": false,\r\n    \"compliance_ownATMs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1147"},{"key":"ETag","value":"W/\"47b-LS1sg+cc/tDkU/m0sPFPbd/cSNo\""},{"key":"X-Response-Time","value":"1938.352ms"},{"key":"Date","value":"Tue, 14 Jan 2025 04:50:37 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"business_id\": \"BID250114045037-ELRZR862RL\",\n        \"status\": \"NEW\",\n        \"name\": \"ACME Corporation\",\n        \"DBA\": null,\n        \"description\": \"This is construction company located in the midwest\",\n        \"taxPayer_id\": \"YWVzLTI1Ni1nY20kJGRlZmF1bHQ=$rptchS7Rq+tSMMPI$/u2RiJ9Cx3J8/3WC$P0xoYlVhkOnvy0X3HEpoGw\",\n        \"taxPayer_id_type\": \"EIN\",\n        \"yearsInOperation\": null,\n        \"numberOfEmployees\": null,\n        \"estimatedYearlyRevenue\": null,\n        \"email\": \"acme@acme.com\",\n        \"website\": null,\n        \"country\": \"USA\",\n        \"compliance_inForeignPol\": false,\n        \"compliance_takingCharity\": false,\n        \"compliance_moneyTransmitter\": false,\n        \"compliance_thirdPartyTxs\": false,\n        \"compliance_onlineGambling\": false,\n        \"compliance_ownATMs\": false,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-13T23:48:43.000Z\",\n        \"updatedAt\": \"2025-01-14T04:50:37.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\n        \"industry\": 40,\n        \"phone\": 19,\n        \"main_address\": 21,\n        \"mailing_address\": 22\n    },\n    \"url\": \"/businesses\",\n    \"status\": 201,\n    \"timestamp\": \"2025-01-14T04:50:37Z\"\n}"},{"id":"44ebfb41-3827-4dfe-a139-33aecb3c1cfc","name":"Create Business - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"Anna2\",\r\n    \"name\": \"ACME\",\r\n    \"email\": \"acme@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"600-10-1111\",\r\n    \"taxPayer_id_type\": \"TFN\"\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"404"},{"key":"ETag","value":"W/\"194-cwTsUbVWnpndc1IdOqLRKzqOUqQ\""},{"key":"X-Response-Time","value":"585.676ms"},{"key":"Date","value":"Tue, 14 Jan 2025 04:04:41 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"Missing required fields for Business creation: description, country, industry, main_address, compliance_inForeignPol, compliance_takingCharity, compliance_moneyTransmitter, compliance_thirdPartyTxs, compliance_onlineGambling, compliance_ownATMs\"\n    },\n    \"timestamp\": \"2025-01-14T04:04:41Z\"\n}"},{"id":"b109f01d-6e6c-4b33-8de0-130631078906","name":"Create Business - 429 (Too Many Requests)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\r\n    \"name\": \"ACME Corporation\",\r\n    \"description\": \"This is construction company located in the midwest\",\r\n    \"country\": \"USA\",\r\n    \"industry\":  40,\r\n    \"email\": \"acme@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"99-9999999\",\r\n    \"taxPayer_id_type\": \"EIN\",\r\n    \"compliance_inForeignPol\": false,\r\n    \"compliance_takingCharity\": false,\r\n    \"compliance_moneyTransmitter\": false,\r\n    \"compliance_thirdPartyTxs\": false,\r\n    \"compliance_onlineGambling\": false,\r\n    \"compliance_ownATMs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses"},"status":"Too Many Requests","code":429,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"207"},{"key":"ETag","value":"W/\"cf-SBMJYZC0baOYixuCH3t66gGvwX0\""},{"key":"X-Response-Time","value":"383.562ms"},{"key":"Date","value":"Tue, 14 Jan 2025 04:50:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 429,\n        \"reason\": \"Rate Limit Exceeded\",\n        \"description\": \"Duplicate request detected within 1-minute window.\"\n    },\n    \"timestamp\": \"2025-01-14T04:50:50Z\"\n}"}],"_postman_id":"cddd0640-3846-4e99-a4d8-c07cd72d3697"},{"name":"List Businesses","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"a628ba8d-b789-435c-9d37-d36401add107","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"{{baseURL}}/businesses","description":"<h3 id=\"list-businesses\"><strong>List Businesses</strong></h3>\n<p>Retrieves a list of businesses associated with the authenticated client.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /businesses</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches a list of businesses linked to the authenticated client. The response includes essential business details such as business ID, name, status, industry, country, and creation date.</p>\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Client authentication failed.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"70a48556-8a95-4952-b10f-972026d70988","name":"List Businesses - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"{{baseURL}}/businesses"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1140"},{"key":"ETag","value":"W/\"474-IzztBIlEHpTz4GjeUpLz7+r54eI\""},{"key":"X-Response-Time","value":"566.088ms"},{"key":"Date","value":"Tue, 14 Jan 2025 14:40:57 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"business_id\": \"BID250114045037-ELRZR862RL\",\n            \"status\": \"NEW\",\n            \"name\": \"ACME Corporation\",\n            \"DBA\": null,\n            \"description\": \"This is construction company located in the midwest\",\n            \"taxPayer_id\": \"99-9999999\",\n            \"taxPayer_id_type\": \"EIN\",\n            \"yearsInOperation\": null,\n            \"numberOfEmployees\": null,\n            \"estimatedYearlyRevenue\": null,\n            \"email\": \"acme@acme.com\",\n            \"website\": null,\n            \"country\": \"USA\",\n            \"compliance_inForeignPol\": false,\n            \"compliance_takingCharity\": false,\n            \"compliance_moneyTransmitter\": false,\n            \"compliance_thirdPartyTxs\": false,\n            \"compliance_onlineGambling\": false,\n            \"compliance_ownATMs\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-13T23:48:43.000Z\",\n            \"updatedAt\": \"2025-01-14T04:50:37.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\n            \"industry\": 40,\n            \"phone\": 19,\n            \"main_address\": 21,\n            \"mailing_address\": 22\n        }\n    ],\n    \"url\": \"/businesses\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-14T14:40:57Z\"\n}"}],"_postman_id":"a628ba8d-b789-435c-9d37-d36401add107"},{"name":"Get Business Details","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"56724a51-5a4f-4c69-8085-e60ffea50aaf","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL","description":"<h2 id=\"get-business-details\"><strong>Get Business Details</strong></h2>\n<p>Retrieves the details of a specific business by its <code>business_id</code>, including customer information, industry, phone, and addresses.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /businesses/:business_id</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches a <strong>single business</strong> record with full details, including linked customer information, industry, phone, and addresses. The business must belong to the authenticated <code>client_id</code>.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>business_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique business identifier.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Client authentication failed.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The business does not exist or does not belong to the client.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses","BID250114045037-ELRZR862RL"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"c34c2e42-7692-4ba6-92ef-718165405c93","name":"Get Business Details - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2815"},{"key":"ETag","value":"W/\"aff-fk50YEyGSmaEIVPszDkZQFSaBs4\""},{"key":"X-Response-Time","value":"562.021ms"},{"key":"Date","value":"Tue, 14 Jan 2025 14:42:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"business_id\": \"BID250114045037-ELRZR862RL\",\n        \"status\": \"NEW\",\n        \"name\": \"ACME Corporation\",\n        \"DBA\": null,\n        \"description\": \"This is construction company located in the midwest\",\n        \"taxPayer_id\": \"99-9999999\",\n        \"taxPayer_id_type\": \"EIN\",\n        \"yearsInOperation\": null,\n        \"numberOfEmployees\": null,\n        \"estimatedYearlyRevenue\": null,\n        \"email\": \"acme@acme.com\",\n        \"website\": null,\n        \"country\": \"USA\",\n        \"compliance_inForeignPol\": false,\n        \"compliance_takingCharity\": false,\n        \"compliance_moneyTransmitter\": false,\n        \"compliance_thirdPartyTxs\": false,\n        \"compliance_onlineGambling\": false,\n        \"compliance_ownATMs\": false,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-13T23:48:43.000Z\",\n        \"updatedAt\": \"2025-01-14T04:50:37.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\n            \"status\": \"ACT\",\n            \"firstName\": \"Anna2\",\n            \"middleName\": null,\n            \"lastName\": \"Smith\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"annera.smith@example.com\",\n            \"DOB\": \"1998-03-28T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"600-10-1111\",\n            \"taxPayer_id_type\": \"TFN\",\n            \"primaryCitizenship\": \"AUS\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": false,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-03T01:07:06.000Z\",\n            \"updatedAt\": \"2025-01-11T21:49:17.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 16,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 15,\n            \"mailing_address\": 16\n        },\n        \"industry\": {\n            \"id\": 40,\n            \"name\": \"Agriculture\"\n        },\n        \"phone\": {\n            \"id\": 19,\n            \"number\": \"1188771234\",\n            \"countryCode\": \"61\",\n            \"country\": \"AUS\",\n            \"type\": \"M\",\n            \"createdAt\": \"2025-01-13T23:50:36.000Z\"\n        },\n        \"main_address\": {\n            \"id\": 21,\n            \"addressLine1\": \"42 Wallaby Way\",\n            \"addressLine2\": null,\n            \"cityLocale\": \"Sydney\",\n            \"stateRegion\": \"NSW\",\n            \"postalCode\": \"2000\",\n            \"createdAt\": \"2025-01-13T23:50:36.000Z\",\n            \"updatedAt\": \"2025-01-14T04:50:37.000Z\",\n            \"country\": \"AUS\"\n        },\n        \"mailing_address\": {\n            \"id\": 22,\n            \"addressLine1\": \"42 Wallaby Way\",\n            \"addressLine2\": null,\n            \"cityLocale\": \"Sydney\",\n            \"stateRegion\": \"NSW\",\n            \"postalCode\": \"2000\",\n            \"createdAt\": \"2025-01-13T23:50:37.000Z\",\n            \"updatedAt\": \"2025-01-14T04:50:37.000Z\",\n            \"country\": \"AUS\"\n        }\n    },\n    \"url\": \"/businesses/BID250114045037-ELRZR862RL\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-14T14:42:21Z\"\n}"}],"_postman_id":"56724a51-5a4f-4c69-8085-e60ffea50aaf"},{"name":"Update Business","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"e9ea025e-682a-4e69-84e3-ab98b559ad2d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"ACME Corporation LLC.\",\r\n    \"industry\":  41,\r\n    \"email\": \"acmecllc@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"8005554445\",\r\n        \"countryCode\": \"1\",\r\n        \"country\": \"USA\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"1125 Burn Rate\",\r\n        \"cityLocale\": \"Kansas City\",\r\n        \"stateRegion\": \"KY\",\r\n        \"postalCode\": \"66063\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"compliance_thirdPartyTxs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL","description":"<h2 id=\"update-business\"><strong>Update Business</strong></h2>\n<p>The <strong>Update Business</strong> API allows clients to update details of an existing business associated with a customer. Certain fields such as <code>business_id</code>, <code>customer_id</code>, <code>client_id</code>, <code>createdAt</code>, and <code>updatedAt</code> <strong>cannot be modified</strong>.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>PUT /businesses/:business_id</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API updates the details of a specific business associated with a customer. The request must include the <code>business_id</code> in the URL path. The business must exist and belong to the authenticated <code>client_id</code>.</p>\n<hr />\n<h3 id=\"restricted-fields-cannot-be-updated\"><strong>Restricted Fields (Cannot Be Updated)</strong></h3>\n<p>The following fields <strong>CANNOT</strong> be updated via this API:</p>\n<ul>\n<li><p><code>business_id</code></p>\n</li>\n<li><p><code>customer_id</code></p>\n</li>\n<li><p><code>client_id</code></p>\n</li>\n<li><p><code>createdAt</code></p>\n</li>\n<li><p><code>updatedAt</code></p>\n</li>\n</ul>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>business_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique ID of the business to be updated.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"optional-updatable-fields\"><strong>Optional Updatable Fields</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>status</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated status of the business (e.g., <code>NEW</code>, <code>ACT</code>, <code>PND</code>).</td>\n</tr>\n<tr>\n<td><strong>name</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated legal name of the business.</td>\n</tr>\n<tr>\n<td><strong>DBA</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated \"Doing Business As\" name.</td>\n</tr>\n<tr>\n<td><strong>description</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated description of the business.</td>\n</tr>\n<tr>\n<td><strong>taxPayer_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated taxpayer identification number. Must match the format of the selected <code>taxPayer_id_type</code>.</td>\n</tr>\n<tr>\n<td><strong>taxPayer_id_type</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated taxpayer ID type. See allowed values below.</td>\n</tr>\n<tr>\n<td><strong>industry</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The updated industry ID. Must be a valid ID from the industries list.</td>\n</tr>\n<tr>\n<td><strong>yearsInOperation</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated number of years the business has been in operation.</td>\n</tr>\n<tr>\n<td><strong>numberOfEmployees</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated number of employees in the business.</td>\n</tr>\n<tr>\n<td><strong>estimatedYearlyRevenue</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated estimated yearly revenue of the business.</td>\n</tr>\n<tr>\n<td><strong>phone</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The updated phone details. See format below.</td>\n</tr>\n<tr>\n<td><strong>email</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated business email.</td>\n</tr>\n<tr>\n<td><strong>website</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated website URL.</td>\n</tr>\n<tr>\n<td><strong>main_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The updated main business address. See format below.</td>\n</tr>\n<tr>\n<td><strong>mailing_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The updated mailing business address. See format below.</td>\n</tr>\n<tr>\n<td><strong>country</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The updated country of operation (ISO3 format).</td>\n</tr>\n<tr>\n<td><strong>compliance_inForeignPol</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business operates in foreign politics.</td>\n</tr>\n<tr>\n<td><strong>compliance_takingCharity</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business accepts charitable donations.</td>\n</tr>\n<tr>\n<td><strong>compliance_moneyTransmitter</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business operates as a money transmitter.</td>\n</tr>\n<tr>\n<td><strong>compliance_thirdPartyTxs</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business processes third-party transactions.</td>\n</tr>\n<tr>\n<td><strong>compliance_onlineGambling</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business is involved in online gambling.</td>\n</tr>\n<tr>\n<td><strong>compliance_ownATMs</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Whether the business owns ATMs.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"phone-object-format\"><strong>Phone Object Format</strong></h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"number\": \"18005551234\",\n  \"countryCode\": \"+1\",\n  \"country\": \"USA\",\n  \"type\": \"M\"\n}\n\n</code></pre>\n<h3 id=\"address-object-format\"><strong>Address Object Format</strong></h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"456 Corporate Ave\",\n  \"addressLine2\": \"Suite 101\",\n  \"cityLocale\": \"Los Angeles\",\n  \"stateRegion\": \"CA\",\n  \"postalCode\": \"90001\",\n  \"country\": \"USA\"\n}\n\n</code></pre>\n<h3 id=\"allowed-taxpayer-id-types\"><strong>Allowed Taxpayer ID Types</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Expected Format</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>SSN</strong></td>\n<td>XXX-XX-XXXX</td>\n</tr>\n<tr>\n<td><strong>EIN</strong></td>\n<td>XX-XXXXXXX</td>\n</tr>\n<tr>\n<td><strong>ITIN</strong></td>\n<td>9XX-XX-XXXX</td>\n</tr>\n<tr>\n<td><strong>NINO</strong></td>\n<td>XX999999X</td>\n</tr>\n<tr>\n<td><strong>GSTIN</strong></td>\n<td>15 Alphanumeric Characters</td>\n</tr>\n<tr>\n<td><strong>ABN</strong></td>\n<td>11 Digits</td>\n</tr>\n<tr>\n<td><strong>PAN</strong></td>\n<td>XXXXX9999X</td>\n</tr>\n<tr>\n<td><strong>NIF</strong></td>\n<td>X9999999T</td>\n</tr>\n<tr>\n<td><strong>CPF</strong></td>\n<td>XXX.XXX.XXX-XX</td>\n</tr>\n<tr>\n<td><strong>CNPJ</strong></td>\n<td>XX.XXX.XXX/0001-XX</td>\n</tr>\n<tr>\n<td><strong>TIN</strong></td>\n<td>No format restriction</td>\n</tr>\n<tr>\n<td><strong>ETIN</strong></td>\n<td>No format restriction</td>\n</tr>\n<tr>\n<td><strong>OTHER</strong></td>\n<td>No format restriction</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"allowed-industry-ids\"><strong>Allowed Industry IDs</strong></h3>\n<p>Refer to the <strong>industry list</strong> used in the <code>Create Business</code> API for the valid industry IDs.</p>\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>taxPayer_id</code> must match the expected format for the provided <code>taxPayer_id_type</code>.</p>\n</li>\n<li><p><code>industry</code> must be a valid industry ID from the list.</p>\n</li>\n<li><p><code>phone</code> must be a valid phone object.</p>\n</li>\n<li><p><code>main_address</code> and <code>mailing_address</code>, if provided, must follow the required address structure.</p>\n</li>\n<li><p><code>country</code> must be in <strong>ISO 3166-1 alpha-3</strong> format (e.g., <code>USA</code>, <code>GBR</code>, <code>IND</code>).</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>The request contains invalid or improperly formatted data.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>The request is missing required parameters.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Restricted Update</td>\n<td>Attempted to update restricted fields (<code>business_id</code>, <code>customer_id</code>, etc.).</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The business ID does not exist or does not belong to this client.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses","BID250114045037-ELRZR862RL"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"ca30fd2a-9b01-46e3-aeee-ea935b2a603a","name":"Update Business - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"ACME Corporation Limited\",\r\n    \"description\": \"This is construction company located in the midwest. Kansas native.\",\r\n    \"country\": \"USA\",\r\n    \"industry\":  40,\r\n    \"email\": \"acmecorpk@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"8005554444\",\r\n        \"countryCode\": \"1\",\r\n        \"country\": \"USA\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"1125 Burn Rate\",\r\n        \"cityLocale\": \"Kansas City\",\r\n        \"stateRegion\": \"KY\",\r\n        \"postalCode\": \"66063\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"taxPayer_id\": \"99-9999999\",\r\n    \"taxPayer_id_type\": \"EIN\",\r\n    \"compliance_inForeignPol\": false,\r\n    \"compliance_takingCharity\": false,\r\n    \"compliance_moneyTransmitter\": false,\r\n    \"compliance_thirdPartyTxs\": false,\r\n    \"compliance_onlineGambling\": false,\r\n    \"compliance_ownATMs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1204"},{"key":"ETag","value":"W/\"4b4-P4JQNx2r+zZqIMKUIZ1QOlzwOWE\""},{"key":"X-Response-Time","value":"1702.147ms"},{"key":"Date","value":"Tue, 14 Jan 2025 16:09:52 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"business_id\": \"BID250114045037-ELRZR862RL\",\n        \"status\": \"NEW\",\n        \"name\": \"ACME Corporation Limited\",\n        \"DBA\": null,\n        \"description\": \"This is construction company located in the midwest. Kansas native.\",\n        \"taxPayer_id\": \"YWVzLTI1Ni1nY20kJGRlZmF1bHQ=$wvuE52sTii6LbFuW$J7ofg3VbS69EC3D9$55ExnJ8ZK4e1KKn8RLHFmA\",\n        \"taxPayer_id_type\": \"EIN\",\n        \"yearsInOperation\": null,\n        \"numberOfEmployees\": null,\n        \"estimatedYearlyRevenue\": null,\n        \"email\": \"acmecorpk@acme.com\",\n        \"website\": null,\n        \"country\": \"USA\",\n        \"compliance_inForeignPol\": false,\n        \"compliance_takingCharity\": false,\n        \"compliance_moneyTransmitter\": false,\n        \"compliance_thirdPartyTxs\": false,\n        \"compliance_onlineGambling\": false,\n        \"compliance_ownATMs\": false,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-13T23:48:43.000Z\",\n        \"updatedAt\": \"2025-01-14T16:09:52.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\n        \"industry\": 40,\n        \"phone\": 20,\n        \"main_address\": 23,\n        \"mailing_address\": 22\n    },\n    \"status\": 202,\n    \"url\": \"/businesses/BID250114045037-ELRZR862RL\",\n    \"description\": \"Business details successfully updated.\"\n}"},{"id":"d148f682-5f0f-42a2-8911-40625ad3bb19","name":"Update Business - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103061236-6AT5DW-KSGN24\",\r\n    \"name\": \"ACME Corporation\",\r\n    \"description\": \"This is construction company located in the midwest\",\r\n    \"country\": \"USA\",\r\n    \"industry\":  40,\r\n    \"email\": \"acme@acme.com\",\r\n    \"phone\": {\r\n        \"number\": \"1188771234\",\r\n        \"countryCode\": \"61\",\r\n        \"country\": \"AUS\",\r\n        \"type\": \"M\"\r\n    },\r\n     \"main_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"mailing_address\": {\r\n        \"addressLine1\": \"42 Wallaby Way\",\r\n        \"cityLocale\": \"Sydney\",\r\n        \"stateRegion\": \"NSW\",\r\n        \"postalCode\": \"2000\",\r\n        \"country\": \"AUS\"\r\n    },\r\n    \"taxPayer_id\": \"99-9999999\",\r\n    \"taxPayer_id_type\": \"EIN\",\r\n    \"compliance_inForeignPol\": false,\r\n    \"compliance_takingCharity\": false,\r\n    \"compliance_moneyTransmitter\": false,\r\n    \"compliance_thirdPartyTxs\": false,\r\n    \"compliance_onlineGambling\": false,\r\n    \"compliance_ownATMs\": false\r\n}\r\n","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"184"},{"key":"ETag","value":"W/\"b8-FQBrjXL5evsnuPklGiEp1Gva6kw\""},{"key":"X-Response-Time","value":"577.477ms"},{"key":"Date","value":"Tue, 14 Jan 2025 15:59:38 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Validation Error\",\n        \"description\": \"customer_id cannot be updated.\"\n    },\n    \"timestamp\": \"2025-01-14T15:59:38Z\"\n}"}],"_postman_id":"e9ea025e-682a-4e69-84e3-ab98b559ad2d"},{"name":"Remove Business","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"3f5b5bb8-5aa1-4a1f-bf4a-daff459ea243","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"Remove this business as a test. Part 2.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL","description":"<h2 id=\"remove-business\"><strong>Remove Business</strong></h2>\n<p>The <strong>Remove Business</strong> API allows a client to soft-delete a business associated with a customer. The business remains in the system but is marked as deleted (<code>isDeleted: true</code>), preventing further transactions or updates.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>DELETE /businesses/:business_id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API is used to <strong>remove a business</strong> by setting its <code>isDeleted</code> field to <code>true</code>. It does not permanently delete the business from the database. A removed business can be reinstated using the <strong>Reinstate Business</strong> API.</p>\n<p>A history record of the removal action will be stored in the <code>BusinessesHistory</code> model.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>business_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique identifier of the business to be removed.</td>\n</tr>\n<tr>\n<td><strong>notes</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>A reason for removing the business.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p>The <code>business_id</code> <strong>must exist</strong> and <strong>belong to the authenticated client</strong>.</p>\n</li>\n<li><p>The <code>business</code> <strong>must not already be deleted</strong>.</p>\n</li>\n<li><p>The <code>notes</code> field is <strong>required</strong> and provides context for the removal.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>The <code>notes</code> field is required.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The <code>business_id</code> does not exist or is already deleted.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses","BID250114045037-ELRZR862RL"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"bbe1f84e-0f4a-4e96-814a-2c53185c0ab8","name":"Update Business - 204 (No Content)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"Remove this business as a test.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL"},"status":"No Content","code":204,"_postman_previewlanguage":"plain","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"ETag","value":"W/\"c1-/tJ2sb+mrVmn1sYTG6+tnz0ICaM\""},{"key":"X-Response-Time","value":"1264.823ms"},{"key":"Date","value":"Wed, 15 Jan 2025 02:59:43 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":null},{"id":"2fb09237-315b-4be9-9984-d48ca78d0799","name":"Remove Business - 400 (Bad Request)","originalRequest":{"method":"DELETE","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"188"},{"key":"ETag","value":"W/\"bc-f/8l3+aGWLwk5oyeWdQb4toHZYg\""},{"key":"X-Response-Time","value":"379.078ms"},{"key":"Date","value":"Wed, 15 Jan 2025 02:57:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"The notes field is required.\"\n    },\n    \"timestamp\": \"2025-01-15T02:57:17Z\"\n}"}],"_postman_id":"3f5b5bb8-5aa1-4a1f-bf4a-daff459ea243"},{"name":"Reinstate Business","event":[{"listen":"prerequest","script":{"id":"30bcc030-aa83-45d9-a67f-ea56aed760e8","exec":["// Use CryptoJS for HMAC and hashing operations\r","const CryptoJS = require('crypto-js');\r","\r","// Retrieve environment variables\r","const apiKey = pm.environment.get('MBAPI-KEY');\r","const apiSecret = pm.environment.get('MBAPI-SECRET');\r","\r","// Generate a random 32-character string\r","const generateRandomString = () => {\r","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\r","    let randomString = '';\r","    for (let i = 0; i < 32; i++) {\r","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));\r","    }\r","    return randomString;\r","};\r","\r","// Generate a nonce\r","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds\r","const randomString = generateRandomString();\r","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;\r","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);\r","\r","// Extract only the path from the full URL\r","const method = pm.request.method.toUpperCase();\r","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)\r","// Include the body only for methods that support it\r","let body = '';\r","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {\r","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified\r","}\r","\r","// Construct the string to sign\r","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;\r","\r","// Generate the HMAC signature\r","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);\r","\r","// Set headers\r","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });\r","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });\r","pm.request.headers.add({ key: 'mbapi-signature', value: signature });\r","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });\r","\r","// Log details for debugging (optional)\r","// console.log('HMAC Authentication Details:', {\r","//     apiKey,\r","//     timestamp,\r","//     randomString,\r","//     nonce,\r","//     stringToSign,\r","//     signature\r","// });\r","\r","// console.log('String to Sign (Postman):', stringToSign);\r","// console.log('String to Sign Length (Postman):', stringToSign.length);\r",""],"type":"text/javascript","packages":{}}}],"id":"9b55f3a0-623b-4bac-a641-b0d76c901187","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"I am reinstating this business because it is needed again.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL/reinstate","description":"<h2 id=\"reinstate-business\"><strong>Reinstate Business</strong></h2>\n<p>The <strong>Reinstate Business</strong> API allows a client to restore a previously removed business by setting its <code>isDeleted</code> field back to <code>false</code>.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>PATCH /businesses/:business_id/reinstate</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API <strong>reactivates a previously removed business</strong>, allowing it to be used for transactions and other operations. A history record of the reinstatement action will be stored in the <code>BusinessesHistory</code> model.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>business_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique identifier of the business to be reinstated.</td>\n</tr>\n<tr>\n<td><strong>notes</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>A reason for reinstating the business.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>The <code>notes</code> field is required.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The <code>business_id</code> does not exist or is not in a deleted state.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["businesses","BID250114045037-ELRZR862RL","reinstate"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"c4a2889c-459f-4b7b-96e9-943b6020014e","name":"Reinstate Business - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"I am reinstating this business because it is needed again.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL/reinstate"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"206"},{"key":"ETag","value":"W/\"ce-1Jprpv1hdR2lTuDDv3Jl6ZbS3x4\""},{"key":"X-Response-Time","value":"1280.421ms"},{"key":"Date","value":"Wed, 15 Jan 2025 03:06:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"message\": \"Business reinstated successfully.\"\n    },\n    \"url\": \"/businesses/BID250114045037-ELRZR862RL/reinstate\",\n    \"status\": 202,\n    \"timestamp\": \"2025-01-15T03:06:07Z\"\n}"},{"id":"36172e9e-5ec0-441c-8acd-f0f4a3a8929e","name":"Reinstate Business - 404 (Not Found)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"I am reinstating this business because it is needed again.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/businesses/BID250114045037-ELRZR862RL/reinstate"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"230"},{"key":"ETag","value":"W/\"e6-zGuoAnFDLsIMOU7Z4fNu8mVPtJw\""},{"key":"X-Response-Time","value":"545.638ms"},{"key":"Date","value":"Wed, 15 Jan 2025 03:06:34 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 404,\n        \"reason\": \"Not Found\",\n        \"description\": \"Business with id BID250114045037-ELRZR862RL not found or is not in a deleted state.\"\n    },\n    \"timestamp\": \"2025-01-15T03:06:34Z\"\n}"}],"_postman_id":"9b55f3a0-623b-4bac-a641-b0d76c901187"}],"id":"8965993c-b01f-4321-8d03-accc17dfc24f","_postman_id":"8965993c-b01f-4321-8d03-accc17dfc24f","description":""},{"name":"Accounts","item":[{"name":"Request Account","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"43cc9643-d4a5-410f-afb7-cbd8fd118739","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"CSAV\",\r\n    \"category\": \"C\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts","description":"<h2 id=\"request-account\"><strong>Request Account</strong></h2>\n<p>The Request Account API allows clients to create a new financial account for a customer. The account is initially set to <strong>Pending (PND)</strong> status, requiring approval by a bank administrator before activation. Each request must specify the account type, category, and currency.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>POST</strong> <code>/accounts/request</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to request the creation of a new account. The system will generate a unique account number based on the account type and ensure that duplicate pending requests for the same customer and account type are not allowed.</p>\n<p>Upon successful creation, the account is logged in the account history with an action of <strong>\"REQUESTED\"</strong> and the default origin as <strong>\"API\"</strong>.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>customer_id</strong> (in body) – The unique identifier of the customer for whom the account is being created.</p>\n</li>\n<li><p><strong>account_type</strong> (in body) – The type of account being requested.</p>\n</li>\n<li><p><strong>category</strong> (in body) – The category of the account, either <strong>B</strong> (Business) or <strong>C</strong> (Consumer/Personal).</p>\n</li>\n<li><p><strong>currency</strong> (in body) – The currency type of the account. Accepted values: <strong>USD, GBP, EUR</strong>.</p>\n</li>\n</ul>\n<h4 id=\"account-types\"><strong>Account Types</strong></h4>\n<ul>\n<li><p><strong>Business Accounts:</strong></p>\n<ul>\n<li><p>BDCA – Business Custody</p>\n</li>\n<li><p>BDDA – Business DDA</p>\n</li>\n<li><p>BSAV – Business Savings</p>\n</li>\n<li><p>BCOD – Business CD</p>\n</li>\n<li><p>BLON – Business Loan</p>\n</li>\n</ul>\n</li>\n<li><p><strong>Consumer Accounts:</strong></p>\n<ul>\n<li><p>CDCA – Consumer Custody</p>\n</li>\n<li><p>CDDA – Consumer DDA</p>\n</li>\n<li><p>CSAV – Consumer Savings</p>\n</li>\n<li><p>CCOD – Consumer CD</p>\n</li>\n<li><p>CLON – Consumer Loan</p>\n</li>\n<li><p>CNOW – Consumer NOW</p>\n</li>\n</ul>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p><strong>customer_id, account_type, category, and currency</strong> are required fields.</p>\n</li>\n<li><p>The <strong>account_type</strong> must match the <strong>category</strong>:</p>\n<ul>\n<li><p><strong>Business (B)</strong> can only request <strong>BDCA, BDDA, BSAV, BCOD, BLON</strong>.</p>\n</li>\n<li><p><strong>Consumer (C)</strong> can only request <strong>CDCA, CDDA, CSAV, CCOD, CLON, CNOW</strong>.</p>\n</li>\n</ul>\n</li>\n<li><p>The <strong>currency</strong> must be one of <strong>USD, GBP, EUR</strong>.</p>\n</li>\n<li><p>A customer cannot request multiple accounts of the same <strong>account_type</strong> if there is already a <strong>pending (PND)</strong> request for that account type.</p>\n</li>\n<li><p>The system ensures the generated <strong>account number</strong> is unique.</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"d60adc5e-a4cd-470e-9963-e596b620d02a","name":"Request Account - 200 (Request Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"619"},{"key":"ETag","value":"W/\"26b-5CxIvdLBf/7CEfuFJGwH765eJH0\""},{"key":"X-Response-Time","value":"1222.228ms"},{"key":"Date","value":"Sat, 04 Jan 2025 19:23:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"account_id\": 2,\n        \"account_no\": \"2175544749318837\",\n        \"account_type\": \"BDDA\",\n        \"category\": \"B\",\n        \"status\": \"PND\",\n        \"description\": \"BDDA\",\n        \"nickname\": null,\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"isDeleted\": false,\n        \"openedAt\": null,\n        \"closedAt\": null,\n        \"closedReason\": null,\n        \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n        \"updatedAt\": \"2025-01-04T19:23:06.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n        \"currency\": \"USD\"\n    },\n    \"status\": 201,\n    \"timestamp\": \"2025-01-04T19:23:06Z\"\n}"},{"id":"2d1afd92-e9df-4548-9d7c-a402fc6d7775","name":"Request Account - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID123456ABCD\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/accounts"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"207"},{"key":"ETag","value":"W/\"cf-uQEzUw/EF2yTe1ydNSgD3wu5+o0\""},{"key":"X-Response-Time","value":"405.938ms"},{"key":"Date","value":"Sat, 04 Jan 2025 18:52:22 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"Missing required fields: account_type, category\"\n    },\n    \"timestamp\": \"2025-01-04T18:52:22Z\"\n}"}],"_postman_id":"43cc9643-d4a5-410f-afb7-cbd8fd118739"},{"name":"List Accounts","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"c2220737-9930-47ef-acf1-2809529c10d6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts","description":"<h2 id=\"list-accounts\"><strong>List Accounts</strong></h2>\n<p>The List Accounts API allows clients to retrieve all accounts associated with their client ID. This API supports filtering, sorting, and pagination to efficiently retrieve account data.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>GET</strong> <code>/accounts</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to retrieve a list of accounts linked to their client ID. It supports optional query parameters for sorting, filtering, and pagination.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<p>None</p>\n<h4 id=\"optional-parameters\"><strong>Optional Parameters</strong></h4>\n<ul>\n<li><p><strong>sort</strong> (in query) – Specifies sorting of results in the format <code>{field}:{direction}</code>. Allowed fields: <code>account_no</code>, <code>account_type</code>, <code>category</code>, <code>status</code>, <code>createdAt</code>. Direction can be <code>ASC</code> or <code>DESC</code>.</p>\n</li>\n<li><p><strong>limit</strong> (in query) – Defines the number of records to return per page. Default is <code>50</code>.</p>\n</li>\n<li><p><strong>page</strong> (in query) – Specifies the page number of results. Default is <code>1</code>.</p>\n</li>\n<li><p><strong>filter</strong> (in query) – Allows filtering of results based on account attributes.</p>\n</li>\n</ul>\n<h4 id=\"response-fields\"><strong>Response Fields</strong></h4>\n<ul>\n<li><p><strong>total</strong> – The total number of accounts available.</p>\n</li>\n<li><p><strong>data</strong> – An array of account objects.</p>\n</li>\n<li><p><strong>url</strong> – The requested URL.</p>\n</li>\n<li><p><strong>next</strong> – The URL for the next page of results (if applicable).</p>\n</li>\n<li><p><strong>status</strong> – The HTTP status code.</p>\n</li>\n<li><p><strong>timestamp</strong> – The timestamp when the response was generated.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <code>sort</code> parameter must be in the format <code>{field}:{direction}</code> and use only allowed fields.</p>\n</li>\n<li><p>The <code>limit</code> parameter must be a positive integer.</p>\n</li>\n<li><p>The <code>page</code> parameter must be a positive integer.</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"60bac00c-0179-4588-b9ad-4aa751bd5141","name":"Request Account - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"703"},{"key":"ETag","value":"W/\"2bf-/o28IsLfCogTQ0UU/x/vz9z+hYA\""},{"key":"X-Response-Time","value":"767.749ms"},{"key":"Date","value":"Sat, 04 Jan 2025 20:21:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"account_id\": 2,\n            \"account_no\": \"2175544749318837\",\n            \"account_type\": \"BDDA\",\n            \"category\": \"B\",\n            \"status\": \"PND\",\n            \"description\": \"BDDA\",\n            \"nickname\": null,\n            \"balance\": 0,\n            \"balance_available\": 0,\n            \"isDeleted\": false,\n            \"openedAt\": null,\n            \"closedAt\": null,\n            \"closedReason\": null,\n            \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n            \"updatedAt\": \"2025-01-04T19:23:06.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\"\n        }\n    ],\n    \"url\": \"/accounts\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-04T20:21:48Z\",\n    \"total\": 1\n}"},{"id":"7d2f142d-d389-4dd6-a29b-dc5eda7a279e","name":"Request Account - 200 (No Data)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"703"},{"key":"ETag","value":"W/\"2bf-/o28IsLfCogTQ0UU/x/vz9z+hYA\""},{"key":"X-Response-Time","value":"767.749ms"},{"key":"Date","value":"Sat, 04 Jan 2025 20:21:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [],\n    \"url\": \"/accounts\",\n    \"status\": 200,\n    \"timestamp\": \"2022-01-01 13:15:40\",\n    \"total\": 0\n}"}],"_postman_id":"c2220737-9930-47ef-acf1-2809529c10d6"},{"name":"Get Account Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"052e4da0-ff12-4ec3-acf3-d30972a58403","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts/2","description":"<h2 id=\"get-account-details\"><strong>Get Account Details</strong></h2>\n<p>The Get Account Details API allows clients to retrieve full details for a specific account, including account history.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>GET</strong> <code>/accounts/:account_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to fetch all details of a specific account using the <code>account_id</code>. It includes associated data such as currency details and account history.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>account_id</strong> (in path) – The unique identifier of the account to retrieve.</li>\n</ul>\n<h4 id=\"response-fields\"><strong>Response Fields</strong></h4>\n<ul>\n<li><p><strong>account_id</strong> – The unique identifier of the account.</p>\n</li>\n<li><p><strong>client_id</strong> – The client to which the account belongs.</p>\n</li>\n<li><p><strong>customer_id</strong> – The customer associated with the account.</p>\n</li>\n<li><p><strong>account_no</strong> – The account number.</p>\n</li>\n<li><p><strong>account_type</strong> – The type of the account.</p>\n</li>\n<li><p><strong>category</strong> – Whether the account is Business (<code>B</code>) or Consumer (<code>C</code>).</p>\n</li>\n<li><p><strong>status</strong> – The current status of the account.</p>\n</li>\n<li><p><strong>description</strong> – The description of the account type.</p>\n</li>\n<li><p><strong>currency</strong> – The currency type of the account.</p>\n</li>\n<li><p><strong>balance</strong> – The current account balance.</p>\n</li>\n<li><p><strong>balance_available</strong> – The available balance for transactions.</p>\n</li>\n<li><p><strong>openedAt</strong> – The date the account was opened.</p>\n</li>\n<li><p><strong>closedAt</strong> – The date the account was closed (if applicable).</p>\n</li>\n<li><p><strong>account_history</strong> – A list of recorded actions and changes associated with the account.</p>\n</li>\n<li><p><strong>createdAt</strong> – The timestamp of account creation.</p>\n</li>\n<li><p><strong>updatedAt</strong> – The last update timestamp.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <code>account_id</code> must exist and belong to the requesting client.</p>\n</li>\n<li><p>The account must not be marked as deleted (<code>isDeleted = false</code>).</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts","2"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"24795e12-aecf-4506-9718-3c3edaafaab2","name":"Get Account Details - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1730"},{"key":"ETag","value":"W/\"6c2-Q/3oaDRFH7k5hlE/AkDDm+5a844\""},{"key":"X-Response-Time","value":"576.350ms"},{"key":"Date","value":"Sat, 04 Jan 2025 20:24:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"account_id\": 2,\n        \"account_no\": \"2175544749318837\",\n        \"account_type\": \"BDDA\",\n        \"category\": \"B\",\n        \"status\": \"PND\",\n        \"description\": \"BDDA\",\n        \"nickname\": null,\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"isDeleted\": false,\n        \"openedAt\": null,\n        \"closedAt\": null,\n        \"closedReason\": null,\n        \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n        \"updatedAt\": \"2025-01-04T19:23:06.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"PND\",\n            \"firstName\": \"John\",\n            \"middleName\": null,\n            \"lastName\": \"Doe\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"john.doe@example.com\",\n            \"DOB\": \"1990-05-22T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"400-20-1112\",\n            \"taxPayer_id_type\": \"SSN\",\n            \"primaryCitizenship\": \"GBR\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": true,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-02T20:36:58.000Z\",\n            \"updatedAt\": \"2025-01-03T01:40:42.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 12,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 7,\n            \"mailing_address\": 8\n        },\n        \"currency\": {\n            \"code\": \"USD\",\n            \"symbol\": \"$\",\n            \"name\": \"US Dollar\",\n            \"symbol_native\": \"$\",\n            \"decimal_digits\": 2,\n            \"rounding\": 0,\n            \"name_plural\": \"US dollars\"\n        }\n    },\n    \"url\": \"/accounts/2\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-04T20:24:50Z\"\n}"},{"id":"4fd7136c-9194-404b-bd4d-6480c0e958ad","name":"Get Account Details - 200 (With Account History)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2885"},{"key":"ETag","value":"W/\"b45-zyxS/M2ZjKcmHU77VlSWEesHsYg\""},{"key":"X-Response-Time","value":"755.394ms"},{"key":"Date","value":"Sat, 04 Jan 2025 21:52:16 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"account_id\": 2,\n        \"account_no\": \"2175544749318837\",\n        \"account_type\": \"BDDA\",\n        \"category\": \"B\",\n        \"status\": \"ACT\",\n        \"description\": \"BDDA\",\n        \"nickname\": null,\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"isDeleted\": false,\n        \"openedAt\": null,\n        \"closedAt\": null,\n        \"closedReason\": null,\n        \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n        \"updatedAt\": \"2025-01-04T21:48:55.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"PND\",\n            \"firstName\": \"John\",\n            \"middleName\": null,\n            \"lastName\": \"Doe\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"john.doe@example.com\",\n            \"DOB\": \"1990-05-22T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"400-20-1112\",\n            \"taxPayer_id_type\": \"SSN\",\n            \"primaryCitizenship\": \"GBR\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": true,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-02T20:36:58.000Z\",\n            \"updatedAt\": \"2025-01-03T01:40:42.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 12,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 7,\n            \"mailing_address\": 8\n        },\n        \"currency\": {\n            \"code\": \"USD\",\n            \"symbol\": \"$\",\n            \"name\": \"US Dollar\",\n            \"symbol_native\": \"$\",\n            \"decimal_digits\": 2,\n            \"rounding\": 0,\n            \"name_plural\": \"US dollars\"\n        },\n        \"history\": [\n            {\n                \"id\": 3,\n                \"action\": \"REACTIVATED\",\n                \"notes\": \"This account is being re-opened. It passed checks.\",\n                \"origin\": \"API\",\n                \"origin_id\": \"CLID2412310510476RFCR3\",\n                \"createdAt\": \"2025-01-04T21:48:56.000Z\",\n                \"account_id\": 2,\n                \"client_id\": \"CLID2412310510476RFCR3\",\n                \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\"\n            },\n            {\n                \"id\": 2,\n                \"action\": \"FROZEN\",\n                \"notes\": \"This account is being frozen due to weird account behavior\",\n                \"origin\": \"API\",\n                \"origin_id\": \"CLID2412310510476RFCR3\",\n                \"createdAt\": \"2025-01-04T21:48:15.000Z\",\n                \"account_id\": 2,\n                \"client_id\": \"CLID2412310510476RFCR3\",\n                \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\"\n            },\n            {\n                \"id\": 1,\n                \"action\": \"REQUESTED\",\n                \"notes\": \"Account request created\",\n                \"origin\": \"API\",\n                \"origin_id\": \"CLID2412310510476RFCR3\",\n                \"createdAt\": \"2025-01-04T19:23:06.000Z\",\n                \"account_id\": 2,\n                \"client_id\": \"CLID2412310510476RFCR3\",\n                \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\"\n            }\n        ]\n    },\n    \"url\": \"/accounts/2\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-04T21:52:16Z\"\n}"}],"_postman_id":"052e4da0-ff12-4ec3-acf3-d30972a58403"},{"name":"Get Account Balance","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"affccaa7-2637-48d2-a430-f54c09c16199","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts/2/getBalance","description":"<h2 id=\"get-account-details\"><strong>Get Account Details</strong></h2>\n<p>The Get Account Details API allows clients to retrieve full details for a specific account, including account history.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>GET</strong> <code>/accounts/:account_id</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to fetch all details of a specific account using the <code>account_id</code>. It includes associated data such as currency details and account history.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><strong>account_id</strong> (in path) – The unique identifier of the account to retrieve.</li>\n</ul>\n<h4 id=\"response-fields\"><strong>Response Fields</strong></h4>\n<ul>\n<li><p><strong>account_id</strong> – The unique identifier of the account.</p>\n</li>\n<li><p><strong>client_id</strong> – The client to which the account belongs.</p>\n</li>\n<li><p><strong>customer_id</strong> – The customer associated with the account.</p>\n</li>\n<li><p><strong>account_no</strong> – The account number.</p>\n</li>\n<li><p><strong>account_type</strong> – The type of the account.</p>\n</li>\n<li><p><strong>category</strong> – Whether the account is Business (<code>B</code>) or Consumer (<code>C</code>).</p>\n</li>\n<li><p><strong>status</strong> – The current status of the account.</p>\n</li>\n<li><p><strong>description</strong> – The description of the account type.</p>\n</li>\n<li><p><strong>currency</strong> – The currency type of the account.</p>\n</li>\n<li><p><strong>balance</strong> – The current account balance.</p>\n</li>\n<li><p><strong>balance_available</strong> – The available balance for transactions.</p>\n</li>\n<li><p><strong>openedAt</strong> – The date the account was opened.</p>\n</li>\n<li><p><strong>closedAt</strong> – The date the account was closed (if applicable).</p>\n</li>\n<li><p><strong>account_history</strong> – A list of recorded actions and changes associated with the account.</p>\n</li>\n<li><p><strong>createdAt</strong> – The timestamp of account creation.</p>\n</li>\n<li><p><strong>updatedAt</strong> – The last update timestamp.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The <code>account_id</code> must exist and belong to the requesting client.</p>\n</li>\n<li><p>The account must not be marked as deleted (<code>isDeleted = false</code>).</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts","2","getBalance"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"358acce1-6b77-4168-bf6d-8255a04d8a35","name":"Get Account Balance - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_type\": \"BDDA\",\r\n    \"category\": \"B\",\r\n    \"currency\": \"USD\"\r\n}"},"url":"{{baseURL}}/accounts/2/getBalance"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"197"},{"key":"ETag","value":"W/\"c5-C5nV+tgCZQcAoHt/4EL+Medpiww\""},{"key":"X-Response-Time","value":"569.820ms"},{"key":"Date","value":"Sat, 04 Jan 2025 22:16:35 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"currency\": \"USD\"\n    },\n    \"url\": \"/accounts/2/getBalance\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-04T22:16:35Z\"\n}"}],"_postman_id":"affccaa7-2637-48d2-a430-f54c09c16199"},{"name":"Deactivate Account","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"558e6061-db00-4297-bfa7-0fba9cab49df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"FRZ\",\r\n    \"notes\": \"This account is being frozen due to weird account behavior\"\r\n}"},"url":"{{baseURL}}/accounts/2/deactivate","description":"<h2 id=\"deactivate-account\"><strong>Deactivate Account</strong></h2>\n<p>The Deactivate Account API allows clients to modify the status of an active account. This API ensures that only accounts in an Active (ACT) state can have their status changed. Pending accounts (PND) must be approved by a bank administrator before they can be modified.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/accounts/:account_id/status</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to change the status of an account for specific scenarios, including freezing, suspending, closing, marking as dormant, locking, and restricting an account. The status update must be accompanied by a reason in the <code>notes</code> field.</p>\n<p>Only accounts in <strong>Active (ACT)</strong> status can be modified via this API.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>account_id</strong> (in path) – The unique identifier of the account to be modified.</p>\n</li>\n<li><p><strong>status</strong> (in body) – The new status to be applied to the account.</p>\n</li>\n<li><p><strong>notes</strong> (in body) – A required description of the reason for the status change.</p>\n</li>\n</ul>\n<h4 id=\"allowed-status-changes\"><strong>Allowed Status Changes</strong></h4>\n<ul>\n<li><p><strong>FRZ (Frozen)</strong> – Account is frozen due to investigation.</p>\n</li>\n<li><p><strong>SUS (Suspended)</strong> – Account is suspended due to issues like missed payments.</p>\n</li>\n<li><p><strong>CLO (Closed)</strong> – Account is permanently closed.</p>\n</li>\n<li><p><strong>DRM (Dormant)</strong> – Account has had no activity for an extended period.</p>\n</li>\n<li><p><strong>LCK (Locked)</strong> – Account is locked due to failed logins or security concerns.</p>\n</li>\n<li><p><strong>RES (Restricted)</strong> – Account has limited functionality due to compliance or legal issues.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>The account must be in an <strong>ACT (Active)</strong> state to change its status.</p>\n</li>\n<li><p>The <code>notes</code> field is required and must contain a reason for the status change.</p>\n</li>\n<li><p>Only the statuses listed above are allowed.</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts","2","deactivate"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"556ca0e6-104a-40fe-897a-6050473829c0","name":"Deactivate Account - 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"status\": \"FRZ\",\r\n    \"notes\": \"This account is being frozen due to weird account behavior\"\r\n}"},"url":"{{baseURL}}/accounts/2/deactivate"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"650"},{"key":"ETag","value":"W/\"28a-p2YjkzTgxdtVCKdqnFWM434Y1co\""},{"key":"X-Response-Time","value":"1327.203ms"},{"key":"Date","value":"Sat, 04 Jan 2025 21:48:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"account_id\": 2,\n        \"account_no\": \"2175544749318837\",\n        \"account_type\": \"BDDA\",\n        \"category\": \"B\",\n        \"status\": \"FRZ\",\n        \"description\": \"BDDA\",\n        \"nickname\": null,\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"isDeleted\": false,\n        \"openedAt\": null,\n        \"closedAt\": null,\n        \"closedReason\": null,\n        \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n        \"updatedAt\": \"2025-01-04T21:48:15.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n        \"currency\": \"USD\"\n    },\n    \"url\": \"/accounts/2/status\",\n    \"status\": 202,\n    \"timestamp\": \"2025-01-04T21:48:15Z\"\n}"},{"id":"7a26fe8a-8be3-49f2-ac8c-026a7e056864","name":"Deactivate Account - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n   \r\n}"},"url":"{{baseURL}}/accounts/2/deactivate"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"197"},{"key":"ETag","value":"W/\"c5-HZQtY/PpikbrQhB3IRqcUvwEBiM\""},{"key":"X-Response-Time","value":"391.212ms"},{"key":"Date","value":"Sat, 04 Jan 2025 20:42:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"Status and notes are required fields.\"\n    },\n    \"timestamp\": \"2025-01-04T20:42:42Z\"\n}"}],"_postman_id":"558e6061-db00-4297-bfa7-0fba9cab49df"},{"name":"Reactivate Account","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"ad518050-5774-46c7-b55d-abab62727d4e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n     \"notes\": \"This account is being re-opened. It passed checks.\"\r\n}"},"url":"{{baseURL}}/accounts/2/reactivate","description":"<h3 id=\"reactivate-account\"><strong>Reactivate Account</strong></h3>\n<p>The Reactivate Account API allows clients to restore a previously deactivated account to Active (ACT) status. This API ensures that only accounts that were <strong>Frozen (FRZ), Suspended (SUS), Dormant (DRM), Locked (LCK), or Restricted (RES)</strong> can be reactivated.</p>\n<h4 id=\"endpoint\"><strong>Endpoint</strong></h4>\n<p><strong>PUT</strong> <code>/accounts/:account_id/reactivate</code></p>\n<h4 id=\"description\"><strong>Description</strong></h4>\n<p>This API enables clients to restore an account's full functionality by reactivating it. Reactivation applies only to accounts that were previously deactivated but <strong>does not apply to accounts in a Closed (CLO) status</strong>.</p>\n<p>The request must include a reason for reactivation in the <code>notes</code> field.</p>\n<h4 id=\"required-parameters\"><strong>Required Parameters</strong></h4>\n<ul>\n<li><p><strong>account_id</strong> (in path) – The unique identifier of the account to be reactivated.</p>\n</li>\n<li><p><strong>notes</strong> (in body) – A required description of the reason for reactivating the account.</p>\n</li>\n</ul>\n<h4 id=\"allowed-status-changes\"><strong>Allowed Status Changes</strong></h4>\n<ul>\n<li><p><strong>FRZ (Frozen) → ACT (Active)</strong> – Account was frozen and is now reactivated.</p>\n</li>\n<li><p><strong>SUS (Suspended) → ACT (Active)</strong> – Account was suspended and is now reactivated.</p>\n</li>\n<li><p><strong>DRM (Dormant) → ACT (Active)</strong> – Account was inactive for an extended period and is now reactivated.</p>\n</li>\n<li><p><strong>LCK (Locked) → ACT (Active)</strong> – Account was locked due to security reasons and is now reactivated.</p>\n</li>\n<li><p><strong>RES (Restricted) → ACT (Active)</strong> – Account had limited functionality and is now reactivated.</p>\n</li>\n</ul>\n<h4 id=\"validation-rules\"><strong>Validation Rules</strong></h4>\n<ul>\n<li><p>Only accounts with a status of <strong>FRZ, SUS, DRM, LCK, or RES</strong> can be reactivated.</p>\n</li>\n<li><p>Accounts in <strong>CLO (Closed)</strong> status cannot be reactivated.</p>\n</li>\n<li><p>The <code>notes</code> field is required and must contain a reason for the reactivation.</p>\n</li>\n</ul>\n","urlObject":{"path":["accounts","2","reactivate"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"11909464-f7ca-4af9-975b-a79327b1b7ce","name":"Reactivate Account 202 (Accepted)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n     \"notes\": \"This account is being re-opened. It passed checks.\"\r\n}"},"url":"{{baseURL}}/accounts/2/reactivate"},"status":"Accepted","code":202,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"654"},{"key":"ETag","value":"W/\"28e-gT9dDurA1P63PRrpk2yBwRR9jKs\""},{"key":"X-Response-Time","value":"1284.128ms"},{"key":"Date","value":"Sat, 04 Jan 2025 21:48:56 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"account_id\": 2,\n        \"account_no\": \"2175544749318837\",\n        \"account_type\": \"BDDA\",\n        \"category\": \"B\",\n        \"status\": \"ACT\",\n        \"description\": \"BDDA\",\n        \"nickname\": null,\n        \"balance\": 0,\n        \"balance_available\": 0,\n        \"isDeleted\": false,\n        \"openedAt\": null,\n        \"closedAt\": null,\n        \"closedReason\": null,\n        \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n        \"updatedAt\": \"2025-01-04T21:48:55.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n        \"currency\": \"USD\"\n    },\n    \"url\": \"/accounts/2/reactivate\",\n    \"status\": 202,\n    \"timestamp\": \"2025-01-04T21:48:56Z\"\n}"},{"id":"f09b3997-6746-41e2-885e-b79eea72a34a","name":"Reactivate Account - 400 (Bad Request)","originalRequest":{"method":"PUT","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"notes\": \"This account is being re-opened. It passed checks.\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseURL}}/accounts/2/reactivate"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"197"},{"key":"ETag","value":"W/\"c5-HZQtY/PpikbrQhB3IRqcUvwEBiM\""},{"key":"X-Response-Time","value":"391.212ms"},{"key":"Date","value":"Sat, 04 Jan 2025 20:42:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"Status and notes are required fields.\"\n    },\n    \"timestamp\": \"2025-01-04T20:42:42Z\"\n}"}],"_postman_id":"ad518050-5774-46c7-b55d-abab62727d4e"}],"id":"f0366760-8df7-4015-980b-f8adf06b820e","description":"<p>We offer a number of different <strong>Account</strong> products (types) when creating an Account:  </p>\n<ul>\n<li><p>Business Accounts</p>\n<ul>\n<li><p>BDDA - Business Direct Deposit Account</p>\n</li>\n<li><p>BSAV - Business Savings Account</p>\n</li>\n<li><p>BNOW - Business NOW Account</p>\n</li>\n<li><p>BDCA - Business Custody Account (Escrow, Trust, FBO)</p>\n</li>\n</ul>\n</li>\n<li><p>Personal Accounts</p>\n<ul>\n<li><p>CDDA - Personal Direct Deposit Account</p>\n</li>\n<li><p>CSAV - Personal Savings Account</p>\n</li>\n<li><p>CNOW - Personal NOW Account</p>\n</li>\n<li><p>CDCA - Personal Custody Account (Escrow, Trust, FBO)</p>\n</li>\n</ul>\n</li>\n</ul>\n","_postman_id":"f0366760-8df7-4015-980b-f8adf06b820e"},{"name":"Send Money","item":[{"name":"Send Wire","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"5e27c99a-54c2-4c4f-8825-5a3edfb0a6e0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 15.55,\r\n    \"currency\": \"USD\",\r\n    \"instruction_code\": \"CRED\",\r\n    \"beneficiary_name\": \"Sam Porter\",\r\n    \"beneficiary_account_number\": \"15489489849\",\r\n    \"beneficiary_address\": {\r\n        \"addressLine1\": \"100 Bank Square\",\r\n        \"addressLine2\": \"Apt 4H\",\r\n        \"cityLocale\": \"Stockholm\",\r\n        \"stateRegion\": \"New York\",\r\n        \"postalCode\": \"10000\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"beneficiary_bank\": \"Bank of China\",\r\n    \"beneficiary_bank_bic_swift\": \"CHZ090343\",\r\n    \"beneficiary_bank_address\": {\r\n        \"addressLine1\": \"Beenie Bank Plaza Squre\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"intermediary_bank\": \"Chase Manahttan Bank\",\r\n    \"intermediary_bank_account\": \"222334456546\",\r\n    \"intermediary_address\": {\r\n        \"addressLine1\": \"Inter Me Ban\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"isUS\": false,\r\n    \"notes\": \"This is a test\"\r\n}"},"url":"{{baseURL}}/funding/withdraw/wire","description":"<h2 id=\"withdraw-wire\"><strong>Withdraw Wire</strong></h2>\n<p>The <strong>Withdraw Wire</strong> API allows clients to initiate a wire transfer from their account to an external beneficiary. This withdrawal follows the SWIFT MT103 format, ensuring compliance with international and domestic wire transfer standards.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>POST /funding/withdraw/wire</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API processes an outgoing wire transfer, deducting funds from the client's account and sending them to a specified beneficiary. The required details differ depending on whether the wire is <strong>domestic (U.S.)</strong> or <strong>international (Non-U.S.)</strong>.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The ID of the account from which the funds will be withdrawn.</td>\n</tr>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The ID of the customer initiating the wire transfer.</td>\n</tr>\n<tr>\n<td><strong>amount</strong></td>\n<td>Body</td>\n<td>Decimal</td>\n<td>The amount to be withdrawn. Must be a number greater than zero.</td>\n</tr>\n<tr>\n<td><strong>currency</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The currency of the wire transfer (e.g., \"USD\").</td>\n</tr>\n<tr>\n<td><strong>instruction_code</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The transaction instruction code. See allowed values below.</td>\n</tr>\n<tr>\n<td><strong>isUS</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Indicates whether the wire is domestic (<code>true</code>) or international (<code>false</code>).</td>\n</tr>\n<tr>\n<td><strong>beneficiary_name</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The full name of the beneficiary.</td>\n</tr>\n<tr>\n<td><strong>beneficiary_account_number</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The account number of the beneficiary.</td>\n</tr>\n<tr>\n<td><strong>beneficiary_bank</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The name of the beneficiary's bank.</td>\n</tr>\n<tr>\n<td><strong>beneficiary_bank_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The address of the beneficiary's bank (see structure below).</td>\n</tr>\n<tr>\n<td><strong>beneficiary_bank_bic_swift</strong> or <strong>beneficiary_bank_routing_no</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>Either the SWIFT/BIC code or the routing number of the beneficiary's bank is required.</td>\n</tr>\n<tr>\n<td><strong>beneficiary_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The address of the beneficiary (see structure below).</td>\n</tr>\n<tr>\n<td><strong>notes</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The payment notes or remittance information for the wire.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"beneficiary-address-object-format\">Beneficiary Address Object Format</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"123 Main St\",\n  \"addressLine2\": \"Apt 4B\",\n  \"cityLocale\": \"New York\",\n  \"stateRegion\": \"NY\",\n  \"postalCode\": \"10001\",\n  \"country\": \"USA\"\n}\n\n</code></pre>\n<h3 id=\"beneficiary-bank-address-object-format\">Beneficiary Bank Address Object Format</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"456 Bank Ave\",\n  \"addressLine2\": \"Suite 200\",\n  \"cityLocale\": \"Los Angeles\",\n  \"stateRegion\": \"CA\",\n  \"postalCode\": \"90001\",\n  \"country\": \"USA\"\n}\n\n</code></pre>\n<h3 id=\"additional-required-fields-for-international-wires-isus--false\"><strong>Additional Required Fields for International Wires (<strong><strong><code>isUS = false</code></strong></strong>)</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>intermediary_bank</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The name of the intermediary bank handling the transaction.</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank_account</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The account number at the intermediary bank.</td>\n</tr>\n<tr>\n<td><strong>intermediary_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The address of the intermediary bank (see structure below).</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"intermediary-address-object-format\">Intermediary Address Object Format</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"789 Finance Blvd\",\n  \"addressLine2\": \"\",\n  \"cityLocale\": \"London\",\n  \"stateRegion\": \"\",\n  \"postalCode\": \"SW1A 1AA\",\n  \"country\": \"GBR\"\n}\n\n</code></pre>\n<h3 id=\"allowed-values-for-instruction-code-four_block_23\"><strong>Allowed Values for Instruction Code (<strong><strong><code>four_block_23</code></strong></strong>)</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Code</th>\n<th>Meaning</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>CRED</td>\n<td>Payment to be credited to the beneficiary.</td>\n</tr>\n<tr>\n<td>HOLD</td>\n<td>Funds to be held for further instructions.</td>\n</tr>\n<tr>\n<td>PHOB</td>\n<td>Contact ordering bank for further details.</td>\n</tr>\n<tr>\n<td>PHOI</td>\n<td>Contact intermediary bank for further details.</td>\n</tr>\n<tr>\n<td>REPA</td>\n<td>Payment with remittance information.</td>\n</tr>\n<tr>\n<td>SDVA</td>\n<td>Same-day value transfer.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>amount</code> must be a <strong>valid number</strong> and <strong>greater than zero</strong>.</p>\n</li>\n<li><p><code>account_id</code> must exist and have <strong>sufficient balance</strong> for the withdrawal.</p>\n</li>\n<li><p>If <code>isUS = false</code>, <strong>intermediary bank details</strong> (<code>intermediary_bank</code>, <code>intermediary_bank_account</code>, <code>intermediary_address</code>) must be provided.</p>\n</li>\n<li><p>The wire reference (<code>wire_reference</code>) is <strong>automatically generated</strong>.</p>\n</li>\n<li><p>The sender's correspondent (<code>four_block_53</code>) is <strong>predefined</strong>.</p>\n</li>\n<li><p><code>beneficiary_address.country</code>, <code>beneficiary_bank_address.country</code>, and <code>intermediary_address.country</code> (if applicable) <strong>must be in ISO 3166-1 alpha-3 format</strong>.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Amount must be a valid number greater than zero.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>Required fields are missing in the request.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Insufficient Funds</td>\n<td>Account balance is too low for this withdrawal.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Invalid Country Code</td>\n<td>The country must be in ISO3 format.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The account does not exist.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","withdraw","wire"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"3145e2fd-0ca3-42e8-b136-9466200d1174","name":"Create Wire Withdrawal - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 15.55,\r\n    \"currency\": \"USD\",\r\n    \"instruction_code\": \"CRED\",\r\n    \"beneficiary_name\": \"Sam Porter\",\r\n    \"beneficiary_account_number\": \"15489489849\",\r\n    \"beneficiary_address\": {\r\n        \"addressLine1\": \"100 Bank Square\",\r\n        \"addressLine2\": \"Apt 4H\",\r\n        \"cityLocale\": \"Stockholm\",\r\n        \"stateRegion\": \"New York\",\r\n        \"postalCode\": \"10000\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"beneficiary_bank\": \"Bank of China\",\r\n    \"beneficiary_bank_bic_swift\": \"CHZ090343\",\r\n    \"beneficiary_bank_address\": {\r\n        \"addressLine1\": \"Beenie Bank Plaza Squre\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"intermediary_bank\": \"Chase Manahttan Bank\",\r\n    \"intermediary_bank_account\": \"222334456546\",\r\n    \"intermediary_address\": {\r\n        \"addressLine1\": \"Inter Me Ban\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"isUS\": false,\r\n    \"notes\": \"This is a test\"\r\n}"},"url":"{{baseURL}}/funding/withdraw/wire"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1764"},{"key":"ETag","value":"W/\"6e4-Z+xoNdY8xVsJQJZ+0TvHpsEtpd4\""},{"key":"X-Response-Time","value":"1884.048ms"},{"key":"Date","value":"Thu, 09 Jan 2025 21:02:26 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"transaction\": {\n            \"transaction_id\": 14,\n            \"direction\": \"O\",\n            \"type\": \"WYR\",\n            \"account_no\": \"2175544749318837\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"PND\",\n            \"amount\": 15.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Wire Withdrawal - MB7Y8DMMRCBMFRTC\",\n            \"line2\": null,\n            \"trnCode\": \"5448\",\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"settledAt\": null,\n            \"isReversal\": false,\n            \"reversed_tx_id\": null,\n            \"wire\": {\n                \"id\": 14,\n                \"status\": \"PND\",\n                \"direction\": \"O\",\n                \"four_block_20\": \"MB7Y8DMMRCBMFRTC\",\n                \"four_block_23\": \":23:CRED\",\n                \"four_block_32\": \"250109USD15,55\",\n                \"four_block_33\": \"USD15,55\",\n                \"four_block_50\": \"2175544749318837\\nJohn Doe\\n10 Downing Street\\nLondon ENG SW1A 2AA\\nGBR\",\n                \"four_block_53\": \"4500 4500032415 02\\n MEDICI BANK INTERNATIONAL\",\n                \"four_block_56\": \"222334456546\\nChase Manahttan Bank\\nInter Me Ban Suite 5\\nDelwone Delaware 48948\\nUSA\",\n                \"four_block_57\": \"CHZ090343\\nBank of China\\nBeenie Bank Plaza Squre Suite 5\\nDelwone Delaware 48948\\nUSA\",\n                \"four_block_59\": \"15489489849\\nSam Porter\\n100 Bank Square Apt 4H\\nStockholm New York 10000\\nUSA\",\n                \"four_block_70\": \"This is a test\",\n                \"four_block_71A\": \":71A:OUR\",\n                \"createdAt\": \"2025-01-09T15:13:02.000Z\",\n                \"updatedAt\": \"2025-01-09T21:02:26.000Z\"\n            },\n            \"createdAt\": \"2025-01-09T15:13:02.000Z\",\n            \"updatedAt\": \"2025-01-09T21:02:26.000Z\"\n        }\n    },\n    \"url\": \"/funding/withdraw/wire\",\n    \"status\": 201,\n    \"timestamp\": \"2025-01-09T21:02:26Z\"\n}"},{"id":"1875fa90-a53e-4b4c-a4d5-63eba50844af","name":"Create Wire Withdrawal - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 15.55,\r\n    \"currency\": \"USD\",\r\n    \"instruction_code\": \"CRED\",\r\n    \"beneficiary_name\": \"Sam Porter\",\r\n    \"beneficiary_address\": \"100 MOckingbird Lane\",\r\n    \"beneficiary_bank\": \"Medici Bank\",\r\n    \"beneficiary_account_number\": \"15489489849\",\r\n    \"isUS\": true,\r\n    \"notes\": \"This is a test\"\r\n}"},"url":"{{baseURL}}/funding/withdraw/wire"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"204"},{"key":"ETag","value":"W/\"cc-PbbcAn3g5B9ylgzv3orsoi2mO3w\""},{"key":"X-Response-Time","value":"629.154ms"},{"key":"Date","value":"Thu, 09 Jan 2025 18:42:58 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Missing Requirement(s)\",\n        \"description\": \"Missing required fields: beneficiary_address\"\n    },\n    \"timestamp\": \"2025-01-09T18:42:58Z\"\n}"}],"_postman_id":"5e27c99a-54c2-4c4f-8825-5a3edfb0a6e0"},{"name":"Send ACH","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"535f4490-210f-4d77-9e55-455aa7f5d030","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 21.13,\r\n    \"currency\": \"USD\",\r\n    \"ach_reference\": \"ACHrefwer\",\r\n    \"receiver_name\": \"Tom Server\",\r\n    \"receiver_bank\": \"Captial One\",\r\n    \"receiver_address\": {\r\n        \"addressLine1\": \"Beenie Bank Plaza Squre\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"receiver_account_number\": \"789488887\",\r\n    \"receiver_routing_number\": \"01221232\",\r\n    \"ach_type\": \"Signature ACH\",\r\n    \"standard_entry_class\": \"WEB\",\r\n    \"isUS\": true\r\n}"},"url":"{{baseURL}}/funding/withdraw/ach","description":"<h2 id=\"withdraw-ach\"><strong>Withdraw ACH</strong></h2>\n<p>The <strong>Withdraw ACH</strong> API allows clients to initiate an ACH transfer from their account to an external beneficiary. This withdrawal follows the NACHA ACH format and adheres to U.S. and international banking standards.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>POST /funding/withdraw/ach</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API processes an outgoing ACH transfer, deducting funds from the client's account and sending them to a specified beneficiary. The required details differ depending on whether the ACH is <strong>domestic (U.S.)</strong> or <strong>international (Non-U.S.)</strong>.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The ID of the account from which the funds will be withdrawn.</td>\n</tr>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The ID of the customer initiating the ACH transfer.</td>\n</tr>\n<tr>\n<td><strong>amount</strong></td>\n<td>Body</td>\n<td>Decimal</td>\n<td>The amount to be withdrawn. Must be a number greater than zero.</td>\n</tr>\n<tr>\n<td><strong>currency</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The currency of the ACH transfer (e.g., \"USD\").</td>\n</tr>\n<tr>\n<td><strong>ach_reference</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>A unique reference identifier for the ACH transaction.</td>\n</tr>\n<tr>\n<td><strong>ach_type</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>A required business-defined ACH type.</td>\n</tr>\n<tr>\n<td><strong>standard_entry_class</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The NACHA Standard Entry Class (SEC) code. See allowed values below.</td>\n</tr>\n<tr>\n<td><strong>receiver_name</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The full name of the beneficiary.</td>\n</tr>\n<tr>\n<td><strong>receiver_bank</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The name of the beneficiary's bank.</td>\n</tr>\n<tr>\n<td><strong>receiver_routing_number</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The routing number of the beneficiary's bank.</td>\n</tr>\n<tr>\n<td><strong>receiver_account_number</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The account number of the beneficiary.</td>\n</tr>\n<tr>\n<td><strong>isUS</strong></td>\n<td>Body</td>\n<td>Boolean</td>\n<td>Indicates whether the ACH is domestic (<code>true</code>) or international (<code>false</code>).</td>\n</tr>\n<tr>\n<td><strong>notes</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The payment notes or remittance information for the ACH.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"optional-parameters\"><strong>Optional Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>receiver_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The address of the beneficiary (see format below).</td>\n</tr>\n<tr>\n<td><strong>effective_date</strong></td>\n<td>Body</td>\n<td>Date</td>\n<td>The effective date for the ACH transfer.</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The name of the intermediary bank (Required if <code>isUS = false</code>).</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank_account_number</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The account number at the intermediary bank (Required if <code>isUS = false</code>).</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank_bic_swift</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The SWIFT/BIC of the intermediary bank (Required if <code>isUS = false</code> and no routing number is provided).</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank_routing_number</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The routing number of the intermediary bank (Required if <code>isUS = false</code> and no SWIFT/BIC is provided).</td>\n</tr>\n<tr>\n<td><strong>intermediary_bank_address</strong></td>\n<td>Body</td>\n<td>Object</td>\n<td>The address of the intermediary bank (see format below).</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"receiver-address-object-format-optional\"><strong>Receiver Address Object Format (Optional)</strong></h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"123 Beneficiary St\",\n  \"addressLine2\": \"Suite 500\",\n  \"cityLocale\": \"Los Angeles\",\n  \"stateRegion\": \"CA\",\n  \"postalCode\": \"90001\",\n  \"country\": \"USA\"\n}\n\n</code></pre>\n<h3 id=\"intermediary-bank-address-object-format-required-if-isus--false\"><strong>Intermediary Bank Address Object Format (Required if</strong> <strong><code>isUS = false</code>****)</strong></h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"addressLine1\": \"456 Bank Ave\",\n  \"addressLine2\": \"Floor 12\",\n  \"cityLocale\": \"London\",\n  \"stateRegion\": \"\",\n  \"postalCode\": \"SW1A 1AA\",\n  \"country\": \"GBR\"\n}\n</code></pre>\n<h3 id=\"allowed-values-for-standard_entry_class-sec-code\"><strong>Allowed Values for</strong> <strong><code>standard_entry_class</code></strong> <strong>(SEC Code)</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>SEC Code</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>CCD</strong></td>\n<td>Corporate Credit or Debit - Used for business-to-business transactions.</td>\n</tr>\n<tr>\n<td><strong>PPD</strong></td>\n<td>Prearranged Payment and Deposit - Used for consumer transactions (e.g., payroll direct deposits).</td>\n</tr>\n<tr>\n<td><strong>WEB</strong></td>\n<td>Internet-Initiated Entry - Used for consumer transactions initiated online.</td>\n</tr>\n<tr>\n<td><strong>TEL</strong></td>\n<td>Telephone-Initiated Entry - Used for transactions authorized over the phone.</td>\n</tr>\n<tr>\n<td><strong>CTX</strong></td>\n<td>Corporate Trade Exchange - Used for B2B transactions with detailed remittance.</td>\n</tr>\n<tr>\n<td><strong>ARC</strong></td>\n<td>Accounts Receivable Entry - Used for converting mailed checks to ACH transactions.</td>\n</tr>\n<tr>\n<td><strong>BOC</strong></td>\n<td>Back Office Conversion - Used for converting in-person checks into ACH.</td>\n</tr>\n<tr>\n<td><strong>POP</strong></td>\n<td>Point of Purchase Entry - Used when a consumer authorizes an ACH transaction at the point of sale.</td>\n</tr>\n<tr>\n<td><strong>RCK</strong></td>\n<td>Re-Presented Check Entry - Used for representing a bounced check due to insufficient funds.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>amount</code> must be a <strong>valid number</strong> and <strong>greater than zero</strong>.</p>\n</li>\n<li><p><code>account_id</code> must exist and have <strong>sufficient balance</strong> for the withdrawal.</p>\n</li>\n<li><p><code>ach_reference</code> must be <strong>unique</strong>.</p>\n</li>\n<li><p><code>ach_type</code> is <strong>required</strong> but not validated against predefined values.</p>\n</li>\n<li><p><code>standard_entry_class</code> must be a valid <strong>NACHA SEC Code</strong> (see allowed values).</p>\n</li>\n<li><p>If <code>isUS = false</code>, <strong>intermediary bank details</strong> (<code>intermediary_bank</code>, <code>intermediary_bank_account_number</code>, <code>intermediary_bank_address</code>) <strong>must be provided</strong>.</p>\n</li>\n<li><p><code>receiver_address.country</code>, <code>intermediary_bank_address.country</code> (if applicable) <strong>must be in ISO 3166-1 alpha-3 format</strong>.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Amount must be a valid number greater than zero.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>Required fields are missing in the request.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Insufficient Funds</td>\n<td>Account balance is too low for this withdrawal.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Invalid SEC Code</td>\n<td>The provided <code>standard_entry_class</code> is not a valid NACHA SEC Code.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The account does not exist.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"notes\"><strong>Notes</strong></h3>\n<ul>\n<li><p>The <strong>ACH Type (<strong><strong><code>ach_type</code></strong></strong>) is required</strong> but not validated against predefined values.</p>\n</li>\n<li><p>The <strong><code>standard_entry_class</code></strong> <strong>(SEC Code) is validated</strong> against official NACHA SEC Codes.</p>\n</li>\n<li><p><strong>International ACH Transfers (<strong><strong><code>isUS = false</code></strong></strong>) require intermediary bank details</strong>.</p>\n</li>\n</ul>\n","urlObject":{"path":["funding","withdraw","ach"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"349e9fc8-1986-4485-8f0f-e87409fdc989","name":"Create ACH Withdrawal - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 21.13,\r\n    \"currency\": \"USD\",\r\n    \"ach_reference\": \"ACHrefwer\",\r\n    \"receiver_name\": \"Tom Server\",\r\n    \"receiver_bank\": \"Captial One\",\r\n    \"receiver_address\": {\r\n        \"addressLine1\": \"Beenie Bank Plaza Squre\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"receiver_account_number\": \"789488887\",\r\n    \"receiver_routing_number\": \"01221232\",\r\n    \"ach_type\": \"Signature ACH\",\r\n    \"standard_entry_class\": \"WEB\",\r\n    \"isUS\": true\r\n}"},"url":"{{baseURL}}/funding/withdraw/ach"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1915"},{"key":"ETag","value":"W/\"77b-UY1MfAqs4NAsYsujKLWYKGFr/Ow\""},{"key":"X-Response-Time","value":"2512.454ms"},{"key":"Date","value":"Fri, 10 Jan 2025 19:32:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"transaction\": {\n            \"transaction_id\": 20,\n            \"direction\": \"O\",\n            \"type\": \"ACH\",\n            \"account_no\": \"2175544749318837\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"PND\",\n            \"amount\": 21.13,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Withdrawal - ACHrefwer\",\n            \"line2\": null,\n            \"trnCode\": \"6011\",\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"settledAt\": null,\n            \"isReversal\": false,\n            \"reversed_tx_id\": null,\n            \"ach\": {\n                \"id\": 12,\n                \"ach_reference\": \"ACHrefwer\",\n                \"ach_type\": \"Signature \",\n                \"standard_entry_class\": \"WEB\",\n                \"status\": \"PND\",\n                \"direction\": \"O\",\n                \"sender_id\": null,\n                \"sender_name\": \"John Doe\",\n                \"sender_bank\": \"Medici Bank International\",\n                \"sender_routing_number\": \"10000001\",\n                \"sender_account_number\": \"2175544749318837\",\n                \"sender_address\": null,\n                \"receiver_id\": null,\n                \"receiver_name\": \"Tom Server\",\n                \"receiver_bank\": \"Captial One\",\n                \"receiver_routing_number\": \"01221232\",\n                \"receiver_account_number\": \"789488887\",\n                \"receiver_address\": 2,\n                \"intermediary_bank\": null,\n                \"intermediary_bank_account_number\": null,\n                \"intermediary_bank_bic_swift\": null,\n                \"intermediary_bank_routing_number\": null,\n                \"intermediary_bank_address\": null,\n                \"notes\": null,\n                \"effective_date\": null,\n                \"isUS\": true,\n                \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n                \"updatedAt\": \"2025-01-10T19:32:03.000Z\"\n            },\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n            \"updatedAt\": \"2025-01-10T19:32:03.000Z\"\n        }\n    },\n    \"url\": \"/funding/withdraw/ach\",\n    \"status\": 201,\n    \"timestamp\": \"2025-01-10T19:32:03Z\"\n}"},{"id":"b573b86c-e0c4-4aa4-bd0d-efa5e2f6ae77","name":"Create ACH Withdrawal - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 21.13,\r\n    \"currency\": \"USD\",\r\n    \"ach_reference\": \"ACHrefwer\",\r\n    \"receiver_name\": \"Tom Server\",\r\n    \"receiver_bank\": \"Captial One\",\r\n    \"receiver_address\": {\r\n        \"addressLine1\": \"Beenie Bank Plaza Squre\",\r\n        \"addressLine2\": \"Suite 5\",\r\n        \"cityLocale\": \"Delwone\",\r\n        \"stateRegion\": \"Delaware\",\r\n        \"postalCode\": \"48948\",\r\n        \"country\": \"USA\"\r\n    },\r\n    \"receiver_account_number\": \"789488887\",\r\n    \"receiver_routing_number\": \"01221232\",\r\n    \"ach_type\": \"Signature ACH\",\r\n    \"standard_entry_class\": \"WEB\",\r\n    \"isUS\": true\r\n}"},"url":"{{baseURL}}/funding/withdraw/ach"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"182"},{"key":"ETag","value":"W/\"b6-541UbBRVn/8sixu89SWPPBJ6jik\""},{"key":"X-Response-Time","value":"1100.342ms"},{"key":"Date","value":"Fri, 10 Jan 2025 19:32:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Duplicate Entry\",\n        \"description\": \"ACH reference must be unique.\"\n    },\n    \"timestamp\": \"2025-01-10T19:32:28Z\"\n}"}],"_postman_id":"535f4490-210f-4d77-9e55-455aa7f5d030"},{"name":"List Wires","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"99623445-378d-40e5-a782-0c605b5ce170","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/wires","description":"<h2 id=\"list-wires\"><strong>List Wires</strong></h2>\n<p>Retrieves a list of wire transactions with optional filtering parameters.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/wires</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches a list of wire transactions based on optional filters such as status, customer, account, or date range. Only active transactions are returned, and soft-deleted (<code>isDeleted: true</code>) transactions are excluded.</p>\n<hr />\n<h3 id=\"optional-parameters\"><strong>Optional Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>status</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter wires by status (<code>PND</code>, <code>CMP</code>, <code>HLD</code>, etc.).</td>\n</tr>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Retrieve wires for a specific customer.</td>\n</tr>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Query</td>\n<td>Integer</td>\n<td>Retrieve wires for a specific account.</td>\n</tr>\n<tr>\n<td><strong>date_from</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter wires created on or after this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n<tr>\n<td><strong>date_to</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter wires created on or before this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"allowed-values-for-status\"><strong>Allowed Values for</strong> <strong><code>status</code></strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>PND</code></td>\n<td>Pending</td>\n</tr>\n<tr>\n<td><code>CMP</code></td>\n<td>Completed</td>\n</tr>\n<tr>\n<td><code>HLD</code></td>\n<td>On Hold</td>\n</tr>\n<tr>\n<td><code>CXL</code></td>\n<td>Canceled</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>date_from</code> and <code>date_to</code> must be in <code>YYYY-MM-DD</code> format.</p>\n</li>\n<li><p>If both <code>date_from</code> and <code>date_to</code> are provided, <code>date_from</code> must be before or equal to <code>date_to</code>.</p>\n</li>\n</ul>\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid parameters such as date format issues.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No wire transactions found for the provided filters.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","wires"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"8752a7bc-8633-4311-bd5a-512b978acdf7","name":"List Wires - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/wires"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1620"},{"key":"ETag","value":"W/\"654-+DPn8PGsj2CzeWieNGAv1tmEqUg\""},{"key":"X-Response-Time","value":"564.855ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:32:02 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 17,\n            \"status\": \"PND\",\n            \"direction\": \"I\",\n            \"amount\": 1565.55,\n            \"one_block\": \"1:\",\n            \"two_block\": \"2:\",\n            \"three_block\": null,\n            \"four_block_20\": \"wwoeiiowier\",\n            \"four_block_23\": \":23:CRED\",\n            \"four_block_26\": null,\n            \"four_block_32\": \"250112USD1565,55\",\n            \"four_block_33\": \"USD1565,55\",\n            \"four_block_36\": null,\n            \"four_block_50\": \"5548948987\\nFrank Thomas\\n123 Thomas Square Suite 5\\nDelwone Delaware 48948\\nUSA\",\n            \"four_block_52\": \"021222232\\nChase Manahttan Bank\\n934 Xenith Avae Suite 5\\nNew York City NY 11111\\nUSA\",\n            \"four_block_53\": null,\n            \"four_block_54\": null,\n            \"four_block_56\": \"97987898\\nCommerce Bank\\nInter Me Ban Suite 5\\nDelwone Delaware 48948\\nUSA\",\n            \"four_block_57\": \"4500032415\\nMedici Bank International\\n1250 Ponce de Leon Avenue\\nSan Juan, PR 00907\\nPRI\",\n            \"four_block_59\": \"2175544749318837\\nJohn Doe\\n10 Downing Street\\nLondon ENG SW1A 2AA\\nGBR\",\n            \"four_block_70\": null,\n            \"four_block_71A\": \":71A:OUR\",\n            \"four_block_71F\": null,\n            \"four_block_71G\": null,\n            \"four_block_72\": null,\n            \"four_block_77B\": null,\n            \"notes\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n            \"updatedAt\": \"2025-01-12T20:27:15.000Z\",\n            \"transaction_id\": 45,\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\"\n        }\n    ],\n    \"url\": \"/funding/wires\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:32:02Z\"\n}"}],"_postman_id":"99623445-378d-40e5-a782-0c605b5ce170"},{"name":"Get Wire Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"dcc8d77c-81c5-41a3-a5ea-b02a34326285","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/wires/17","description":"<h2 id=\"get-wire-details\"><strong>Get Wire Details</strong></h2>\n<p>Retrieves detailed information about a specific wire transaction.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/wires/:wire_id</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches detailed wire transaction data, including populated account, customer, and transaction details.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>wire_id</strong></td>\n<td>Path</td>\n<td>Integer</td>\n<td>Unique identifier of the wire transaction.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid <code>wire_id</code> format.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No wire transaction found for the provided <code>wire_id</code>.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","wires","17"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"0b4c66fb-59b3-4383-b63d-5be0a5e86d9c","name":"Get Wire Details - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/wires/17"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"3801"},{"key":"ETag","value":"W/\"ed9-m+Ub2PsL/8j6pp5IgDTp8Mg3QlI\""},{"key":"X-Response-Time","value":"558.077ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:32:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 17,\n        \"status\": \"PND\",\n        \"direction\": \"I\",\n        \"amount\": 1565.55,\n        \"one_block\": \"1:\",\n        \"two_block\": \"2:\",\n        \"three_block\": null,\n        \"four_block_20\": \"wwoeiiowier\",\n        \"four_block_23\": \":23:CRED\",\n        \"four_block_26\": null,\n        \"four_block_32\": \"250112USD1565,55\",\n        \"four_block_33\": \"USD1565,55\",\n        \"four_block_36\": null,\n        \"four_block_50\": \"5548948987\\nFrank Thomas\\n123 Thomas Square Suite 5\\nDelwone Delaware 48948\\nUSA\",\n        \"four_block_52\": \"021222232\\nChase Manahttan Bank\\n934 Xenith Avae Suite 5\\nNew York City NY 11111\\nUSA\",\n        \"four_block_53\": null,\n        \"four_block_54\": null,\n        \"four_block_56\": \"97987898\\nCommerce Bank\\nInter Me Ban Suite 5\\nDelwone Delaware 48948\\nUSA\",\n        \"four_block_57\": \"4500032415\\nMedici Bank International\\n1250 Ponce de Leon Avenue\\nSan Juan, PR 00907\\nPRI\",\n        \"four_block_59\": \"2175544749318837\\nJohn Doe\\n10 Downing Street\\nLondon ENG SW1A 2AA\\nGBR\",\n        \"four_block_70\": null,\n        \"four_block_71A\": \":71A:OUR\",\n        \"four_block_71F\": null,\n        \"four_block_71G\": null,\n        \"four_block_72\": null,\n        \"four_block_77B\": null,\n        \"notes\": null,\n        \"isUS\": true,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n        \"updatedAt\": \"2025-01-12T20:27:15.000Z\",\n        \"transaction_id\": {\n            \"transaction_id\": 45,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"I\",\n            \"type\": \"WYR\",\n            \"status\": \"PND\",\n            \"amount\": 1565.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Wire Deposit - wwoeiiowier\",\n            \"line2\": null,\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n            \"updatedAt\": \"2025-01-12T20:27:14.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"5448\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": 17,\n            \"ach_id\": null\n        },\n        \"account_id\": {\n            \"account_id\": 2,\n            \"account_no\": \"2175544749318837\",\n            \"account_type\": \"BDDA\",\n            \"category\": \"B\",\n            \"status\": \"ACT\",\n            \"description\": \"BDDA\",\n            \"nickname\": null,\n            \"balance\": 4588.35,\n            \"balance_available\": 4588.35,\n            \"isDeleted\": false,\n            \"openedAt\": null,\n            \"closedAt\": null,\n            \"closedReason\": null,\n            \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:11.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\"\n        },\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"ACT\",\n            \"firstName\": \"John\",\n            \"middleName\": null,\n            \"lastName\": \"Doe\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"john.doe@example.com\",\n            \"DOB\": \"1990-05-22T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"400-20-1112\",\n            \"taxPayer_id_type\": \"SSN\",\n            \"primaryCitizenship\": \"GBR\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": true,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-02T20:36:58.000Z\",\n            \"updatedAt\": \"2025-01-11T21:49:17.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 12,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 7,\n            \"mailing_address\": 8\n        },\n        \"currency\": \"USD\"\n    },\n    \"url\": \"/funding/wires/17\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:32:50Z\"\n}"}],"_postman_id":"dcc8d77c-81c5-41a3-a5ea-b02a34326285"},{"name":"List ACHs","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"b3043738-8691-4c5d-b5d8-3702cdb8eb38","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/achs","description":"<h2 id=\"list-achs\"><strong>List ACHs</strong></h2>\n<p>Retrieves a list of ACH transactions with optional filtering parameters.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/achs</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches a list of ACH transactions based on optional filters such as status, customer, account, or date range. Only active transactions are returned, and soft-deleted (<code>isDeleted: true</code>) transactions are excluded.</p>\n<hr />\n<h3 id=\"optional-parameters\"><strong>Optional Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>status</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter ACH transactions by status (<code>PND</code>, <code>CMP</code>, <code>HLD</code>, etc.).</td>\n</tr>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Retrieve ACH transactions for a specific customer.</td>\n</tr>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Query</td>\n<td>Integer</td>\n<td>Retrieve ACH transactions for a specific account.</td>\n</tr>\n<tr>\n<td><strong>date_from</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter ACHs created on or after this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n<tr>\n<td><strong>date_to</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter ACHs created on or before this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"allowed-values-for-status\"><strong>Allowed Values for</strong> <strong><code>status</code></strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>PND</code></td>\n<td>Pending</td>\n</tr>\n<tr>\n<td><code>CMP</code></td>\n<td>Completed</td>\n</tr>\n<tr>\n<td><code>HLD</code></td>\n<td>On Hold</td>\n</tr>\n<tr>\n<td><code>CXL</code></td>\n<td>Canceled</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>date_from</code> and <code>date_to</code> must be in <code>YYYY-MM-DD</code> format.</p>\n</li>\n<li><p>If both <code>date_from</code> and <code>date_to</code> are provided, <code>date_from</code> must be before or equal to <code>date_to</code>.</p>\n</li>\n</ul>\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid parameters such as date format issues.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No ACH transactions found for the provided filters.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","achs"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"11071818-0741-4bed-9fdc-b43bb17c3f5e","name":"List ACHs - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/achs"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2669"},{"key":"ETag","value":"W/\"a6d-0qBA+PMbb9hWLI37I+x0q3W1PU8\""},{"key":"X-Response-Time","value":"548.660ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:33:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 11,\n            \"status\": \"PND\",\n            \"direction\": \"I\",\n            \"amount\": 100.55,\n            \"ach_type\": \"For Deposi\",\n            \"ach_reference\": \"woweieruio\",\n            \"standard_entry_class\": \"CCD\",\n            \"sender_id\": null,\n            \"sender_name\": \"Tom Server\",\n            \"sender_bank\": \"Captial One\",\n            \"sender_routing_number\": \"01221232\",\n            \"sender_account_number\": \"1564848898\",\n            \"receiver_name\": \"John Doe\",\n            \"receiver_id\": null,\n            \"receiver_bank\": \"Medici Bank International\",\n            \"receiver_routing_number\": \"10000001\",\n            \"receiver_account_number\": \"2175544749318837\",\n            \"intermediary_bank\": null,\n            \"intermediary_bank_account_number\": null,\n            \"intermediary_bank_bic_swift\": null,\n            \"intermediary_bank_routing_number\": null,\n            \"effective_date\": \"2024-12-04T00:00:00.000Z\",\n            \"settledAt\": null,\n            \"notes\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T13:30:48.000Z\",\n            \"updatedAt\": \"2025-01-10T18:30:49.000Z\",\n            \"transaction_id\": 19,\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"sender_address\": null,\n            \"receiver_address\": null,\n            \"intermediary_bank_address\": null\n        },\n        {\n            \"id\": 12,\n            \"status\": \"PND\",\n            \"direction\": \"O\",\n            \"amount\": 21.13,\n            \"ach_type\": \"Signature \",\n            \"ach_reference\": \"ACHrefwer\",\n            \"standard_entry_class\": \"WEB\",\n            \"sender_id\": null,\n            \"sender_name\": \"John Doe\",\n            \"sender_bank\": \"Medici Bank International\",\n            \"sender_routing_number\": \"10000001\",\n            \"sender_account_number\": \"2175544749318837\",\n            \"receiver_name\": \"Tom Server\",\n            \"receiver_id\": null,\n            \"receiver_bank\": \"Captial One\",\n            \"receiver_routing_number\": \"01221232\",\n            \"receiver_account_number\": \"789488887\",\n            \"intermediary_bank\": null,\n            \"intermediary_bank_account_number\": null,\n            \"intermediary_bank_bic_swift\": null,\n            \"intermediary_bank_routing_number\": null,\n            \"effective_date\": null,\n            \"settledAt\": null,\n            \"notes\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n            \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n            \"transaction_id\": 20,\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"sender_address\": null,\n            \"receiver_address\": 2,\n            \"intermediary_bank_address\": null\n        }\n    ],\n    \"url\": \"/funding/achs\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:33:36Z\"\n}"}],"_postman_id":"b3043738-8691-4c5d-b5d8-3702cdb8eb38"},{"name":"Get ACH Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"bb8ab25e-c773-4147-9124-e93ed5c601ad","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/achs/12","description":"<h2 id=\"get-ach-details\"><strong>Get ACH Details</strong></h2>\n<p>Retrieves detailed information about a specific ACH transaction.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/achs/:ach_id</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches detailed ACH transaction data, including populated account, customer, and transaction details.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>ach_id</strong></td>\n<td>Path</td>\n<td>Integer</td>\n<td>Unique identifier of the ACH transaction.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid <code>ach_id</code> format.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No ACH transaction found for the provided <code>ach_id</code>.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","achs","12"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"aca14b11-1ba9-4688-9e98-796a8f7ffb46","name":"Get ACH Details","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/achs/12"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"3560"},{"key":"ETag","value":"W/\"de8-WVcYBEDryL6wrlwKQNbvm4aYaSw\""},{"key":"X-Response-Time","value":"556.961ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:34:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 12,\n        \"status\": \"PND\",\n        \"direction\": \"O\",\n        \"amount\": 21.13,\n        \"ach_type\": \"Signature \",\n        \"ach_reference\": \"ACHrefwer\",\n        \"standard_entry_class\": \"WEB\",\n        \"sender_id\": null,\n        \"sender_name\": \"John Doe\",\n        \"sender_bank\": \"Medici Bank International\",\n        \"sender_routing_number\": \"10000001\",\n        \"sender_account_number\": \"2175544749318837\",\n        \"receiver_name\": \"Tom Server\",\n        \"receiver_id\": null,\n        \"receiver_bank\": \"Captial One\",\n        \"receiver_routing_number\": \"01221232\",\n        \"receiver_account_number\": \"789488887\",\n        \"intermediary_bank\": null,\n        \"intermediary_bank_account_number\": null,\n        \"intermediary_bank_bic_swift\": null,\n        \"intermediary_bank_routing_number\": null,\n        \"effective_date\": null,\n        \"settledAt\": null,\n        \"notes\": null,\n        \"isUS\": true,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n        \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n        \"transaction_id\": {\n            \"transaction_id\": 20,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"ACH\",\n            \"status\": \"PND\",\n            \"amount\": 21.13,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Withdrawal - ACHrefwer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n            \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6011\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": 12\n        },\n        \"account_id\": {\n            \"account_id\": 2,\n            \"account_no\": \"2175544749318837\",\n            \"account_type\": \"BDDA\",\n            \"category\": \"B\",\n            \"status\": \"ACT\",\n            \"description\": \"BDDA\",\n            \"nickname\": null,\n            \"balance\": 4588.35,\n            \"balance_available\": 4588.35,\n            \"isDeleted\": false,\n            \"openedAt\": null,\n            \"closedAt\": null,\n            \"closedReason\": null,\n            \"createdAt\": \"2025-01-04T14:22:54.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:11.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\"\n        },\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"ACT\",\n            \"firstName\": \"John\",\n            \"middleName\": null,\n            \"lastName\": \"Doe\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"john.doe@example.com\",\n            \"DOB\": \"1990-05-22T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"400-20-1112\",\n            \"taxPayer_id_type\": \"SSN\",\n            \"primaryCitizenship\": \"GBR\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": true,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-02T20:36:58.000Z\",\n            \"updatedAt\": \"2025-01-11T21:49:17.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 12,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 7,\n            \"mailing_address\": 8\n        },\n        \"currency\": \"USD\",\n        \"sender_address\": null,\n        \"receiver_address\": 2,\n        \"intermediary_bank_address\": null\n    },\n    \"url\": \"/funding/achs/12\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:34:36Z\"\n}"}],"_postman_id":"bb8ab25e-c773-4147-9124-e93ed5c601ad"}],"id":"fd7fdca6-7ee1-45b1-a9e8-cebcd44433f9","_postman_id":"fd7fdca6-7ee1-45b1-a9e8-cebcd44433f9","description":""},{"name":"Transfers","item":[{"name":"Transfer Funds","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"8f3d84fd-5b67-4047-99c9-74310f94b79d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 45.00,\r\n    \"currency\": \"USD\",\r\n    \"sender_account_id\": 2,\r\n    \"receiver_account_id\": 4\r\n}"},"url":"{{baseURL}}/funding/transfer","description":"<h2 id=\"transfer-funds\"><strong>Transfer Funds</strong></h2>\n<p>The <strong>Transfer Funds</strong> API allows clients to move funds between accounts. Transfers are instant and categorized as either <strong>Internal Transfers (INT)</strong> or <strong>Network Transfers (NET)</strong>. This function ensures sufficient balance checks and proper transaction logging.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>POST /funding/transfer</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API facilitates fund transfers between two accounts. The transfer type is determined automatically:</p>\n<ul>\n<li><p><strong>Internal Transfer (INT):</strong> When the sender and receiver belong to the same customer.</p>\n</li>\n<li><p><strong>Network Transfer (NET):</strong> When the transfer is between two different customers.</p>\n</li>\n</ul>\n<p>The system ensures:</p>\n<ul>\n<li><p><strong>Sufficient balance checks</strong> on the sender’s account.</p>\n</li>\n<li><p><strong>Account and customer status validation</strong> to ensure both sender and receiver are active (<code>status = 'ACT'</code>).</p>\n</li>\n<li><p><strong>Instant processing</strong>, meaning transactions are immediately reflected in the system.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>sender_account_id</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The ID of the account from which funds will be debited.</td>\n</tr>\n<tr>\n<td><strong>receiver_account_id</strong></td>\n<td>Body</td>\n<td>Integer</td>\n<td>The ID of the account receiving the funds.</td>\n</tr>\n<tr>\n<td><strong>amount</strong></td>\n<td>Body</td>\n<td>Decimal</td>\n<td>The amount to be transferred. Must be greater than zero.</td>\n</tr>\n<tr>\n<td><strong>currency</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The currency of the transfer (e.g., \"USD\").</td>\n</tr>\n<tr>\n<td><strong>client_id</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The ID of the client initiating the transfer.</td>\n</tr>\n<tr>\n<td><strong>status</strong></td>\n<td>Body</td>\n<td>String</td>\n<td>The status of the transfer (<code>PND</code>, <code>CMP</code>, etc.).</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"determining-transfer-type-transfer_type\"><strong>Determining Transfer Type (</strong><code>transfer_type</code><strong>)</strong></h3>\n<ul>\n<li><p>If <strong>sender and receiver accounts belong to the same customer</strong>, the transfer type is <strong>Internal Transfer (INT)</strong>.</p>\n</li>\n<li><p>If <strong>sender and receiver accounts belong to different customers</strong>, the transfer type is <strong>Network Transfer (NET)</strong>.</p>\n</li>\n</ul>\n<p>The system automatically derives <code>sender_customer_id</code> and <code>receiver_customer_id</code> from the <strong>Accounts</strong> model.</p>\n<hr />\n<h3 id=\"transaction-codes-and-descriptions\"><strong>Transaction Codes and Descriptions</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Transfer Type</th>\n<th>Debit Transaction Code</th>\n<th>Credit Transaction Code</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>Internal Transfer (INT)</strong></td>\n<td><code>6001</code></td>\n<td><code>6000</code></td>\n<td>Move funds between a customer's own accounts.</td>\n</tr>\n<tr>\n<td><strong>Network Transfer (NET)</strong></td>\n<td><code>6003</code></td>\n<td><code>6002</code></td>\n<td>Transfer funds from one customer to another.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>amount</code> must be <strong>a valid number greater than zero</strong>.</p>\n</li>\n<li><p><code>sender_account_id</code> and <code>receiver_account_id</code> <strong>must be different</strong> unless it’s an <strong>Internal Transfer (INT)</strong>.</p>\n</li>\n<li><p>The <strong>sender account must have sufficient funds</strong> to cover the transfer.</p>\n</li>\n<li><p>The <strong>sender and receiver accounts must be active (<strong><strong><code>status = 'ACT'</code></strong></strong>)</strong>.</p>\n</li>\n<li><p>The <strong>sender and receiver customers must also be active (<strong><strong><code>status = 'ACT'</code></strong></strong>)</strong>.</p>\n</li>\n<li><p>The <strong>currency must match both accounts' currency</strong>.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>The request contains invalid or missing parameters.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Insufficient Funds</td>\n<td>The sender’s account does not have enough balance for the transfer.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Account Not Active</td>\n<td>The sender or receiver account is not in <code>ACT</code> status.</td>\n</tr>\n<tr>\n<td><strong>400</strong></td>\n<td>Customer Not Active</td>\n<td>The sender or receiver customer is not in <code>ACT</code> status.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>Either the sender or receiver account does not exist.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the transfer.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","transfer"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"56db6e01-8fae-46c0-95c6-a2ea49c4274e","name":"Transfer Funds - 201 (Created)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 45.00,\r\n    \"currency\": \"USD\",\r\n    \"sender_account_id\": 2,\r\n    \"receiver_account_id\": 4\r\n}"},"url":"{{baseURL}}/funding/transfer"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2577"},{"key":"ETag","value":"W/\"a11-oDvuagwnW27nXfdJyvySEhdp88U\""},{"key":"X-Response-Time","value":"6191.025ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:13:14 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"transfer_id\": \"TRID250112201310-HVCT2YMPDL-A2FLMJUCBN\",\n        \"transfer_type\": \"INT\",\n        \"transferRecord\": {\n            \"id\": 10,\n            \"transfer_id\": \"TRID250112201310-HVCT2YMPDL-A2FLMJUCBN\",\n            \"amount\": 45,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        \"debitTransaction\": {\n            \"transaction_id\": 43,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 45,\n            \"currency\": \"USD\",\n            \"balance_available\": 4588.35,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": \"Outgoing Transfer To: 3115595309991372 From: 2175544749318837\",\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 10,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        \"creditTransaction\": {\n            \"transaction_id\": 44,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 45,\n            \"currency\": \"USD\",\n            \"balance_available\": 511.65,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:14.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 10,\n            \"wire_id\": null,\n            \"ach_id\": null\n        }\n    },\n    \"url\": \"/funding/transfer\",\n    \"status\": 201,\n    \"timestamp\": \"2025-01-12T20:13:14Z\"\n}"},{"id":"31545fba-1ba1-43b2-8aef-33dd76d663c9","name":"Transfer Funds - 400 (Bad Request)","originalRequest":{"method":"POST","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\r\n    \"account_id\": 2,\r\n    \"amount\": 110.55,\r\n    \"currency\": \"USD\",\r\n    \"sender_account_id\": 2,\r\n    \"receiver_account_id\": 4\r\n}"},"url":"{{baseURL}}/funding/transfer"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"212"},{"key":"ETag","value":"W/\"d4-O7K71+Z91zLuoVvanECOa78IaDA\""},{"key":"X-Response-Time","value":"2106.775ms"},{"key":"Date","value":"Sat, 11 Jan 2025 22:00:02 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 400,\n        \"reason\": \"Insufficient Funds\",\n        \"description\": \"Sender account has insufficient funds for this transfer.\"\n    },\n    \"timestamp\": \"2025-01-11T22:00:02Z\"\n}"}],"_postman_id":"8f3d84fd-5b67-4047-99c9-74310f94b79d"},{"name":"List Transfers","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"eb56f951-e44f-48ef-935d-75f852199158","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/transfers","description":"<h2 id=\"list-transfers\"><strong>List Transfers</strong></h2>\n<p>Retrieves a list of transfer transactions with optional filtering parameters.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/transfers</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches a list of transfers based on optional filters such as status, account, or date range. Only active transfers are returned, and soft-deleted (<code>isDeleted: true</code>) transfers are excluded.</p>\n<hr />\n<h3 id=\"optional-parameters\"><strong>Optional Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>status</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transfers by status (<code>PND</code>, <code>CMP</code>, <code>HLD</code>, etc.).</td>\n</tr>\n<tr>\n<td><strong>from_account_id</strong></td>\n<td>Query</td>\n<td>Integer</td>\n<td>Retrieve transfers from a specific sender account.</td>\n</tr>\n<tr>\n<td><strong>to_account_id</strong></td>\n<td>Query</td>\n<td>Integer</td>\n<td>Retrieve transfers to a specific receiver account.</td>\n</tr>\n<tr>\n<td><strong>date_from</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transfers created on or after this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n<tr>\n<td><strong>date_to</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transfers created on or before this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"allowed-values-for-status\"><strong>Allowed Values for</strong> <strong><code>status</code></strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>PND</code></td>\n<td>Pending</td>\n</tr>\n<tr>\n<td><code>CMP</code></td>\n<td>Completed</td>\n</tr>\n<tr>\n<td><code>HLD</code></td>\n<td>On Hold</td>\n</tr>\n<tr>\n<td><code>CXL</code></td>\n<td>Canceled</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>date_from</code> and <code>date_to</code> must be in <code>YYYY-MM-DD</code> format.</p>\n</li>\n<li><p>If both <code>date_from</code> and <code>date_to</code> are provided, <code>date_from</code> must be before or equal to <code>date_to</code>.</p>\n</li>\n</ul>\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid parameters such as date format issues.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transfers found for the provided filters.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","transfers"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"ae005261-1392-4bde-9794-5f5559d7f7b6","name":"List Transfers - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/transfers"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"5632"},{"key":"ETag","value":"W/\"1600-3NgthA4XvptLzR6cxgxS6Ry8vaU\""},{"key":"X-Response-Time","value":"566.384ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:16:08 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": 10,\n            \"transfer_id\": \"TRID250112201310-HVCT2YMPDL-A2FLMJUCBN\",\n            \"amount\": 45,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 9,\n            \"transfer_id\": \"TRID250112201004-LF239UJ2DU-CG8ENDVLG4\",\n            \"amount\": 15,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n            \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 8,\n            \"transfer_id\": \"TRID250112190907-75XE6VL2UY-VS2QTKHLYR\",\n            \"amount\": 5,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n            \"updatedAt\": \"2025-01-12T19:09:10.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 7,\n            \"transfer_id\": \"TRID250112190820-98LKH63TV2-UYYBR5J32A\",\n            \"amount\": 5,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n            \"updatedAt\": \"2025-01-12T19:08:23.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 6,\n            \"transfer_id\": \"TRID250112190302-XA3BADW5RA-VBKSLK295L\",\n            \"amount\": 5,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n            \"updatedAt\": \"2025-01-12T19:03:05.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 5,\n            \"transfer_id\": \"TRID250112185224-QW3MLB8CNR-FLF8WGYXM2\",\n            \"amount\": 5,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n            \"updatedAt\": \"2025-01-12T18:52:27.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 4,\n            \"transfer_id\": \"TRID250112183925-HYVTQ4KFWQ-KAC3N7L7VL\",\n            \"amount\": 110.55,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n            \"updatedAt\": \"2025-01-12T18:39:28.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 3,\n            \"transfer_id\": \"TRID250112183718-XWZ5NJAQ34-VYTBLBSKXG\",\n            \"amount\": 110.55,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n            \"updatedAt\": \"2025-01-12T18:37:21.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        },\n        {\n            \"id\": 2,\n            \"transfer_id\": \"TRID250112183538-JNJ9PUTPGD-YQ5ADCUEQK\",\n            \"amount\": 110.55,\n            \"transfer_type\": \"INT\",\n            \"status\": \"CMP\",\n            \"isReversed\": false,\n            \"notes\": null,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n            \"updatedAt\": \"2025-01-12T18:35:41.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"from_account_id\": \"2\",\n            \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"to_account_id\": \"4\",\n            \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\",\n            \"reversed_transfer_id\": null\n        }\n    ],\n    \"url\": \"/funding/transfers\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:16:08Z\"\n}"}],"_postman_id":"eb56f951-e44f-48ef-935d-75f852199158"},{"name":"Get Transfer Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"1366d21e-8187-4a45-93f5-0d970ff98b5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/transfers/10","description":"<h2 id=\"get-transfer-details\"><strong>Get Transfer Details</strong></h2>\n<p>Retrieves detailed information about a specific transfer transaction.</p>\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /funding/transfers/:transfer_id</code></p>\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API fetches detailed transfer transaction data, including populated account, customer, and transaction details.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>transfer_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>Unique identifier of the transfer transaction.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid <code>transfer_id</code> format.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transfer transaction found for the provided <code>transfer_id</code>.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["funding","transfers","10"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"d9cc14a4-cd22-409f-9cf7-46f1b96de16f","name":"Get Transfer Details - 200 (Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/transfers/10"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"695"},{"key":"ETag","value":"W/\"2b7-iaF1fLaD1timSZhULXh6r8lCJTs\""},{"key":"X-Response-Time","value":"585.420ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:21:17 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"id\": 10,\n        \"transfer_id\": \"TRID250112201310-HVCT2YMPDL-A2FLMJUCBN\",\n        \"amount\": 45,\n        \"transfer_type\": \"INT\",\n        \"status\": \"CMP\",\n        \"isReversed\": false,\n        \"notes\": null,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n        \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"from_account_id\": null,\n        \"from_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n        \"to_account_id\": null,\n        \"to_customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n        \"currency\": \"USD\",\n        \"reversed_transfer_id\": null\n    },\n    \"url\": \"/funding/transfers/10\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-12T20:21:17Z\"\n}"},{"id":"eb9b6ee9-1652-4837-8a60-cde4a5a6b2d6","name":"Get Transfer Details - 404 (Not Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/funding/transfers/10"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"173"},{"key":"ETag","value":"W/\"ad-noZNWFayqJ/YN2g7QQ6dlR1/2/Q\""},{"key":"X-Response-Time","value":"590.240ms"},{"key":"Date","value":"Sun, 12 Jan 2025 20:18:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": false,\n    \"error\": {\n        \"status\": 404,\n        \"reason\": \"Not Found\",\n        \"description\": \"Transfer record not found.\"\n    },\n    \"timestamp\": \"2025-01-12T20:18:07Z\"\n}"}],"_postman_id":"1366d21e-8187-4a45-93f5-0d970ff98b5f"}],"id":"12fdca7e-6fff-4be6-84bf-fb859650b811","_postman_id":"12fdca7e-6fff-4be6-84bf-fb859650b811","description":""},{"name":"Transactions","item":[{"name":"List Transactions","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"25a941ea-6335-46a5-b058-246e9866294f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions","description":"<h2 id=\"list-transactions\"><strong>List Transactions</strong></h2>\n<p>The <strong>List Transactions</strong> API allows clients to retrieve a list of transactions based on optional filters such as account, customer, transaction code, or date range.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /transactions</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API returns a paginated list of transactions. Clients can filter results based on the provided query parameters.</p>\n<hr />\n<h3 id=\"optional-query-parameters\"><strong>Optional Query Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Query</td>\n<td>Integer</td>\n<td>Filter transactions by a specific account.</td>\n</tr>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transactions by a specific customer.</td>\n</tr>\n<tr>\n<td><strong>trnCode</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transactions by transaction code.</td>\n</tr>\n<tr>\n<td><strong>status</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Filter transactions by status (e.g., <code>PND</code>, <code>CMP</code>, <code>HLD</code>).</td>\n</tr>\n<tr>\n<td><strong>date_from</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Retrieve transactions created on or after this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n<tr>\n<td><strong>date_to</strong></td>\n<td>Query</td>\n<td>String</td>\n<td>Retrieve transactions created on or before this date (<code>YYYY-MM-DD</code>).</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"allowed-values-for-status\"><strong>Allowed Values for</strong> <strong><code>status</code></strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>PND</code></td>\n<td>Pending</td>\n</tr>\n<tr>\n<td><code>CMP</code></td>\n<td>Completed</td>\n</tr>\n<tr>\n<td><code>HLD</code></td>\n<td>On Hold</td>\n</tr>\n<tr>\n<td><code>CXL</code></td>\n<td>Canceled</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>date_from</code> and <code>date_to</code> must be in <code>YYYY-MM-DD</code> format.</p>\n</li>\n<li><p>If both <code>date_from</code> and <code>date_to</code> are provided, <code>date_from</code> must be before or equal to <code>date_to</code>.</p>\n</li>\n</ul>\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>One or more query parameters are invalid.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transactions found matching the given criteria.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["transactions"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"0addc840-4bbe-47c1-98f3-d911b96606ee","name":"List Transactions - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"17179"},{"key":"ETag","value":"W/\"431b-4aD3lyMpJS57AEMXGHvOikVdG04\""},{"key":"X-Response-Time","value":"575.488ms"},{"key":"Date","value":"Mon, 13 Jan 2025 02:50:49 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"transaction_id\": 19,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"I\",\n            \"type\": \"ACH\",\n            \"status\": \"PND\",\n            \"amount\": 100.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Deposit - woweieruio\",\n            \"line2\": null,\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T13:29:33.000Z\",\n            \"updatedAt\": \"2025-01-10T18:30:48.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6010\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": 11\n        },\n        {\n            \"transaction_id\": 20,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"ACH\",\n            \"status\": \"PND\",\n            \"amount\": 21.13,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Withdrawal - ACHrefwer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n            \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6011\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": 12\n        },\n        {\n            \"transaction_id\": 27,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n            \"updatedAt\": \"2025-01-12T18:35:40.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 28,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n            \"updatedAt\": \"2025-01-12T18:35:41.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 29,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n            \"updatedAt\": \"2025-01-12T18:37:19.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 30,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n            \"updatedAt\": \"2025-01-12T18:37:20.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 31,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n            \"updatedAt\": \"2025-01-12T18:39:28.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 4,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 32,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n            \"updatedAt\": \"2025-01-12T18:39:29.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 4,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 33,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n            \"updatedAt\": \"2025-01-12T18:52:27.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 5,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 34,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n            \"updatedAt\": \"2025-01-12T18:52:28.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 5,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 35,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n            \"updatedAt\": \"2025-01-12T19:03:05.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 6,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 36,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n            \"updatedAt\": \"2025-01-12T19:03:06.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 6,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 37,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n            \"updatedAt\": \"2025-01-12T19:08:23.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 7,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 38,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n            \"updatedAt\": \"2025-01-12T19:08:24.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 7,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 39,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n            \"updatedAt\": \"2025-01-12T19:09:11.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 8,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 40,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n            \"updatedAt\": \"2025-01-12T19:09:11.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 8,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 41,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 15,\n            \"currency\": \"USD\",\n            \"balance_available\": 4633.35,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n            \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 9,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 42,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 15,\n            \"currency\": \"USD\",\n            \"balance_available\": 466.65,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n            \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 9,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 43,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 45,\n            \"currency\": \"USD\",\n            \"balance_available\": 4588.35,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": \"Outgoing Transfer To: 3115595309991372 From: 2175544749318837\",\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 10,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 44,\n            \"account_no\": \"3115595309991372\",\n            \"direction\": \"I\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 45,\n            \"currency\": \"USD\",\n            \"balance_available\": 511.65,\n            \"description\": \"Incoming Move Funds Transfer\",\n            \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:14.000Z\",\n            \"account_id\": 4,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6000\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 10,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 45,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"I\",\n            \"type\": \"WYR\",\n            \"status\": \"PND\",\n            \"amount\": 1565.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Wire Deposit - wwoeiiowier\",\n            \"line2\": null,\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n            \"updatedAt\": \"2025-01-12T20:27:14.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"5448\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": 17,\n            \"ach_id\": null\n        }\n    ],\n    \"url\": \"/transactions\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-13T02:50:48Z\"\n}"}],"_postman_id":"25a941ea-6335-46a5-b058-246e9866294f"},{"name":"Get Transaction Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"6acbfb68-e2b6-4b1d-b877-0e22b2caa526","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/44","description":"<h2 id=\"get-transaction-details\"><strong>Get Transaction Details</strong></h2>\n<p>The <strong>Get Transaction Details</strong> API allows clients to retrieve detailed information about a specific transaction.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /transactions/:id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API returns detailed information about a specific transaction, including transaction type, customer, and account details.</p>\n<hr />\n<h3 id=\"required-parameter\"><strong>Required Parameter</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>id</strong></td>\n<td>Path</td>\n<td>Integer</td>\n<td>The unique identifier of the transaction.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Validation Error</td>\n<td>Invalid transaction ID format.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transaction found for the provided transaction ID.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["transactions","44"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"ee7cefbe-3e77-4118-9c7e-e7af799ce9b3","name":"Get Transactions Details - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/44"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"2387"},{"key":"ETag","value":"W/\"953-8LDG3oSuYCAtNh4kZChLtP8f4Co\""},{"key":"X-Response-Time","value":"553.565ms"},{"key":"Date","value":"Mon, 13 Jan 2025 02:52:51 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"transaction_id\": 44,\n        \"account_no\": \"3115595309991372\",\n        \"direction\": \"I\",\n        \"type\": \"INT\",\n        \"status\": \"CMP\",\n        \"amount\": 45,\n        \"currency\": \"USD\",\n        \"balance_available\": 511.65,\n        \"description\": \"Incoming Move Funds Transfer\",\n        \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n        \"isCredit\": true,\n        \"isFee\": false,\n        \"isReversal\": false,\n        \"settledAt\": null,\n        \"isUS\": true,\n        \"isDeleted\": false,\n        \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n        \"updatedAt\": \"2025-01-12T20:13:14.000Z\",\n        \"account_id\": {\n            \"account_id\": 4,\n            \"account_no\": \"3115595309991372\",\n            \"account_type\": \"CSAV\",\n            \"category\": \"C\",\n            \"status\": \"ACT\",\n            \"description\": \"CSAV\",\n            \"nickname\": null,\n            \"balance\": 511.65,\n            \"balance_available\": 511.65,\n            \"isDeleted\": false,\n            \"openedAt\": null,\n            \"closedAt\": null,\n            \"closedReason\": null,\n            \"createdAt\": \"2025-01-11T16:23:14.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:12.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"currency\": \"USD\"\n        },\n        \"client_id\": \"CLID2412310510476RFCR3\",\n        \"customer_id\": {\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"status\": \"ACT\",\n            \"firstName\": \"John\",\n            \"middleName\": null,\n            \"lastName\": \"Doe\",\n            \"maidenName\": null,\n            \"suffix\": null,\n            \"nickname\": null,\n            \"email\": \"john.doe@example.com\",\n            \"DOB\": \"1990-05-22T00:00:00.000Z\",\n            \"birthplace\": null,\n            \"nationality\": null,\n            \"occupation\": null,\n            \"taxPayer_id\": \"400-20-1112\",\n            \"taxPayer_id_type\": \"SSN\",\n            \"primaryCitizenship\": \"GBR\",\n            \"secondaryCitizenship\": null,\n            \"isPEP\": true,\n            \"isUS\": false,\n            \"isSeniorPolFig\": false,\n            \"isFamilySeniorPolFig\": false,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-02T20:36:58.000Z\",\n            \"updatedAt\": \"2025-01-11T21:49:17.000Z\",\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"mobile\": 12,\n            \"homePhone\": null,\n            \"workPhone\": null,\n            \"residential_address\": 7,\n            \"mailing_address\": 8\n        },\n        \"trnCode\": \"6000\",\n        \"reversed_tx_id\": null,\n        \"transfer_id\": 10,\n        \"wire_id\": null,\n        \"ach_id\": null\n    },\n    \"url\": \"/transactions/44\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-13T02:52:51Z\"\n}"}],"_postman_id":"6acbfb68-e2b6-4b1d-b877-0e22b2caa526"},{"name":"Get Account Transactions","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"f75588a7-a596-4d83-b672-34f2a0339d0d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/account/2","description":"<h2 id=\"get-account-transactions\"><strong>Get Account Transactions</strong></h2>\n<p>The <strong>Get Account Transactions</strong> API retrieves all transactions for a specific account belonging to the authenticated client.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /transactions/account/:account_id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API allows clients to retrieve all transactions associated with a specific account. Transactions are returned in ascending order based on their creation date.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Path</td>\n<td>Integer</td>\n<td>The ID of the account whose transactions are requested.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>account_id</code> must be provided in the path.</p>\n</li>\n<li><p>The <code>account_id</code> must belong to the authenticated client (<code>client_id</code>).</p>\n</li>\n<li><p>The account must not be deleted (<code>isDeleted: false</code>).</p>\n</li>\n<li><p>If no transactions exist for the given <code>account_id</code>, a <code>404 Not Found</code> response is returned.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>The account_id parameter is required.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transactions found for the specified account.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["transactions","account","2"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"251b8b5e-8a5f-405f-8e95-3c47e01d17e7","name":"Get Account Transactions - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/account/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"9604"},{"key":"ETag","value":"W/\"2584-M7Aj7U1PdEIYa6XKylx+Yw7lOE8\""},{"key":"X-Response-Time","value":"558.890ms"},{"key":"Date","value":"Mon, 13 Jan 2025 15:54:39 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": [\n        {\n            \"transaction_id\": 19,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"I\",\n            \"type\": \"ACH\",\n            \"status\": \"PND\",\n            \"amount\": 100.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Deposit - woweieruio\",\n            \"line2\": null,\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T13:29:33.000Z\",\n            \"updatedAt\": \"2025-01-10T18:30:48.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6010\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": 11\n        },\n        {\n            \"transaction_id\": 20,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"ACH\",\n            \"status\": \"PND\",\n            \"amount\": 21.13,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"ACH Withdrawal - ACHrefwer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n            \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6011\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": 12\n        },\n        {\n            \"transaction_id\": 27,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n            \"updatedAt\": \"2025-01-12T18:35:40.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 29,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n            \"updatedAt\": \"2025-01-12T18:37:19.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 31,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 110.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n            \"updatedAt\": \"2025-01-12T18:39:28.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 4,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 33,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"PND\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n            \"updatedAt\": \"2025-01-12T18:52:27.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 5,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 35,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n            \"updatedAt\": \"2025-01-12T19:03:05.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 6,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 37,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n            \"updatedAt\": \"2025-01-12T19:08:23.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 7,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 39,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 5,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n            \"updatedAt\": \"2025-01-12T19:09:11.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 8,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 41,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 15,\n            \"currency\": \"USD\",\n            \"balance_available\": 4633.35,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": null,\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n            \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 9,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 43,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"O\",\n            \"type\": \"INT\",\n            \"status\": \"CMP\",\n            \"amount\": 45,\n            \"currency\": \"USD\",\n            \"balance_available\": 4588.35,\n            \"description\": \"Outgoing Move Funds Transfer\",\n            \"line2\": \"Outgoing Transfer To: 3115595309991372 From: 2175544749318837\",\n            \"isCredit\": false,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n            \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"6001\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": 10,\n            \"wire_id\": null,\n            \"ach_id\": null\n        },\n        {\n            \"transaction_id\": 45,\n            \"account_no\": \"2175544749318837\",\n            \"direction\": \"I\",\n            \"type\": \"WYR\",\n            \"status\": \"PND\",\n            \"amount\": 1565.55,\n            \"currency\": \"USD\",\n            \"balance_available\": 0,\n            \"description\": \"Wire Deposit - wwoeiiowier\",\n            \"line2\": null,\n            \"isCredit\": true,\n            \"isFee\": false,\n            \"isReversal\": false,\n            \"settledAt\": null,\n            \"isUS\": true,\n            \"isDeleted\": false,\n            \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n            \"updatedAt\": \"2025-01-12T20:27:14.000Z\",\n            \"account_id\": 2,\n            \"client_id\": \"CLID2412310510476RFCR3\",\n            \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n            \"trnCode\": \"5448\",\n            \"reversed_tx_id\": null,\n            \"transfer_id\": null,\n            \"wire_id\": 17,\n            \"ach_id\": null\n        }\n    ],\n    \"url\": \"/transactions/account/2\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-13T15:54:39Z\"\n}"}],"_postman_id":"f75588a7-a596-4d83-b672-34f2a0339d0d"},{"name":"Get Customer Transactions","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"7c61d401-3332-4116-ac96-c293730b9847","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/customer/CID250103014042-RAFVZE-98TWFD","description":"<h2 id=\"get-customer-transactions\"><strong>Get Customer Transactions</strong></h2>\n<p>The <strong>Get Customer Transactions</strong> API retrieves all transactions for a specific customer, grouping them by the customer’s accounts.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /transactions/customer/:customer_id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API allows clients to retrieve all transactions associated with a specific customer. Transactions are <strong>grouped by account</strong> and sorted in <strong>ascending order</strong> by account number. Each account entry includes its <strong>account number, description, balance, and available balance</strong>, followed by its corresponding transactions.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>customer_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The ID of the customer whose transactions are requested.</td>\n</tr>\n</tbody>\n</table>\n</div><hr />\n<h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li><p><code>customer_id</code> must be provided in the path.</p>\n</li>\n<li><p>The <code>customer_id</code> must belong to the authenticated client (<code>client_id</code>).</p>\n</li>\n<li><p>The customer must not be deleted (<code>isDeleted: false</code>).</p>\n</li>\n<li><p>If no transactions exist for the given <code>customer_id</code>, a <code>404 Not Found</code> response is returned.</p>\n</li>\n</ul>\n<hr />\n<h3 id=\"error-handling\"><strong>Error Handling</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Error Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td>The customer_id parameter is required.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>No transactions found for the specified customer.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>A server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["transactions","customer","CID250103014042-RAFVZE-98TWFD"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[{"id":"852a6a59-0d43-4238-894b-fd8025895495","name":"Get Customer Transactions - 200 (Data Found)","originalRequest":{"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/transactions/customer/CID250103014042-RAFVZE-98TWFD"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Frame-Options","value":"DENY"},{"key":"X-Powered-By","value":"Medici Bank International <medici.bank>"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"19928"},{"key":"ETag","value":"W/\"4dd8-3Dy1MRr42lqERJmgnNpvH6QIZbk\""},{"key":"X-Response-Time","value":"768.603ms"},{"key":"Date","value":"Mon, 13 Jan 2025 16:19:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"data\": {\n        \"2\": {\n            \"account_no\": \"2175544749318837\",\n            \"description\": \"BDDA\",\n            \"balance\": 4588.35,\n            \"balance_available\": 4588.35,\n            \"transactions\": [\n                {\n                    \"transaction_id\": 19,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"I\",\n                    \"type\": \"ACH\",\n                    \"status\": \"PND\",\n                    \"amount\": 100.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"ACH Deposit - woweieruio\",\n                    \"line2\": null,\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-10T13:29:33.000Z\",\n                    \"updatedAt\": \"2025-01-10T18:30:48.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6010\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": 11\n                },\n                {\n                    \"transaction_id\": 20,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"ACH\",\n                    \"status\": \"PND\",\n                    \"amount\": 21.13,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"ACH Withdrawal - ACHrefwer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-10T14:30:09.000Z\",\n                    \"updatedAt\": \"2025-01-10T19:32:03.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6011\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": 12\n                },\n                {\n                    \"transaction_id\": 27,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"PND\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:35:40.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 29,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"PND\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:37:19.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 31,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"PND\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:39:28.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 4,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 33,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"PND\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:52:27.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 5,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 35,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:03:05.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 6,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 37,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:08:23.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 7,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 39,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:09:11.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 8,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 41,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 15,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 4633.35,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": null,\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n                    \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 9,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 43,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"O\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 45,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 4588.35,\n                    \"description\": \"Outgoing Move Funds Transfer\",\n                    \"line2\": \"Outgoing Transfer To: 3115595309991372 From: 2175544749318837\",\n                    \"isCredit\": false,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n                    \"updatedAt\": \"2025-01-12T20:13:13.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6001\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 10,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 45,\n                    \"account_no\": \"2175544749318837\",\n                    \"direction\": \"I\",\n                    \"type\": \"WYR\",\n                    \"status\": \"PND\",\n                    \"amount\": 1565.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Wire Deposit - wwoeiiowier\",\n                    \"line2\": null,\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T15:25:44.000Z\",\n                    \"updatedAt\": \"2025-01-12T20:27:14.000Z\",\n                    \"account_id\": 2,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"5448\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": 17,\n                    \"ach_id\": null\n                }\n            ]\n        },\n        \"4\": {\n            \"account_no\": \"3115595309991372\",\n            \"description\": \"CSAV\",\n            \"balance\": 511.65,\n            \"balance_available\": 511.65,\n            \"transactions\": [\n                {\n                    \"transaction_id\": 28,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:35:25.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:35:41.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 30,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:37:10.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:37:20.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": null,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 32,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 110.55,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:38:59.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:39:29.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 4,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 34,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T13:47:43.000Z\",\n                    \"updatedAt\": \"2025-01-12T18:52:28.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 5,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 36,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:02:52.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:03:06.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 6,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 38,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:08:09.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:08:24.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 7,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 40,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 5,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 0,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T14:08:55.000Z\",\n                    \"updatedAt\": \"2025-01-12T19:09:11.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 8,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 42,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 15,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 466.65,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T15:08:06.000Z\",\n                    \"updatedAt\": \"2025-01-12T20:10:07.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 9,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                },\n                {\n                    \"transaction_id\": 44,\n                    \"account_no\": \"3115595309991372\",\n                    \"direction\": \"I\",\n                    \"type\": \"INT\",\n                    \"status\": \"CMP\",\n                    \"amount\": 45,\n                    \"currency\": \"USD\",\n                    \"balance_available\": 511.65,\n                    \"description\": \"Incoming Move Funds Transfer\",\n                    \"line2\": \"Incoming Transfer From: 2175544749318837 To: 3115595309991372\",\n                    \"isCredit\": true,\n                    \"isFee\": false,\n                    \"isReversal\": false,\n                    \"settledAt\": null,\n                    \"isUS\": true,\n                    \"isDeleted\": false,\n                    \"createdAt\": \"2025-01-12T15:12:57.000Z\",\n                    \"updatedAt\": \"2025-01-12T20:13:14.000Z\",\n                    \"account_id\": 4,\n                    \"client_id\": \"CLID2412310510476RFCR3\",\n                    \"customer_id\": \"CID250103014042-RAFVZE-98TWFD\",\n                    \"trnCode\": \"6000\",\n                    \"reversed_tx_id\": null,\n                    \"transfer_id\": 10,\n                    \"wire_id\": null,\n                    \"ach_id\": null\n                }\n            ]\n        }\n    },\n    \"url\": \"/transactions/customer/CID250103014042-RAFVZE-98TWFD\",\n    \"status\": 200,\n    \"timestamp\": \"2025-01-13T16:19:55Z\"\n}"}],"_postman_id":"7c61d401-3332-4116-ac96-c293730b9847"}],"id":"75d9678b-a8f1-4c56-9363-cbd59b04cd66","_postman_id":"75d9678b-a8f1-4c56-9363-cbd59b04cd66","description":""},{"name":"Statements","item":[{"name":"Get Statements","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"ccdeeb3f-4f24-41c3-aea7-5667296c194e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/statements","description":"<h1 id=\"get-statements\"><strong>Get Statements</strong></h1>\n<p>The <strong>Get Statements</strong> API provides a list of statements for an account, grouped by month. Each statement includes the transaction count for that month and a link to access detailed statement information.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /statements/:account_id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API returns a list of monthly statements for a specified account. Each statement contains summary information, including the month, year, transaction count, and a link to access detailed statement data for that period.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique ID of the account to retrieve statements for.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"validation-rules\"><strong>Validation Rules</strong></h3>\n<ul>\n<li>The <code>account_id</code> must exist, be valid, and belong to the client making the API call.</li>\n</ul>\n<h3 id=\"error-responses\"><strong>Error Responses</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td><code>account_id</code> is required in the request path.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The account does not exist or does not belong to the requesting client.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["statements"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"ccdeeb3f-4f24-41c3-aea7-5667296c194e"},{"name":"Get Statement Details","event":[{"listen":"prerequest","script":{"id":"bc84af38-ef2c-4076-961b-8f51ac554a44","exec":["// Use CryptoJS for HMAC and hashing operations","const CryptoJS = require('crypto-js');","","// Retrieve environment variables","const apiKey = pm.environment.get('MBAPI-KEY');","const apiSecret = pm.environment.get('MBAPI-SECRET');","","// Generate a random 32-character string","const generateRandomString = () => {","    const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';","    let randomString = '';","    for (let i = 0; i < 32; i++) {","        randomString += characters.charAt(Math.floor(Math.random() * characters.length));","    }","    return randomString;","};","","// Generate a nonce","const timestamp = Math.floor(Date.now() / 1000); // Unix timestamp in seconds","const randomString = generateRandomString();","const nonceStringToHash = `${apiKey}${timestamp}${randomString}`;","const nonce = CryptoJS.SHA512(nonceStringToHash).toString(CryptoJS.enc.Base64);","","// Extract only the path from the full URL","const method = pm.request.method.toUpperCase();","const rawUrl = pm.request.url.getPath(); // Extracts only the path (e.g., /info)","// Include the body only for methods that support it","let body = '';","if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(method)) {","    body = pm.request.body && pm.request.body.raw ? JSON.stringify(JSON.parse(pm.request.body.raw)) : \"\"; // Ensure body is stringified","}","","// Construct the string to sign","const stringToSign = `${apiKey}${method}${rawUrl}${timestamp}${body}`;","","// Generate the HMAC signature","const signature = CryptoJS.HmacSHA512(stringToSign, apiSecret).toString(CryptoJS.enc.Base64);","","// Set headers","pm.request.headers.add({ key: 'mbapi-key', value: apiKey });","pm.request.headers.add({ key: 'mbapi-timestamp', value: timestamp.toString() });","pm.request.headers.add({ key: 'mbapi-signature', value: signature });","pm.request.headers.add({ key: 'mbapi-nonce', value: nonce });","","// Log details for debugging (optional)","// console.log('HMAC Authentication Details:', {","//     apiKey,","//     timestamp,","//     randomString,","//     nonce,","//     stringToSign,","//     signature","// });","","// console.log('String to Sign (Postman):', stringToSign);","// console.log('String to Sign Length (Postman):', stringToSign.length);",""],"type":"text/javascript","packages":{}}}],"id":"676f2b35-5d85-45e1-ac66-e0b960dd072e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[{"key":"MBAPI-TIMESTAMP","value":"{{MBAPI-TIMESTAMP}}","type":"text"},{"key":"MBAPI-NONCE","value":"{{MBAPI-NONCE}}","type":"text"},{"key":"MBAPI-SIGNATURE","value":"{{MBAPI-SIGNATURE}}","type":"text"},{"key":"MBAPI-KEY","value":"{{MBAPI-KEY}}","type":"text"},{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{baseURL}}/statements","description":"<h1 id=\"get-statement-details\"><strong>Get Statement Details</strong></h1>\n<p>The <strong>Get Statement Details</strong> API provides detailed transaction information and summary statistics for a specific statement month.</p>\n<hr />\n<h3 id=\"endpoint\"><strong>Endpoint</strong></h3>\n<p><code>GET /statements/:account_id/:statement_id</code></p>\n<hr />\n<h3 id=\"description\"><strong>Description</strong></h3>\n<p>This API returns detailed statement information for a specific account and month. The response includes account holder information, account details, transaction data, and summary statistics.</p>\n<hr />\n<h3 id=\"required-parameters\"><strong>Required Parameters</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameter</th>\n<th>Location</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>account_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The unique ID of the account to retrieve the statement for.</td>\n</tr>\n<tr>\n<td><strong>statement_id</strong></td>\n<td>Path</td>\n<td>String</td>\n<td>The ID of the statement to retrieve, formatted as <code>YYYYMM</code>.</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"error-responses\"><strong>Error Responses</strong></h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Status Code</th>\n<th>Reason</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>400</strong></td>\n<td>Missing Requirement(s)</td>\n<td><code>account_id</code> and/or <code>statement_id</code> are required.</td>\n</tr>\n<tr>\n<td><strong>404</strong></td>\n<td>Not Found</td>\n<td>The account or statement does not exist or does not belong to the client.</td>\n</tr>\n<tr>\n<td><strong>500</strong></td>\n<td>Unexpected Error</td>\n<td>An internal server error occurred while processing the request.</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"path":["statements"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"676f2b35-5d85-45e1-ac66-e0b960dd072e"}],"id":"e87e31d0-9016-47cf-b610-94c284b20078","_postman_id":"e87e31d0-9016-47cf-b610-94c284b20078","description":""}],"event":[{"listen":"prerequest","script":{"id":"18cc826b-47ba-49d3-8b66-956e0f6d6587","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"94fc6eb6-3e96-4640-9411-4daf09b64474","type":"text/javascript","exec":[""]}}]}