{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"35210cd6-dc57-466a-a0a2-7a60af49d570","name":"FTX Payment Gateway API","description":"Welcome to the Gateway API's. The purpose of this documentation is to ensure that every user is able to properly integrate the Gateway to their system through our series of simple easy-to-use sets of APIs. Here you will find an explanation of how the product works and how to integrate with them.\n\n## Getting Started\n\nThe Gateway's API environment is based on REST technology and authorizes requests using a JWT Token or APIKEY sent and encrypted via HTTPS.\n\n**Note:** Although there are multiple avenues to test and utilize Gateway API, the Gateway's uses the universal tool [Postman](https://www.getpostman.com/) and recommends it for Client testing.\n\nTo gain access to Gateway’s API environment, do the following:\n\n1.  Select an authentication method as outlined in the “Authorization” section of this guide.\n2.  Determine the environment type: A) Sandbox or B) Production.\n3.  For JWT based authentication, acquire the username and password. To the Gateway API, Client’s are required to first acquire a Token by posting the Client’s API Security Credentials via HTTPS to the Login endpoint: `{{url}}/api/v1/login`<p><b>Note:</b> The Token must then be supplied to all other endpoint requests via an authorization header. E.g. <code>Authorization:</code></p>\n4.  For any questions or issues regarding the APIs please contact the Payments Team.\n    \n\n## Authorization\n\nFor every request the client **must** submit headers containing authentication parameters so that the Gateway can properly identify the client. This is a required procedure and failing todo so will result in a `403` http error code. Currently the API supports 2 authentication methods:\n\n*   JWT authorization for session based authentication following the [RFC 7519](https://tools.ietf.org/html/rfc7519) standard\n*   API key authorization for server-to-server communication\n    \n\n### JWT authentication\n\nThe JWT token authentication method is advised for clients that require different people to access the data from the gateway using their login. Each login credential can issue a token that will be valid for 1 hour. After the token expires, the user must request a new token. With this method it's possible to create user interfaces thru mobile, desktop, or browsers to fully enable authorized users to access the gateway and perform actions based on their needs.\n\nUsers must use their credentials (username and password) to get the JWT token from the [Login - Get Token](#a7fcaaf7-ab9d-4a30-b786-7e0d61708042). Once the JWT token is received in the response, it can be used on the `Authorization` header for every request.\n\n```\nAuthorization: {{accessToken}}\n\n```\n\n### APIKEY authentication without signature\n\nAn `APIKEY` is a token that a client provides when making calls to the Gateway API endpoints. With the `APIKEY` authentication, you send a key-value pair in the request headers. An example of the `APIKEY` in the headers would look something like this:\n\n```\nAPIKEY: {{apikey}}\n\n```\n\n### APIKEY authentication with signature**\n\nIf the apikey configuration has the request signature validation turned on than the `SIGNATURE` is mandatory in the request headers along with the `APIKEY`\n\n```\nAPIKEY: {{apikey}}\nCONTENT: {{content}}\nTIMESTAMP: {{timestamp}}\nSIGNATURE: {{signature}}\n\n```\n\nThe signature is computed by hashing a predefined string with the secret key for every request you make to the API endpoint. The signature is the resulting hash value of the following predefined string AP `APIKEY + TIMESTAMP + CONTENT` with the secret key configured with the APIKEY.\n\n``` php\n$apikey = \"{{apikey}}\";\n$secret = \"{{secret}}\"\n$timestamp = time(); // Basic epoch timestamp\n$content = md5(\"\"); // The content should always be an MD5 hash even when empty\n$signature = hash_hmac('sha512', \"{$apikey}{$timestamp}{$content}\", $secret);\n\n```\n\n## Query parameters\n\nQuery parameters are used along with API requests (usually type GET) for filtering purposes. For any GET call, the following query parameters will be available:\n\n*   with\\[\\]\n    \n\nThis parameter will let the user who is requesting it add any desired relation the resource has in the API endpoint, so it lists nested on the JSON structure. It can be sent as many as the resource has available, it is also possible to access subsequent relations by separating the names by \".\" (dot).  \nAn example of a request would be  \n`{{url}}/api/v1/entities?with[]=documents&with[]=cards` , this request would query for all entities and add to the structure their documents and cards relations.\n\n*   and\\[\\]\n    \n\nThis query parameter will enable the user to filter the records by applying a \"AND\" conditional, meaning that the search needs to satisfy all values so it loads on the response, it is possible to use multiple values for the same attribute and use as many and as needed. An example would be  \n`{{url}}/api/v1/entities?and[last_name][][eq]=Bankman`\n\n*   or\\[\\]\n    \n\nThis query parameter will enable the user to filter the records by applying an \"OR\" conditional, meaning that the search needs to satisfy at least one or more values so it loads on the response, it is possible to use multiple values for the same attribute and use as many ors as needed. An example would be  \n`{{url}}/api/v1/login?or[username][][eq]=system&or[username][][eq]=GatewayAdmin`\n\n*   in\\[\\]\n    \n\nThis query parameter will enable the user to filter the records by applying an \"IN\" conditional, meaning that the attribute needs to satisfy at least one or more values within the array so it loads on the response, it is possible to use multiple values for the same attribute and use as many ors as needed. An example would be  \n`in[tierLevel][]=1&in[tierLevel][]=2&in[tierLevel][]=3`\n\n*   has\\[\\]\n    \n\nThis query parameter will enable the user to search data within the relational records of a parent record. An example would be `{{url}}/api/v1/entities?has[emails][][type][][eq]=personal`, which will return all entities that contains an email relation of type `personal`.\n\n*   hasNot\\[\\]\n    \n\nThis query parameter will enable the user to search the data within the relational records of a parent record that does not exist. An example would be `{{url}}/api/v1/entities?hasNot[emails][][type][][eq]=work`, which will return all entities that does not contain an email of type `work`.\n\n*   date\\[\\]\n    \n\nThis query parameter will enable the user to filter the records by applying a \"DATE\" conditional, meaning that the search needs to satisfy a certain date conditional so it loads on the response, it is possible to use multiple values for same attribute. An example would be  \n`{{url}}/api/v1/entities?date[birthdate][][gt]=1988-01-01&date[birthdate][][lt]=2000-01-31`\n\nFor all query parameters we can use various type of operators, below is the mapping for each one:\n\n| **Name** | **Operator** | **Description** |\n| --- | --- | --- |\n| eq | \\== | Equal, will apply an exact equalizer |\n| nq | != | Not Equal, will apply a different conditional search |\n| gt | \\> | Greater than |\n| lt | < | Less than |\n| gte | \\=> | Greater than or equal to |\n| lte | \\=< | Less than or equal to |\n| like | like | Like conditional, will apply a similarity search, with this operator it is possible to use a \"%\" as a wild card to do comparisons on data starting, ending or both with a certain string value |\n\n## Request and Response structure\n\nThe API accepts as a request a raw JSON body containing the data according to the structure of each object from the endpoint that is being requested. In this documentation, each API endpoint has the data structure that should be strictly followed.\n\nThe response structure of the endpoints follows 2 possible structures based on the success flag which indicates if the request was successful or not.\n\nThe success flag indicates the following:\n\n*   That the request is properly formatted and acceptable (security headers, data structure, etc.)T\n*   hat the data was properly committed to our database without validation errors\n*   The success flag should not be conflicted with the state or values of the record which was created (like a bank transfer that was created with the status set to failed), the client should implement on their side the required logic to properly parse the data created and analyze the relevance of keeping track of the ids of data committed in our database with their system. Below are further examples of our successful/failure responses.\n    \n\n### Successful Response\n\nEvery single response in the API will consist of a JSON response that will wrap the resource being queried and/or created. Although there are many different kind of resource structures, the outer wrapper will always be the same and only differ in two scenarios; those being when the request is querying for a result set of records or when the request is changing or querying a single record. In both cases what differs is only how the data comes within the data array. The data array will always be an array of objects and only have **one** indexed item on position 0 with the object of the \"single\" record being queried or changed or it will contain a result set object that will have the `results` array which will consist of the many objects that came from the queried resource.\n\n#### Response structure for all requests\n\n| Name | Type | Description |\n| --- | --- | --- |\n| success | boolean | Flag indicating if the request was successful and had no errors |\n| data | array | An array consisting of one element containing the object of the resource requested, will be empty in case of no data records |\n| errors | array | An array of objects containing details of errors that occurred on the request, will be empty in case of no errors |\n| request | string | An ID string identifying the  <br>request |\n\n##### Example for a single record query, update, create, and delete\n\n``` json\n{\n    \"success\": true,\n    \"data\": [\n        {\n            \"id\": \"94f28533-4653-4f79-bf7b-cb3dae212b44\",\n            \"created_at\": \"2021-11-23T18:49:37.311522Z\",\n            \"created_by_id\": \"94eae8a9-98db-4558-8e5c-08ed0c6ab5b2\",\n            \"created_from_id\": \"94eae8a9-e3c0-4592-96c8-e05ce38b75ba\",\n            \"updated_at\": \"2021-11-23T18:49:37.311522Z\",\n            \"updated_by_id\": \"94eae8a9-98db-4558-8e5c-08ed0c6ab5b2\",\n            \"updated_from_id\": \"94eae8a9-e3c0-4592-96c8-e05ce38b75ba\",\n            \"partition_id\": \"94eae889-5d35-4803-91a3-e649fdb6ee55\",\n            \"login_id\": \"94eae889-90ad-4de6-bcdd-73e42dcad434\",\n            \"first_name\": \"Rich\",\n            \"last_name\": \"Krull\",\n            \"nin\": \"614499852012119\",\n            \"nin_type\": \"driverLicense\",\n            \"nin_exp_date\": \"2026-11-15\",\n            \"nin_issue_date\": \"2021-11-15\",\n            \"birthdate\": \"1993-11-15\",\n            \"inactive\": 0,\n            \"freeze\": 0\n        }\n    ],\n    \"errors\": [],\n    \"request\": \"619d3fba34c21\"\n}\n\n```\n\n##### Example for querying a result set\n\n``` json\n{\n    \"success\": true,\n    \"data\": [\n        {\n            \"current_page\": 1,\n            \"results\": [\n                {\n                    \"id\": \"94f28533-4653-4f79-bf7b-cb3dae212b44\",\n                    \"created_at\": \"2021-11-23T18:49:37.311522Z\",\n                    \"created_by_id\": \"94eae8a9-98db-4558-8e5c-08ed0c6ab5b2\",\n                    \"created_from_id\": \"94eae8a9-e3c0-4592-96c8-e05ce38b75ba\",\n                    \"updated_at\": \"2021-11-23T18:49:37.311522Z\",\n                    \"updated_by_id\": \"94eae8a9-98db-4558-8e5c-08ed0c6ab5b2\",\n                    \"updated_from_id\": \"94eae8a9-e3c0-4592-96c8-e05ce38b75ba\",\n                    \"partition_id\": \"94eae889-5d35-4803-91a3-e649fdb6ee55\",\n                    \"login_id\": \"94eae889-90ad-4de6-bcdd-73e42dcad434\",\n                    \"first_name\": \"Rich\",\n                    \"last_name\": \"Krull\",\n                    \"nin\": \"614499852012119\",\n                    \"nin_type\": \"driverLicense\",\n                    \"nin_exp_date\": \"2026-11-15\",\n                    \"nin_issue_date\": \"2021-11-15\",\n                    \"birthdate\": \"1993-11-15\",\n                    \"inactive\": 0,\n                    \"freeze\": 0\n                }\n            ],\n            \"first_page_url\": \"{{url}}/api/v1/entities?page=1\",\n            \"from\": 1,\n            \"last_page\": 1,\n            \"last_page_url\": \"{{url}}/api/v1/entities?page=1\",\n            \"next_page_url\": null,\n            \"path\": \"{{url}}/api/v1/entities\",\n            \"per_page\": 50,\n            \"prev_page_url\": null,\n            \"to\": 1,\n            \"total\": 1\n        }\n    ],\n    \"errors\": [],\n    \"request\": \"619d3fba34c21\"\n}\n\n```\n\n##### Example for a request that failed\n\n``` json\n{\n    \"success\": false,\n    \"data\": [],\n    \"errors\": [\n        {\n            \"code\": 4,\n            \"message\": \"The API key provided is invalid\",\n            \"errorCode\": \"logins.auth.invalid\",\n            \"field\": null,\n            \"nestingPath\": null\n        }\n    ],\n    \"request\": \"619d41d396274\"\n}\n\n```\n\n## Validations and their meaning\n\nIn the Gateway API, validations have been implemented for the fields in the endpoint request body.\n\n1.  **nullable** - The field is not mandatory in the request body and can be null\n2.  **min** - For strings, this applies towards the amount of individual characters, for numeric values, this applies to the minimum numeric value allowed `e.g. minimum 3 characters`\n3.  **max** - For strings, this applies towards the amount of individual characters, for numeric values, this applies to the maximum numeric value allowed `e.g. maximum 120 characters`\n4.  **required** - The field is required in the request body\n    \n\n## Error Codes\n\n| Code | Description |\n| --- | --- |\n| 200 - Ok | Everything worked as expected |\n| 400 - Bad Request | The request was unacceptable, often due to missing a required parameter |\n| 401 - Unauthorized | No valid API key provided |\n| 403 - Forbidden | The API key doesn't have permission to perform the request |\n| 404 - Not Found | The requested resource does not exist |\n| 422 - Request can not be processed | The request was accepted but the data/instructions provided can not be processed |\n| 500 - Service Error | Something went wrong on Gateway's end |\n| 503 - Service Unavailable | Something went wrong on the Gateway's end while communicating with a third-party provider. We do not know if the request fulfilled successfully or not. |\n\nAll the error code and messages can be found [here](https://ftxus.atlassian.net/wiki/plugins/viewsource/viewpagesrc.action?pageId=119242753).","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"18437240","team":2803307,"collectionId":"35210cd6-dc57-466a-a0a2-7a60af49d570","publishedId":"UVJYLfHx","public":true,"publicUrl":"https://docs.fpptools.com","privateUrl":"https://go.postman.co/documentation/18437240-35210cd6-dc57-466a-a0a2-7a60af49d570","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.0","publishDate":"2022-01-12T22:21:09.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"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/a3f1beb0df55bd395d22dc8a91428e109a860df5d552be7f6c3817ca653f54b8","favicon":"https://res.cloudinary.com/postman/image/upload/v1639782867/team/q45t1ogss7xynagswd6q.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://docs.fpptools.com/view/metadata/UVJYLfHx"}