{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"e043068c-391f-35af-8a76-42844ded821f","name":"EasyOFAC v2 API","description":"## Getting Started\n\nThe EasyOFAC API allows you to access the EasyOFAC platform from within your own software. Using the API endpoints provided by the API, you can integrate your application with EasyOFAC.\n\nThis API is a REST/JSON type webservice, and is defined by a set of endpoints, each one serving a specific function. The following documents the purpose of each endpoint, what parameters are required, and what you can expect in return.\n\nTo learn more about the EasyOFAC platform itself, please refer to the [EasyOFAC Overview](https://easyofac.com/site/overview).\n\n## Connecting\n\nThere are a number of ways you can connect to the EasyOFAC API. Most programming languages have some mechanism for making HTTP calls with GET or POST parameters. All of the EasyOFAC API endpoints live under this web address:\n\n```\n{{base_url}}/v2/{{endpoint}}\n\n ```\n\nAll endpoints require an API key, which you can get simply by signing up for a free account. Learn more about API Keys below.\n\nIf all this sounds intimidating, or you are new to the idea of REST or APIs in general, we encourage you learn a bit more about them before diving in to this documentation. There is a great tutorial for REST available at [http://www.restapitutorial.com/](http://www.restapitutorial.com/).\n\n## API Keys\n\nIn order to connect to the EasyOFAC API, you will need an API Key. You can get one for free by signing up. Once logged into your account, look on the left for \"Manage\" under the \"API Keys\" section. You can copy your API Key from there. You can also add or remove keys, and update existing keys. Note that your API key allows you to access most of the information in your account, so you should treat it like a username/password.\n\nEach API key has full access to the entire account. If you need to support separate development and production environments, we recommend doing so under two separate accounts to prevent development data from entering your production account.\n\nWithin the documentation you may see a demo API key provided for example purposes. Note that this demo key only searches a fraction of the overall records available on the EasyOFAC system.\n\n## Authentication\n\nBeginning with version 2 of the EasyOFAC API, all authentication is done using There are two ways to authenticate on the EasyOFAC API: passing an API key via the GET Query, or by using HTTP Basic Authentication.\n\n### HTTP Basic Authentication\n\nThe EasyOFAC API also supports the HTTP Basic Authentication scheme. As this method requires both a username and password, you will need to provide the account email address as the username, and the API key as the password.\n\n```\nhttps://{{email}}:{{api_key}}@easyofac.com/v2/{{endpoint}}\n\n ```\n\nYour programming language likley provides a mechanism to pass a HTTP auth username/password. However, since the underlying mechanism used to perform this authentication is the Authorization HTTP header, it can be used directly as follows:\n\n```\nAuthorization: Basic {{token}}\n\n ```\n\nIn this case, `{token}` is the base-64 encoded username and password, separated by a colon. In pseudo-code, the token would be calculated as:\n\n``` javascript\n// Generate the HTTP Authorization token\ntoken = base64( email + ':' + api_key );\n\n ```\n\n### Unauthorized Requests\n\nAll API endpoints require authorization. If you are not properly authorized, you will receive a `HTTP 401 Unauthorized` response:\n\n```\n{\n    \"status\": {\n        \"success\": false,\n        \"httpCode\": 401,\n        \"msg\": \"Unauthorized\"\n    },\n    \"errors\": [\n        {\n            \"name\": \"Unauthorized\",\n            \"message\": \"Your request was made with invalid credentials.\",\n            \"code\": 0,\n            \"status\": 401\n        }\n    ]\n}\n\n ```\n\n## Requests\n\n### HTTP Verbs\n\nVersion 2 of the EasyOFAC API makes use of [HTTP Verbs](http://www.restapitutorial.com/lessons/httpmethods.html) (GET, POST, PUT, PATCH and DELETE). A single API endpoint will respond differently, depending on which verb you use.\n\n- POST: Create a new record\n    \n- GET: Read a record, or list several records\n    \n- PUT, PATCH: Update record\n    \n- DELETE: Remove a record\n    \n\nPay careful attention to the verbs you are using, as they help inform the API of your intention. Consider these two identical URLs with different verbs, that have very distinct results.\n\n#### View a Record\n\n`GET https://api.easyofac.com/v2/customers/12345`\n\n#### Delete a Record\n\n`DELETE https://api.easyofac.com/v2/customers/12345`\n\n### Request Format\n\nThere are two ways that parameters can be passed to the API. Some endpoints will require a parameter be included in the URL, such as an ID:\n\n```\nGET https://api.easyofac.com/v2/customers/{{id}}\n\n ```\n\nOthers will expect that you POST, PUT or PATCH the parameters in the request body, specifying an HTTP heder of `Content-type: application/json`. The body must be valid JSON.\n\n```\nPOST https://api.easyofac.com/v2/customers\nContent-type: application/json\n{\n  \"id\": \"customer-101\",\n  \"first-name\": \"John\",\n  \"last_name\": \"Doe\"\n}\n\n ```\n\nA PUT and PATCH request (for updating a record) typically requires a parameter in the URL as well as a JSON-formatted request body.\n\n### Response Format\n\nAll responses are formatted as valid JSON object. At a minimum, each response will include a `status` to tell you if the request was successful:\n\n``` json\n{\n    \"status\": {\n        \"success\": true,\n        \"httpCode\": 200,\n        \"msg\": \"OK\"\n    }\n}\n\n ```\n\n#### Single Objects\n\nWhen a response includes data, it will be sent as an added variable on the JSON object, corresponding to the entity type you are working with. This could be: `customer` or `company`.\n\n```\n{\n    \"status\": {\n        \"success\": true,\n        \"httpCode\": 200,\n        \"msg\": \"OK\"\n    },\n    \"customer\": {\n        \"id\": \"11235-test\",\n        \"customer_datetime\": \"2017-11-18 07:29:01\",\n        \"customer_status\": \"inspect\",\n        \"customer_kyc\": null\n    }\n}\n\n ```\n\n#### Collections\n\nCertain endpoints are designed to return a list of objects. For instance, `GET {{base_url}}/v2/customers` will return a list of all customers, and `POST {{base_url}}/v2/customers/_search` will return a result set for the given search terms.\n\nAn array of objects is sent, and variable name will be in the pluralized form: `customers` or `companies`.\n\n``` json\n{\n    \"status\": {\n        \"success\": true,\n        \"httpCode\": 200,\n        \"msg\": \"OK\"\n    },\n    \"customers\": [\n        {\n            \"id\": \"6683963-test\",\n            \"customer_datetime\": \"2017-11-01 19:50:09\",\n            \"customer_status\": \"inspect\",\n            \"customer_kyc\": 0\n        },\n        {\n            \"id\": \"6683961-test\",\n            \"customer_datetime\": \"2017-11-01 20:00:50\",\n            \"customer_status\": \"inspect\",\n            \"customer_kyc\": 0\n        }\n    ],\n    \"_links\": {\n        \"self\": {\n            \"href\": \"https://api.easyofac.com/v2/customers?page=1\"\n        }\n    },\n    \"_meta\": {\n        \"totalCount\": 3,\n        \"pageCount\": 1,\n        \"currentPage\": 1,\n        \"perPage\": 20\n    }\n}\n\n ```\n\n#### Collection Pagination\n\nNotice that in addition to the array of objects in the collection, the API returns `_links` and `_meta` objects to help you understand the context and pagination of the list.\n\n##### Links\n\nThe `_links` object provide URLs to fetch the `next`, `prev`,`first`, and `last` pages, along with a link to `self` (the current page). This information is also included in the `Link` HTTP Header.\n\n##### Meta Information\n\nThe `_meta` object combines information about `totalCount`, `pageCount`, `currentPage`, and `perPage`.\n\n##### HTTP Headers\n\nFor convenience, all pagination and link information is also included within the HTTP Response Headers.\n\n```\nHTTP/1.1 200 OK\n...\nX-Pagination-Total-Count: 1000\nX-Pagination-Page-Count: 50\nX-Pagination-Current-Page: 1\nX-Pagination-Per-Page: 20\nLink: <https://api.easyofac.com/v2/customers?page=1>; rel=self, \n      <https://api.easyofac.com/v2/customers?page=2>; rel=next, \n      <https://api.easyofac.com/v2/customers?page=50>; rel=last\n\n ```\n\n##### Controlling Pagination\n\nParameters may be passed on the GET request to control how results are paginated. _These parameters can only be passed on the GET request, NOT the POST body._\n\nAs you can see in the `_links` object and `Link` header, the `page` parameter can be used to specify the results page you wish to return:\n\n```\n{{base_url}}/v2/{{endpoint}}?page=2\n\n ```\n\nAdditionally, you can set the number of results per page by using the `per-page` parameter, with a **minimum of 1 and maximum of 500:**\n\n```\n{{base_url}}/v2/{{endpoint}}?page=2&per-page=200\n\n ```\n\nBe aware that the larger `per-page` is, the more _data per request_. The smaller `per-page` is, the more requests you will need to make to retrieve all the data. Please consider this and weigh carefully to determine the best `per-page` size for your application, as too-big or too-small of a size may have performance implications.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"2849701","team":72669,"collectionId":"e043068c-391f-35af-8a76-42844ded821f","publishedId":"7E8hGHk","public":true,"publicUrl":"https://docs.easyofac.com","privateUrl":"https://go.postman.co/documentation/2849701-e043068c-391f-35af-8a76-42844ded821f","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"34495E"},"documentationLayout":"classic-double-column","version":"8.10.1","publishDate":"2018-12-14T16:08:55.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"EasyOFAC API Production v2 Example","id":"ebab845a-8cf5-4f6e-ef57-943357870fb5","owner":"2849701","values":[{"enabled":true,"key":"base_url","value":"https://api.easyofac.com","type":"text"},{"enabled":true,"key":"auth_string","value":"your-auth-string-here","type":"text"},{"enabled":true,"key":"webhook_base_url","value":"https://webhook.easyofac.com/","type":"text"},{"enabled":false,"key":"webhook_token_id","value":"c3f99018-45d3-45bf-a8bf-e30db7236a78","type":"text"},{"enabled":false,"key":"webhook_full_url","value":"https://webhook.easyofac.com/c3f99018-45d3-45bf-a8bf-e30db7236a78","type":"text"},{"enabled":false,"key":"record_id","value":"11235-test","type":"text"},{"enabled":false,"key":"webhook_id","value":"1","type":"text"}],"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/6fe2c97e9ed9082a732e7eff37f0e70616383ddc131c64d735083ce5e5e62e14","favicon":"https://easyofac.com/favicon.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"EasyOFAC API Production v2 Example","value":"2849701-ebab845a-8cf5-4f6e-ef57-943357870fb5"}],"canonicalUrl":"https://docs.easyofac.com/view/metadata/7E8hGHk"}