{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"88b978ba-fd53-4745-8fd0-ed2eabb35813","name":"OneBill Developer Guide","description":"OneBill Developer Guide can be used by a technical user who intends to integrate their existing business applications with OneBill using an API (Application Programming Interface).\n\nThis is a developer's guide to integrating with OneBill with REST web services. The documentation contains the list of the various _**REST APIs**_ across the different functional modules offered by OneBill. To refer OSS application APIs, [<b>Click here.</b>](https://ossdev.onebillsoftware.com/)\n\n# Authentication\n\nOneBill uses OAuth for authenticating a user to access the API. An access token must be generated in order to utilize the OneBill REST web services.\n\n**Original Request URL**\n\n``` ruby\nNOTE: Do a POST request for the following URL.\n\n ```\n\n``` javascript\nhttps://www....com/oauth/token?grant_type=password&client_id=<TenantID>&client_secret=<client_secret>&username=<username>&password=<hashed_password>&scope=trust\n\n ```\n\n**Request Parameter Description**\n\nThe following are descriptions of the parameters which appear in the aforementioned URL.\n\n- **client_id**: (Check your welcome pack email notification for the Tenant ID or contact your OneBill onboarding executive for the same).\n    \n- **client_secret**: You can find the client id and the client secret in the Business Profile section of the application. Click here to learn more about it.\n    \n- **username**: This is the username for a particular tenant.\n    \n- **hashed_password**: This is the password for the account in the encoded format. It should be encoded using the \"ShaPasswordEncoder256\"\n    \n\n# Prerequisite Headers\n\nThe following headers need to be added prior to consuming any of the RESTful APIs.\n\n| Header | Value |\n| --- | --- |\n| Authorization | Bearer **access_token** |\n| Content-Type | application/json |\n| Accept | application/json |\n\n# Proxy Information\n\nOneBill supports a Channel Management module to let a business expand their business through channel partners. When a user wants to manage data under a partner, the proxy information is provided as part of the header. This enables the user to perform the operation as a Channel Partner would do it from the user interface, by using a single login created at the top level or the provider level. This avoids using different logins for each partner from the API route if the main business were to manage the operations on behalf of their partner through APIs.\n\nUsers must pass the following header details along with the other headers mentioned in the \"Prerequisite Headers\" section, as part of the URL, without the double quotes (\"\"). This proxy header must ONLY be passed for APIs which support the proxy functionality.\n\n- **Header**: \"proxy_accountNumber\"\n    \n- **Value**: \"Partner's account number\"\n    \n\n# Passing the X-OB-Tenant-Identifier HTTP Header\n\n**Effective Date:** January 2025\n\n**Purpose:** Starting January 2025, all API requests to our services must include the `X-OB-Tenant-Identifier` HTTP header. This header is mandatory for identifying tenant-specific requests and ensuring proper processing.\n\n## Header Details\n\n| Header Name | Required | Description |\n| --- | --- | --- |\n| X-OB-Tenant-Identifier | Yes | Unique identifier for the tenant making the API request. |\n\n**Example Value:** `X-OB-Tenant-Identifier: tenant12345`\n\n## How to Pass the Header\n\nThe `X-OB-Tenant-Identifier` HTTP header should be included in all HTTP requests made to our APIs. Below are examples in several programming languages:\n\n### 1\\. Java (Using Apache HttpClient)\n\n```\nimport org.apache.http.HttpResponse;\nimport org.apache.http.client.methods.HttpGet;\nimport org.apache.http.impl.client.CloseableHttpClient;\nimport org.apache.http.impl.client.HttpClients;\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        String url = \"https://api.yourservice.com/resource\";\n        CloseableHttpClient client = HttpClients.createDefault();\n        HttpGet request = new HttpGet(url);\n        request.addHeader(\"X-OB-Tenant-Identifier\", \"tenant12345\");\n        HttpResponse response = client.execute(request);\n        System.out.println(\"Response Code: \" + response.getStatusLine().getStatusCode());\n        client.close();\n    }\n}\n\n ```\n\n### 2\\. Python (Using requests library)\n\n```\nimport requests\nurl = \"https://api.yourservice.com/resource\"\nheaders = {\n    \"X-OB-Tenant-Identifier\": \"tenant12345\"\n}\nresponse = requests.get(url, headers=headers)\nprint(f\"Response Status Code: {response.status_code}\")\n\n ```\n\n### 3\\. JavaScript (Using Axios)\n\n```\nconst axios = require('axios');\nconst url = \"https://api.yourservice.com/resource\";\naxios.get(url, {\n    headers: {\n        'X-OB-Tenant-Identifier': 'tenant12345'\n    }\n})\n.then(response => {\n    console.log(`Response Status: ${response.status}`);\n})\n.catch(error => {\n    console.error(`Error: ${error.message}`);\n});\n\n ```\n\n### 4\\. cURL Command\n\n```\ncurl -X GET \"https://api.yourservice.com/resource\" \\\n     -H \"X-OB-Tenant-Identifier: tenant12345\"\n\n ```\n\n### 5\\. Go (Using net/http)\n\n```\npackage main\nimport (\n    \"fmt\"\n    \"net/http\"\n)\nfunc main() {\n    client := &http.Client{}\n    req, err := http.NewRequest(\"GET\", \"https://api.yourservice.com/resource\", nil)\n    if err != nil {\n        fmt.Println(\"Error creating request:\", err)\n        return\n    }\n    req.Header.Add(\"X-OB-Tenant-Identifier\", \"tenant12345\")\n    resp, err := client.Do(req)\n    if err != nil {\n        fmt.Println(\"Error making request:\", err)\n        return\n    }\n    defer resp.Body.Close()\n    fmt.Println(\"Response Status Code:\", resp.StatusCode)\n}\n\n ```\n\n## FAQ\n\n**Q: What happens if the header is missing?**\n\nA: Requests without the `X-OB-Tenant-Identifier` header will return a `400 Bad Request` error with the message:\n\n```\n{\n    \"error\": \"Missing required header: X-OB-Tenant-Identifier\"\n}\n\n ```\n\n**Q: Where do I get the tenant identifier?**\n\nA: You can log into your OneBill account and navigate to: **Config > Settings > Business Profile > Tenant ID**.\n\nIf you are unable to locate your Tenant ID, please contact our support team for assistance.\n\n**Q: Is the header required for all endpoints?**\n\nA: Yes, the `X-OB-Tenant-Identifier` header is mandatory for all API endpoints.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"9682794","team":605755,"collectionId":"88b978ba-fd53-4745-8fd0-ed2eabb35813","publishedId":"SWE3cKF6","public":true,"publicUrl":"https://dev.onebillsoftware.com","privateUrl":"https://go.postman.co/documentation/9682794-88b978ba-fd53-4745-8fd0-ed2eabb35813","customColor":{"top-bar":"FFFFFF","right-sidebar":"505C66","highlight":"F05123"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","themes":[{"name":"dark","logo":"https://content.pstmn.io/3a1e1f7a-e575-4545-941b-393257a2177e/T25lQmlsbC1Mb2dvLUZpbmFsLUhpUmVzLnBuZw==","colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":"https://content.pstmn.io/3a1e1f7a-e575-4545-941b-393257a2177e/T25lQmlsbC1Mb2dvLUZpbmFsLUhpUmVzLnBuZw==","colors":{"top-bar":"FFFFFF","right-sidebar":"505C66","highlight":"F05123"}}]}},"version":"8.10.1","publishDate":"2024-01-23T11:29:55.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":"https://content.pstmn.io/3a1e1f7a-e575-4545-941b-393257a2177e/T25lQmlsbC1Mb2dvLUZpbmFsLUhpUmVzLnBuZw==","logoDark":"https://content.pstmn.io/3a1e1f7a-e575-4545-941b-393257a2177e/T25lQmlsbC1Mb2dvLUZpbmFsLUhpUmVzLnBuZw=="}},"statusCode":200},"environments":[],"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/cc4af9b417289c3ef7de6c63e5f8f1f357c22767ae22e3dea512794b1446ab2a","favicon":"https://res.cloudinary.com/postman/image/upload/v1575615447/team/opbnqia8lul8u86hpxga.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"}],"canonicalUrl":"https://dev.onebillsoftware.com/view/metadata/SWE3cKF6"}