{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"7c0eb5da-b51c-4b27-9f98-27d3507a21cf","name":"Zplatform Apps","description":"# About this Documentation\n\nThis document serves as an exclusive guide for affiliated developers to implement the Zplatform API within their applications. It details the application flow and provides instructions on effectively using the API to achieve desired outcomes.\n\nWithin this document, you'll find a comprehensive explanation of Zplatform's workflow and how to integrate the API into your application, including the relevant endpoints and parameters.\n\nPlease note that this document is confidential and intended only for authorized affiliates. Unauthorized sharing of this document may result in serious legal consequences. We encourage all users to adhere to these guidelines to ensure the security and confidentiality of the information related to the Zplatform API.\n\nFollow the instructions and guidelines in this document carefully. For any questions or additional needs, please contact the Zplatform development team for assistance.\n\nThank you for your cooperation in maintaining the confidentiality and security of information related to the Zplatform API.\n\n# Requirement\n\nHere are the requirements for implementing the Zplatform API:\n\n1. **Base URL**: You'll need the base URL of the Zplatform API for application implementation. This information will be provided by the Zplatform development team or your deployment team.\n    \n2. **Username and Password**: A valid username and password are required to access the Zplatform API. These credentials will also be provided by the development or deployment team. Ensure the confidentiality and security of your login information.\n    \n3. **Knowledge of Postman**: A basic understanding of using Postman as an API testing tool is necessary. Postman allows you to send HTTP requests and test API responses. You can learn to use Postman through its official documentation.\n    \n4. **Understanding of RESTful API**: A solid grasp of RESTful API concepts and principles is essential. Familiarity with HTTP methods like GET, POST, PUT, and DELETE, as well as an understanding of resource representation, endpoints, and parameters in a RESTful API, is required.\n    \n\nEnsure that you meet these requirements before proceeding with the implementation of the Zplatform API. For any questions or additional needs, feel free to contact the Zplatform development team for assistance.\n\n# Authorization\n\nFor every API request that requires user credentials (API requests made after login), you must include an authentication header. The required header is as follows:\n\n| Header | Value |\n| --- | --- |\n| Authorization | Bearer {access_token} |\n\nAny request that requires login but does not include the correct Authorization header will receive a 401 Unauthenticated error response.\n\nYou can get the {access_token} from `Login / Generate token` API.\n\n# API Request\n\nAPI requests should be made as outlined in this documentation.\n\n## **Headers**\n\nIn addition to the authorization header, you must include the following header in every API request:\n\n| Header | Value | Description |\n| --- | --- | --- |\n| Accept | application/json | Failing to include this header may result in responses that differ from the documented behavior, especially in error cases. |\n| User-Agent | {app_name}/{app_version} (OS/{os_version}; Device/{device_model}; Build/{app_build_number}) | example:  <br>`Zplatform/1.2.3 (OS/Android 13; Device/Pixel 7; Build/12345)`  <br>  <br>Required to track application versions, OS, and devices for improved debugging and performance optimization. |\n| Accept-Language | {prefered_language} | example: 'id', 'en'  <br>  <br>Optional. If not set, responses will default to the language specified in the project setting. |\n\n## API Request Guidelines\n\n### **GET**\n\n- Parameters should only be placed in Query Params.\n    \n\n### **POST**\n\n- All options are supported, but it's recommended to place parameters in the JSON Body. For API requests involving file uploads, such as Upload New Media, use `multipart/form-data`.\n    \n\n### **PUT / DELETE**\n\n- Only JSON Body or Query Params are natively supported, with a recommendation to use JSON Body. If this is not possible, you may use an alternative method.\n    \n\n### **Alternative Method for PUT/DELETE**\n\n- If the PUT/DELETE method is not supported or cannot use JSON Body parameters, you can change the request method to POST. Add an additional parameter, `_method=PUT` for PUT requests or `_method=DELETE` for DELETE requests. This allows you to access APIs requiring PUT/DELETE methods using the same approach as POST.\n    \n\n### Paginated Request Parameters\n\nWhen you encounter a paginated response, you can use the `page` parameter to navigate between pages.\n\n### Boolean Data Type\n\nIn this documentation, boolean data types are typically represented as int (1/0), which is functionally equivalent to boolean values, although in some cases, they are written directly as boolean. When using a JSON body, you are allowed to send the parameter as a boolean (true/false). However, for other methods that do not support boolean types, you must send the value as an integer (1/0). If you send it as a boolean, when sending false, it may be detected as 'false' (a string), which could be interpreted as true.\n\n# API Response\n\nGenerally, unless specifically stated in the documentation, the API response will include:\n\n- **status**: (string) The status of the API response, which can be one of the following:\n    \n    - **OK**: Request was successful.\n        \n    - **EMPTY**: Request was successful, but no data was found or is available. The app should show an appropriate message.\n        \n    - **CONFIRM**: Action requires user confirmation. The app should display a confirmation dialog with the message from `message` or `messages`. If the user confirms, the app should resend the API request with the additional parameter `confirmation=1`.\n        \n    - **OK_WITH_WARNING**: Request was successful, but with warnings. The app should show a dialog with the warning message but continue processing data as with an OK status.\n        \n    - **UNAUTHENTICATED**: Authentication is required or failed. The app should log out the user and redirect to the login screen.\n        \n    - **NOT_ALLOWED**: The app version is outdated and needs to be updated. The app should show an update confirmation dialog and then close.\n        \n    - **UNDER_MAINTENANCE**: Service is currently undergoing maintenance. The app should display a maintenance screen.\n        \n    - **ERROR**: A general error occurred. The app should show a dialog with the message from `message` or `messages` and then return to the previous screen.\n        \n    - **FORBIDDEN**: Access is denied due to insufficient permissions. Handle this like an ERROR status.\n        \n    - **FAILED**: The request failed to complete successfully. Handle this like an ERROR status.\n        \n    - **INVALID**: Input or request parameters are invalid. Handle this like an ERROR status.\n        \n    - If the app encounters another status value, it should handle it as an ERROR status.\n        \n- **data**: (dynamic) Contains the result of the API request, which can be an array, object, string, integer, boolean, or null.\n    \n- **message**: (string|null) A message to be displayed, typically used for errors or confirmations.\n    \n- **messages**: (array) An array of messages to be displayed, if multiple messages need to be conveyed.\n    \n\nTo display a message, you can choose between `message` and `messages` based on your needs, as they contain similar information.\n\nFor APIs with paginated responses, additional fields will be included:\n\n- **current_page**: The current page number.\n    \n- **last_page**: The last available page.\n    \n- **per_page**: The number of items per page.\n    \n- **from**: The starting item number on the current page.\n    \n- **to**: The ending item number on the current page.\n    \n- **total**: The total number of available items.\n    \n\n> 🔵 **Note:** To keep the documentation concise, only the data section will be documented in detail moving forward, even though the general structure is as outlined above. \n  \n\n# Handling API Data\n\nData received from the API can either be raw (for logic processing) or ready for display. To distinguish between the two:\n\n- **Formatted Data**: If the key starts with “formatted_” (e.g., “formatted_amount”), the data is ready for display without any additional processing. Always prioritize using this data for display if available.\n    \n- **Raw Data**: If the key does not start with “formatted_” (e.g., “amount”), this data is raw and should be used for internal app logic, such as input validation, component styling, etc., but not for direct display.\n    \n- **Usage Guidelines**:\n    \n    - **Display**: Use formatted data (`formatted_`) whenever possible.\n        \n    - **Logic**: Use raw data for handling logic within the app.\n        \n\n# Enabling Push Notifications\n\nThe system uses Firebase Cloud Messaging (FCM) for push notifications, and the process ensures that the server can send notifications to registered devices:\n\n1. **Obtain FCM Token**: Before logging in, the app should request and receive a valid FCM token.\n    \n2. **Include in Login Request**: Use the FCM token as the \"device_token\" parameter in the login API request. This ensures the token is stored on the server.\n    \n3. **Regular Token Updates**: Each time the app reaches the home screen, it should send the FCM token to the server to ensure the server has the most current token.\n    \n\nBy following these steps, the server will have the correct FCM token and can send push notifications to the registered devices whenever necessary.\n\n# Predefined Lists\n\n## Available Client Type\n\n- mobile_apps: Customer apps or Main Apps\n    \n- outlet_apps: Outlet Apps","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"25342919","team":6398085,"collectionId":"7c0eb5da-b51c-4b27-9f98-27d3507a21cf","publishedId":"2sA3s9Bnt3","public":true,"publicUrl":"https://zplatform-api-docs.zonaku.co.id","privateUrl":"https://go.postman.co/documentation/25342919-7c0eb5da-b51c-4b27-9f98-27d3507a21cf","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"005a93"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":"This document serves as an exclusive guide for affiliated developers to implement the Zplatform API within their applications. It details the application flow and provides instructions on effectively using the API to achieve desired outcomes."},{"name":"title","value":"Zplatform API Documentation"}],"appearance":{"default":"system_default","themes":[{"name":"dark","logo":"https://content.pstmn.io/8dfbea80-3933-48dc-ab7c-28bbb5ea3839/d2lkdGggZnVsbCBjb2xvci5wbmc=","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"005a93"}},{"name":"light","logo":"https://content.pstmn.io/8dfbea80-3933-48dc-ab7c-28bbb5ea3839/d2lkdGggZnVsbCBjb2xvci5wbmc=","colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"005a93"}}]}},"version":"8.12.10","publishDate":"2024-08-17T12:11:52.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"Zplatform API Documentation","description":"This document serves as an exclusive guide for affiliated developers to implement the Zplatform API within their applications. It details the application flow and provides instructions on effectively using the API to achieve desired outcomes."},"logos":{"logoLight":"https://content.pstmn.io/8dfbea80-3933-48dc-ab7c-28bbb5ea3839/d2lkdGggZnVsbCBjb2xvci5wbmc=","logoDark":"https://content.pstmn.io/8dfbea80-3933-48dc-ab7c-28bbb5ea3839/d2lkdGggZnVsbCBjb2xvci5wbmc="}},"statusCode":200},"environments":[{"name":"Zplatform Demo","id":"6dcc88ca-2727-43a1-bfba-fb4d2c4cf695","owner":"25342919","values":[{"key":"baseUrl","value":"https://zplatform-demo.zonaku.com","enabled":true,"type":"default"},{"key":"access_token","value":"","enabled":true,"type":"default"},{"key":"outlet_access_token","value":"","enabled":true,"type":"any"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/5c98e5e48419d272a7517a9a877d48c6a4ca989ebaa33092ad2b338160fe8cab","favicon":"https://zonaku.co.id/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Zplatform Demo","value":"25342919-6dcc88ca-2727-43a1-bfba-fb4d2c4cf695"}],"canonicalUrl":"https://zplatform-api-docs.zonaku.co.id/view/metadata/2sA3s9Bnt3"}