{"info":{"_postman_id":"cae5807b-5f15-4e3e-9fc3-cf09ab01c214","name":"UPYA APIs","description":"<html><head></head><body><p>This documentation describes all the methods available for programmatically interacting with your Upya database and accessing your Upya platform.</p>\n<p>It is separated in 3 sections:</p>\n<ul>\n<li><p><strong>Upya Manage:</strong> covering the REST APIs for handling your cients, contracts, field operators, web users and a other Upya collections.</p>\n</li>\n<li><p><strong>Webhooks</strong>: covering how to subscribe to events happening to your different Upya collections</p>\n</li>\n<li><p><strong>Upya Payment Gateway:</strong> covering the REST APIs for interacting with Mobile Money Operators and to post payments.</p>\n</li>\n<li><p><strong>Upya Code Gateway:</strong> covering the REST APIs for interacting with physical devices managed by Upya.</p>\n</li>\n</ul>\n<p>The Upya API is an HTTP REST API. The API uses resource-oriented URLs, returns JSON from all requests, and uses standard HTTP response codes.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"9200381","collectionId":"cae5807b-5f15-4e3e-9fc3-cf09ab01c214","publishedId":"VUr1HCpY","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"54e5ce"},"publishDate":"2023-09-01T23:08:34.000Z"},"item":[{"name":"Upya Manage","item":[{"name":"Clients","item":[{"name":"Create clients","id":"45c119ab-01c4-4ed6-8607-91297b379edc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/clients","description":"<p>Endpoint to create a list of new clients by API calls.</p>\n<blockquote>\n<p>\"ClientNumber\" is an optional field in the body but is a mandatory and unique field in the sytem. If you don't specify one, a clientNumber will be automatically generated and assigned to the new client(s). You can select the rule to generate clientNumbers in your Settings (incremental rule, random with a chosen prefix, etc). </p>\n</blockquote>\n<p>See the client schema (in <strong>Schema section</strong>) to see the full list of contact numbers, dates and geographic/administrative fields that you can specify.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>clientNumber</code></td>\n<td>String, optional</td>\n<td>Unique identifier. System generated if not specified.</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String, optional</td>\n<td>Specifies the \"onboarding <strong>status</strong>\" of the client. Will default to \"Pending\" if not specified. Other accepted values are: \"Qualifying\", Approved\", \"Signed\", \"Rejected\", \"Validated</td>\n</tr>\n<tr>\n<td><code>stage</code></td>\n<td>String, optional</td>\n<td>Specifies the \"onboarding <strong>stage.</strong>\" Can take any value, reflecting your own funnel terminology. Values are set in your Setting section</td>\n</tr>\n<tr>\n<td><code>profile.firstName</code></td>\n<td>String, mandatory</td>\n<td>First name</td>\n</tr>\n<tr>\n<td><code>profile.lastName</code></td>\n<td>String, mandatory</td>\n<td>Last name</td>\n</tr>\n<tr>\n<td><code>profile.gender</code></td>\n<td>String, optional</td>\n<td>Gender</td>\n</tr>\n<tr>\n<td><code>profile.village</code></td>\n<td>String, optional</td>\n<td>Client village. Other similar attributes include: city, commune, district, county, region, province, state, country, landmark, address, route, directions, postcode</td>\n</tr>\n<tr>\n<td><code>contact.countryCode</code></td>\n<td>String, optional</td>\n<td>Country code, including the +</td>\n</tr>\n<tr>\n<td><code>contact.mobile</code></td>\n<td>String, optional</td>\n<td>Mobile number excluding country code. Other similar attributes are secondaryMobile, neighourMobile and nextOfKinMobile</td>\n</tr>\n<tr>\n<td><code>contact.email</code></td>\n<td>String, optional</td>\n<td>Email</td>\n</tr>\n<tr>\n<td><code>entryDate</code></td>\n<td>Date, optional</td>\n<td>Date of entry in mobile app</td>\n</tr>\n<tr>\n<td><code>submissionDate</code></td>\n<td>Date, optional</td>\n<td>Date of entry in cloud-based database</td>\n</tr>\n<tr>\n<td><code>creditDecisionDate</code></td>\n<td>Date, optional</td>\n<td>Date of credit decision (approve or reject)</td>\n</tr>\n<tr>\n<td><code>signingDate</code></td>\n<td>Date, optional</td>\n<td>Signing date</td>\n</tr>\n<tr>\n<td><code>lastStageUpdate</code></td>\n<td>Date, optional</td>\n<td>Date of last stage change</td>\n</tr>\n<tr>\n<td><code>lastStatusUpdate</code></td>\n<td>Date, optional</td>\n<td>Date of last status change</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>String, optional</td>\n<td></td>\n</tr>\n<tr>\n<td><code>externalId</code></td>\n<td>String, optional</td>\n<td>Foreign key</td>\n</tr>\n<tr>\n<td><code>respAgent</code></td>\n<td>String, optional</td>\n<td>Unique identifier of app user in charge of client</td>\n</tr>\n<tr>\n<td><code>entityNumber</code></td>\n<td>String, optional</td>\n<td>Unique identifier of entity of new client</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","clients"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"2c893d20-82cc-49c7-9a4f-1302acd4859d","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[{\n    \"clientNumber\": \"C4759813\",\n    \"profile\": {\n        \"firstName\": \"John\",\n        \"lastName\": \"Lennon\",\n        \"gender\": \"Male\",\n        \"gps\": {\n            \"longitude\": \"33.8325807\",\n            \"latitude\": \"-13.1451227\"\n        },\n        \"village\": \"Koko\",\n        \"county\": \"Sc chilooko\",\n        \"district\": \"Ntchisi\",\n        \"region\": \"Central region\",\n        \"country\": \"Malawi\"\n    },\n    \"contact\": {\n        \"countryCode\":\"+265\",\n        \"mobile\": \"123456768\",\n        \"email\": \"john.lennon@gmail.com\"\n    }\n}]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/clients"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sun, 03 Sep 2023 21:57:52 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"400"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"190-Ao6TdW7dheShEasfnRSv92YWrFs\""}],"cookie":[],"responseTime":null,"body":"{\n    \"successes\": [\n        {\n            \"profile\": {\n                \"firstName\": \"John\",\n                \"lastName\": \"Lennon\",\n                \"gender\": \"Male\",\n                \"gps\": {\n                    \"longitude\": \"33.8325807\",\n                    \"latitude\": \"-13.1451227\"\n                },\n                \"village\": \"Koko\",\n                \"county\": \"Sc chilooko\",\n                \"district\": \"Ntchisi\",\n                \"region\": \"Central region\",\n                \"country\": \"Malawi\"\n            },\n            \"clientNumber\": \"C4759813\",\n            \"contact\": {\n                \"countryCode\": \"+265\",\n                \"mobile\": \"123456768\",\n                \"fullNumber\": \"265123456768\",\n                \"email\": \"john.lennon@gmail.com\"\n            }\n        }\n    ],\n    \"errors\": []\n}"},{"id":"ef0e321c-4519-4fb9-b2e6-b09c07110266","name":"error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[{\n    \"clientNumber\": \"C4759813\",\n    \"profile\":{\n        \"lastName\":\"Lennon\"\n    }\n}, {\n\"profile\": {\n        \"village\": \"Koko\",\n        \"county\": \"Sc chilooko\",\n        \"district\": \"Ntchisi\",\n        \"region\": \"Central region\",\n        \"country\": \"Malawi\"\n    }\n}]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/clients"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sun, 03 Sep 2023 22:15:45 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"116"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"74-WbQIUprxsReBbDxJzxFaXCNKisw\""}],"cookie":[],"responseTime":null,"body":"{\n    \"successes\": [],\n    \"errors\": [\n        {\n            \"message\": \"Client C4759813 already in db\"\n        },\n        {\n            \"message\": \"profile.lastName is compulsory\"\n        }\n    ]\n}"}],"_postman_id":"45c119ab-01c4-4ed6-8607-91297b379edc"},{"name":"Search clients","id":"b70193c6-03ac-4b9b-a36a-5ba85e9e2305","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/clients","description":"<p>Endpoint to search your clients collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<blockquote>\n<p><em>Example</em>: to retrieve all clients updated after the 2018 World Cup final, send the following body:</p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"updatedAt\": { \n            \"$gte\": \"5 July 2018\"\n         }\n    }\n}\n\n</code></pre>\n<p>You can also use the following MongoDb options: <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<blockquote>\n<p><em>Example</em>: to get the clientNumbers of the 3 most recently clients send the following request:</p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {},\n    \"limit\": 3,\n    \"select\": \"clientNumber\",\n    \"sort\": \"updatedAt\"\n}\n\n</code></pre>\n<p>Finally, to paginate your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: <em>paginate</em>, <em>pageNumber</em> and <em>nPerPage</em>. The skip option overrides any sort value for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"profile.lastName\": {\"$regex\":\"idane\"}\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","clients"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"62091342-18de-4ae6-9ede-7c2032864d05","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"query\": {\n        \"profile.lastName\": {\n            \"$regex\": \"ennon\"\n        }\n    },\n    \"select\": \"clientNumber profile contact\",\n    \"paginate\": true,\n    \"pageNumber\": 1,\n    \"nPerPage\": 1000\n}","options":{"raw":{"language":"json"}}},"url":"https://api.upya.io/data/search/clients"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sun, 03 Sep 2023 22:35:20 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"965"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"3c5-AMEm/gw43/60N//RIAAzq3q0hBU\""}],"cookie":[],"responseTime":null,"body":"{\n    \"paging\": {\n        \"total\": 2,\n        \"pageNumber\": 1,\n        \"nPerPage\": 1000\n    },\n    \"data\": [\n        {\n            \"profile\": {\n                \"gps\": {\n                    \"longitude\": \"-0.193631\",\n                    \"latitude\": \"51.5135949\"\n                },\n                \"firstName\": \"John\",\n                \"lastName\": \"Lennon\"\n            },\n            \"contact\": {\n                \"countryCode\": \"+265\",\n                \"mobile\": \"677\",\n                \"fullNumber\": \"265677\"\n            },\n            \"contracts\": [\n                {\n                    \"_id\": \"5eb16b2950b48c00112293fe\",\n                    \"deal\": {\n                        \"_id\": \"5eaf0b24dd799f918cbb0f78\",\n                        \"dealName\": \"New\",\n                        \"dealNumber\": \"1622549617920\"\n                    },\n                    \"dealName\": \"New\",\n                    \"contractNumber\": \"68560927\",\n                    \"paygNumber\": \"2200000112\"\n                }\n            ],\n            \"_id\": \"5eb16b2950b48c00112293fd\",\n            \"clientNumber\": \"C68560912\",\n            \"agent\": {\n                \"agentNumber\": \"US020676\"\n            }\n        },\n        {\n            \"profile\": {\n                \"gps\": {\n                    \"longitude\": \"33.8325807\",\n                    \"latitude\": \"-13.1451227\"\n                },\n                \"firstName\": \"John\",\n                \"lastName\": \"Lennon\",\n                \"gender\": \"Male\",\n                \"village\": \"Koko\",\n                \"county\": \"Sc chilooko\",\n                \"district\": \"Ntchisi\",\n                \"region\": \"Central region\",\n                \"country\": \"Malawi\"\n            },\n            \"contact\": {\n                \"countryCode\": \"+265\",\n                \"mobile\": \"123456768\",\n                \"fullNumber\": \"265123456768\",\n                \"email\": \"john.lennon@gmail.com\"\n            },\n            \"contracts\": [],\n            \"_id\": \"64f5016082bcc10019a6d013\",\n            \"clientNumber\": \"C4759813\"\n        }\n    ]\n}"}],"_postman_id":"b70193c6-03ac-4b9b-a36a-5ba85e9e2305"},{"name":"Count clients","id":"2b9a98e2-737c-4d84-878b-00ee6a2d7391","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/count/clients","description":"<p>Endpoint to count the clients matching a given query. Pass through MongoDb-like queries in the body of the request.</p>\n<p>See the \"Search clients\" section for more details.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"query\": {\n        \"updatedAt\": { \n            \"$gte\": \"5 July 2018\",\n            \"$lte\": \"6 July 2018\"\n         }\n    }\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","count","clients"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"37906506-f1c8-4d40-80ab-c9bf13477718","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"clientNumber\": \"<string>\",\n    \"status\": \"<string>\",\n    \"signingDate\": \"<date>\",\n    \"respAgent\": \"<string>\",\n    \"contact\": {\n      \"mobile\": \"<number>\",\n      \"email\": \"<string>\",\n      \"address\": \"<string>\"\n    },\n    \"profile\": {\n      \"firstName\": \"<string>\",\n      \"lastName\": \"<string>\",\n      \"gender\": \"<string>\",\n      \"birthday\": \"<date>\",\n      \"gps\": {\n        \"longitude\": \"<string>\",\n        \"latitude\": \"<string>\"\n      },\n      \"village\": \"<string>\",\n      \"city\": \"<string>\",\n      \"county\": \"<string>\",\n      \"district\": \"<string>\",\n      \"commune\": \"<string>\",\n      \"province\": \"<string>\",\n      \"region\": \"<string>\",\n      \"state\": \"<string>\",\n      \"country\": \"<string>\"\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/count/clients"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"count\": 123,\n  \"status\": \"Success\",\n  \"message\": \"123 clients found to match query\"\n}"}],"_postman_id":"2b9a98e2-737c-4d84-878b-00ee6a2d7391"},{"name":"Get client","id":"238ce951-4eb9-43f5-9885-5639028c4205","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://data.upya.io/data/clients/:clientNumber","description":"<p>Endpoint to retrieve information regarding one client, specified by its clientNumber as a path variable.</p>\n","urlObject":{"protocol":"https","path":["data","clients",":clientNumber"],"host":["data","upya","io"],"query":[],"variable":[{"description":{"content":"<p>Unique identifier of client being fetched</p>\n","type":"text/plain"},"type":"any","value":"","key":"clientNumber"}]}},"response":[{"id":"748fd867-d821-4e9f-a463-01a68aa8e1fc","name":"success","originalRequest":{"method":"GET","header":[],"url":"https://data.upya.io/data/clients/C4759813"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sun, 03 Sep 2023 22:55:48 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"474"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"1da-XxkDNGzhC8bN1lGIMKfir3guw0Q\""}],"cookie":[],"responseTime":null,"body":"{\n    \"client\": {\n        \"profile\": {\n            \"gps\": {\n                \"longitude\": \"33.8325807\",\n                \"latitude\": \"-13.1451227\"\n            },\n            \"firstName\": \"John\",\n            \"lastName\": \"Lennon\",\n            \"gender\": \"Male\",\n            \"village\": \"Koko\",\n            \"county\": \"Sc chilooko\",\n            \"district\": \"Ntchisi\",\n            \"region\": \"Central region\",\n            \"country\": \"Malawi\"\n        },\n        \"contact\": {\n            \"countryCode\": \"+265\",\n            \"mobile\": \"123456768\",\n            \"fullNumber\": \"265123456768\",\n            \"email\": \"john.lennon@gmail.com\"\n        },\n        \"_id\": \"64f5016082bcc10019a6d013\",\n        \"clientNumber\": \"C4759813\",\n        \"entryDate\": \"2023-09-03T21:57:52.500Z\",\n        \"status\": \"Pending\"\n    }\n}"}],"_postman_id":"238ce951-4eb9-43f5-9885-5639028c4205"},{"name":"Edit client","id":"4fc78f35-9ef4-4044-8a62-3864d02a53f1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/clients/:clientNumber","description":"<p>Endpoint to edit an existing client specified by its <code>clientNumber</code> as a path variable.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>firstName</code>, <code>lastName</code>, <code>gender</code>, <code>nickName</code>, <code>middleName</code>, <code>gvtId</code>, ...</td>\n<td>String (optional)</td>\n<td>Any attribute of the <code>client.profile</code> object</td>\n</tr>\n<tr>\n<td><code>mobile</code>, <code>secondaryMobile</code>, <code>email</code>, ...</td>\n<td>String (optional)</td>\n<td>Any attribute of the <code>client.contact</code> object</td>\n</tr>\n<tr>\n<td><code>village</code>, <code>city</code>, <code>route</code>, <code>county</code>, <code>country</code>, <code>province</code>, <code>landmark</code>, ...</td>\n<td>String (optional)</td>\n<td>Any location attribute of the <code>client.profile</code> object</td>\n</tr>\n<tr>\n<td><code>respAgent</code></td>\n<td>String (optional)</td>\n<td>App user in charge of client. Will move the client to the app user's entity.</td>\n</tr>\n<tr>\n<td><code>stage,</code> <code>status,</code> <code>category</code></td>\n<td>String (optional)</td>\n<td>Update the state of the target client</td>\n</tr>\n</tbody>\n</table>\n</div><p>All changes are tracked by a <code>clientEvent</code> and can be listened to using a webhook</p>\n","urlObject":{"protocol":"https","path":["data","clients",":clientNumber"],"host":["data","upya","io"],"query":[],"variable":[{"type":"any","value":"","key":"clientNumber"}]}},"response":[{"id":"35b636da-b0ec-4871-8fb8-f84d2a3862f9","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"mobile\": 12345,\n  \"secondaryMobile\": 2348092,\n  \"firstName\": \"Taylor\",\n  \"lastName\": \"Swift\",\n  \"gender\": \"Female\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/clients/C4759813"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Sun, 03 Sep 2023 22:59:30 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"546"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"222-KUU1NEy9Jnt7tMyFfChcCM0XLEw\""}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Success\",\n    \"client\": {\n        \"profile\": {\n            \"gps\": {\n                \"longitude\": \"33.8325807\",\n                \"latitude\": \"-13.1451227\"\n            },\n            \"firstName\": \"Taylor\",\n            \"lastName\": \"Swift\",\n            \"gender\": \"Female\",\n            \"village\": \"Koko\",\n            \"county\": \"Sc chilooko\",\n            \"district\": \"Ntchisi\",\n            \"region\": \"Central region\",\n            \"country\": \"Malawi\"\n        },\n        \"contact\": {\n            \"countryCode\": \"+265\",\n            \"mobile\": \"12345\",\n            \"fullNumber\": \"26512345\",\n            \"email\": \"john.lennon@gmail.com\",\n            \"secondaryMobile\": \"2348092\"\n        },\n        \"contracts\": [],\n        \"_id\": \"64f5016082bcc10019a6d013\",\n        \"clientNumber\": \"C4759813\",\n        \"agentReference\": \"1693778272523\",\n        \"updatedAt\": \"2023-09-03T22:59:30.804Z\"\n    }\n}"}],"_postman_id":"4fc78f35-9ef4-4044-8a62-3864d02a53f1"}],"id":"e1ac6faa-1980-4c8a-8c9e-2876a170c5aa","description":"<p>Endpoints relating to your <strong>clients</strong> collection. Your clients are organized according to their</p>\n<ul>\n<li><strong>status</strong>: \"Pending\", \"Approved\", \"Signed\", \"Rejected\" or \"Validated\"</li>\n<li><strong>category</strong>: customizable list (in settings)</li>\n<li><strong>stage</strong>: customizable list (in settings), representing the client's \"progress stage\"</li>\n</ul>\n<p>Each one of your clients can have multiple <em>contracts</em> (see <strong>contracts</strong> section) and multiple <em>forms</em> (see <strong>forms</strong> section).</p>\n<blockquote>\n<p><strong>Categories</strong> allow you to filter what pricing terms, forms (etc) will be available to any particular client. </p>\n</blockquote>\n<blockquote>\n<p>Progress <strong>stages</strong> allow you to trigger actions based on changes in the stage at which a client is.</p>\n</blockquote>\n","_postman_id":"e1ac6faa-1980-4c8a-8c9e-2876a170c5aa"},{"name":"Contracts","item":[{"name":"Create contract","id":"fa1c2d31-7a29-4861-a10e-a21bf4ff60b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/contracts/create","description":"<p>Endpoint to add one new contract to an existing client specified by its clientNumber</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th>Type</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>clientNumber</code></td>\n<td>String, mandatory</td>\n<td>Client you want to add a contract to</td>\n</tr>\n<tr>\n<td><code>dealNumber</code></td>\n<td>String, mandatory</td>\n<td>Deal (pricing terms) of the contract you want to add. Can be replaced by \"dealName\"</td>\n</tr>\n<tr>\n<td><code>entryDate</code></td>\n<td>Date, optional</td>\n<td>Date at which application for the contract was made on the ground</td>\n</tr>\n<tr>\n<td><code>respAgent</code></td>\n<td>String, optional</td>\n<td>AgentNumber of the mobile app user responsible for the contract</td>\n</tr>\n<tr>\n<td><code>recorder</code></td>\n<td>String, optional</td>\n<td>AgentNumber of the mobile app user having collected the application (defaults to <code>respAgent</code> if not specified)</td>\n</tr>\n<tr>\n<td><code>totalPaid</code></td>\n<td>Number, optional</td>\n<td>0 by default, specify number otherwise</td>\n</tr>\n<tr>\n<td><code>flag</code></td>\n<td>String, optional</td>\n<td>Informational</td>\n</tr>\n<tr>\n<td><code>origin</code></td>\n<td>String, optional</td>\n<td>Informational</td>\n</tr>\n<tr>\n<td><code>externalId</code></td>\n<td>String, optional</td>\n<td>Foreign key</td>\n</tr>\n<tr>\n<td><code>channel</code></td>\n<td>String, optional</td>\n<td>Informational</td>\n</tr>\n<tr>\n<td><code>costCenter</code></td>\n<td>String, optional</td>\n<td>Informational</td>\n</tr>\n<tr>\n<td><code>signed</code></td>\n<td>Boolean, optional</td>\n<td>Set to TRUE if contract is already signed</td>\n</tr>\n<tr>\n<td><code>signingDate</code></td>\n<td>Date, optional</td>\n<td>Informational</td>\n</tr>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String, optional</td>\n<td>Required if <code>signed</code> is TRUE and if the underlying product is serialized</td>\n</tr>\n<tr>\n<td><code>dealVersion</code></td>\n<td>Number, optional</td>\n<td>Specify a <code>dealVersion</code> if you want to create a <code>contract</code> with an old deal version (defaults to the currently active version)</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","contracts","create"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"49df0ed8-6b38-487a-a34e-c17be56fe844","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"clientNumber\": \"CL2030617\",\n  \"dealName\": \"New\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 16:09:14 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"454"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"1c6-v3Xw0XVRIrFYOypO3HTjF2U5fR4\""}],"cookie":[],"responseTime":null,"body":"{\n    \"clientNumber\": \"CL2030617\",\n    \"contractNumber\": \"A84375415\",\n    \"dealName\": \"New\",\n    \"pricingSchedule\": {\n        \"highSeason\": {\n            \"months\": []\n        },\n        \"midSeason\": {\n            \"months\": []\n        },\n        \"lowSeason\": {\n            \"months\": []\n        },\n        \"upfrontPayment\": 570,\n        \"minPayment\": 500,\n        \"upfrontDays\": 30,\n        \"recurrentPayment\": 500,\n        \"freq\": 30,\n        \"discounts\": []\n    },\n    \"totalCost\": 1025,\n    \"totalPaid\": 0,\n    \"entryDate\": \"2023-09-04T16:09:14.144Z\",\n    \"status\": \"LOCKED\",\n    \"type\": \"PAYG\",\n    \"onboardingStatus\": \"Approved\",\n    \"lastStatusUpdate\": \"2023-09-04T16:09:14.152Z\"\n}"},{"id":"bf3fd68d-bcf4-46ec-ac3c-3be7b8b59f3e","name":"error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"clientNumber\": \"CL2030617\",\n  \"dealNumber\": \"1622549617598\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/create"},"status":"Bad Request","code":400,"_postman_previewlanguage":"html","header":[{"key":"Date","value":"Mon, 04 Sep 2023 15:56:22 GMT"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"33"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"21-jevG7pwlow+3K2Q7uKS1ehQ+WiU\""}],"cookie":[],"responseTime":null,"body":"Error - no dealName was specified"}],"_postman_id":"fa1c2d31-7a29-4861-a10e-a21bf4ff60b4"},{"name":"Search contracts","id":"3236d433-7e85-42d6-b70d-9c5e525468de","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/contracts","description":"<p>Endpoint to search your contracts collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<blockquote>\n<p><em>Example</em>: to retrieve all contracts updated after the 1998 World Cup final, send the following body:</p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"updatedAt\": { \n            \"$gte\": \"12 July 2018\"\n         }\n    }\n}\n\n</code></pre>\n<p>You can also use the following MongoDb options: <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<blockquote>\n<p><em>Example</em>: to get the contractNumbers of the 3 most recently clients send the following request:</p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {},\n    \"limit\": 3,\n    \"select\": \"contractNumber\",\n    \"sort\": \"updatedAt\"\n}\n\n</code></pre>\n<p>Finally, to paginate your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: <em>paginate</em>, <em>pageNumber</em> and <em>nPerPage</em>. The skip option overrides any sort value for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"totalpaid\": {\"$gte\":1000}\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","contracts"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"9f391288-988e-4ad7-926b-1a868dc15cbd","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"query\": {\r\n        \"totalPaid\": {\r\n            \"$gte\": 2000,\r\n            \"$lte\": 3000\r\n        },\r\n        \"onboardingStatus\":\"Signed\"\r\n    },\r\n    \"paginate\": true,\r\n    \"pageNumber\": 1,\r\n    \"select\": \"totalPaid nextStatusUpdate\",\r\n    \"nPerPage\": 10\r\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/contracts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 15:44:31 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"837"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"345-s0DGZaOSJK8wnouE9os1RcAyOo4\""}],"cookie":[],"responseTime":null,"body":"{\n    \"paging\": {\n        \"total\": 43,\n        \"pageNumber\": 1,\n        \"nPerPage\": 10\n    },\n    \"data\": [\n        {\n            \"_id\": \"5e9c87bdadbee200112bd73c\",\n            \"totalPaid\": 2000,\n            \"nextStatusUpdate\": \"2020-06-19T18:57:25.751Z\"\n        },\n        {\n            \"_id\": \"5e9ef7426179150011f49064\",\n            \"totalPaid\": 2500,\n            \"nextStatusUpdate\": null\n        },\n        {\n            \"_id\": \"5e9ef7a16179150011f4906d\",\n            \"totalPaid\": 2000\n        },\n        {\n            \"_id\": \"5e9ef7e26179150011f49076\",\n            \"totalPaid\": 3000,\n            \"nextStatusUpdate\": \"2020-05-22T14:33:35.395Z\"\n        },\n        {\n            \"_id\": \"5e9f066b6179150011f49143\",\n            \"totalPaid\": 3000\n        },\n        {\n            \"_id\": \"5e9f0a2a6179150011f49217\",\n            \"totalPaid\": 2000,\n            \"nextStatusUpdate\": null\n        },\n        {\n            \"_id\": \"5e9f4df06179150011f494f5\",\n            \"totalPaid\": 2000,\n            \"nextStatusUpdate\": \"2020-04-24T14:34:02.583Z\"\n        },\n        {\n            \"_id\": \"5ea15edcbf08d082bcd66ae4\",\n            \"totalPaid\": 2500,\n            \"nextStatusUpdate\": \"2020-06-07T09:27:05.894Z\"\n        },\n        {\n            \"_id\": \"5ea1621ebf08d082bcd66aec\",\n            \"totalPaid\": 2000,\n            \"nextStatusUpdate\": null\n        },\n        {\n            \"_id\": \"5eb16b2950b48c00112293fe\",\n            \"totalPaid\": 2000\n        }\n    ]\n}"}],"_postman_id":"3236d433-7e85-42d6-b70d-9c5e525468de"},{"name":"Count contracts","id":"ed3e589b-5907-4f8f-8566-10db2143fb86","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/count/contracts","description":"<p>Endpoint to count the contracts matching a given query. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","count","contracts"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"eaa58d8c-6744-4d7f-961a-b146783e90bc","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"contractNumber\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"paygNumber\": \"<string>\",\n    \"dealName\": \"<string>\",\n    \"status\": \"<string>\",\n    \"onboardingStatus\": \"<string>\",\n    \"signingDate\": \"<string>\",\n    \"nextStatusUpdate\": \"<string>\",\n    \"lastStatusUpdate\": \"<string>\",\n    \"respAgent\": \"<string>\",\n    \"recorder\": \"<string>\",\n    \"singingDate\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/count/contracts"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"\n{\n  \"count\": 123,\n  \"status\": \"Success\",\n  \"message\": \"123 contracts found to match query\"\n}"}],"_postman_id":"ed3e589b-5907-4f8f-8566-10db2143fb86"},{"name":"Get contract","id":"fff01e4a-40e5-4ef4-9eab-99778b7456b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://data.upya.io/data/contracts/:contractNumber","description":"<p>Endpoint to retrieve information regarding one contract, specified by its contractNumber</p>\n","urlObject":{"protocol":"https","path":["data","contracts",":contractNumber"],"host":["data","upya","io"],"query":[],"variable":[{"type":"any","value":"","key":"contractNumber"}]}},"response":[],"_postman_id":"fff01e4a-40e5-4ef4-9eab-99778b7456b7"},{"name":"Update contract","id":"47eb3880-5aba-4700-97aa-15670068b3dc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/updateOne","description":"<p>Endpoint to \"manually\" update a contract. Equivalent to the \"<strong>hard reset</strong>\" button on the Upya Manage platform.</p>\n<p>Updates made via this endpoint override the specified contract object without being linked to any payment.</p>\n<p>All updates are tracked with the creations of \"contract events\".</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, mandatory</td>\n<td>Identifier of the contract being updated</td>\n</tr>\n<tr>\n<td><code>totalPaid</code></td>\n<td>Number, optional</td>\n<td>New totalPaid</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String, optional</td>\n<td>New status</td>\n</tr>\n<tr>\n<td><code>nextStatusUpdate</code></td>\n<td>Date, optional</td>\n<td>New nextStatusUpdate</td>\n</tr>\n<tr>\n<td><code>flag</code></td>\n<td>String, optional</td>\n<td>New flag (will override any previous flag)</td>\n</tr>\n<tr>\n<td><code>categoriesToAdd</code></td>\n<td>Array, optional</td>\n<td>New categories to add</td>\n</tr>\n<tr>\n<td><code>categoriesToRemove</code></td>\n<td>Array, optional</td>\n<td>Categories to remove</td>\n</tr>\n<tr>\n<td><code>sliceToAdd</code></td>\n<td>String, optional</td>\n<td>New slice to add, specified by its sliceNumber</td>\n</tr>\n<tr>\n<td><code>sliceToRemove</code></td>\n<td>String, optional</td>\n<td>Slice to remove, specified by its sliceNumber</td>\n</tr>\n<tr>\n<td><code>externalId</code></td>\n<td>String, optional</td>\n<td>ExternalId of contract</td>\n</tr>\n<tr>\n<td><code>externalRawData</code></td>\n<td>String, optional</td>\n<td>Stringified external data</td>\n</tr>\n<tr>\n<td><code>externalData</code></td>\n<td>Array, optional</td>\n<td>Array of external data: [{ label, data }]</td>\n</tr>\n<tr>\n<td><code>unUsedBalance</code></td>\n<td>Number, optional</td>\n<td>New unUsedBalance</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","contracts","updateOne"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"efc23249-9929-4e87-8c71-f9953eb2409e","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"AC2029652\",\n  \"totalPaid\": \"3000\",\n  \"flag\": \"Interested\",\n  \"categoriesToAdd\": \"Under warranty\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/updateOne"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 16:26:12 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"52"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"34-cD04MsXX8amxvpxGp81Kqh0Ej4o\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"Success\",\n    \"message\": \"Successfully edited\"\n}"}],"_postman_id":"47eb3880-5aba-4700-97aa-15670068b3dc"},{"name":"Change deal","id":"16c0d2e3-c63b-418a-8c96-94309b11dc6a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/changedeal","description":"<p>Endpoint to change the deal (pricing terms) of an existing contract. The request will update the <em>pricingSchedule</em>, <em>totalCost</em> and <em>remainingDebt</em> of the contract.</p>\n<p>Equivalent to the <strong>Change deal</strong> button of the Upya Manage platform.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, mandatory</td>\n<td>Contract being targeted</td>\n</tr>\n<tr>\n<td><code>dealNumber</code></td>\n<td>String, mandatory</td>\n<td>Deal the contract is being moved to</td>\n</tr>\n</tbody>\n</table>\n</div><blockquote>\n<p>Warning: the new deal and the old one need to share the same underlying product</p>\n</blockquote>\n","urlObject":{"protocol":"https","path":["data","contracts","changedeal"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"d02232a3-ed83-4146-8cc5-fea954134e91","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"AC2029652\",\n  \"dealNumber\": \"X5WX0\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/changedeal"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 16:42:12 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"53"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"35-RyUR1SWwvWVrpiU58mURlMPahGY\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"Success\",\n    \"message\": \"Successfully changed\"\n}"},{"id":"4fbbc894-a596-4f6f-b805-468cbfc4589b","name":"error","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"AC2029652\",\n  \"dealNumber\": \"FTQ8BNXJ\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/changedeal"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 16:40:22 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"51"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"33-ipRXXumUWdbNTJixljIbmnFQ5Q4\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"Error\",\n    \"message\": \"No active deal found\"\n}"}],"_postman_id":"16c0d2e3-c63b-418a-8c96-94309b11dc6a"},{"name":"Edit terms","id":"75d5c31d-c894-4b31-a540-a6bd90b037d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/editterms","description":"<p>Endpoint to edit any of the terms of an existing contract (<em>totalCost</em>, <em>monthly payment</em>, <em>frequency of payments, min payment</em>), without affecting the others.</p>\n<p>Use this action to modify the economic terms of a given contrat without actually changing the deal of the contract.</p>\n<p>Equivalent to the <strong>Edit terms</strong> button of the Upya Manage platform.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, mandatory</td>\n<td>Contract being targeted</td>\n</tr>\n<tr>\n<td><code>edits.totalCost</code></td>\n<td>Number, optional</td>\n<td>New total cost</td>\n</tr>\n<tr>\n<td><code>edits.pricingSchedule.freq</code></td>\n<td>Number, optional</td>\n<td>New frequency of payments</td>\n</tr>\n<tr>\n<td><code>edits.pricingSchedule.recurrentPayment</code></td>\n<td>Number, optional</td>\n<td>New recurring payment</td>\n</tr>\n<tr>\n<td><code>edits.pricingSchedule.minPayment</code></td>\n<td>Number, optional</td>\n<td>New min payment</td>\n</tr>\n<tr>\n<td><code>edits.pricingSchedule.upfrontDays</code></td>\n<td>Number, optional</td>\n<td>New number of days given with upfront payment</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","contracts","editterms"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"14bb1d40-e8b5-4add-8a30-4b9f4816c795","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"AC2029652\",\n  \"edits\": {\n    \"totalCost\": 120000,\n    \"pricingSchedule\": {\n        \"freq\": 15,\n        \"recurrentPayment\": 1000\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/editterms"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 20:28:46 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"52"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"34-cD04MsXX8amxvpxGp81Kqh0Ej4o\""}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"Success\",\n    \"message\": \"Successfully edited\"\n}"},{"id":"128dc8c4-6adb-401c-b6df-f89d6907bb4e","name":"error","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"edits\": {\n    \"totalCost\": 120000,\n    \"pricingSchedule\": {\n        \"freq\": 15,\n        \"recurrentPayment\": 1000\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/editterms"},"status":"Bad Request","code":400,"_postman_previewlanguage":"html","header":[{"key":"Date","value":"Mon, 04 Sep 2023 20:29:15 GMT"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"29-eNkYlzIG4S+F3Cm5IBnP1Xw28/I\""}],"cookie":[],"responseTime":null,"body":"No or incorrect contractNumber specified."}],"_postman_id":"75d5c31d-c894-4b31-a540-a6bd90b037d3"},{"name":"Approve contracts","id":"07bacc5b-e2ab-413a-a949-63d70f868b56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/approve","description":"<p>Endpoint to approve a list of contracts, specified by their contractNumbers</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumbers</code></td>\n<td>Array, mandatory</td>\n<td>List of contractNumbers being approved. <em>Example: [\"A98034333\", \"A123564\"]</em></td>\n</tr>\n</tbody>\n</table>\n</div><p>Equivalant to the <strong>Approve</strong> button on the Upya Manage platform.</p>\n","urlObject":{"protocol":"https","path":["data","contracts","approve"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"7eaa12a2-893d-434b-8b30-51cbe76e15ab","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumbers\": [\"A98034333\", \"A123564\"]\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/approve"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 20:32:40 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"49"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"31-ofUMYi+BR9RH5wfg+Z/gDS/jIvg\""}],"cookie":[],"responseTime":null,"body":"{\n    \"successes\": [\n        \"A98034333\",\n        \"A123564\"\n    ],\n    \"errors\": []\n}"}],"_postman_id":"07bacc5b-e2ab-413a-a949-63d70f868b56"},{"name":"Reject contracts","id":"18d4ae8b-cd93-493e-806a-7c76b6567a38","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/reject","description":"<p>Endpoint to reject a contract, specified by its contractNumber</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of the targeted contract</td>\n</tr>\n<tr>\n<td><code>noteToAgent</code></td>\n<td>String, optional</td>\n<td>Notification sent to app user</td>\n</tr>\n<tr>\n<td><code>rejectClient</code></td>\n<td>Boolean, optional</td>\n<td>Option to also reject the client linked to contract</td>\n</tr>\n</tbody>\n</table>\n</div><p>Equivalant to the <strong>Reject</strong> button on the Upya Manage platform.</p>\n<blockquote>\n<p>You can add a note that will be sent as a pop up notification to the field agent in charge of the client by using the field \"noteToAgent\"</p>\n</blockquote>\n","urlObject":{"protocol":"https","path":["data","contracts","reject"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"34302b15-7ccf-4042-a561-c9ba48eba905","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"A98034333\",\n  \"noteToAgent\": \"Contract failed credit check\",\n  \"rejectClient\": true\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/reject"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:20:35 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"152"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"98-OBNvhC63zo8PReFxh5h36gA4nao\""}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": {\n        \"rejectedContract\": \"A98034333\",\n        \"clientRejected\": true,\n        \"noteSentToAgent\": \"Application for test 5 was rejected. Contract failed credit check\"\n    }\n}"}],"_postman_id":"18d4ae8b-cd93-493e-806a-7c76b6567a38"},{"name":"Pay off contracts","id":"ecfe9053-197a-4763-aee4-01fcaa50536a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/unlock","description":"<p>Endpoint to pay-off a list of contracts. The following changes will be applied to each contract in the list:</p>\n<ul>\n<li><p>contract status moved to \"PAIDOFF\"</p>\n</li>\n<li><p>paidOffDate set to today</p>\n</li>\n<li><p>nextStatusUpdate removed</p>\n</li>\n<li><p>remainingDebt set to 0</p>\n</li>\n</ul>\n<p>An unlock code is sent to each client if the \"<em>sendCodeToClients</em>\" flag is set to true</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumbers</code></td>\n<td>Array, mandatory</td>\n<td>List of contractNumbers being targeted</td>\n</tr>\n<tr>\n<td><code>sendCodeToClients</code></td>\n<td>Boolean, optional</td>\n<td>Send unlock code to client linked to contract</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","contracts","unlock"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"b574c54d-fd5b-4e32-9df8-fe47fbcfa257","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumbers\": [\"A74189497\"],\n  \"sendCodeToClients\": false\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/unlock"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:25:45 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"58"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"3a-FzCLvHBbCdDkboG816n25Fb4QfU\""}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [],\n    \"successes\": [\n        {\n            \"contractNumber\": \"A74189497\"\n        }\n    ]\n}"}],"_postman_id":"ecfe9053-197a-4763-aee4-01fcaa50536a"},{"name":"Write off contracts","id":"97b53061-30bf-41bc-a65c-ec4b8fcfaccd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/contracts/writeoff","description":"<p>Endpoint to write-off a list of contracts.</p>\n<p>The following rules will apply to each contract in the list:</p>\n<ul>\n<li><p>if its status is \"ENABLED\" or \"LOCKED\", both the contract and the attached unit(s) are written-off</p>\n</li>\n<li><p>if its status is \"REPOSSESSED\", only the contract is written-off</p>\n</li>\n<li><p>f its status is \"PAIDOFF\", the action fails</p>\n</li>\n<li><p>if its status is \"WRITEOFF\", the contract is un-writtenoff and the unit is restored (unless the contract was repossessed).</p>\n</li>\n</ul>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumbers</code></td>\n<td>Array, mandatory</td>\n<td>List of contractNumbers being targeted</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","contracts","writeoff"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"72dc6b83-c5ba-4253-91f8-d2e508a460d5","name":"success","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumbers\": [\"AC2029811\"]\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/writeoff"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:29:41 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"58"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"3a-LBzfVrvo/M3B+2jC9yyqxbFYIjc\""}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [],\n    \"successes\": [\n        {\n            \"contractNumber\": \"AC2029811\"\n        }\n    ]\n}"},{"id":"ee8f5f88-0457-45f3-875d-d26234997822","name":"error","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\n  \"contractNumbers\": [\"9416703\"]\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/writeoff"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:28:05 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"74"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"4a-9G9QtnDixxiFjIm+H2+KMBPih6M\""}],"cookie":[],"responseTime":null,"body":"{\n    \"errors\": [\n        {\n            \"contractNumber\": \"9416703\",\n            \"message\": \"Error\"\n        }\n    ],\n    \"successes\": []\n}"}],"_postman_id":"97b53061-30bf-41bc-a65c-ec4b8fcfaccd"},{"name":"Send bonus","id":"ba4e2513-14ac-4fbc-9940-6b277c7426d3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/codes/send-bonus","description":"<p>Use this endpoint to send bonus days for a given contract.</p>\n<p>This action will generate an activation code and will update the \"nextStatusUpdate\" field of the contract. It will however not change the economics of the contract (totalPaid, totalCost, ...).</p>\n<p>An event will be logged in the contract history</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Descrption</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of targeted contract</td>\n</tr>\n<tr>\n<td><code>numberOfDays</code></td>\n<td>String, optional</td>\n<td>Numbe of days given</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","codes","send-bonus"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"3a7dd22e-54f9-43ed-afc3-3c4758fd15e1","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"<string>\",\n  \"userNumber\": \"<string>\",\n  \"numberOfDays\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/codes/send-bonus"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"irure non laboris mollit\"\n}"}],"_postman_id":"ba4e2513-14ac-4fbc-9940-6b277c7426d3"},{"name":"Sync unit","id":"bc2e5385-5753-4115-935d-38eb4fbea175","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/codes/syncUnit","description":"<p>Endpoint to \"sync\" a unit attached to a contract. The \"sync\" action aligns the \"lock date\" of the physical unit to the \"nextStatusUpdate\" of the contract.</p>\n<p>The \"sync\" action is not available with all manufacurers / hardware.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of the unit that needs to be \"synced\"</td>\n</tr>\n<tr>\n<td><code>sendText</code></td>\n<td>Boolean, optional</td>\n<td>Send \"sync\" code to the phone number in file. Codes might or might not be be generated depending on hardware</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","codes","syncUnit"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"bc2e5385-5753-4115-935d-38eb4fbea175"}],"id":"29bd9e83-95a0-470f-b4f6-fa1b2389f654","description":"<p>Use these endpoints to interact with your <strong>contracts</strong> collection.</p>\n<p>Contracts are organized according to their:</p>\n<ul>\n<li><p><strong>onboardingStatus</strong>: \"Pending\", \"Approved\", \"Rejected\" or \"Signed</p>\n</li>\n<li><p><strong>status</strong>: \"LOCKED\", \"ENABLED\", \"REPOSSESSED\", \"PAIDOFF\" or \"WRITEOFF\"</p>\n</li>\n<li><p><strong>categories</strong>: a customizable list that you can define in your settings.</p>\n</li>\n<li><p><strong>flag</strong>: a customizable list that you can define in your settings</p>\n</li>\n</ul>\n<blockquote>\n<p><strong>Categories</strong> allow you to filter what units is available to each contract.. </p>\n</blockquote>\n<blockquote>\n<p><strong>Flags</strong> allow you to trigger actions based on changes in the stage at which a contract is. </p>\n</blockquote>\n<p>Your contracts can be linked to one or several serialized <strong>units</strong> or to one or several non-serialized <strong>items</strong>. But only to one serialized <strong>lockable</strong> unit.</p>\n<p>Each contract is associated to a <strong>deal</strong>. A deal summarizes the pricing structure of the contract, along with its onboarding process (approval needed or not, questions asked during onboarding, etc...).</p>\n<p>Contracts can be of the following <strong>types</strong> (attribute inherited from their deal):</p>\n<ul>\n<li><p><strong>FULL</strong>: full upfront pricing structure (cash sale)</p>\n</li>\n<li><p><strong>PAYG</strong>: lease-to-own pricing structure with pre-set monthly instalment (lockable units)</p>\n</li>\n<li><p><strong>INSTALMENT</strong>: lease-to-own pricing structure with pre-set monthly instalment (non-lockable units)</p>\n</li>\n<li><p><strong>LOAN</strong>: loan pricing structure with weekly or monthly interest rate, early &amp; late repayment rules, etc</p>\n</li>\n<li><p><strong>TOPUP</strong>: prepaid pricing structure</p>\n</li>\n<li><p><strong>PERPEUITY</strong>: lease pricing structure, with pre-set monthly instalment</p>\n</li>\n</ul>\n","_postman_id":"29bd9e83-95a0-470f-b4f6-fa1b2389f654"},{"name":"Assets","item":[{"name":"Search units","id":"3ebb7984-e681-4828-bf2a-77632d006ebb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/assets","description":"<p>Endpoint to search your asset collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<p>You can also use the following MongoDb options: <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<p>Finally, to paginate your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: <em>paginate</em>, <em>pageNumber</em> and <em>nPerPage</em>. The skip option overrides any sort value for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"status\": \"INSTOCK\"\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","assets"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"694b70e7-020a-4f45-97e5-ad0f683ec0ff","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"serialNumber\": {\"$regex\": \"12345\"}\n  },\n      \"paginate\": true,\n    \"pageNumber\": 1,\n    \"select\":\"-ownedBy -heldBy -product serialNumber datedAdded contract\",\n    \"nPerPage\": 1000\n\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/assets"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:33:17 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"341"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"155-VCRtShC3HELvuB3Uaj8di4L1/rw\""}],"cookie":[],"responseTime":null,"body":"{\n    \"paging\": {\n        \"total\": 3,\n        \"pageNumber\": 1,\n        \"nPerPage\": 1000\n    },\n    \"data\": [\n        {\n            \"_id\": \"5e98d90aeff7135eb83f0506\",\n            \"serialNumber\": \"SHX-12345857\"\n        },\n        {\n            \"_id\": \"5e98da76eff7135eb83f1a88\",\n            \"serialNumber\": \"SHX-12345719\",\n            \"contract\": {\n                \"contractNumber\": \"AC1837317\"\n            }\n        },\n        {\n            \"_id\": \"5e98db64eff7135eb83f281a\",\n            \"serialNumber\": \"SHX-12345396\",\n            \"contract\": {\n                \"contractNumber\": \"AC1880773\"\n            }\n        }\n    ]\n}"}],"_postman_id":"3ebb7984-e681-4828-bf2a-77632d006ebb"},{"name":"Create units","id":"cfd7cfe3-d26a-48e2-9318-e7b13878a3f1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/assets","description":"<p>Endpoint to create a list of serialized units. Each element in the list should have the following attributes:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>SerialNumber</code></td>\n<td>String, mandatory</td>\n<td>SerialNumber of the unit being added</td>\n</tr>\n<tr>\n<td><code>BatchNumber</code></td>\n<td>String, mandatory</td>\n<td>Identifier of the batch of units to which the added unit belongs</td>\n</tr>\n<tr>\n<td><code>ProductReference</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of the product type of the added unit</td>\n</tr>\n<tr>\n<td><code>AgentNumber</code></td>\n<td>String, optional</td>\n<td>App user holding the unit. If not specified, the unit will be PENDING instead of INSTOCK</td>\n</tr>\n<tr>\n<td><code>PaygNumber</code></td>\n<td>String, optional</td>\n<td>Optional other unique identifier. If not specified, set to be equal to the serialNumber</td>\n</tr>\n</tbody>\n</table>\n</div><p>This endpoint is equivalent to the <strong>drag and drop zone</strong> to create units on the <a href=\"https://manage.upya.io\">Upya Manage platform</a>.</p>\n","urlObject":{"protocol":"https","path":["data","assets"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"cfd7cfe3-d26a-48e2-9318-e7b13878a3f1"},{"name":"Edit units","id":"e1e91c72-90d5-43a3-acde-60ad84ee26c4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/assets","description":"<p>Endpoint to edit a list of serialized units:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": [\n        {\n            \"serialNumber\": \"xxx\",\n            \"NewBatchNumber\": \"YYY\"\n        }\n    ]\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>SerialNumber</code></td>\n<td>String, mandatory</td>\n<td>Serial number of targeted unit</td>\n</tr>\n<tr>\n<td><code>NewSerialNumber</code></td>\n<td>String, optional</td>\n<td>New serial number</td>\n</tr>\n<tr>\n<td><code>NewProductReference</code></td>\n<td>String, optional</td>\n<td>Unique identifier of new product type</td>\n</tr>\n<tr>\n<td><code>NewCount</code></td>\n<td>String, optional</td>\n<td>New count</td>\n</tr>\n<tr>\n<td><code>NewBatchNumber</code></td>\n<td>String, optional</td>\n<td>New batch number</td>\n</tr>\n<tr>\n<td><code>NewSecretKey</code></td>\n<td>String, optional</td>\n<td>New secret key to call manufacturer</td>\n</tr>\n<tr>\n<td><code>NewManagedBy</code></td>\n<td>String, optional</td>\n<td>New managedBy</td>\n</tr>\n<tr>\n<td><code>NewStartingCode</code></td>\n<td>String, optional</td>\n<td>New startingCode (OpenToken)</td>\n</tr>\n<tr>\n<td><code>NewKey</code></td>\n<td>String, optional</td>\n<td>New key (OpenToken)</td>\n</tr>\n<tr>\n<td><code>SliceToAdd</code></td>\n<td>String, optional</td>\n<td>Add slice specified by its sliceNumber</td>\n</tr>\n<tr>\n<td><code>SliceToRemove</code></td>\n<td>String, optional</td>\n<td>Remove slice specified by its sliceNumber</td>\n</tr>\n<tr>\n<td><code>NewFlag</code></td>\n<td>String, optional</td>\n<td>Flag to be added to unit. Put <code>None</code> to remove flag.</td>\n</tr>\n<tr>\n<td><code>NewBookValue</code></td>\n<td>String, optional</td>\n<td>New book value</td>\n</tr>\n<tr>\n<td><code>NewPurchasePrice</code></td>\n<td>String, optional</td>\n<td>New purchase price</td>\n</tr>\n<tr>\n<td><code>NewPurchaseDate</code></td>\n<td>Date, optional</td>\n<td>New purchase date</td>\n</tr>\n<tr>\n<td><code>NewManufacturerWarranty</code></td>\n<td>Date, optional</td>\n<td>New manufacturer's warranty</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","assets"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"e1e91c72-90d5-43a3-acde-60ad84ee26c4"},{"name":"Write off units","id":"7fb0d872-8e0f-4e51-bf35-45da8b00c45a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/assets/writeoff","description":"<p>Endpoint to write off (or un-write off) a list of units, specified by their serialNumbers.</p>\n<p>All elements of the list should have the below structure:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String, mandatory</td>\n<td>Serial number of targeted unit</td>\n</tr>\n<tr>\n<td><code>comment</code></td>\n<td>String, optional</td>\n<td>Note appearing on assetEvent</td>\n</tr>\n<tr>\n<td><code>unWriteOff</code></td>\n<td>Boolean, optional</td>\n<td>Set to \"true\" to un-writeoff units</td>\n</tr>\n<tr>\n<td><code>HelbyNumber</code></td>\n<td>String, optional</td>\n<td>Mandatory if unWriteOff is true</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","assets","writeoff"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"7fb0d872-8e0f-4e51-bf35-45da8b00c45a"},{"name":"Get unit details","id":"4ff017b6-01a6-4507-aa9c-2b122203b0ef","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://data.upya.io/data/assets/:serialNumber","description":"<p>Endpoint to get the details of one serialized units, specified by its serialNumber as a path variable</p>\n","urlObject":{"protocol":"https","path":["data","assets",":serialNumber"],"host":["data","upya","io"],"query":[],"variable":[{"type":"any","value":"","key":"serialNumber"}]}},"response":[],"_postman_id":"4ff017b6-01a6-4507-aa9c-2b122203b0ef"},{"name":"Transfer units","id":"67596d46-33a6-4c54-8c2d-1db19fe10f75","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/assets/transfer","description":"<p>Endpoint to transfer a list of units from one field operator to another one.</p>\n<p>The elements of the list should have the following attributes:</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>SerialNumber</code></td>\n<td>String, mandatory</td>\n<td>SerialNumber</td>\n</tr>\n<tr>\n<td><code>AgentNumberFrom</code></td>\n<td>String, mandatory</td>\n<td>App user currently holding the unit</td>\n</tr>\n<tr>\n<td><code>AgentNumberTo</code></td>\n<td>String, mandatory</td>\n<td>App user to whom the unit is transfered</td>\n</tr>\n</tbody>\n</table>\n</div><p>Equivalent to the <strong>Transfer button</strong> and to <strong>the drag and drop zone</strong> to mass transfer units on the Upya Manage platform.</p>\n<blockquote>\n<p>Warning: non-deployed units cannot by \"held\" by anyone and transfer to non-existing field operator will fail.</p>\n</blockquote>\n","urlObject":{"protocol":"https","path":["data","assets","transfer"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"67596d46-33a6-4c54-8c2d-1db19fe10f75"},{"name":"Count units","id":"70f1f607-d187-4738-8ffb-515dc63e3683","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/count/assets","description":"<p>Endpoint to count the units matching a given query. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","count","assets"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"23d1f9c0-3d12-4ea2-89a4-a5c1a6eb637a","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"serialNumber\": {\"$regex\": \"125\"}\n  }\n\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/count/assets"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:34:24 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"75"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"4b-mrrJkmBeWVUEuG9yy972IaPbLNI\""}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 248,\n    \"status\": \"Success\",\n    \"message\": \"248 units found to match query\"\n}"}],"_postman_id":"70f1f607-d187-4738-8ffb-515dc63e3683"}],"id":"0616bd29-6b33-4ee2-9e9b-7003cbcc14b9","description":"<p>Endpoints related to your <strong>assets</strong> collection. Your assets are organized according to their <strong>status.</strong></p>\n<p>Available status are:</p>\n<ul>\n<li><p><strong>DEPLOYED</strong>: unit has been sold</p>\n</li>\n<li><p><strong>INSTOCK</strong>: unit is in stock and physically with an agent (or warehouse)</p>\n</li>\n<li><p><strong>PENDING</strong>: unit is on its way from the manufacturer. Unit cannot be scanned or sold yet</p>\n</li>\n<li><p><strong>DEFECTIVE</strong>: unit is defective and cannot as it stands be sold again</p>\n</li>\n</ul>\n","_postman_id":"0616bd29-6b33-4ee2-9e9b-7003cbcc14b9"},{"name":"Payments","item":[{"name":"Search payments","id":"632a80e6-a2c6-4d34-b16f-526242f1d16b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/payments","description":"<p>Endpoint to search your payments collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<p>You can also use the following MongoDb options: <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<p>Finally, to paginate your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: <em>paginate</em>, <em>pageNumber</em> and <em>nPerPage</em>. The skip option overrides any sort value for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"date\": {\"$gte\":\"01 November 2022\"}\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","payments"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"86435430-f21f-401e-b96f-02ac65d2bf84","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"query\": {\n      \"date\": {\n          \"$gte\": \"05 August 2023\"\n      }\n  },\n  \"paginate\": true,\n    \"pageNumber\": 1,\n    \"nPerPage\": 1\n\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/payments"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 22:12:25 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"433"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"1b1-Wa/WVMgHaucSUxaNj3kpO4wg+9E\""}],"cookie":[],"responseTime":null,"body":"{\n    \"paging\": {\n        \"total\": 1791,\n        \"pageNumber\": 1,\n        \"nPerPage\": 1\n    },\n    \"data\": [\n        {\n            \"contract\": {\n                \"contractNumber\": \"701462113\"\n            },\n            \"contractNumber\": \"701462113\",\n            \"operator\": \"Airtel\",\n            \"type\": \"MM\",\n            \"date\": \"2023-08-05T06:02:43.781Z\",\n            \"amount\": 16750,\n            \"paymentReference\": \"016100001093\",\n            \"ccy\": \"NGN\",\n            \"mobile\": \"0703***1554\",\n            \"status\": \"ACCEPTED\",\n            \"paymentCode\": \"PAYMENT_SUCCESS\",\n            \"transactionId\": \"23080579807070205520\",\n            \"entity\": {\n                \"name\": \"MK 43\",\n                \"entityNumber\": \"LH4072GGIW5SN\"\n            }\n        }\n    ]\n}"}],"_postman_id":"632a80e6-a2c6-4d34-b16f-526242f1d16b"},{"name":"Add payments","id":"ef017e75-f1b0-49e1-bda1-840847cb0f27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/payments/add","description":"<p>Endpoint to add a list of payments. This is the API equivalent of the <strong>Excel loader</strong>, that allows to upload bank/MNO statements from Upya Manage.</p>\n<p>The query updates the contracts accordingly (totalPaid, debt, status, nextStatusUpdate, etc) and generate all relevant contract events.</p>\n<p>Existing payments are disregarded (identified by their <code>transactionId</code>).</p>\n<p>Unrecognized payments go to <strong>un-assigned</strong>.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>reference</code></td>\n<td>String, mandatory</td>\n<td>Reference used by client</td>\n</tr>\n<tr>\n<td><code>amount</code></td>\n<td>Number, mandatory</td>\n<td>Amount</td>\n</tr>\n<tr>\n<td><code>transactionId</code></td>\n<td>String, mandatory</td>\n<td>Unique transaction identifier provided by MNO</td>\n</tr>\n<tr>\n<td><code>subscriber</code></td>\n<td>String, mandatory</td>\n<td>Phone number making payment</td>\n</tr>\n<tr>\n<td><code>ccy</code></td>\n<td>String, mandatory</td>\n<td>Currency</td>\n</tr>\n<tr>\n<td><code>date</code></td>\n<td>Date, optional</td>\n<td>Date of payment, defaults to today</td>\n</tr>\n<tr>\n<td><code>note</code></td>\n<td>String, optional</td>\n<td>Additional note for internal tracking</td>\n</tr>\n<tr>\n<td><code>operator</code></td>\n<td>String, optional</td>\n<td>MNO</td>\n</tr>\n<tr>\n<td><code>source</code></td>\n<td>String, optional</td>\n<td>Optional field: API, excel, etc</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","payments","add"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"529c5a12-5772-4fb4-9055-c9feff3fd90c","name":"success","originalRequest":{"method":"PUT","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"contractNumber\": \"<string>\",\n  \"amount\": \"<string>\",\n  \"transactionId\": \"<string>\",\n  \"ccy\": \"<string>\",\n  \"date\": \"<date>\",\n  \"note\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/contracts/addPayments"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"successes\": [\n    \"consequat Lorem eiusmod\",\n    \"cupidatat minim\"\n  ],\n  \"errors\": [\n    \"ea Lorem\",\n    \"eu rep\"\n  ]\n}"}],"_postman_id":"ef017e75-f1b0-49e1-bda1-840847cb0f27"},{"name":"Count payments","id":"03d861a7-43be-44c6-b8d5-dc772aabdf39","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/count/payments","description":"<p>Endpoint to count the payments matching a given query. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","count","payments"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"bea6e6dc-3038-4a0f-a05f-f83574ec7bd3","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n  \"query\": {\n      \"date\": {\n          \"$gte\": \"05 August 2023\"\n      }\n  }\n\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/count/payments"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 22:13:13 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"80"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"50-MxEYMOAs5rmvdlJmLe2264LeZ80\""}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 1791,\n    \"status\": \"Success\",\n    \"message\": \"1791 payments found to match query\"\n}"}],"_postman_id":"03d861a7-43be-44c6-b8d5-dc772aabdf39"}],"id":"03527056-acbb-4e5f-8bc0-a92b9f1a6fbd","description":"<p>Endpoints relating to your <strong>payments</strong> collection. Your payments are organized according to their <strong>status.</strong></p>\n<p>Available statuses are:</p>\n<ul>\n<li><p><strong>ACCEPTED</strong>: payments that have been successfully processed <em>and</em> allocated to their target contract</p>\n</li>\n<li><p><strong>UNASSIGNED</strong>: payments that have been successfully processed <em>but</em> that could not be allocated to any contract</p>\n</li>\n<li><p><strong>FAILED</strong>: payments that have been rejected and that have <em>not</em> hit your Mobile Money account</p>\n</li>\n<li><p><strong>PREACCEPTED</strong>: payments that have been accepted but for which the relevant contract has not been synced yet by the sale agent</p>\n</li>\n</ul>\n","_postman_id":"03527056-acbb-4e5f-8bc0-a92b9f1a6fbd"},{"name":"Forms","item":[{"name":"Search forms","id":"3906bc57-e316-42b6-82a3-9561b6f4e929","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/forms","description":"<p>Endpoint to search your form collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<blockquote>\n<p><em>Example</em>: to retrieve all forms completed for the \"Example\" questionnaire, send the following body:</p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"name\": \"Example\"\n    }\n}\n\n</code></pre>\n<p>You can also use the following MongoDb options: <strong>sort</strong> and <strong>limit</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<p>Finally, to <strong>paginate</strong> your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: paginate, pageNumber and nPerPage. The skip option overrides any \"sort\" input for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"name\": {\"$regex\":\"Example\"}\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","forms"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"0ed03c91-99f9-454c-aaf6-3aba1e1c719b","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/forms"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  },\n  {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  }\n]"}],"_postman_id":"3906bc57-e316-42b6-82a3-9561b6f4e929"},{"name":"Count forms","id":"ad57497f-0192-4218-a31d-435e3f0e838e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/count/forms","description":"<p>Endpoint to count the forms matching a given query. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","count","forms"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"ecc926ac-c76c-440f-b823-224bb2b684b7","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/forms"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 123,\n    \"status\": \"Success\",\n    \"message\": \"123 forms fount to match query\"\n  }"}],"_postman_id":"ad57497f-0192-4218-a31d-435e3f0e838e"},{"name":"Get Pictures SignedUrls","id":"8e1f0f23-df6d-4d52-964a-b317d8e0348a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/forms/signedUrls","description":"<p>Get signedUrls to download images from Firestore.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>listOfIds</code></td>\n<td>Array, mandatory</td>\n<td>List of mongoIds of the answers you want the signedUrls for</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","forms","signedUrls"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8e1f0f23-df6d-4d52-964a-b317d8e0348a"}],"id":"0848ed42-945e-44bd-943b-3071d02f80ea","description":"<p>Forms are created each time data is collected on the ground. Forms can be \"<strong>client-linked</strong>\" or \"<strong>standalone</strong>\" (meaning not linked to any client).</p>\n<p>Client-linked forms can be \"onboarding\" forms or forms completed by existing clients.</p>\n<p>You can attach forms to clients, to contracts, tasks and tickets.</p>\n","_postman_id":"0848ed42-945e-44bd-943b-3071d02f80ea"},{"name":"Mobile App Users","item":[{"name":"Create app users","id":"2db7d68d-de17-4fc5-a60f-d07a1862a8cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/agents","description":"<p>Endpoint to create a list of agents. Elements of the list should use the following attributes</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>agentNumber</code></td>\n<td>String, optional</td>\n<td>Unique identifier. System generated if not specified.</td>\n</tr>\n<tr>\n<td><code>role</code></td>\n<td>String, mandatory</td>\n<td>Role</td>\n</tr>\n<tr>\n<td><code>country</code></td>\n<td>String, mandatory</td>\n<td>Country</td>\n</tr>\n<tr>\n<td><code>contact.mobile</code></td>\n<td>String, mandatory</td>\n<td>Mobile phone (excluding country code)</td>\n</tr>\n<tr>\n<td><code>email</code></td>\n<td>String, mandatory</td>\n<td>Username to access mobile app (does not need to be an actual email)</td>\n</tr>\n<tr>\n<td><code>assignedPwd</code></td>\n<td>String, optional</td>\n<td>Password to access mobile app. System generated if not specified.</td>\n</tr>\n<tr>\n<td><code>profile.firstName</code></td>\n<td>String, mandatory</td>\n<td>Firstname</td>\n</tr>\n<tr>\n<td><code>profile.lastName</code></td>\n<td>String, mandatory</td>\n<td>Lastname</td>\n</tr>\n<tr>\n<td><code>profile.gender</code></td>\n<td>String, optional</td>\n<td>Gender</td>\n</tr>\n<tr>\n<td><code>location.village</code></td>\n<td>String, optional</td>\n<td>Other similar attributes include: commune, district, county, region, province, state</td>\n</tr>\n<tr>\n<td><code>n1Number</code></td>\n<td>String, optional</td>\n<td>Unique identifier of n+1</td>\n</tr>\n<tr>\n<td><code>n2Number</code></td>\n<td>String, optional</td>\n<td>Unique identifier of n+2</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","agents"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"86803d7c-f453-44b4-864d-610224e985b6","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"agentNumber\": \"<string>\",\n  \"role\": \"<string>\",\n  \"country\": \"<string>\",\n  \"contact\": {\n    \"mobile\": \"<number>\",\n    \"email\": \"<string>\"\n  },\n  \"profile\": {\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"birthday\": \"<date>\"\n  },\n  \"location\": {\n    \"gps\": {\n      \"longitude\": \"<string>\",\n      \"latitude\": \"<string>\"\n    },\n    \"village\": \"<string>\",\n    \"city\": \"<string>\",\n    \"county\": \"<string>\",\n    \"district\": \"<string>\",\n    \"commune\": \"<string>\",\n    \"province\": \"<string>\",\n    \"region\": \"<string>\",\n    \"state\": \"<string>\",\n    \"country\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/agents"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"pariatur\",\n  \"agent\": {\n    \"agentNumber\": \"<string>\",\n    \"role\": \"<string>\",\n    \"country\": \"<string>\",\n    \"contact\": {\n      \"mobile\": \"<number>\",\n      \"email\": \"<string>\"\n    },\n    \"profile\": {\n      \"firstName\": \"<string>\",\n      \"lastName\": \"<string>\",\n      \"gender\": \"<string>\",\n      \"birthday\": \"<date>\"\n    },\n    \"location\": {\n      \"gps\": {\n        \"longitude\": \"<string>\",\n        \"latitude\": \"<string>\"\n      },\n      \"village\": \"<string>\",\n      \"city\": \"<string>\",\n      \"county\": \"<string>\",\n      \"district\": \"<string>\",\n      \"commune\": \"<string>\",\n      \"province\": \"<string>\",\n      \"region\": \"<string>\",\n      \"state\": \"<string>\",\n      \"country\": \"<string>\"\n    }\n  }\n}"}],"_postman_id":"2db7d68d-de17-4fc5-a60f-d07a1862a8cd"},{"name":"Search app users","id":"73f0fd89-1aa3-45fb-91cc-96aa7e169ccb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/agents","description":"<p>Endpoint to search the agent collection. Pass through MongoDb-like queries in the body of your request.</p>\n","urlObject":{"protocol":"https","path":["data","search","agents"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"99d9161b-0579-4d30-90d9-14ae129a8018","name":"success","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Basic <credentials>","type":"text"}],"body":{"mode":"raw","raw":"{\r\n  \"query\": {\r\n    \"agentNumber\": \"<string>\",\r\n    \"firstName\": \"<string>\",\r\n    \"lastName\": \"<string>\",\r\n    \"email\": \"<string>\",\r\n    \"role\": \"<string>\",\r\n    \"n1AgentNumber\": \"<string>\",\r\n    \"n2AgentNumber\": \"<string>\",\r\n    \"mobile\": \"<string>\",\r\n    \"village\": \"<string>\",\r\n    \"region\": \"<string>\",\r\n    \"district\": \"<string>\",\r\n    \"county\": \"<string>\"\r\n  }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/agents"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[],"responseTime":null,"body":"{\n    \"agentNumber\": \"<string>\",\n    \"role\": \"<string>\",\n    \"email\":\"<string>\",\n    \"country\": \"<string>\",\n    \"ccy\": \"<string>\",\n    \"countryCode\": \"<string>\",\n    \"internalNumber\": \"<string>\",\n    \"contact\": {\n        \"mobile\": \"<number>\",\n        \"email\": \"<string>\",\n        \"address\": \"<string>\"\n    },\n    \"profile\": {\n        \"firstName\": \"<string>\",\n        \"lastName\": \"<string>\",\n        \"gender\": \"<string>\",\n        \"birthday\": \"<date>\",\n        \"village\": \"<string>\"\n    },\n    \"location\":{\n        \n        \"city\": \"<string>\",\n        \"county\": \"<string>\",\n        \"district\": \"<string>\",\n        \"commune\": \"<string>\",\n        \"province\": \"<string>\",\n        \"region\": \"<string>\",\n        \"state\": \"<string>\",\n        \"country\": \"<string>\"\n    },\n    \"contracts\": \"<string>\",\n    \"assets\": \"<string>\" \n\n}"}],"_postman_id":"73f0fd89-1aa3-45fb-91cc-96aa7e169ccb"},{"name":"Edit app user","id":"89d5eb79-43c7-46b6-816b-f508f67424bc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/agents","description":"<p>Endpoint to edit an existing agent specified by its agentNumber</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>newAgentNumber</code></td>\n<td>String (optional)</td>\n<td>New unique identifier of app user</td>\n</tr>\n<tr>\n<td><code>role</code></td>\n<td>String (optional)</td>\n<td>Role of app user</td>\n</tr>\n<tr>\n<td><code>cannotRegisterNewClients</code></td>\n<td>Boolean (optional)</td>\n<td>If true, prevents app user from registering new clients</td>\n</tr>\n<tr>\n<td><code>cannotManuallyAddStock</code></td>\n<td>Boolean (optional)</td>\n<td>If <code>true</code>, prevents app user scanning units by manually typing serial number</td>\n</tr>\n<tr>\n<td><code>cannotScanFrom</code></td>\n<td>List (optional)</td>\n<td>List of app user roles, user cannot scan stock from</td>\n</tr>\n<tr>\n<td><code>cannotScanFromAgent</code></td>\n<td>Boolean (optional)</td>\n<td>If <code>true</code>, app user cannot scan in stock from other app users with role \"Agent\"</td>\n</tr>\n<tr>\n<td><code>n1Number</code></td>\n<td>String (optional)</td>\n<td>Unique identifier of n+1</td>\n</tr>\n<tr>\n<td><code>n2Number</code></td>\n<td>String (optional)</td>\n<td>Unique identifier of n+2</td>\n</tr>\n<tr>\n<td><code>actingAsNumber</code></td>\n<td>String (optional)</td>\n<td>Unique identifier of app user on behalf of whom user is acting</td>\n</tr>\n<tr>\n<td><code>email</code></td>\n<td>String (optional)</td>\n<td>Unique username to log in to app</td>\n</tr>\n<tr>\n<td><code>assignedPwd</code></td>\n<td>String (optional)</td>\n<td>Password to log in to app</td>\n</tr>\n<tr>\n<td><code>newEntityNumber</code></td>\n<td>String (optional)</td>\n<td>Transfers app user to new entity</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","agents"],"host":["data","upya","io"],"query":[],"variable":[{"id":"a02ef567-c701-4873-b114-e07f759b5983","description":{"content":"<p>(Required) </p>\n","type":"text/plain"},"type":"any","value":"<string>","key":"agentNumber"}]}},"response":[{"id":"911305ac-feb3-42f1-9105-4faee5f61582","name":"success","originalRequest":{"method":"PUT","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"agentNumber\": \"<string>\",\n  \"role\": \"<string>\",\n  \"country\": \"<string>\",\n  \"contact\": {\n    \"mobile\": \"<number>\",\n    \"email\": \"<string>\"\n  },\n  \"profile\": {\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\",\n    \"gender\": \"<string>\",\n    \"birthday\": \"<date>\"\n  },\n  \"location\": {\n    \"gps\": {\n      \"longitude\": \"<string>\",\n      \"latitude\": \"<string>\"\n    },\n    \"village\": \"<string>\",\n    \"city\": \"<string>\",\n    \"county\": \"<string>\",\n    \"district\": \"<string>\",\n    \"commune\": \"<string>\",\n    \"province\": \"<string>\",\n    \"region\": \"<string>\",\n    \"state\": \"<string>\",\n    \"country\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://data.upya.io/data/agents","protocol":"https","host":["data","upya","io"],"path":["data","agents"],"variable":[{"key":"agentNumber","value":"<string>","description":"(Required) "}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"pariatur\",\n  \"agent\": {\n    \"agentNumber\": \"<string>\",\n    \"role\": \"<string>\",\n    \"country\": \"<string>\",\n    \"contact\": {\n      \"mobile\": \"<number>\",\n      \"email\": \"<string>\"\n    },\n    \"profile\": {\n      \"firstName\": \"<string>\",\n      \"lastName\": \"<string>\",\n      \"gender\": \"<string>\",\n      \"birthday\": \"<date>\"\n    },\n    \"location\": {\n      \"gps\": {\n        \"longitude\": \"<string>\",\n        \"latitude\": \"<string>\"\n      },\n      \"village\": \"<string>\",\n      \"city\": \"<string>\",\n      \"county\": \"<string>\",\n      \"district\": \"<string>\",\n      \"commune\": \"<string>\",\n      \"province\": \"<string>\",\n      \"region\": \"<string>\",\n      \"state\": \"<string>\",\n      \"country\": \"<string>\"\n    }\n  }\n}"}],"_postman_id":"89d5eb79-43c7-46b6-816b-f508f67424bc"}],"id":"68145a0f-ebe7-4494-8df8-8f9003b5468a","description":"<p>Endpoints relating to your <strong>mobile app users</strong>. Default available <strong>roles</strong> for mobile app users are</p>\n<ul>\n<li><p><strong>Agent:</strong> standard field operators</p>\n</li>\n<li><p><strong>Warehouse</strong>: app users with special rights in terms of scanning units in and out of stock</p>\n</li>\n</ul>\n<blockquote>\n<p>You can set up your own list of mobile app user roles in your settings. For example: Manager, Technician, etc </p>\n</blockquote>\n<p>You can set up <strong>accessibility rules</strong> for each product, form, pricing terms (deal), ticket template or challenge, based on app users' roles.</p>\n<blockquote>\n<p>Example: make the \"Technnical Incident\" form only accessible to mobile app users with the \"Technician\" role. </p>\n</blockquote>\n<p>You can create <strong>teams</strong>, create <strong>managers</strong> and set <strong>n+1</strong> and <strong>n+2</strong> to all app users.</p>\n<p><em><strong>Important:</strong></em> <em>credentials for the mobile app do not work for the web platform, and vice and versa. You can however attach a mobile app profile (and credentials) to any web platform user.</em></p>\n","_postman_id":"68145a0f-ebe7-4494-8df8-8f9003b5468a"},{"name":"Products","item":[{"name":"Create product","id":"38f2b7a2-5cbf-497b-9968-24549d5c2a91","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/products/create","description":"<p>Use this endpoint to set up a new product.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>productReference</code></td>\n<td>String, optional</td>\n<td>Unique identifier of product. System generated if not specified</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>String, mandatory</td>\n<td>Name of product</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>String, mandatory</td>\n<td>Category of product</td>\n</tr>\n<tr>\n<td><code>manufacturer</code></td>\n<td>String, mandatory</td>\n<td>Manufacturer of product</td>\n</tr>\n<tr>\n<td><code>lockable</code></td>\n<td>Boolean, mandatory</td>\n<td>Whether the product is lockable or not</td>\n</tr>\n<tr>\n<td><code>nonSerialized</code></td>\n<td>Boolean, optional</td>\n<td>Whether the product is serialized or not</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","products","create"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"236214ba-6dfb-49aa-985b-c6c91a064190","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"product\": {\n        \"productReference\": \"BI620\",\n        \"name\": \"620\",\n        \"category\": \"Energy\",\n        \"manufacturer\": \"Biolite\",\n        \"lockable\": true\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/products/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:56:40 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"86"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"56-arELkCG/CESeCNRMzBNV5k1MEis\""}],"cookie":[],"responseTime":null,"body":"{\n    \"result\": [\n        {\n            \"message\": \"Success\",\n            \"status\": \"Success\",\n            \"_id\": \"64f660a8b28ab6001917d955\"\n        }\n    ]\n}"},{"id":"483cd427-61fa-4456-ba93-1ccb9c28c475","name":"error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"product\": {\n        \"name\": \"620\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/products/create"},"status":"Bad Request","code":400,"_postman_previewlanguage":"html","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:57:11 GMT"},{"key":"Content-Type","value":"text/html; charset=utf-8"},{"key":"Content-Length","value":"17"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"11-BmXyJR57V3HTR6Z9RoFXLee/9SE\""}],"cookie":[],"responseTime":null,"body":"Product malformed"}],"_postman_id":"38f2b7a2-5cbf-497b-9968-24549d5c2a91"},{"name":"Search products","id":"a09251b2-a55f-4fb9-925e-618911800742","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/products/search","description":"<p>Endpoint to retrieve information regarding available products</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"query\": {\n        \"manufacturer\": \"Amped\"\n    },\n    \"limit\": 1\n}\n\n</code></pre>\n<p>Like for the other search queries, you can use the <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> MongoDb options to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<p>You can use the additionnal field <code>includeBoQ</code> to request a populated build of quantities for each product.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"query\": {\n        \"name\": \"Samsung A3\"\n    },\n    \"includeBoQ\": true\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","products","search"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"0966f0d4-5a97-478a-9e94-cfcaba6b4142","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"query\": {\n        \"manufacturer\": \"Amped\"\n    },\n    \"limit\": 1\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/products/search"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:13:36 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"113"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"71-m/Qh26CFonLOoyzCm5fTfhp+3yY\""},{"key":"Set-Cookie","value":"connect.sid=s%3AMVRHr1Vkk_uJQICi2twg2O9EGZOb-Hf9.%2FzGAccLtdP7LAXhTYH3F2AJuvBYP7UwJNo2DafQLWQ0; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"name\": \"Wow100\",\n        \"category\": \"Energy\",\n        \"lockable\": true,\n        \"productReference\": \"1594202540734\",\n        \"manufacturer\": \"Amped\"\n    }\n]"}],"_postman_id":"a09251b2-a55f-4fb9-925e-618911800742"},{"name":"Edit product","id":"ca981201-f326-4534-a51a-910548d9d314","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/products","description":"<p>Use this endpoint to edit an existing product, specified by its <em>productReference</em>.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>productReference</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of targeted product</td>\n</tr>\n<tr>\n<td><code>name</code></td>\n<td>String, optional</td>\n<td>New name</td>\n</tr>\n<tr>\n<td><code>manufacturer</code></td>\n<td>String, optional</td>\n<td>New manufacturer</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","products"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"e71c3293-4f3e-44c6-857d-9c1a1da94f40","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n    \"product\": {\n        \"productReference\": \"BI620\",\n        \"name\": \"620 Plus\"\n    }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/products/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"message\": \"irure non laboris mollit\"\n}"}],"_postman_id":"ca981201-f326-4534-a51a-910548d9d314"}],"id":"1aa3985d-8583-4d9a-9688-3463c87aea67","description":"<p>Set up endpoints. Your products are the type of goods that your company sells with Upya.</p>\n<blockquote>\n<p>Example: Samsung S20</p>\n</blockquote>\n<p>Products can be <strong>serialized</strong> or <strong>non-serialized</strong> and <strong>lockable</strong> or <strong>non-lockable</strong>.</p>\n<p>Lockable products are products that can be remotely locked if the client doesn't pay for his/her device. The locking mechanism can be either time-based or communication-based.</p>\n","_postman_id":"1aa3985d-8583-4d9a-9688-3463c87aea67"},{"name":"Deals","item":[{"name":"Create deal","id":"0b5cea46-4240-4f40-81db-e21b6ad0da4e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/deals/create","description":"<p>Endpoint to create new deals (as an array) for products specified by their productReference.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>productReference</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of underlying product</td>\n</tr>\n<tr>\n<td><code>type</code></td>\n<td>String, mandatory</td>\n<td>Pricing structure: FULL, PAYG, LOAN, TOPUP, INSTALMENT</td>\n</tr>\n<tr>\n<td><code>dealName</code></td>\n<td>String, mandatory</td>\n<td>Name of deal</td>\n</tr>\n<tr>\n<td><code>description</code></td>\n<td>String, optional</td>\n<td>Internal description</td>\n</tr>\n<tr>\n<td><code>ccy</code></td>\n<td>String, mandatory</td>\n<td>Currency</td>\n</tr>\n<tr>\n<td><code>totalCost</code></td>\n<td>Number, optional</td>\n<td>Total value of deal (not applicable to non-serialized products and loan deals)</td>\n</tr>\n<tr>\n<td><code>costPerItem</code></td>\n<td>Number, optional</td>\n<td>Cost per item (only applicable to non-serialized products)</td>\n</tr>\n<tr>\n<td><code>noApprovalNeeded</code></td>\n<td>Boolean, optional</td>\n<td>Whether applications for this deal need to be approved before signature</td>\n</tr>\n<tr>\n<td><code>noQuestionnaireNeeded</code></td>\n<td>Boolean, optional</td>\n<td>Absence of onboarding questionnaire/digitalized contract</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfrontPayment</code></td>\n<td>Number, optional</td>\n<td><em>PAYG deals:</em> downpayment amount</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfrontDays</code></td>\n<td>Number, optional</td>\n<td><em>PAYG deals:</em> number of days given with downpayment</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.recurrentPayment</code></td>\n<td>Number, optional</td>\n<td><em>PAYG deals:</em> recurring amount</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.freq</code></td>\n<td>Number, optional</td>\n<td><em>PAYG deals:</em> frequency of payments</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.minPayment</code></td>\n<td>Number, optional</td>\n<td><em>PAYG deals:</em> min amount necessary to generate codes</td>\n</tr>\n<tr>\n<td><code>externalId</code></td>\n<td>String, optional</td>\n<td>External id</td>\n</tr>\n<tr>\n<td><code>loanSchedule.rate</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> rate applied per period in %</td>\n</tr>\n<tr>\n<td><code>loanSchedule.freq</code></td>\n<td>String, optional</td>\n<td><em>LOAN deals:</em> lenght of each period (Weekly or Monthly)</td>\n</tr>\n<tr>\n<td><code>loanSchedule.setDuration</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> preset duration of deal</td>\n</tr>\n<tr>\n<td><code>loanSchedule.minDuration</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> minimum accepted duration</td>\n</tr>\n<tr>\n<td><code>loanSchedule.maxDuration</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> maximum accepted duration</td>\n</tr>\n<tr>\n<td><code>loanSchedule.setDeposit</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> preset deposit needed</td>\n</tr>\n<tr>\n<td><code>loanSchedule.setValue</code></td>\n<td>Number, optional</td>\n<td><em>LOAN deals:</em> preset cost of goods</td>\n</tr>\n<tr>\n<td><code>loanSchedule.recomputeInterests</code></td>\n<td>Boolean, optional</td>\n<td><em>LOAN deals:</em> recomputes due interests upon early or late repayment</td>\n</tr>\n<tr>\n<td><code>loanSchedule.balanceIsSentToNextDate</code></td>\n<td>Boolean, optional</td>\n<td><em>LOAN deals:</em> an early repayment doesn't deduct from the last due date / period but from the next one</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","deals","create"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"8d179bb5-18d1-4357-a498-c1abb02a2413","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[{\n  \"type\": \"PAYG\",\n  \"productReference\": \"1594202540734\",\n  \"dealName\": \"New Paygo deal\",\n  \"description\": \"Created by API call\",\n  \"totalCost\": 10000,\n  \"ccy\": \"MWK\",\n  \"backPay\": \"On\",\n  \"noQuestionnaireNeeded\": true,\n  \"pricingSchedule\": {\n      \"upfrontPayment\": 10000,\n      \"upfrontDays\": 30,\n      \"recurrentPayment\": 5000,\n      \"freq\":30,\n      \"minPayment\":5000\n  }\n}]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/deals/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:32:57 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"436"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"1b4-M7ov8LeyFiJHZh9F5gTCLhegJPo\""},{"key":"Set-Cookie","value":"connect.sid=s%3Au6_PNxoOmORsaL82epPsIRQlDYay88qU.9phPvaleahkiJSfDpa06%2BME44dv7slJzOmtzhxGXPiU; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"invalidRequests\": [],\n    \"results\": [\n        {\n            \"dealName\": \"New Paygo deal\",\n            \"description\": \"Created by API call\",\n            \"dealNumber\": \"XJ0SR\",\n            \"type\": \"PAYG\",\n            \"totalCost\": 10000,\n            \"status\": \"Active\",\n            \"ccy\": \"MWK\",\n            \"backPay\": \"On\",\n            \"lockable\": true,\n            \"noQuestionnaireNeeded\": true,\n            \"eligibleProduct\": {},\n            \"pricingSchedule\": {\n                \"recurring\": 5000,\n                \"days\": 30,\n                \"upfront\": 10000,\n                \"upfrontDays\": 30,\n                \"minPayment\": 5000\n            },\n            \"topUpSchedule\": {},\n            \"setUpOn\": \"2023-09-05T10:32:57.580Z\",\n            \"restrictedTo\": []\n        }\n    ]\n}"},{"id":"6fc100eb-29fc-4396-87f8-834d7e971c4c","name":"error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[{\n  \"type\": \"PAYG\",\n  \"name\": \"API deal\",\n  \"description\": \"Created by API call\",\n  \"totalCost\": 10000,\n  \"ccy\": \"MWK\",\n  \"backPay\": \"On\",\n  \"noQuestionnaireNeeded\": true,\n  \"pricingSchedule\": {\n      \"upfrontPayment\": 10000,\n      \"upfrontDays\": 30,\n      \"recurrentPayment\": 5000,\n      \"freq\":30,\n      \"minPayment\":5000\n  }\n}]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/deals/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:31:53 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"350"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"15e-D2oc8fiuT3CBSKKsmQoI83I7sb4\""},{"key":"Set-Cookie","value":"connect.sid=s%3Aj69u0MKmawWDBBonxns6AAVnQzZCJ2Yi.pHQTUe7Slpg1OM3bvyvHQiWPcvn4X827vZDMdA4xDic; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"invalidRequests\": [\n        {\n            \"error\": 400,\n            \"message\": \"Incorrect productReference\",\n            \"data\": {\n                \"type\": \"PAYG\",\n                \"name\": \"API deal\",\n                \"description\": \"Created by API call\",\n                \"totalCost\": 10000,\n                \"ccy\": \"MWK\",\n                \"backPay\": \"On\",\n                \"noQuestionnaireNeeded\": true,\n                \"pricingSchedule\": {\n                    \"upfrontPayment\": 10000,\n                    \"upfrontDays\": 30,\n                    \"recurrentPayment\": 5000,\n                    \"freq\": 30,\n                    \"minPayment\": 5000\n                }\n            }\n        }\n    ],\n    \"results\": []\n}"}],"_postman_id":"0b5cea46-4240-4f40-81db-e21b6ad0da4e"},{"name":"Search deals","id":"9cf314ff-102e-461e-ab06-5987e89f8064","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/deals/search","description":"<p>Endpoint to retrieve list of <strong>deals</strong> available given provided criteria. Deals are the terms or payment plans under which you sell your different <strong>products</strong>.</p>\n<p>You can also use the following MongoDb options: <strong>sort</strong>, <strong>limit</strong> and <strong>select</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details</p>\n<p>Add a <code>includeOldVersions</code> flag set to true to include all deal versions in the answer. \"Old_version\" deals are not accessible by web or app users anymore.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"query\": {\n        \"type\": \"PAYG\",\n        \"status\":\"Active\"\n    },\n    \"limit\": 1,\n    \"includeOldVersions\": true\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","deals","search"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"200441c8-a00a-4d35-8a0a-81fdfccbd55b","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"query\": {\n        \"type\": \"PAYG\",\n        \"status\":\"Active\"\n    },\n    \"limit\": 1\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/deals/search"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:36:25 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"401"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"191-WAVDNsso92wvhAd3rGq3brJvINs\""},{"key":"Set-Cookie","value":"connect.sid=s%3ArqAD7ltHtUaHoh4uY-4GOvo0svaOdoEQ.CHrgj3YF1bo7BgwDvvStx%2B%2FDJe1cAQq%2BFmDPFkKV%2FbE; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"dealName\": \"GLP Home40 - Rural - 24 Month\",\n        \"dealNumber\": \"GR012563\",\n        \"type\": \"PAYG\",\n        \"totalCost\": 76100,\n        \"status\": \"Active\",\n        \"ccy\": \"MWK\",\n        \"backPay\": \"On\",\n        \"lockable\": true,\n        \"eligibleProduct\": {\n            \"name\": \"SKH40Z\",\n            \"productReference\": \"SKGLP40Z\",\n            \"category\": \"Energy\"\n        },\n        \"pricingSchedule\": {\n            \"recurring\": 2950,\n            \"days\": 30,\n            \"upfront\": 5300,\n            \"upfrontDays\": 30,\n            \"minPayment\": 2950\n        },\n        \"topUpSchedule\": {},\n        \"restricted\": true,\n        \"restrictedTo\": []\n    }\n]"}],"_postman_id":"9cf314ff-102e-461e-ab06-5987e89f8064"},{"name":"Edit deal","id":"dda23ecd-82cf-4f1e-8d8e-d06f80adb453","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/deals","description":"<p>Endpoint to edit a given deal specified by its dealNumber.</p>\n<p>Editing any numerical value (totalCost, recurring payment, etc) with an economical impact will create a <strong>new deal version</strong>. Editing non-economic fields (dealName, description, etc) will not create a new deal version.</p>\n<p>A new deal version only affects future customers picking the edited deal. Existing customers (including pending ones) will not be affected by an edit creating a new deal version.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>dealNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of deal being targeted</td>\n</tr>\n<tr>\n<td><code>totalCost</code></td>\n<td>Number, optional</td>\n<td>New total cost</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.freq</code></td>\n<td>Number, optional</td>\n<td>New payment frequency</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.recurring</code></td>\n<td>Number, optional</td>\n<td>New recurring payment amount</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfront</code></td>\n<td>Number, optional</td>\n<td>New downpayment amount</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfrontDays</code></td>\n<td>Number, optional</td>\n<td>New number of days given with downpayment</td>\n</tr>\n<tr>\n<td><code>restricted</code></td>\n<td>Boolean, optional</td>\n<td>Deal can only be accessed by the listed app users</td>\n</tr>\n<tr>\n<td><code>paused</code></td>\n<td>Boolean, optional</td>\n<td>Option to pause the deal</td>\n</tr>\n<tr>\n<td><code>agentNumbersToAdd</code></td>\n<td>Array, optional</td>\n<td>AgentNumbers to be added to the list of app users that can sell this deal</td>\n</tr>\n<tr>\n<td><code>agentNumbersToRemove</code></td>\n<td>Array, optional</td>\n<td>AgentNumbers to be removed from the list of app users that can sell this deal</td>\n</tr>\n<tr>\n<td><code>eligibleCategories</code></td>\n<td>Array, optional</td>\n<td>List of client categories to which this deal is restricted</td>\n</tr>\n<tr>\n<td><code>description</code></td>\n<td>String, optional</td>\n<td>Internal description</td>\n</tr>\n</tbody>\n</table>\n</div><p>You can also restrict access to the deal to certain mobile app users, using the agentNumbersToAdd and agentNumbersToRemove fields.</p>\n","urlObject":{"protocol":"https","path":["data","deals"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"8806d91b-4ff6-4869-8101-70a3ab91531f","name":"success","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"dealNumber\": \"XJ0SR\",\n    \"totalCost\": 150000,\n    \"pricingSchedule\": {\n        \"days\": 20,\n        \"recurring\": 15000,\n        \"upfront\": 5000,\n        \"upfrontDays\": 3000\n    },\n    \"description\": \"Edited by API call\"\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/deals"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:40:07 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"453"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"1c5-neZpICDAjHrM3Ep9vTCzSpsh0wg\""},{"key":"Set-Cookie","value":"connect.sid=s%3An4Ll1gWwHVRcqc8ACEc43HsxkjIepeXp.EG5fAtAbdVQKrsLRrZqVsM1vP9lTDV4uIXFENhbOI54; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"Success\",\n    \"message\": \"Success\",\n    \"result\": {\n        \"dealName\": \"New Paygo deal\",\n        \"description\": \"Edited by API call\",\n        \"dealNumber\": \"XJ0SR\",\n        \"type\": \"PAYG\",\n        \"totalCost\": 150000,\n        \"status\": \"Active\",\n        \"ccy\": \"MWK\",\n        \"backPay\": \"On\",\n        \"lockable\": true,\n        \"noQuestionnaireNeeded\": true,\n        \"eligibleProduct\": {},\n        \"pricingSchedule\": {\n            \"recurring\": 15000,\n            \"days\": 20,\n            \"upfront\": 5000,\n            \"upfrontDays\": 3000,\n            \"minPayment\": 5000\n        },\n        \"topUpSchedule\": {},\n        \"setUpOn\": \"2023-09-05T10:40:07.080Z\",\n        \"restrictedTo\": []\n    }\n}"}],"_postman_id":"dda23ecd-82cf-4f1e-8d8e-d06f80adb453"}],"id":"449a9037-19dc-4af9-96ac-5f78e6a38522","description":"<p>Set up endpoints. <strong>Deals</strong> are the different pricing terms under which your company sells its products.</p>\n<p>Deals can be of different types:</p>\n<ul>\n<li><strong>FULL</strong>: full upfront pricing structure (cash sale)</li>\n<li><strong>PAYG</strong>: lease-to-own pricing structure with pre-set monthly instalment (lockable units)</li>\n<li><strong>INSTALMENT</strong>: lease-to-own pricing structure with pre-set monthly instalment (non-lockable units)</li>\n<li><strong>LOAN</strong>: loan pricing structure with weekly or monthly interest rate, early &amp; late repayment rules, etc</li>\n<li><strong>TOPUP</strong>: prepaid pricing structure</li>\n<li><strong>PERPEUITY</strong>: lease pricing structure, with pre-set monthly instalment</li>\n</ul>\n<p>Deals also specify the <strong>onboarding process</strong>, behind selling product X under pricing terms Y. Along with the <strong>penalty regime</strong> for late payments and the offered <strong>warranty</strong>.</p>\n","_postman_id":"449a9037-19dc-4af9-96ac-5f78e6a38522"},{"name":"Tickets","item":[{"name":"Create tickets","id":"438b44cc-069c-4349-825f-97a2d870ed76","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/tickets/create","description":"<p>Endpoint to send <strong>tickets</strong> to web app users. Requires to have the \"<em>task</em>\" option activated and to have set up a \"<em>ticket template</em>\" in the Templates &gt;&gt; Set Up section of <a href=\"https://manage.upya.io\">Manage</a>.</p>\n<p>Use an existing <strong>templateNumber</strong> and an existing <strong>userNumber.</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>templateNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of the ticket template being used</td>\n</tr>\n<tr>\n<td><code>userNumber</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of the web user receiving the ticket</td>\n</tr>\n<tr>\n<td><code>clientNumber</code></td>\n<td>String, optional</td>\n<td><em>Optional</em>: unique identifier of the client linked to the ticket</td>\n</tr>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String, optional</td>\n<td><em>Optional</em>: unique identifier of the contract linked to the ticket</td>\n</tr>\n<tr>\n<td><code>text</code></td>\n<td>String, optional</td>\n<td><em>Optional</em>: addiational instructions</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","tickets","create"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"438b44cc-069c-4349-825f-97a2d870ed76"},{"name":"Search tickets","id":"691470a8-35f2-486e-a8bb-a63b21423086","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/tickets","description":"<p>Endpoint to search the ticket database. Pass through MongoDb-like queries in the body of the request</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"query\": {\n      \"createdAt\": {\n          \"$gte\": \"05 September 2023\"\n      }\n  },\n  \"paginate\":true,\n  \"limit\":1\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","tickets"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"892c8aa9-95f5-4240-adb6-c5e3aaecae81","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n      \"createdAt\": {\n          \"$gte\": \"05 September 2023\"\n      }\n  },\n  \"paginate\":true,\n  \"limit\":1\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/tickets"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 10:44:13 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"542"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"21e-cGAUCflnuC/ctUgheg5fbVaJH/8\""},{"key":"Set-Cookie","value":"connect.sid=s%3ASMbKP7saersdTZb3u_B3unrhyKBJd3n_.DwbsKPPmoMfNiLy9q9Yp5d%2Fv767a2RSp7i9NPm0itQk; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"paging\": {\n        \"total\": 0,\n        \"nPerPage\": 5000\n    },\n    \"data\": [\n        {\n            \"ticketId\": \"64f6c3009d4b2500128b1c06\",\n            \"ticketNumber\": \"WDQBMNKTZ\",\n            \"status\": \"Closed\",\n            \"progress\": \"Closed\",\n            \"origin\": \"Automation\",\n            \"raisedOn\": \"05-Sep-2023 05:56:16\",\n            \"closedOn\": \"05-Sep-2023 10:15:22\",\n            \"title\": \"New Customer for validation\",\n            \"contractNumber\": \"389337611\",\n            \"clientNumber\": \"C389268624\",\n            \"parentTask\": \"64f6c25c9d4b2500128b17c2\",\n            \"parentTicket\": \"64f6c25c9d4b2500128b17b0\",\n            \"ReportId 01\": \"64f6c25c9d4b2500128b17c6\",\n            \"ReportId 11\": \"64f6c2ff9d4b2500128b1b91\",\n            \"ReportId 21\": \"64f6ff019d4b25001290f6fc\"\n        }\n    ]\n}"}],"_postman_id":"691470a8-35f2-486e-a8bb-a63b21423086"}],"id":"0fa4d2c9-58e0-4754-9d8a-33eae131e343","description":"<p><strong>Tickets</strong> are \"actions\" received by <em>web users</em>.</p>\n","_postman_id":"0fa4d2c9-58e0-4754-9d8a-33eae131e343"},{"name":"Tasks","item":[{"name":"Create tasks","id":"59273466-f3a1-4597-a451-5c82ac3f4514","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/tasks/create","description":"<p>Endpoint to send <strong>tasks</strong> to mobile app users. Requires to have the \"<em>task</em>\" option activated and to have set up a \"<em>task template</em>\" in the Templates &gt;&gt; Set Up section of <a href=\"https://manage.upya.io\">Manage</a>.</p>\n<p>Tasks can be created in bulk.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>templateNumber</code></td>\n<td>String</td>\n<td>Unique identifier of the task being sent to the agent</td>\n</tr>\n<tr>\n<td><code>agentNumber</code></td>\n<td>String</td>\n<td>Unique identifier of the agent the task is being assigned to</td>\n</tr>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String</td>\n<td><em>Optional</em>: identifier of the contract the task relates to</td>\n</tr>\n<tr>\n<td><code>instructions</code></td>\n<td>String</td>\n<td><em>Optional:</em> if populated, overrides the template's intructions</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","tasks","create"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"28aadaf6-f555-4abc-9d45-27b7fce5e21c","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"templateNumber\": \"D9VKDIE0W\",\r\n        \"agentNumber\": \"YE46H\"\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/tasks/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 19:34:54 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"109"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"6d-UDHszyqjIfOQ1M7o49yfEMNCqP0\""}],"cookie":[],"responseTime":null,"body":"{\n    \"invalidRequests\": [],\n    \"results\": [\n        {\n            \"templateNumber\": \"D9VKDIE0W\",\n            \"taskNumber\": \"PMI17MB7Q\",\n            \"status\": \"Success\"\n        }\n    ]\n}"},{"id":"ca633b90-3898-4007-ba28-2bd8b333d338","name":"error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"templateNumber\": \"D9VK0W\",\r\n        \"agentNumber\": \"YE46H\"\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/tasks/create"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 19:35:14 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"151"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"97-Ea6AOItezfbQe6Mg+eq5yekWlYs\""}],"cookie":[],"responseTime":null,"body":"{\n    \"invalidRequests\": [\n        {\n            \"error\": 400,\n            \"message\": \"Incorrect or empty templateNumber\",\n            \"data\": {\n                \"templateNumber\": \"D9VK0W\",\n                \"agentNumber\": \"YE46H\"\n            }\n        }\n    ],\n    \"results\": []\n}"}],"_postman_id":"59273466-f3a1-4597-a451-5c82ac3f4514"},{"name":"Search tasks","id":"e050b56d-45e1-4068-a35f-f569ccf4a9b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/tasks","description":"<p>Endpoint to search the task database. Pass through MongoDb-like queries in the body of the request</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"query\": {\n      \"createdAt\": {\n          \"$gte\": \"05 September 2023\"\n      }\n  },\n  \"paginate\":true,\n  \"limit\":1\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","tasks"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"9b0c0ef3-1965-49dd-92e4-bb1dc660faa4","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {},\n  \"limit\": 1\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/tasks"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n    \"docs\": [\n        {\n            \"taskId\": \"638a30d09b24310013c1a175\",\n            \"taskNumber\": \"RDX9H5YK5\",\n            \"title\": \"Installation\",\n            \"priority\": \"High\",\n            \"instructions\": \"Compéter installation\\nMerci pour votre paiement de\",\n            \"assignedOn\": \"02-Dec-2022 05:07:28\",\n            \"completedOn\": \"\",\n            \"dueOn\": \"07-Dec-2022 05:07:15\",\n            \"closedOn\": \"\",\n            \"assignedTo\": \"123\",\n            \"contractNumber\": \"A04757857\",\n            \"clientNumber\": \"C04757823\",\n            \"parentTicket\": \"638a1a36199e630011dc0ad6\"\n        }\n    ],\n    \"limit\": 1\n}"}],"_postman_id":"e050b56d-45e1-4068-a35f-f569ccf4a9b8"}],"id":"3b1de97b-266f-4ed3-9de6-7485829ea235","description":"<p><strong>Tasks</strong> are \"actions\" assigned to mobile app users.</p>\n","_postman_id":"3b1de97b-266f-4ed3-9de6-7485829ea235"},{"name":"Events","item":[{"name":"Search contract events","id":"fc75a8f2-5472-4d6b-9a44-3603ffbca825","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/search/contract-events","description":"<p>Endpoint to search the contractEvent database. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","search","contract-events"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"86859c6d-e2cd-467d-b675-c63006740a11","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"endDate\": \"<string>\",\n    \"info\": \"<string>\",\n    \"additionalInfo\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/contract-events"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"endDate\": \"<string>\",\n    \"info\": \"<string>\",\n    \"additionalInfo\": \"<string>\"\n  },\n  {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"endDate\": \"<string>\",\n    \"info\": \"<string>\",\n    \"additionalInfo\": \"<string>\"\n  }\n]"}],"_postman_id":"fc75a8f2-5472-4d6b-9a44-3603ffbca825"},{"name":"Search asset events","id":"d1436272-e0df-461f-b495-f2f1e7de1a27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/search/asset-events","description":"<p>Endpoint to search the assetEvent database. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","search","asset-events"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"e8b29d2e-3030-46af-8be4-a3b178e814fa","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"paygNumber\": \"<string>\",\n    \"prevPaygNumber\": \"<string>\",\n    \"prevContractNumber\": \"<string>\",\n    \"note\": \"<string>\",\n    \"author\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/asset-events"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"paygNumber\": \"<string>\",\n    \"prevPaygNumber\": \"<string>\",\n    \"prevContractNumber\": \"<string>\",\n    \"note\": \"<string>\",\n    \"author\": \"<string>\"\n  },\n  {\n    \"type\": \"<string>\",\n    \"date\": \"<string>\",\n    \"paygNumber\": \"<string>\",\n    \"prevPaygNumber\": \"<string>\",\n    \"prevContractNumber\": \"<string>\",\n    \"note\": \"<string>\",\n    \"author\": \"<string>\"\n  }\n]"}],"_postman_id":"d1436272-e0df-461f-b495-f2f1e7de1a27"}],"id":"4bf8d3e0-d309-4dd5-a635-deeaf8fda5d7","description":"<p>On Upya, changes to any client, unit or contract are monitored and logged as <strong>events</strong>. These events can be forwarded to <strong>webhooks</strong> as they occur (see the \"Webhook\" section).</p>\n<p>Alternatively, you can query your <strong>clientEvents</strong>, <strong>contractEvents</strong> and <strong>assetEvents</strong> database.</p>\n<p>They are different <strong>types</strong> of contractEvents and assetEvents and these types can be divided between:</p>\n<ul>\n<li><p>Life events types</p>\n</li>\n<li><p>Updates events types</p>\n</li>\n</ul>\n<p>ContractEvents <strong>life events</strong> types include:</p>\n<blockquote>\n<p>SIGNED, SUBMITTED, REJECTED, APPROVED,  WRITEOFF, UNWRITEOFF, REPOSSESSED, UNREPOSSESSED, ENABLED, LOCKED, PAIDOFF, FLAG, PAYMENT </p>\n</blockquote>\n<p>ContractEvents <strong>update events</strong> types include:</p>\n<blockquote>\n<p>DEAL_CHANGE, DEAL_UPDATE, REPLACED, MODIFIED, TRANSFERED, ADDED, REMOVED</p>\n</blockquote>\n","_postman_id":"4bf8d3e0-d309-4dd5-a635-deeaf8fda5d7"},{"name":"Communicate","item":[{"name":"Send pop-up notification","id":"bd4b367f-c3b0-4807-b8dd-6db9e4319211","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/communication/notification","description":"<p>Send a pop up message, or \"notification\", to the mobile app of your agents. There is no charge for sending notifications.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>agentNumber</code></td>\n<td>String, mandatory</td>\n<td>Targeted app user</td>\n</tr>\n<tr>\n<td><code>message</code></td>\n<td>String, mandatory</td>\n<td>Message</td>\n</tr>\n<tr>\n<td><code>title</code></td>\n<td>String, mandatory</td>\n<td>Title</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","communication","notification"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"bd4b367f-c3b0-4807-b8dd-6db9e4319211"},{"name":"Send chat message","id":"8510201f-aea1-4c55-bf43-1d755018dff5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/communication/chat","description":"<p>Send a message to the chat of a task or ticket. Specify either a ticketNumber or taskNumber.</p>\n<p>There is no charge for sending chat messages.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>taskNumber</code></td>\n<td>String, optional (*)</td>\n<td>Unique identifier of targeted task</td>\n</tr>\n<tr>\n<td><code>ticketNumber</code></td>\n<td>String, optional (*)</td>\n<td>Unique identifier of targeted ticket</td>\n</tr>\n<tr>\n<td><code>message</code></td>\n<td>String, mandatory</td>\n<td>Message</td>\n</tr>\n</tbody>\n</table>\n</div><p>(*) at least one of taskNumber or ticketNumber must be specified</p>\n","urlObject":{"protocol":"https","path":["data","communication","chat"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8510201f-aea1-4c55-bf43-1d755018dff5"},{"name":"Send text message","id":"c077057a-a70b-4273-923b-d2e011bbf368","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/communication/message","description":"<p>Send a text message to your clients or agents. Standard SMS charges apply.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>agentNumber</code></td>\n<td>String, optional (*)</td>\n<td>Unique identifier of targeted app user</td>\n</tr>\n<tr>\n<td><code>clientNumber</code></td>\n<td>String, optional (*)</td>\n<td>Unique identifier of targeted client</td>\n</tr>\n<tr>\n<td><code>message</code></td>\n<td>String, mandatory</td>\n<td>Message</td>\n</tr>\n</tbody>\n</table>\n</div><p>(*) at lest of agentNumber or clientNumber must be specified</p>\n","urlObject":{"protocol":"https","path":["data","communication","message"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"c077057a-a70b-4273-923b-d2e011bbf368"}],"id":"bcb8b134-2212-4e10-a70b-cfebb9d35cbb","description":"<p>Endpoints to communicate with your clients and agents</p>\n","_postman_id":"bcb8b134-2212-4e10-a70b-cfebb9d35cbb"},{"name":"Users","item":[{"name":"Search users","id":"ef8bba5c-0e74-4503-aaf1-94f1303a1b31","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/search/users","description":"<p>Endpoint to get users. Pass through MongoDb-like queries in the body of the request.</p>\n<p>You can also use the following MongoDb options: <strong>sort</strong> and <strong>limit</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details. <strong>Select</strong> is not available for security reasons.</p>\n","urlObject":{"protocol":"https","path":["data","search","users"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"ef8bba5c-0e74-4503-aaf1-94f1303a1b31"},{"name":"Create users","id":"4a05ef5c-6404-417c-ae03-df68a6c40606","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/users","description":"<p>Endpoint to create web platform users</p>\n","urlObject":{"protocol":"https","path":["data","users"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"4a05ef5c-6404-417c-ae03-df68a6c40606"},{"name":"Edit users","id":"0f0b7690-04c8-4480-b4a8-73ed36876998","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/users","description":"<p>Endpoint to edit web platform users</p>\n","urlObject":{"protocol":"https","path":["data","users"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f0b7690-04c8-4480-b4a8-73ed36876998"}],"id":"72182123-58ea-4fac-a447-b29e0da6eb3c","description":"<p><strong>Users</strong> log in to the <a href=\"https://manage.upya.io\">Manage</a> web platform. Their credentials do not work on the mobile app.</p>\n","_postman_id":"72182123-58ea-4fac-a447-b29e0da6eb3c"},{"name":"Messages","item":[{"name":"Search messages","id":"4e832aaf-1e75-4516-8b19-2d3bfa622009","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/search/messages","description":"<p>Endpoint to search your message collection. Pass through MongoDb-like queries in the body of your request in the query attribute.</p>\n<blockquote>\n<p><em>Example</em>: to retrieve all forms completed for the \"Example\" questionnaire, send the following body: </p>\n</blockquote>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"date\": {$gte: \"01 August 2023\"}\n    }\n}\n\n</code></pre>\n<p>You can also use the following MongoDb options: <strong>sort</strong> and <strong>limit</strong> to optimize your request. See <a href=\"https://www.mongodb.com/docs/\">MongoDb documentation</a> for more details.</p>\n<p>Finally, to <strong>paginate</strong> your answer, you can use the MongoDb <strong>skip</strong> option by adding the following attributes to your query: paginate, pageNumber and nPerPage. The skip option overrides any \"sort\" input for answer stability reasons.</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-javascript\">{\n    \"query\": {\n        \"date\": {$gte: \"01 August 2023\"}\n    },\n    \"paginate\": true,\n    \"pageNumber\": 2,\n    \"nPerPage\": 1000\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","search","messages"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"85f10694-6f7e-415d-84e7-42cbbf0d1ff2","name":"success","originalRequest":{"method":"POST","header":[{"description":"Added as a part of security scheme: basic","key":"Authorization","value":"Basic <credentials>"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/forms"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"[\n  {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  },\n  {\n    \"name\": \"<string>\",\n    \"score\": \"<string>\",\n    \"status\": \"<string>\",\n    \"clientNumber\": \"<string>\",\n    \"firstName\": \"<string>\",\n    \"lastName\": \"<string>\"\n  }\n]"}],"_postman_id":"4e832aaf-1e75-4516-8b19-2d3bfa622009"},{"name":"Count messages","id":"d21468be-c5ad-4bc4-a752-6fc8c11bb7f9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/count/messages","description":"<p>Endpoint to count the number of messages matching a given query.</p>\n<p>Pass through MongoDb-like queries in the body of the request.</p>\n","urlObject":{"protocol":"https","path":["data","count","messages"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"ea090603-f751-4dbb-b80a-d1bbf8af9d5a","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"date\": {\n        \"$gte\":\"1 July 2020\",\n        \"$lte\":\"31 July 2020\"\n    }\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/count/messages"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Mon, 04 Sep 2023 22:35:49 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"76"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"4c-q2dEAepDO0L/PV3848CBwtUCv9k\""}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 11,\n    \"status\": \"Success\",\n    \"message\": \"11 messages found to match query\"\n}"}],"_postman_id":"d21468be-c5ad-4bc4-a752-6fc8c11bb7f9"}],"id":"5705a84c-1c6c-49eb-ba56-d04000a57c9c","description":"<p>Messages are sent to clients or field operators via external Teclo services.</p>\n","_postman_id":"5705a84c-1c6c-49eb-ba56-d04000a57c9c"},{"name":"Loans","item":[{"name":"Search due dates","id":"671308e2-77d7-45f3-b254-f23681cd309f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/schedules","description":"<p>Endpoint to search the dueDate collection (<strong>requires the dueDates or Loan option</strong> to be activated).</p>\n<p>Pass through MongoDb-like queries in the body of your request.</p>\n","urlObject":{"protocol":"https","path":["data","search","schedules"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"f7ae4872-2a67-4a38-829f-2ab895bb11ce","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"contractNumber\": \"A43086038\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/schedules"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 16:30:44 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"3870"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"f1e-W/C1HD+SnihU9bwyuTBAL1V83ps\""},{"key":"Set-Cookie","value":"connect.sid=s%3AtC4xt3bKVVLOZ41jE5VNg0JuA8QLFdYq.1B7sbxYFCSnxy7s5MWftb%2BaHFOv2o5VHRLTqUmaTQKo; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"docs\": [\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe2\",\n            \"interests\": 1447,\n            \"amount\": 11312,\n            \"principalRpmt\": 15990,\n            \"debt\": 0,\n            \"date\": \"2024-03-01T00:00:00.000Z\",\n            \"openingBalance\": 9865,\n            \"closingBalance\": 0,\n            \"periodStart\": \"2024-01-30T00:00:00.000Z\",\n            \"periodEnd\": \"2024-03-01T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [\n                {\n                    \"amount\": 18336,\n                    \"changedOn\": \"2023-08-30T21:31:33.038Z\"\n                }\n            ],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb535acbd84249c7f10c5\",\n                    \"closingBalance\": 0,\n                    \"openingBalance\": 15990,\n                    \"changedOn\": \"2023-08-30T21:31:33.039Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe1\",\n            \"interests\": 3607,\n            \"amount\": 18332,\n            \"principalRpmt\": 13941,\n            \"debt\": 15990,\n            \"date\": \"2024-01-30T00:00:00.000Z\",\n            \"openingBalance\": 24590,\n            \"closingBalance\": 9865,\n            \"periodStart\": \"2023-12-30T00:00:00.000Z\",\n            \"periodEnd\": \"2024-01-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10c3\",\n                    \"closingBalance\": 15990,\n                    \"openingBalance\": 29931,\n                    \"changedOn\": \"2023-08-30T21:31:32.979Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe0\",\n            \"interests\": 5491,\n            \"amount\": 18332,\n            \"principalRpmt\": 12158,\n            \"debt\": 29931,\n            \"date\": \"2023-12-30T00:00:00.000Z\",\n            \"openingBalance\": 37431,\n            \"closingBalance\": 24590,\n            \"periodStart\": \"2023-11-30T00:00:00.000Z\",\n            \"periodEnd\": \"2023-12-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10c1\",\n                    \"closingBalance\": 29931,\n                    \"openingBalance\": 42089,\n                    \"changedOn\": \"2023-08-30T21:31:32.920Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fdf\",\n            \"interests\": 7134,\n            \"amount\": 18332,\n            \"principalRpmt\": 10602,\n            \"debt\": 42089,\n            \"date\": \"2023-11-30T00:00:00.000Z\",\n            \"openingBalance\": 48629,\n            \"closingBalance\": 37431,\n            \"periodStart\": \"2023-10-30T00:00:00.000Z\",\n            \"periodEnd\": \"2023-11-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bf\",\n                    \"closingBalance\": 42089,\n                    \"openingBalance\": 52691,\n                    \"changedOn\": \"2023-08-30T21:31:32.853Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fde\",\n            \"interests\": 7713,\n            \"amount\": 18332,\n            \"principalRpmt\": 9246,\n            \"debt\": 52691,\n            \"date\": \"2023-10-30T00:00:00.000Z\",\n            \"openingBalance\": 52580,\n            \"closingBalance\": 48629,\n            \"periodStart\": \"2023-09-29T23:00:00.000Z\",\n            \"periodEnd\": \"2023-10-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 6668,\n            \"payments\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bc\",\n                    \"allocatedAmount\": 6668,\n                    \"payment\": {\n                        \"date\": \"2023-08-30T21:31:18.000Z\",\n                        \"amount\": 25000,\n                        \"ccy\": \"MWK\",\n                        \"transactionId\": \"9343107872\"\n                    }\n                }\n            ],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bd\",\n                    \"closingBalance\": 52691,\n                    \"openingBalance\": 61937,\n                    \"changedOn\": \"2023-08-30T21:31:32.793Z\"\n                }\n            ],\n            \"paid\": false,\n            \"missingAmount\": 11664\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fdd\",\n            \"interests\": 10269,\n            \"amount\": 18332,\n            \"principalRpmt\": 8063,\n            \"debt\": 61937,\n            \"date\": \"2023-09-29T23:00:00.000Z\",\n            \"openingBalance\": 70000,\n            \"closingBalance\": 52580,\n            \"periodStart\": \"2023-08-30T21:28:37.974Z\",\n            \"periodEnd\": \"2023-09-29T23:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 18332,\n            \"payments\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10b9\",\n                    \"allocatedAmount\": 18332,\n                    \"payment\": {\n                        \"date\": \"2023-08-30T21:31:18.000Z\",\n                        \"amount\": 25000,\n                        \"ccy\": \"MWK\",\n                        \"transactionId\": \"9343107872\"\n                    }\n                }\n            ],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10ba\",\n                    \"closingBalance\": 61937,\n                    \"openingBalance\": 70000,\n                    \"changedOn\": \"2023-08-30T21:31:32.726Z\"\n                }\n            ],\n            \"paid\": true,\n            \"missingAmount\": 0,\n            \"paidOn\": \"2023-08-30T21:31:32.728Z\"\n        }\n    ],\n    \"total\": 6,\n    \"limit\": 5000\n}"}],"_postman_id":"671308e2-77d7-45f3-b254-f23681cd309f"},{"name":"Get closingBalance","id":"91bf7673-44ad-41f4-81da-81925d31aff9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/loans/getClosingBalance","description":"<p>Endpoint to get the closingBalance of a contract specified by its contractNumber</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String (optional)</td>\n<td>Unique identifier of target contract</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","loans","getClosingBalance"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"91bf7673-44ad-41f4-81da-81925d31aff9"},{"name":"Edit terms","id":"5a1bd2a9-2215-447a-84f2-4bf60bc61d66","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/loans/editTerms","description":"<p>Endpoint to edit the terms of a <strong>\"LOAN\"</strong> contract.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th>Type</th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String (required)</td>\n<td>Unique identifier of target contract</td>\n</tr>\n<tr>\n<td><code>newAmount</code></td>\n<td>Number (optional)</td>\n<td>New monthly or weekly repayment</td>\n</tr>\n<tr>\n<td><code>newClosingBalance</code></td>\n<td>Number (optional)</td>\n<td>New closing balance</td>\n</tr>\n<tr>\n<td><code>comment</code></td>\n<td>String (optional)</td>\n<td>Free text</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","loans","editTerms"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"5a1bd2a9-2215-447a-84f2-4bf60bc61d66"},{"name":"Convert to loan","id":"e9a63bf2-5df9-4e27-b54c-dc48b29ad09f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"url":"https://data.upya.io/data/loans/convertToLoan","description":"<p>Endpoint to convert an existing \"<strong>PAYG</strong>\" contract to a \"<strong>LOAN</strong>\" contract.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Attribute</th>\n<th><strong>Type</strong></th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String (required)</td>\n<td>Target contract</td>\n</tr>\n<tr>\n<td><code>openingBalance</code></td>\n<td>Number (required)</td>\n<td>Balance at the time of transfer</td>\n</tr>\n<tr>\n<td><code>nextDueDate</code></td>\n<td>Date (required)</td>\n<td>Date of first installment</td>\n</tr>\n<tr>\n<td><code>freq</code></td>\n<td>String (required)</td>\n<td>Monthly or Weekly</td>\n</tr>\n<tr>\n<td><code>repayment</code></td>\n<td>Number (required)</td>\n<td>Repayment per period</td>\n</tr>\n<tr>\n<td><code>rate</code></td>\n<td>Number (required)</td>\n<td>Rate in % per period (Enter <code>10</code> for a 10% rate)</td>\n</tr>\n<tr>\n<td><code>deposit</code></td>\n<td>Number (optional)</td>\n<td>For informative purpose</td>\n</tr>\n<tr>\n<td><code>costOfGoods</code></td>\n<td>Number (optional)</td>\n<td>For informative purpose</td>\n</tr>\n<tr>\n<td><code>syncUnit</code></td>\n<td>Boolean (optional)</td>\n<td>Option to sync the unit attached to target contract to specified next due date</td>\n</tr>\n<tr>\n<td><code>maxPenalty</code></td>\n<td>Number (optional)</td>\n<td>Option to add a maximum penalty amout</td>\n</tr>\n<tr>\n<td><code>overrideRecomputeInterests</code></td>\n<td>Boolean (optional)</td>\n<td>Option to stop totalCost re-computation over early repayments</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["data","loans","convertToLoan"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"e9a63bf2-5df9-4e27-b54c-dc48b29ad09f"}],"id":"f689773b-bd4d-4e5a-bd42-0735ee4ff7b3","_postman_id":"f689773b-bd4d-4e5a-bd42-0735ee4ff7b3","description":""},{"name":"Slices","item":[{"name":"Edit slice","id":"d70d7a88-884b-4cf4-ae26-13a52b445dc2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"sliceNumber\": \"ABC120\",\r\n    \"credentials\": {\r\n        \"trustonic2\":{\r\n            \"tenantId\":\"xxx\",\r\n            \"apiKey\":\"yyy\"\r\n        }\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/slices/","description":"<p>Endpoint to edit a slice, specified by its sliceNumber</p>\n<p>Example payload to edit payTrigger credentials:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"sliceNumber\": \"ABC123\",\n    \"credentials\": {\n        \"payTriggerKey\":\"xxxxx\"\n    }\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["data","slices",""],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"d70d7a88-884b-4cf4-ae26-13a52b445dc2"}],"id":"e891961a-e8b4-4d31-9c29-82ef775466e2","description":"<p>Slices allow you to slice your portfolio in different tranches, based on investors, credentials or time criteria.</p>\n<p><code>Contracts</code>, <code>clients</code> and <code>units</code> can be linked to several <code>slices</code>- while they can be linked to only one <code>entity</code>.</p>\n","_postman_id":"e891961a-e8b4-4d31-9c29-82ef775466e2"},{"name":"Optionals","item":[{"name":"Search due dates","id":"a6e056a7-fbc9-4d25-90a0-150c40b3a550","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://data.upya.io/data/search/schedules","description":"<p>Endpoint to search the dueDate collection (<strong>requires the dueDates or Loan option</strong> to be activated).</p>\n<p>Pass through MongoDb-like queries in the body of your request.</p>\n","urlObject":{"protocol":"https","path":["data","search","schedules"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[{"id":"77b07dbd-6711-4295-873f-e76f1d6a1d0e","name":"success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"contractNumber\": \"A43086038\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/schedules"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Tue, 05 Sep 2023 16:30:44 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"3870"},{"key":"Connection","value":"keep-alive"},{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Methods","value":"PUT, GET, POST, DELETE, OPTIONS"},{"key":"Access-Control-Allow-Headers","value":"Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials, x-access-token"},{"key":"Cache-Control","value":"private, no-cache, no-store, must-revalidate"},{"key":"Expires","value":"-1"},{"key":"Pragma","value":"no-cache"},{"key":"ETag","value":"W/\"f1e-W/C1HD+SnihU9bwyuTBAL1V83ps\""},{"key":"Set-Cookie","value":"connect.sid=s%3AtC4xt3bKVVLOZ41jE5VNg0JuA8QLFdYq.1B7sbxYFCSnxy7s5MWftb%2BaHFOv2o5VHRLTqUmaTQKo; Path=/; HttpOnly"}],"cookie":[],"responseTime":null,"body":"{\n    \"docs\": [\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe2\",\n            \"interests\": 1447,\n            \"amount\": 11312,\n            \"principalRpmt\": 15990,\n            \"debt\": 0,\n            \"date\": \"2024-03-01T00:00:00.000Z\",\n            \"openingBalance\": 9865,\n            \"closingBalance\": 0,\n            \"periodStart\": \"2024-01-30T00:00:00.000Z\",\n            \"periodEnd\": \"2024-03-01T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [\n                {\n                    \"amount\": 18336,\n                    \"changedOn\": \"2023-08-30T21:31:33.038Z\"\n                }\n            ],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb535acbd84249c7f10c5\",\n                    \"closingBalance\": 0,\n                    \"openingBalance\": 15990,\n                    \"changedOn\": \"2023-08-30T21:31:33.039Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe1\",\n            \"interests\": 3607,\n            \"amount\": 18332,\n            \"principalRpmt\": 13941,\n            \"debt\": 15990,\n            \"date\": \"2024-01-30T00:00:00.000Z\",\n            \"openingBalance\": 24590,\n            \"closingBalance\": 9865,\n            \"periodStart\": \"2023-12-30T00:00:00.000Z\",\n            \"periodEnd\": \"2024-01-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10c3\",\n                    \"closingBalance\": 15990,\n                    \"openingBalance\": 29931,\n                    \"changedOn\": \"2023-08-30T21:31:32.979Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fe0\",\n            \"interests\": 5491,\n            \"amount\": 18332,\n            \"principalRpmt\": 12158,\n            \"debt\": 29931,\n            \"date\": \"2023-12-30T00:00:00.000Z\",\n            \"openingBalance\": 37431,\n            \"closingBalance\": 24590,\n            \"periodStart\": \"2023-11-30T00:00:00.000Z\",\n            \"periodEnd\": \"2023-12-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10c1\",\n                    \"closingBalance\": 29931,\n                    \"openingBalance\": 42089,\n                    \"changedOn\": \"2023-08-30T21:31:32.920Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fdf\",\n            \"interests\": 7134,\n            \"amount\": 18332,\n            \"principalRpmt\": 10602,\n            \"debt\": 42089,\n            \"date\": \"2023-11-30T00:00:00.000Z\",\n            \"openingBalance\": 48629,\n            \"closingBalance\": 37431,\n            \"periodStart\": \"2023-10-30T00:00:00.000Z\",\n            \"periodEnd\": \"2023-11-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 0,\n            \"payments\": [],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bf\",\n                    \"closingBalance\": 42089,\n                    \"openingBalance\": 52691,\n                    \"changedOn\": \"2023-08-30T21:31:32.853Z\"\n                }\n            ],\n            \"paid\": false\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fde\",\n            \"interests\": 7713,\n            \"amount\": 18332,\n            \"principalRpmt\": 9246,\n            \"debt\": 52691,\n            \"date\": \"2023-10-30T00:00:00.000Z\",\n            \"openingBalance\": 52580,\n            \"closingBalance\": 48629,\n            \"periodStart\": \"2023-09-29T23:00:00.000Z\",\n            \"periodEnd\": \"2023-10-30T00:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 6668,\n            \"payments\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bc\",\n                    \"allocatedAmount\": 6668,\n                    \"payment\": {\n                        \"date\": \"2023-08-30T21:31:18.000Z\",\n                        \"amount\": 25000,\n                        \"ccy\": \"MWK\",\n                        \"transactionId\": \"9343107872\"\n                    }\n                }\n            ],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10bd\",\n                    \"closingBalance\": 52691,\n                    \"openingBalance\": 61937,\n                    \"changedOn\": \"2023-08-30T21:31:32.793Z\"\n                }\n            ],\n            \"paid\": false,\n            \"missingAmount\": 11664\n        },\n        {\n            \"_id\": \"64efb486acbd84249c7f0fdd\",\n            \"interests\": 10269,\n            \"amount\": 18332,\n            \"principalRpmt\": 8063,\n            \"debt\": 61937,\n            \"date\": \"2023-09-29T23:00:00.000Z\",\n            \"openingBalance\": 70000,\n            \"closingBalance\": 52580,\n            \"periodStart\": \"2023-08-30T21:28:37.974Z\",\n            \"periodEnd\": \"2023-09-29T23:00:00.000Z\",\n            \"contract\": {\n                \"contractNumber\": \"A43086038\"\n            },\n            \"deal\": {\n                \"dealName\": \"PreSet Loan Test\"\n            },\n            \"ccy\": \"MWK\",\n            \"paidAmount\": 18332,\n            \"payments\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10b9\",\n                    \"allocatedAmount\": 18332,\n                    \"payment\": {\n                        \"date\": \"2023-08-30T21:31:18.000Z\",\n                        \"amount\": 25000,\n                        \"ccy\": \"MWK\",\n                        \"transactionId\": \"9343107872\"\n                    }\n                }\n            ],\n            \"pastDates\": [],\n            \"pastAmounts\": [],\n            \"pastBalances\": [\n                {\n                    \"_id\": \"64efb534acbd84249c7f10ba\",\n                    \"closingBalance\": 61937,\n                    \"openingBalance\": 70000,\n                    \"changedOn\": \"2023-08-30T21:31:32.726Z\"\n                }\n            ],\n            \"paid\": true,\n            \"missingAmount\": 0,\n            \"paidOn\": \"2023-08-30T21:31:32.728Z\"\n        }\n    ],\n    \"total\": 6,\n    \"limit\": 5000\n}"}],"_postman_id":"a6e056a7-fbc9-4d25-90a0-150c40b3a550"},{"name":"Search penalties","id":"10f430d8-59b0-4d79-af22-bef29fda5e92","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://data.upya.io/data/search/penalties","description":"<p>Endpoint to search the penalty database. Requires the dueDates or the financialPenalties option. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","search","penalties"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"10f430d8-59b0-4d79-af22-bef29fda5e92"},{"name":"Search commissions","id":"0f011c62-3e01-4933-ab26-6a064ed43da8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"{\n  \"query\": {\n    \"agentNumber\": \"ABC\",\n    \"contractNumber\": \"ABC\",\n    \"challengeNumber\": \"ABC\"\n  }\n}","options":{"raw":{"language":"json"}}},"url":"https://data.upya.io/data/search/commissions","description":"<p>Requires the challenge option. Endpoint to search the commission database. Pass through MongoDb-like queries in the body of the request</p>\n","urlObject":{"protocol":"https","path":["data","search","commissions"],"host":["data","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"0f011c62-3e01-4933-ab26-6a064ed43da8"}],"id":"1fa9b3e0-a888-4ea0-a92c-b6a09e7875a0","_postman_id":"1fa9b3e0-a888-4ea0-a92c-b6a09e7875a0","description":""},{"name":"Schemas","item":[],"id":"21877299-8599-4be4-86f8-ad4c3395f53e","description":"<p>List of Upya Models</p>\n<p><strong>Client Model</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>clientNumber</code></td>\n<td>String</td>\n<td>Unique client identifier</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String</td>\n<td>enum: [\"Validated\", \"Signed\", \"Approved\", \"Rejected\", \"Pending\", \"Qualifying\"]</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>String</td>\n<td>enum customizable by Upya user</td>\n</tr>\n<tr>\n<td><code>stage</code></td>\n<td>String</td>\n<td>enum customizable by Upya user</td>\n</tr>\n<tr>\n<td><code>profile.firstName</code></td>\n<td>String</td>\n<td>Client firstname</td>\n</tr>\n<tr>\n<td><code>profile.lastName</code></td>\n<td>String</td>\n<td>Client lastname</td>\n</tr>\n<tr>\n<td><code>profile.gender</code></td>\n<td>String</td>\n<td>Client gender</td>\n</tr>\n<tr>\n<td><code>profile.village</code></td>\n<td>String</td>\n<td>Client village. Other similar attributes include: city, commune, district, county, region, province, state, country, landmark, address, route, directions, postcode,</td>\n</tr>\n<tr>\n<td><code>contact.countryCode</code></td>\n<td>String</td>\n<td>Country code (+251)</td>\n</tr>\n<tr>\n<td><code>contact.mobile</code></td>\n<td>Number</td>\n<td>Mobile number excluding country code. Other similar attributes are secondaryMobile, neighourMobile and nextOfKinMobile</td>\n</tr>\n<tr>\n<td><code>contracts</code></td>\n<td>Array</td>\n<td>List of contracts</td>\n</tr>\n<tr>\n<td><code>agent</code></td>\n<td>Object</td>\n<td>Responsible agent</td>\n</tr>\n<tr>\n<td><code>entryDate</code></td>\n<td>Date</td>\n<td>Date at which the client was entered in the cloud database (can be later than date on which it was entered by agent)</td>\n</tr>\n<tr>\n<td><code>creditDecisionDate</code></td>\n<td>Date</td>\n<td>Approval / Rejection decision date</td>\n</tr>\n<tr>\n<td><code>signingDate</code></td>\n<td>Date</td>\n<td>Date of signature of first contract</td>\n</tr>\n<tr>\n<td><code>entity</code></td>\n<td>Object</td>\n<td>Entity object</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Contract model</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>contractNumber</code></td>\n<td>String</td>\n<td>Unique contract identifier</td>\n</tr>\n<tr>\n<td><code>client</code></td>\n<td>Object</td>\n<td>Mongodb reference of client linked to contract</td>\n</tr>\n<tr>\n<td><code>onboardingStatus</code></td>\n<td>String</td>\n<td>enum [\"Pending\", \"Approved\", \"Signed\", \"Rejected\"]</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String</td>\n<td>enum [\"LOCKED\", \"ENABLED\", \"PAIDOFF\", \"REPOSSESSED\", \"WRITEOFF\"]</td>\n</tr>\n<tr>\n<td><code>product</code></td>\n<td>Object</td>\n<td>Mongodb reference of product linked to contract</td>\n</tr>\n<tr>\n<td><code>deal</code></td>\n<td>Object</td>\n<td>Mongodb reference of deal linked to contract</td>\n</tr>\n<tr>\n<td><code>lockable</code></td>\n<td>Boolean</td>\n<td>TRUE for contracts linked to lockable products</td>\n</tr>\n<tr>\n<td><code>totalCost</code></td>\n<td>Number</td>\n<td>Total cost of contract</td>\n</tr>\n<tr>\n<td><code>ccy</code></td>\n<td>String</td>\n<td>Currency of contract</td>\n</tr>\n<tr>\n<td><code>remainingDebt</code></td>\n<td>Number</td>\n<td>Debt remaining on contract</td>\n</tr>\n<tr>\n<td><code>totalPaid</code></td>\n<td>Number</td>\n<td>Total amount paid to contract</td>\n</tr>\n<tr>\n<td><code>nextStatusUpdate</code></td>\n<td>Date</td>\n<td>Date of next status change</td>\n</tr>\n<tr>\n<td><code>lastStatusUpdate</code></td>\n<td>Date</td>\n<td>Date of last status change</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfrontPayment</code></td>\n<td>Number</td>\n<td>Deposit amount for contract</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.upfrontDays</code></td>\n<td>Number</td>\n<td>Number of days the client is entitled to upon deposit payment (can be 0)</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.recurrentPayment</code></td>\n<td>Number</td>\n<td>Amount that needs to be paid on a recurring basis</td>\n</tr>\n<tr>\n<td><code>pricingSchedule.freq</code></td>\n<td>Number</td>\n<td>Number of days bought by the \"recurrentPayment\"</td>\n</tr>\n<tr>\n<td><code>agent</code></td>\n<td>Object</td>\n<td>MongoDb reference of mobile app user / agent responsible for contract. Usually the sales person</td>\n</tr>\n<tr>\n<td><code>asset</code></td>\n<td>Object</td>\n<td>MongoDb reference of unit attached to contract</td>\n</tr>\n<tr>\n<td><code>assets</code></td>\n<td>Array</td>\n<td>If multiple units are attached to contract, MongoDb reference of units additional to the main unit</td>\n</tr>\n<tr>\n<td><code>items</code></td>\n<td>Array</td>\n<td>Non-serialized items attached to contract</td>\n</tr>\n<tr>\n<td><code>channel</code></td>\n<td>String</td>\n<td>enum customizable by Upya client</td>\n</tr>\n<tr>\n<td><code>costCenter</code></td>\n<td>String</td>\n<td>enum customizable by Upya client</td>\n</tr>\n<tr>\n<td><code>categories</code></td>\n<td>String</td>\n<td>enum customizable by Upya client</td>\n</tr>\n<tr>\n<td><code>entryDate</code></td>\n<td>Date</td>\n<td>Date at which application was entered on mobile app</td>\n</tr>\n<tr>\n<td><code>subsmissionDate</code></td>\n<td>Date</td>\n<td>date at which phone was synced and application was created in cloud database</td>\n</tr>\n<tr>\n<td><code>creditDecisionDate</code></td>\n<td>Date</td>\n<td>Approval / rejection date</td>\n</tr>\n<tr>\n<td><code>signingDate</code></td>\n<td>Date</td>\n<td>Date of signature</td>\n</tr>\n<tr>\n<td><code>installationDate</code></td>\n<td>Date</td>\n<td>Date of installation</td>\n</tr>\n<tr>\n<td><code>paidOffDate</code></td>\n<td>Date</td>\n<td>Date contract was fully paid off</td>\n</tr>\n<tr>\n<td><code>repossessionDate</code></td>\n<td>Date</td>\n<td>Date contract was repossessed</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Asset model</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>assetNumber</code></td>\n<td>String</td>\n<td>Unique asset identifier (number internal to Upya)</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String</td>\n<td>enum: [\"INSTOCK\", \"DEPLOYED\", \"DEFECTIVE\", \"PENDING\", \"LINKED\"]</td>\n</tr>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String</td>\n<td>Serial number of unit (unique)</td>\n</tr>\n<tr>\n<td><code>paygNumber</code></td>\n<td>String</td>\n<td>PAYGO number of unit (unique). Can be the same or different to serial number</td>\n</tr>\n<tr>\n<td><code>product</code></td>\n<td>Object</td>\n<td>Reference to MongoDb's product object</td>\n</tr>\n<tr>\n<td><code>manageBy</code></td>\n<td>String</td>\n<td>For lockable products: locking serve provider. Example: Nexus or GLP Link</td>\n</tr>\n<tr>\n<td><code>lockable</code></td>\n<td>Boolean</td>\n<td>TRUE for units that can be activated or locked</td>\n</tr>\n<tr>\n<td><code>nonSerialized</code></td>\n<td>Boolean</td>\n<td>TRUE for non-serialized items</td>\n</tr>\n<tr>\n<td><code>isPart</code></td>\n<td>Boolean</td>\n<td>TRUE for parts</td>\n</tr>\n<tr>\n<td><code>heldBy</code></td>\n<td>Object</td>\n<td>MongoDb reference of mobile app user holding the unit</td>\n</tr>\n<tr>\n<td><code>ownedBy</code></td>\n<td>Object</td>\n<td>MongoDb reference of client owning the unit</td>\n</tr>\n<tr>\n<td><code>contract</code></td>\n<td>Object</td>\n<td>MongoDb reference of contract to which the unit is attached</td>\n</tr>\n<tr>\n<td><code>repaired</code></td>\n<td>Boolean</td>\n<td>TRUE if unit has been repaired</td>\n</tr>\n<tr>\n<td><code>secondHand</code></td>\n<td>Boolean</td>\n<td>TRUE if unit has been deployed before</td>\n</tr>\n<tr>\n<td><code>deployDates</code></td>\n<td>Array</td>\n<td></td>\n</tr>\n<tr>\n<td><code>stockEntryDates</code></td>\n<td>Array</td>\n<td></td>\n</tr>\n<tr>\n<td><code>defectDates</code></td>\n<td>Array</td>\n<td></td>\n</tr>\n<tr>\n<td><code>repairDates</code></td>\n<td>Array</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Payment model</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>transactionId</code></td>\n<td>String</td>\n<td>Unique transaction Id. Usually the Mobile Money Operator's unique transaction identifier</td>\n</tr>\n<tr>\n<td><code>amount</code></td>\n<td>Number</td>\n<td>Value of payment</td>\n</tr>\n<tr>\n<td><code>type</code></td>\n<td>String</td>\n<td>Mobile money, Float, Cash, Bank transfer, ...</td>\n</tr>\n<tr>\n<td><code>ccy</code></td>\n<td>String</td>\n<td>Currency of payment</td>\n</tr>\n<tr>\n<td><code>reference</code></td>\n<td>String</td>\n<td>Reference used by client when making payment</td>\n</tr>\n<tr>\n<td><code>subscriber</code></td>\n<td>Number</td>\n<td>Mobile phone having made the payment</td>\n</tr>\n<tr>\n<td><code>status</code></td>\n<td>String</td>\n<td>enum: [\"ACCEPTED\", \"UNASSIGNED\", \"PREACCEPTED\", \"FAILED\"]</td>\n</tr>\n<tr>\n<td><code>contract</code></td>\n<td>Object</td>\n<td>MongoDb reference of contract to which payment has been assigned</td>\n</tr>\n<tr>\n<td><code>client</code></td>\n<td>Object</td>\n<td>MongoDb reference of client linked to contract</td>\n</tr>\n</tbody>\n</table>\n</div><p><strong>Agent model</strong></p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>agentNumber</code></td>\n<td>String</td>\n<td>Unique identifier of agent</td>\n</tr>\n<tr>\n<td><code>role</code></td>\n<td>String</td>\n<td>enum customizable by Upya client</td>\n</tr>\n<tr>\n<td><code>email</code></td>\n<td>String</td>\n<td>Login username of mobile app</td>\n</tr>\n<tr>\n<td><code>profile.firstName</code></td>\n<td>String</td>\n<td>Firstname</td>\n</tr>\n<tr>\n<td><code>profile.lastName</code></td>\n<td>String</td>\n<td>Lastname</td>\n</tr>\n<tr>\n<td><code>contact.countryCode</code></td>\n<td>String</td>\n<td>+251</td>\n</tr>\n<tr>\n<td><code>contact.mobile</code></td>\n<td>Number</td>\n<td>Phone number excluding country code</td>\n</tr>\n<tr>\n<td><code>language</code></td>\n<td>String</td>\n<td>Language preference for mobile app</td>\n</tr>\n<tr>\n<td><code>n1</code></td>\n<td>Object</td>\n<td>MongoDb reference of agent above agent</td>\n</tr>\n<tr>\n<td><code>n2</code></td>\n<td>Object</td>\n<td>MongoDb reference of agent above n1</td>\n</tr>\n<tr>\n<td><code>admin.joinedOn</code></td>\n<td>Date</td>\n<td>When was the agent hired</td>\n</tr>\n<tr>\n<td><code>admin.leftOn</code></td>\n<td>Date</td>\n<td>When did the agent left</td>\n</tr>\n</tbody>\n</table>\n</div>","_postman_id":"21877299-8599-4be4-86f8-ad4c3395f53e"}],"id":"19a99628-bfa0-44fe-b3cb-2805b01863a8","description":"<p><strong>Introduction</strong></p>\n<p>Endpoints for interacting with your different collections from the <a href=\"https://manage.upya.io\">Upya Manage</a> platform. Including:</p>\n<ul>\n<li><p>clients</p>\n</li>\n<li><p>contracts</p>\n</li>\n<li><p>mobile app users (sometimes referred to as \"agents\")</p>\n</li>\n<li><p>assets</p>\n</li>\n<li><p>payments</p>\n</li>\n<li><p>web users</p>\n</li>\n<li><p>products</p>\n</li>\n<li><p>deals</p>\n</li>\n<li><p>forms</p>\n</li>\n<li><p>tasks</p>\n</li>\n<li><p>tickets</p>\n</li>\n<li><p>messages</p>\n</li>\n<li><p>events</p>\n</li>\n<li><p>dueDates (payment schedule)</p>\n</li>\n<li><p>penalties</p>\n</li>\n<li><p>commissions</p>\n</li>\n</ul>\n<p><strong>Authentication</strong></p>\n<p>Upya supports <a href=\"https://en.wikipedia.org/wiki/Basic_access_authentication\">Basic authentication</a>. This allows you to protect your data so that only you and Upya can access them. In order to authenticate, you will use the <strong>same credentials</strong> than the ones you use to <strong>log in to the web platform</strong>.</p>\n<blockquote>\n<p>Depending on your level of permission, you will be able to access all or none of the APIs. These permissions can be set on the <a href=\"https://manage.upy.io\">Upya Manage</a> web platform by your manager, or by API calls.</p>\n</blockquote>\n","_postman_id":"19a99628-bfa0-44fe-b3cb-2805b01863a8"},{"name":"Webhooks","item":[],"id":"8e000907-7d3f-4898-b20e-65e3587e1ff4","description":"<p>You can use <strong>webhook subscriptions</strong> to receive notifications about particular events happening in your Upya Manage Environment.</p>\n<p>After you've subscribed to a webhook topic, you will receive an instantaneous notification about each event within the topic scope. You will be able to execute code immediately, instead of having to make API calls periodically to check their status.</p>\n<p>For example, you can rely on webhooks to trigger an action in your app when a prospect is created, when a customer makes a payment and much more.</p>\n<p>By using webhooks, you can make fewer API calls overall, which makes sure that your apps are more efficient and update quickly.</p>\n<p><strong>All events</strong></p>\n<p>When you add a webhook, you can specify which events should be sent to it. You can subscribe to the following events:</p>\n<ul>\n<li><p>Client creation</p>\n</li>\n<li><p>Client update (change in name, address, mobile phone, etc)</p>\n</li>\n<li><p>Client \"life event\" (change in status, interest level, etc)</p>\n</li>\n<li><p>Form creation</p>\n</li>\n<li><p>Contract creation</p>\n</li>\n<li><p>Contract update (change in pricing terms, etc)</p>\n</li>\n<li><p>Contract \"life event\" (change in status, flag, etc)</p>\n</li>\n<li><p>Incoming payment</p>\n</li>\n<li><p>Task and ticket creation</p>\n</li>\n<li><p>Task and ticket \"life event\" (change in status, etc)</p>\n</li>\n<li><p>Asset creation</p>\n</li>\n<li><p>Asset update (change in serial number, etc)</p>\n</li>\n<li><p>Asset \"life event\" (deployment, stock re-entry, transfer, etc...)</p>\n</li>\n</ul>\n<p><strong>Retry policy</strong></p>\n<p>You can subscribe to webhooks from you Upya Manage account and can also specify the retry policy in case your endpoints are momentarily not available.</p>\n<p><strong>Contract events</strong></p>\n<ul>\n<li><p>List of contract <em>life events</em>: SIGNED, SUBMITTED, REJECTED, APPROVED,  WRITEOFF, UNWRITEOFF, REPOSSESSED, UNREPOSSESSED, ENABLED, LOCKED, PAIDOFF, FLAG, PAYMENT</p>\n</li>\n<li><p>List of contract <em>update events</em>: DEAL_CHANGE, DEAL_UPDATE, REPLACED, MODIFIED, TRANSFERED, ADDED, REMOVED</p>\n</li>\n</ul>\n<p><strong>Asset events</strong></p>\n<ul>\n<li><p>List of asset <em>life events</em>: INSTOCK, DEPLOYED, DEFECTIVE, RESTORED, INTRANSIT, WRITEOFF, UNWRITEOFF, RESERVED, TRANSFERED, CONFIRMED</p>\n</li>\n<li><p>List of asset <em>update events</em>: EDITED, CHECKED, PART ADDED, PART REMOVED</p>\n</li>\n</ul>\n","_postman_id":"8e000907-7d3f-4898-b20e-65e3587e1ff4"},{"name":"Payment Gateway","item":[{"name":"Retrieve payment options for subscriber","id":"e6796ca7-3141-402c-b938-ec7dcba75265","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://mm.api.upya.io/api/payment/options/:clientIdentifier","description":"<p>Endpoint to retrieve payment options for a given mobile number (subscriber) OR for a given payment reference.</p>\n<p>If you send a <code>subscriber</code>, returns a list of contracts associated with the subscriber (mobile number).</p>\n<p>If you send a <code>reference</code>, returns the details of the identified contract</p>\n<p>For each contracts, if a list of pre-defined payment amounts has been defined, returns the said list.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>subscriber</code></td>\n<td>String, mandatory (*)</td>\n<td>Mobile number of paying customer</td>\n</tr>\n<tr>\n<td><code>reference</code></td>\n<td>String, mandatory (*)</td>\n<td>Payment reference</td>\n</tr>\n</tbody>\n</table>\n</div><p>(*) You cannot send both a \"subscriber\" and a \"reference\".</p>\n<blockquote>\n<p>These contract details can then be passed along as suggestions to the customer to reduce input errors </p>\n</blockquote>\n<p>The <code>clientIdentifier</code> in the URL is the name of the company.</p>\n","urlObject":{"protocol":"https","path":["api","payment","options",":clientIdentifier"],"host":["mm","api","upya","io"],"query":[],"variable":[{"description":{"content":"<p>Your identifier as a company</p>\n","type":"text/plain"},"type":"any","value":"<string>","key":"clientIdentifier"}]}},"response":[{"id":"e2615efc-25e0-4eac-a18f-339be8bb5d18","name":"success","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Basic <credentials>","description":"Added as a part of security scheme: basic"}],"body":{"mode":"raw","raw":"{\n  \"subscriber\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://mm.api.upya.io/api/payment/options/:clientIdentifier","protocol":"https","host":["mm","api","upya","io"],"path":["api","payment","options",":clientIdentifier"],"variable":[{"key":"clientIdentifier","value":"<string>","description":"(Required) "}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"firstName\": \"esse Excepteur id reprehenderit sunt\",\n  \"lastName\": \"Duis\",\n  \"contractNumber\": \"deserunt in irure\",\n  \"paygNumber\": \"commodo nulla\",\n  \"minimumPayment\": \"cupidatat sint fugiat ut\",\n  \"expectedPayment\": \"ut\",\n  \"days\": \"consequat aliquip\",\n  \"unitStatus\": \"voluptate deserunt\",\n  \"totalPaid\": \"in Duis\",\n  \"balance\": \"in laborum\",\n  \"mobile\": 12345\n}"}],"_postman_id":"e6796ca7-3141-402c-b938-ec7dcba75265"},{"name":"Validate incoming payment","id":"9a4aa211-3179-44c4-b3fb-9ee84662cc28","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"https://mm.api.upya.io/api/payment/validation","description":"<p>Endpoint to validate incoming payments in a 2-step payment process.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Desription</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>reference</code></td>\n<td>String, mandatory</td>\n<td>Reference entered by the customer to identify his payment</td>\n</tr>\n<tr>\n<td><code>currency</code></td>\n<td>String, mandatory</td>\n<td>Currency</td>\n</tr>\n<tr>\n<td><code>transactionId</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of payment, provided by the mobile money operator</td>\n</tr>\n<tr>\n<td><code>subscriber</code></td>\n<td>String, mandatory</td>\n<td>Mobile number that initiated payment</td>\n</tr>\n<tr>\n<td><code>amount</code></td>\n<td>String, mandatory</td>\n<td>Amount</td>\n</tr>\n<tr>\n<td><code>type</code></td>\n<td>String, optional</td>\n<td>Defaults to MM</td>\n</tr>\n</tbody>\n</table>\n</div><p>Returns Accepted or Rejected.</p>\n<p>If the payment will be accepted, returns additional information regarding client.</p>\n<p>If rejected, returns the likely reason why.</p>\n","urlObject":{"protocol":"https","path":["api","payment","validation"],"host":["mm","api","upya","io"],"query":[],"variable":[]}},"response":[{"id":"0985196d-e693-42c4-aef3-26f0f357997c","name":"success","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Basic <credentials>","description":"Added as a part of security scheme: basic"}],"body":{"mode":"raw","raw":"{\n  \"reference\": \"<string>\",\n  \"amount\": \"<string>\",\n  \"currency\": \"<string>\",\n  \"subscriber\": \"<string>\",\n  \"transactionId\": \"<string>\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"https://mm.api.upya.io/api/payment/validation/:clientIdentifier","protocol":"https","host":["mm","api","upya","io"],"path":["api","payment","validation",":clientIdentifier"],"variable":[{"key":"clientIdentifier","value":"<string>","description":"(Required) "}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"}],"cookie":[],"responseTime":null,"body":"{\n  \"transactionId\": \"ut ea\",\n  \"result\": \"consectetur\",\n  \"contractNumber\": \"cillum consequat a\",\n  \"minimumPayment\": \"velit voluptate\",\n  \"expectedPayment\": \"consequat consectetur id\",\n  \"unitStatus\": \"velit voluptate\",\n  \"totalPaid\": \"dolore voluptate mollit aliquip\",\n  \"balance\": \"culpa mollit incididunt eu\",\n  \"mobile\": 123\n}"}],"_postman_id":"9a4aa211-3179-44c4-b3fb-9ee84662cc28"},{"name":"Confirm incoming payment","id":"019c395b-a80f-430e-8f27-aa85e6162f0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"url":"https://mm.api.upya.io/api/payment/confirmation","description":"<p>Endpoint to notify Upya of an already <strong>confirmed</strong> payment.</p>\n<p>Returns the message sent to customer.</p>\n<p>A payment arriving to that endpoint has already been received by the client and has already been deducted from the end-customer's account.</p>\n<p>If the reference is not recognized, the payment will have the \"<em>UNASSIGNED</em>\" status</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>reference</code></td>\n<td>String, mandatory</td>\n<td>Reference entered by the customer to identify his payment</td>\n</tr>\n<tr>\n<td><code>amount</code></td>\n<td>String, mandatory</td>\n<td>Amount</td>\n</tr>\n<tr>\n<td><code>currency</code></td>\n<td>String, mandatory</td>\n<td>Currency</td>\n</tr>\n<tr>\n<td><code>subscriber</code></td>\n<td>String, mandatory</td>\n<td>Mobile number that initiated payment</td>\n</tr>\n<tr>\n<td><code>transactionId</code></td>\n<td>String, mandatory</td>\n<td>Unique identifier of payment, provided by the mobile money operator</td>\n</tr>\n<tr>\n<td><code>mno</code></td>\n<td>String, mandatory</td>\n<td>Mobile Money Operator</td>\n</tr>\n<tr>\n<td><code>type</code></td>\n<td>String, optional</td>\n<td>Defaults to MM</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","payment","confirmation"],"host":["mm","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"019c395b-a80f-430e-8f27-aa85e6162f0a"},{"name":"Check status","id":"5d6e35cf-83eb-441f-a24d-3128d3415d08","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"https://mm.api.upya.io/api/payment/checkStatus","description":"<p>Endpoint to verify the status of a past payment.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>transactionId</code></td>\n<td>String, mandatory</td>\n<td>Unique transactionId to be verified</td>\n</tr>\n</tbody>\n</table>\n</div><p>Example reply:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"_id\": \"67ac8e595620ae0011d9501e\",\n    \"status\": \"ACCEPTED\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","payment","checkStatus"],"host":["mm","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"5d6e35cf-83eb-441f-a24d-3128d3415d08"}],"id":"1ab2da7e-37c6-42e9-9b3e-2078bfbfe64c","description":"<p><strong>Introduction</strong></p>\n<p>Use this section to connect to the Upya Payment Gateway.</p>\n<p><strong>Authentication</strong></p>\n<p>Upya supports <a href=\"https://en.wikipedia.org/wiki/Basic_access_authentication\">Basic authentication</a>. This allows you to protect your data so that only you and Upya can access them. In order to authenticate to the payment Gateway, you will need <strong>specific Payment Gateway Credentials</strong> that will be sent over to you by the Upya team.</p>\n<blockquote>\n<p>Note: unlike for the Manage endpoints, the credentials that you use here to log in to the web platform, will <strong>not be</strong> <strong>valid</strong>.</p>\n</blockquote>\n","_postman_id":"1ab2da7e-37c6-42e9-9b3e-2078bfbfe64c"},{"name":"Device Gateway","item":[{"name":"Tokens","item":[{"name":"Add tokens","id":"f78aab5b-9f51-4b27-8430-d6e461e8a64c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"tokens\": [{\r\n        \"serialNumber\":\"YYYYYY\",\r\n        \"days\": \"1Days\",\r\n        \"activationCode\":\"XXXXXXX\",\r\n        \"year\": \"1\",\r\n        \"flag\": \"Y\"\r\n    }]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens","description":"<p>Endpoint to <strong>create units</strong> and <strong>add tokens</strong> to them.</p>\n<ul>\n<li><p>All the serialNumbers present in your payload will be added to the database as a a new <strong>unit</strong></p>\n</li>\n<li><p>For each serialNumber, all the <strong>tokens</strong> present in your payload will be added and linked to the corresponding unit.</p>\n</li>\n</ul>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>tokens</code></td>\n<td>Array</td>\n<td>List of [{ serialNumber, activationCode, days }]</td>\n</tr>\n<tr>\n<td><code>productReference</code></td>\n<td>String (optional)</td>\n<td>If you have more than one product type under management, specify here which product should be attached to the added units &amp; tokens</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens"],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"f78aab5b-9f51-4b27-8430-d6e461e8a64c"},{"name":"Search tokens","id":"b53f2168-2145-4614-a20d-2f1c65ba6d0f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"query\": {\r\n        \"serialNumber\":\"YYYYYY\",\r\n        \"days\": \"30\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens/search","description":"<p>Endpoint to <strong>search tokens</strong> for given units, specified by their serial number.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String</td>\n<td>Unique identifier of the unit</td>\n</tr>\n<tr>\n<td><code>days</code></td>\n<td>String (optional)</td>\n<td>1, 30</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>String (oprtional)</td>\n<td>add_time, lock, unlock</td>\n</tr>\n<tr>\n<td><code>used</code></td>\n<td>Boolean (optional)</td>\n<td>true, false</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens","search"],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"b53f2168-2145-4614-a20d-2f1c65ba6d0f"},{"name":"Use tokens","id":"266180f5-8f6a-4fa2-a94b-8a207751a45a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"serialNumber\": \"YYYYYY\",\r\n        \"days\": \"30\",\r\n        \"category\": \"add_time\",\r\n        \"manufacturerName\": \"XX\",\r\n        \"reference\": \"ZZ\"\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens/use","description":"<p>Endpoint to <strong>use tokens</strong> for given units and get the actication codes.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>serialNumber</code></td>\n<td>String</td>\n<td>Unique identifier of the unit</td>\n</tr>\n<tr>\n<td><code>days</code></td>\n<td>String</td>\n<td>1, 30</td>\n</tr>\n<tr>\n<td><code>category</code></td>\n<td>String</td>\n<td>add_time, lock, unlock</td>\n</tr>\n<tr>\n<td><code>manufacturerName</code></td>\n<td>String</td>\n<td>As on your <em>Manage</em> platform</td>\n</tr>\n<tr>\n<td><code>reference</code></td>\n<td>String</td>\n<td>As on your <em>Manage</em> platform</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens","use"],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"266180f5-8f6a-4fa2-a94b-8a207751a45a"},{"name":"Edit tokens","id":"18f6629a-54ab-44d5-91d4-b742ff2a95cb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"tokens\": [\r\n        {\r\n            \"serialNumber\": \"YYYYYY\",\r\n            \"days\": \"1Days\",\r\n            \"activationCode\": \"XXXXXXX\",\r\n            \"year\": \"1\",\r\n            \"flag\": \"Y\"\r\n        }\r\n    ]\r\n}","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens/","description":"<p>Endpoint to modify the <strong>tokens</strong> available to <strong>existing</strong> physical units:</p>\n<ul>\n<li>For each serialNumber, all the <strong>tokens</strong> present in your payload will be added and linked to the corresponding unit. The pre-existing tokens will be deleted - except for those which have already been used.</li>\n</ul>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>tokens</code></td>\n<td>Array</td>\n<td>List of [{ serialNumber, activationCode, days }]</td>\n</tr>\n<tr>\n<td><code>productReference</code></td>\n<td>String (optional)</td>\n<td>If you have more than one product type under management, specify here which product should be attached to the added units &amp; tokens</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens",""],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"18f6629a-54ab-44d5-91d4-b742ff2a95cb"},{"name":"Modify existing tokens","id":"8ac4a304-a318-46cf-bc6d-bb761c4ef7dc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"[\r\n    {\r\n        \"serialNumber\": \"YYYYYY\",\r\n        \"activationCode\": \"XXXXXXX\",\r\n        \"year\": 1,\r\n        \"flag\": \"Y\"\r\n    }\r\n]","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens/modify-data","description":"<p>Endpoint to modify <strong>existing</strong> tokens</p>\n<ul>\n<li><p>All the targeted tokens will be edited according to the sent data</p>\n</li>\n<li><p>Send an array of elements with the following attributes:</p>\n</li>\n</ul>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>serialNumber</td>\n<td>String (mandatory)</td>\n<td>Serial Number linked to the targeted tokens</td>\n</tr>\n<tr>\n<td>activationCode</td>\n<td>String (mandatory)</td>\n<td>Target tokens</td>\n</tr>\n<tr>\n<td>year</td>\n<td>String (optional)</td>\n<td>Year</td>\n</tr>\n<tr>\n<td>flag</td>\n<td>String (optional)</td>\n<td>Type</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens","modify-data"],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"8ac4a304-a318-46cf-bc6d-bb761c4ef7dc"},{"name":"Analyze tokens","id":"9027fd8b-c699-439d-a09d-750b8899cbc7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"basic","basic":{"basicConfig":[{"key":"username","value":"<username>"},{"key":"password","value":"<password>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"query\": {\r\n        \"serialNumbers\": [\"01-61-00000002\"]\r\n    },\r\n    \r\n        \"includeFlags\": true,\r\n        \"includeYear\": true\r\n}","options":{"raw":{"language":"json"}}},"url":"https://tokenmgmt.api.upya.io/api/tokens/analyze","description":"<p>Endpoint to analyze <strong>tokens</strong> using the MongoDb aggregation functionality</p>\n<p>Example query:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"query\": {\n        \"serialNumbers\": [\"YYYYYY\", \"ZZZZZZ\"]\n    },\n    \"includeDays\": true,\n    \"includeYear\": true,\n    \"includeUsage\": true,\n    \"includeFlag\": true\n}\n\n</code></pre>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Attribute</strong></th>\n<th><strong>Type</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>serialNumbers</code></td>\n<td>Array (optional)</td>\n<td>List of serial number to target</td>\n</tr>\n<tr>\n<td><code>includeDays</code></td>\n<td>Boolean (optional)</td>\n<td>Include breakdown by days</td>\n</tr>\n<tr>\n<td><code>includeYear</code></td>\n<td>Boolean (optional)</td>\n<td>Include breakdown by year</td>\n</tr>\n<tr>\n<td><code>includeUsage</code></td>\n<td>Boolean (optional)</td>\n<td>Include breakdown by usage (used or not)</td>\n</tr>\n<tr>\n<td><code>includeFlag</code></td>\n<td>Boolean (optional)</td>\n<td>Include breakdown by flag (N or Y)</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"https","path":["api","tokens","analyze"],"host":["tokenmgmt","api","upya","io"],"query":[],"variable":[]}},"response":[],"_postman_id":"9027fd8b-c699-439d-a09d-750b8899cbc7"}],"id":"3011a4eb-1473-4c73-8804-2a3fb5bf5a99","description":"<p>Enpoints to manage <strong>pre-set tokens</strong> for units managed by the Upya Code Gateway.</p>\n<p>Pre-set tokens are tokens <strong>pre-generated</strong> and <strong>pre-loaded</strong> into units. Once entered, these tokens are decoded by the physical units and their instructions passed to the units.</p>\n","_postman_id":"3011a4eb-1473-4c73-8804-2a3fb5bf5a99"}],"id":"373ad68e-2a6a-44da-b07b-6d862455fede","description":"<p><strong>Introduction</strong></p>\n<p>Use this section to comminicate with the <strong>Upya Device Gateway</strong>.</p>\n<p>The gateway allows you to manage and/or generate activation codes for physical units managed by Upya.</p>\n<p>It is devided in 2 categories of endpoints:</p>\n<ul>\n<li><p><em>Mobile devices</em>: to manage <strong>mobile phones</strong> remotely controlled by API calls</p>\n</li>\n<li><p><em>Tokens</em>: to manage devices for which pre-defined tokens have been <strong>pre-generated</strong> and pre-loaded both on Upya and on the physical devices (keypad)</p>\n</li>\n</ul>\n<p><strong>Access</strong></p>\n<p>This is a separate Upya service. Access to Upya Manage does not access to the Device Gateway (and vice and versa).</p>\n<p><strong>Authentication</strong></p>\n<p>Upya supports <a href=\"https://en.wikipedia.org/wiki/Basic_access_authentication\">Basic authentication</a>. This allows you to protect your data so that only you can access them.</p>\n<p>In order to authenticate to the payment Gateway, you will need <strong>specific Device Gateway Credentials</strong> that will be sent over to you by the Upya team.</p>\n<blockquote>\n<p>Note: unlike for the Upya Manage endpoints, the credentials that you use to log in to the web platform, will <strong>not be</strong> <strong>valid</strong>.</p>\n</blockquote>\n","_postman_id":"373ad68e-2a6a-44da-b07b-6d862455fede"}],"variable":[{"id":"b9d81040-1e98-4831-905c-4c9297bc6846","key":"baseUrl","value":"http://localhost:5000","type":"string"}]}