Private API
Trademen also provides private HTTP APIs which allow read / write access to your private account using personal access token for following functionalities…
- - Register
- - Login
- - Get Forget Password Link/Code
- - Set New Password
- - Get Email Verification Link / Code
- - Verify Email Verification Code
- - Get User Profile
- - Update User Profile
- - Change User Avatar
- - Change Password
- - Get Profile Preference
- - Update Profile Preference
- - KYC Verification
- - Get Support Tickets
- - Get Ticket Detail
- - Submit a Ticket
- - Comment on Ticket
- - Close a Ticket
- - Download Comment Attachment
- - Get Wallets
- - Deposit List
- - Get System's Aavailable Payment Methods
- - Get user's Bank Accounts
- - Deposit Fiat Currency
- - Upload Fiat Deposit Receipt for Admin Review
- - Deposit Cryptocurrency
- - Get Order List
- - Get Open Order List
- - Place Order
- - Cancel Order
- - Get Trade History
- - Get Withdrawal List
- - Withdraw Wallet Balance
- - Cancel Bank Withdrawal Request
- - Get Referral link
- - Get Referral Earnings
- - Get Referral Users
- - Get Referral Earnings through User
Register
Register a new user. Required POST method and request post data are "first_name", "last_name", "email", "username", "password", "password_confirmation", "check_agreement". If successful, the method will return user profile detail and personal access token.
Register Endpoint: https://yourdomain.com/api/register
Field Description first_name Required - Set user's first namelast_nameRequired - Set user's last name email Required - Set user's emailusernameRequired - Set user's username password Required - Set user's passwordpassword_confirmationRequired - Confirm user's password check_agreement Required - Check registration's terms and policySample Register Request:
curl -v -X POST https://yourdomain.com/api/register \ -H "Content-Type: application/json" \ -d '{ "first_name": "Jhon", "last_name": "Doe", "email": "jhondoe@gmail.com", "username": "jhondoe", "password": "123456789", "password_confirmation": "123456789", "check_agreement": 1 }'Sample Register Successful Response: STATUS CODE - 200
{ "success": true, "message": "The registration was successful. Please check your email to verify your account.", "data": { "user": { "email": "jhondoe@gmail.com", "username": "jhondoe", "referral_code": "fcdd3595-6ebe-4668-a65b-6444344eae1a", "assigned_role": "user", "id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "updated_at": "2020-11-12T09:13:38.000000Z", "created_at": "2020-11-12T09:13:38.000000Z", "profile": { "id": "d2354e68-858c-4353-96ed-84cb22fa5af2", "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "first_name": "Jhon", "last_name": "Doe", "address": null, "phone": null, "created_at": "2020-11-12T09:13:38.000000Z", "updated_at": "2020-11-12T09:13:38.000000Z" } }, "access_token": "1|5mao11TRVlzCqF3JVAlPAw7aEJWfKUd2UjVjcqfC" } }Sample Register Error Response: STATUS CODE - 400
{"success": false,"message": "Failed to register."}Login
Sends user's login request. Required POST method and request post data are "username", "password". If successful, the method will return personal access token.
Login Endpoint: https://yourdomain.com/api/login
Field Description username Required - Set user's usernamepasswordRequired - Set user's passwordSample Login Request:
curl -v -X POST https://yourdomain.com/api/login \ -H "Content-Type: application/json" \ -d '{ "email": "jhondoe@gmail.com", "username": "jhondoe", "password": "123456789" }'Sample Login Successful Response: STATUS CODE - 200
{ "success": true, "message": "Login is successful.", "data": { "access_token": "2|qL8HUXM4uz0hLS0GHjGeB1bsAQPDmUSfOzDFQu83" } }Sample Login Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to login." }Get Forget Password Link / Code
Sends request for restore user's forgotten password. Required POST method and request post data are "email". If successful, the method will return verifier hash code.
Get Forget Password Link/Code Endpoint: https://yourdomain.com/api/forget-password
Field Description email Required - Set user's emailSample Get Forget Password Link/Code Request:
curl -v -X POST https://yourdomain.com/api/forget-password \ -H "Content-Type: application/json" \ -d '{ "email": "jhondoe@gmail.com" }'Sample Get Forget Password Link/Code Successful Response: STATUS CODE - 200
{ "success": true, "message": "Password reset link is sent to your email address.", "data": { "verifier_hash_code": "y$UoxFJl4pD3/GWNR6x0z2KepfhalTaW.xuUcDgUv0r0cR3XZj/RaNK" } }Sample Login Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed! Your account is deleted by admin." }Set New Password
Sends request for set new password. Required POST method and request post data are "new_password", "password_confirmation", "verification_code", "email", "verifier_hash_code". If successful, the method will return verifier hash code.
Set New Password Endpoint: https://yourdomain.com/api/forget-password/set-password
Field Description new_password Required - Set user's new password password_confirmation Required - Confirm user's password verification_code Required - The Verification code given by user which was sent to user's registered email email Required - Set user's registered email verifier_hash_code Required - Provide verifier hash code from "Get Forget Password Request"Sample Set New Password Request:
curl -v -X POST https://yourdomain.com/api/forget-password \ -H "Content-Type: application/json" \ -d '{ "new_password" : "123456789", "password_confirmation" : "123456789", "verification_code" : "123456", "email" : "jhondoe@gmail.com", "verifier_hash_code" : "y$Hy5KxTxLOREsrvjZnhBut.hcrg9w2EaxZZVIJTRsM9fO5uhw.d97y" }'Sample Set New Password Successful Response: STATUS CODE - 200
{ "success": true, "message": "New password is updated. Please login your account." }Sample Set New Password Error Response: STATUS CODE - 400
{ "success": false, "message": "The verifier has code is invalid." }Get Email Verification Code
Sends request for verification user's email. Required POST method and request post data are "email". If successful, the method will return verifier hash code.
Get Email Verification Link/Code Endpoint: https://yourdomain.com/api/verification/email
Field Description email Required - Set user's emailSample Get Email Verification Link/Code Request:
curl -v -X POST https://yourdomain.com/api/verification/email \ -H "Content-Type: application/json" \ -d '{ "email": "jhondoe@gmail.com" }'Sample Get Email Verification Link/Code Successful Response: STATUS CODE - 200
{ "success": true, "message": "Email verification link is sent successfully.", "data": { "verifier_hash_code": "y$yh6b9vUFTi1B4Jywdc/YbuYMWQs.Wkl.STSikyt6ZNQYnMGIBndbG", "email": "jhondoe@gmail.com" } }Sample Get Email Verification Link/Code Error Response: STATUS CODE - 400
{ "success": false, "message": "The given email address is already verified." }Verify Email Verification Code
Sends request to verify code sent to user's email. Required POST method and request post data are "email", "verifier_hash_code", "verification_code". If successful, the method will return verifier hash code.
Verify Email Verification Code Endpoint: https://yourdomain.com/api/verification/verify-email-code
Field Description email Required - Set user's emailverifier_hash_codeRequired - Provide verifier hash code from "Get Email Verification Request" responseverification_codeRequired - The Verification code given by user which was sent to user's registered emailSample Verify Email Verification Link/Code Request:
curl -v -X POST https://yourdomain.com/api/verification/verify-email-code \ -H "Content-Type: application/json" \ -d '{ "email": "jhondoe@gmail.com" }'Sample Verify Email Verification Code Successful Response: STATUS CODE - 200
{ "success": true, "message": "Your account has been verified successfully." }Sample Verify Email Verification Code Error Response: STATUS CODE - 400
{ "success": false, "message": "The verifier has code is invalid." }Get User Profile
Sends request to get user profile detail. Required GET method with Bearer/Access Token in HEADER request. If successful, the method will return profile detail.
Get Profile Detail Endpoint: https://yourdomain.com/api/user/profile/show
Sample Get Profile Detail Request:
curl -v -X POST https://yourdomain.com/api/user/profile/show \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Profile Response: STATUS CODE - 200
{ "success": true, "data": { "user": { "id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "assigned_role": "user", "referrer_id": null, "referral_code": "fcdd3595-6ebe-4668-a65b-6444344eae1a", "username": "jhondoe", "email": "jhondoe@gmail.com", "avatar": null, "google2fa_secret": null, "is_id_verified": 0, "is_email_verified": 0, "is_financial_active": 1, "is_accessible_under_maintenance": 0, "is_super_admin": 0, "status": "active", "created_by": null, "created_at": "2020-11-12T09:13:38.000000Z", "updated_at": "2020-11-12T09:13:38.000000Z", "preference": null, "profile": { "id": "d2354e68-858c-4353-96ed-84cb22fa5af2", "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "first_name": "Jhon", "last_name": "Doe", "address": null, "phone": null, "created_at": "2020-11-12T09:13:38.000000Z", "updated_at": "2020-11-12T09:13:38.000000Z" } } } }Sample Get Profile Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Update User Profile
Sends request to update user profile detail. Required PUT method with Bearer/Access-Token in HEADER request and form data are "first_name", "last_name", "address". If successful, the method will return success message.
Update Profile Detail Endpoint: https://yourdomain.com/api/user/profile/update
Field Description first_name Required - Set user's first namelast_nameRequired - Set user's last name address Optional - Set user's addressSample Update Profile Detail Request:
curl -v -X PUT https://yourdomain.com/api/user/profile/update \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "first_name": "Jhon", "last_name": "Doe", }'Sample Get Profile Response: STATUS CODE - 200
{ "success": true, "message": "Profile has been updated successfully." }Sample Update Profile Error Response: STATUS CODE - 401
{ "message": "Unauthenticated." }Change User Avatar
Sends request to update user profile detail. Required POST method with Bearer/Access-Token in HEADER request and form data are "avatar". If successful, the method will return success message and the updated avatar url.
Change Profile Avatar Endpoint: https://yourdomain.com/api/user/profile/avatar/update
Field Description avatar Required - Set user's first nameSample Change Profile Avatar Request:
curl -v -X POST https://yourdomain.com/api/user/profile/avatar/update \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "avatar": "file" }'Sample Change Profile Avatar Response: STATUS CODE - 200
{ "success": true, "message": "Avatar has been uploaded successfully.", "data": { "avatar": "urlOfUpdatedAvatar" } }Sample Change Profile Avatar Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to upload the avatar." }Change Password
Sends request to change user password. Required PUT method with Bearer/Access-Token in HEADER request and form data are "password", "new_password", "new_password_confirmation". If successful, the method will return success message.
Change Password Endpoint: https://yourdomain.com/api/user/password/update
Field Description password Required - Set user's old password new_password Required - Set user's new password new_password_confirmation Required - Confirm new passwordSample Change Password Request:
curl -v -X PUT https://yourdomain.com/api/user/password/update \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "password": "123456789", "new_password": "123456789", "new_password_confirmation": "123456789" }'Sample Change Password Response: STATUS CODE - 200
{ "success": true, "message": "Password has been changed successfully." }Sample Change Password Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to change the password." }Get Profile Preference
Sends request to get profile preference. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return profile preference detail.
Get Preference Endpoint: https://yourdomain.com/api/user/password/update
Sample Get Profile Preference Request:
curl -v -X GET https://yourdomain.com/api/user/preference/show \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Get Preference Successful Response: STATUS CODE - 200
{ "success": true, "data": { "preference": { "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "default_language": "en", "default_coin_pair": null, "id": "82d30318-fa9c-42ad-a992-afa87337c324" } } }Sample Get Preference Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Update Profile Preference
Sends request to update user preference. Required PUT method with Bearer/Access-Token in HEADER request and form data are "display_language", "default_coin_pair". If successful, the method will return success message.
Update Preference Endpoint: https://yourdomain.com/api/user/preference/update
Field Description display_language Optional - Set user's preferred language. default_coin_pair Optional - Set user's preferred coin pair.Sample Update Preference Request:
curl -v -X PUT https://yourdomain.com/api/user/preference/update \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "display_language": "en", "default_coin_pair": "BTC_USD" }'Sample Update Preference Response: STATUS CODE - 200
{ "success": true, "message": "Preference has been updated successfully." }Sample Update Preference Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to update preference." }KYC Verification
Sends request to submit KYC verification document(S). Required POST method with Bearer/Access-Token in HEADER request and form data are "id_type", "id_card_front" and "id_card_back" (optional if id type is passport). If successful, the method will return success message.
KYC Verification Endpoint: https://yourdomain.com/api/user/kyc-verifications
FieldDescriptionid_typeRequired - Set ID verification type one of the following - "national_id", "driving_license", "passport".id_card_frontRequired - Set ID's front image.id_card_backOptional if the id type is passport - Set ID's back image.Sample KYC Verification Request:
curl -v -X POST https://yourdomain.com/api/user/kyc-verifications \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "id_type": "national_id", "id_card_front": "image...", "id_card_back": "image...", }'Sample Update KYC verification Response: STATUS CODE - 200
{ "success": true, "message": "ID has been uploaded successfully." }Sample KYC Verification Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to upload ID." }Get Tickets
Sends request to get user's tickets . Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return tickets detail.
Get Tickets Endpoint: https://yourdomain.com/api/user/tickets
Sample Get Tickets Request:
curl -v -X GET https://yourdomain.com/api/user/tickets \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Get Tickets Response: STATUS CODE - 200
{ "success": true, "data": { "tickets": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/tickets?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/tickets?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/tickets?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/tickets", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Tickets Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Ticket Detail
Sends request to get user's single ticket detail. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return single ticket detail.
Get Ticket Detail Endpoint: https://yourdomain.com/api/user/tickets/{ticketID}/show
Sample Get Ticket Detail Request:
curl -v -X GET https://yourdomain.com/api/user/tickets/c0add1c9-bede-4224-ab5c-adcf79b0cb66/show \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Get Ticket Detail Response: STATUS CODE - 200
{ "success": true, "data": { "tickets": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/tickets?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/tickets?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/tickets?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/tickets", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Ticket Detail Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Submit a Ticket
Sends request to place a support ticket. Required POST method with Bearer/Access-Token in HEADER request and form data are "title", "content", "previous_id" and "attachment" . If successful, the method will return single ticket detail.
FieldDescriptiontitleRequired - Set ticket title.previous_idOptional - Set ticket previous reference ID.attachmentOptional - Set ticket previous attachment image.Submit a Ticket Endpoint: https://yourdomain.com/api/user/tickets
Sample Submit a Ticket Request:
curl -v -X POST https://yourdomain.com/api/user/tickets \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "title": "Ticket Title Goes Here.", "content": "Ticket Content", "previous_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "attachment": "files goes here..." }'Sample Submit a Ticket Response: STATUS CODE - 200
{ "success": true, "message": "Ticket has been created successfully.", "data": { "ticket": { "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "title": "Ticket Title Goes Here", "content": "Ticket Content Goes Here.", "id": "9e13143a-0e6c-4251-8d03-f8fc24372be1", "updated_at": "2020-11-15T05:15:57.000000Z", "created_at": "2020-11-15T05:15:57.000000Z" } } }Sample Submit Ticket Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to create the ticket." }Comment on Ticket
Sends request to place a comment on support ticket. Required POST method with Bearer/Access-Token in HEADER request and the url parameter is ticket ID and the form data is "content" and "attachment" (optional). If successful, the method will return success message.
Comment on a Ticket Endpoint: https://yourdomain.com/api/user/tickets/{ticketID}/comment
FieldDescriptioncontentRequired - Set comment for ticket.attachmentOptional - Upload attachment image.Sample Comment on Ticket Request:
curl -v -X POST https://yourdomain.com/api/user/tickets/c0add1c9-bede-4224-ab5c-adcf79b0cb66/comment \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token \ -d '{ "content": "Comment content goes here..", "attachment": "image file goes here..", }'Sample Comment on Ticket Response: STATUS CODE - 200
{ "success": true, "message": "The message has been created successfully." }Sample Comment on Ticket Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to place the comment." }Close a Ticket
Sends request to close a support ticket. Required PUT method with Bearer/Access-Token in HEADER request and url parameter is ticket ID. If successful, the method will return success message.
Close a Ticket Endpoint: https://yourdomain.com/api/user/tickets/{ticketID}/close
Sample Submit a Ticket Request:
curl -v -X PUT https://yourdomain.com/api/user/tickets/c0add1c9-bede-4224-ab5c-adcf79b0cb66/close \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Submit a Ticket Response: STATUS CODE - 200
{ "success": true, "message": "The ticket has been closed successfully." }Sample Submit Ticket Error Response: STATUS CODE - 400
{ "success": false, "message": "The relevant data is not found." }Download Comment Attachment
Sends request to download a comment attachment for a support ticket. Required GET method with Bearer/Access-Token in HEADER request and url parameter is ticket ID and fileName. If successful, the method will return attachment file.
Download Comment attachment Endpoint: https://yourdomain.com/api/user/tickets/{ticketID}/download-attachment/{fileName}
Sample Download a Comment Attachment Request:
curl -v -X GET https://yourdomain.com/api/user/tickets/c0add1c9-bede-4224-ab5c-adcf79b0cb66/download-attachment/c0add1c9-bede-4224-ab5c-adcf79b0cb66 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenDownload Comment Attachment Response: STATUS CODE - 200
Sample Submit Ticket Error Response: STATUS CODE - 400
Get Wallets
Sends request to get wallets detail of user. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return wallets detail.
Get Wallets Endpoint: https://yourdomain.com/api/user/wallets
Sample Get Wallets Request:
curl -v -X GET https://yourdomain.com/api/user/wallets \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Get Wallets Detail Response: STATUS CODE - 200
{ "success": true, "data": { "current_page": 1, "data": [ { "id": "8ac8dbee-666f-42bf-bb56-d4ff9276434d", "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "symbol": "BTC", "primary_balance": "0.00000000", "address": null, "passphrase": null, "is_system_wallet": false, "is_active": true, "created_at": "2020-11-15T10:35:46.000000Z", "updated_at": "2020-11-15T10:35:46.000000Z", "on_order_balance": null, "coin": { "symbol": "BTC", "name": "Bitcoin", "icon": null } }, { "id": "15111092-39bb-49f8-944a-6284bf104dc8", "user_id": "c0add1c9-bede-4224-ab5c-adcf79b0cb66", "symbol": "USD", "primary_balance": "0.00000000", "address": null, "passphrase": null, "is_system_wallet": false, "is_active": true, "created_at": "2020-11-15T10:35:46.000000Z", "updated_at": "2020-11-15T10:35:46.000000Z", "on_order_balance": null, "coin": { "symbol": "USD", "name": "United States Dollar", "icon": null } } ], "first_page_url": "http://trademen.local/api/user/wallets?page=1", "from": 1, "last_page": 1, "last_page_url": "http://trademen.local/api/user/wallets?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/wallets?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/wallets", "per_page": 15, "prev_page_url": null, "to": 2, "total": 2 } }Sample Get Wallets Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Deposit List
Sends request to get user's deposit list. Required GET method with Bearer/Access-Token in HEADER request and the url parameter is currencySymbol. If successful, the method will return deposit list.
Get Deposit List Endpoint: https://yourdomain.com/api/user/wallets/{currencySymbol}/deposits
Sample Get Deposit Request:
curl -v -X GET https://yourdomain.com/api/user/wallets/BTC/deposits \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-TokenSample Get Deposit List Response: STATUS CODE - 200
{ "success": true, "data": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/wallets/USD/deposits?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/wallets/USD/deposits?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/wallets/USD/deposits?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/wallets/USD/deposits", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } }Sample Get Deposit List Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get System’s Available Payment Methods
Gets System’s Available Payment Methods for a given currency. Required GET method and url parameter is currency symbol . If successful, the method will return a success message and a list of available payment methods and bank information with 200 HTTP status.
Get System's Available Payment Methods Endpoint: https://yourdomain.com/api/coins/{currencySymbol}/payment-methods
Sample Get Deposit Request:
curl -v -X GET https://yourdomain.com/api/coins/USD/payment-methods \ -H "Content-Type: application/json"Sample Get System's Available Payment Methods Successful Response: STATUS CODE - 200
{ "success": true, "data": { "availablePaymentMethods": { "BankApi": "Bank" }, "selectedSystemBanks": [ { "id": "e062682a-6d4f-4809-bad3-0327fc09cc0b", "country": "Yemen", "bankName": "Graham and Sons", "iban": "SE2508297029259183706664", "swift": "BYNLEP58", "referenceNumber": "953987", "accountHolder": "Robbie Kunde V", "bankAddress": "226 Hildegard Gardens Suite 687\nGladysside, WI 89356-4682", "accountHolderAddress": "578 Tomasa Radial\nLake Gay, KS 22988", "isActive": 1 } ] } }Sample Get Deposit List Error Response: STATUS CODE - 400
{ "success": false, "message": "The relevant data is not found." }Get User’s Bank Accounts
Gets user’s bank accounts. Required GET method. If successful, the method will return a success message and a list of user’s bank account information with 200 HTTP status.
Get System's Available Payment Methods Endpoint: https://yourdomain.com/api/user/bank-accounts
Sample Get User’s Bank Accounts Request:
curl -v -X GET https://yourdomain.com/api/user/bank-accounts \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get User Bank Accounts Request: STATUS CODE - 200
{ "success": true, "data": [ { "id": "37d0e460-9813-4fc8-8e6c-7658e5dbd1ba", "name": "Pagac and Sons", "iban": "Pagac and Sons", "swift": "QOQLZUKP5JT", "bankAddress": "4463 Jones Burgs\nPort Lonniefort, OH 75119-9136", "referenceNumber": "49093775212", "accountHolderAddress": "64284 Annabel Course\nSouth Joan, MT 89057-3689", "isVerified": "Verified", "isActive": "Active", "createdAt": "2020-10-27T09:26:30.000000Z" }, { "id": "9a751cd5-a0a4-407c-aa0b-8dbe9b19ebce", "name": "Haag Inc", "iban": "Haag Inc", "swift": "JKGRTU67TMA", "bankAddress": "1040 Joshua Springs\nWest Kiaraview, NJ 26021-2701", "referenceNumber": "7192044944693", "accountHolderAddress": "88515 Janie Fork\nWest Brenden, NM 46622", "isVerified": "Verified", "isActive": "Active", "createdAt": "2020-10-27T09:26:30.000000Z" } ] }Sample Get user’s Bank Accounts Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Deposit Fiat Currency
Deposits fiat currency for given wallet. Required POST method and parameters are “amount”, “api”, “bank_account_id” (If api/payment method is bank), deposit_policy. If successful, the method will return a success message with 200 HTTP status comprising deposit details, user bank detail and system bank detail for user to send the amount to that system bank.
FieldDescriptionamountRequired - The amount user wants to depositapiRequired - The available payment methods for the given currency. To get available payment methods see Get System's Available Payment Methods APIbank_account_idRequired if api/payment method is BANK - The user bank account id by which he/she want to deposit. To get user bank account’s id see Get user's Bank Accounts APIdeposit_policyRequired - Accepted value is 1Deposit Fiat Currency Endpoint: https://yourdomain.com/api/user/wallets/{currencySymbol}/deposits/store
Sample Deposit Fiat Currency Request:
curl -v -X POST https://yourdomain.com/api/user/wallets/USD/deposits/store \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "amount": "200.00000000", "api": "BankApi", "bank_account_id": "724200fa-47f2-4e66-b02f-49a2d0f5db47", "deposit_policy": 1 }'Sample Deposit Fiat Currency Response: STATUS CODE - 200
{ "success": true, "message": "Deposit has been created successfully.", "data": { "depositDetails": { "id": "a591a65c-6332-49a1-ae53-e5297726a0ff", "user": "Brett Jacobson", "wallet": "United States Dollar (USD)", "amount": "200", "bank": "Pagac and Sons", "txnId": null, "status": "pending" }, "userBankDetail": { "id": "37d0e460-9813-4fc8-8e6c-7658e5dbd1ba", "bankName": "Pagac and Sons", "bankAddress": "4463 Jones Burgs\nPort Lonniefort, OH 75119-9136", "accountHolder": "Prof. Axel Ebert", "referenceNumber": "49093775212", "swift": "QOQLZUKP5JT", "iban": "LV55ZSQZZ682H91BID460", "country": "Sao Tome and Principe", "isActive": "Active", "isVerified": "Verified" }, "depositWithBanks": [ { "id": "e062682a-6d4f-4809-bad3-0327fc09cc0b", "country": "Yemen", "bankName": "Graham and Sons", "iban": "SE2508297029259183706664", "swift": "BYNLEP58", "referenceNumber": "953987", "accountHolder": "Robbie Kunde V", "bankAddress": "226 Hildegard Gardens Suite 687\nGladysside, WI 89356-4682", "accountHolderAddress": "578 Tomasa Radial\nLake Gay, KS 22988", "isActive": "Active" } ] } }Sample Deposit Fiat Currency Error Response: STATUS CODE - 400
{ "success": false, "message": "Invalid fiat deposit request." }Upload Fiat Deposit Receipt For Admin Review
Uploads user bank deposit receipt in system bank. Required POST method and URL parameters are currency symbol and deposit id and request form data are “system_bank_id”, “receipt” (image file). If successful, the method will return a success message with 200 HTTP status.
Upload Fiat Deposit Receipt Endpoint: https://yourdomain.com/api/user/wallets/{currencySymbol}/deposits/{depositID}/upload-bank-receipt
Sample Upload Fiat Deposit Receipt Request:
curl -v -X POST https://yourdomain.com/api/user/wallets/USD/deposits/824200fa-47f2-4e66-b02f-49a2d0f5db47/upload-bank-receipt \ -H "Content-Type: multipart/form-data" \ -H "Authorization: Bearer Access-Token" \ -F "system_bank_id=824200fa-47f2-4e66-b02f-49a2d0f5db47" \ -F "receipt=@/home/user1/Desktop/receipt.jpg"Sample Upload Fiat Deposit Receipt Response: STATUS CODE - 200
{ "success": true, "message": "Receipt has been uploaded successfully." }Sample Upload Fiat Deposit Receipt Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to upload receipt." }Get Crypto Wallet Deposit Address
Gets wallet deposit address for cryptocurrency or crypto wallet. Required GET method and url parameter is cryptocurrency symbol. If successful, the method will return a wallet address and qrcode with 200 HTTP status.
Get Crypto Wallet Deposit Address Endpoint: https://yourdomain.com/api/user/wallets/{currencySymbol}/get-deposit-address
Sample Get Crypto Wallet Deposit Address Request:
curl -v -X GET https://yourdomain.com/api/user/wallets/BTC/get-deposit-address \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Crypto Wallet Deposit Address Response: STATUS CODE - 200
{ "success": true, "data": { "walletAddress": "0x7d0e46098134fc88e6c7658e5dbd1ba", "qrCode": ... } }Sample Get Crypto Wallet Deposit Address Error Response: STATUS CODE - 400
{ "success": false, "message": "Network Error! Unable to generate address." }Get Order List
Gets all order list of the user. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return a order list with 200 HTTP status.
Get Order Endpoint: https://yourdomain.com/api/user/orders
Sample Get Order Request:
curl -v -X GET https://yourdomain.com/api/user/orders \-H "Content-Type: application/json" \-H "Authorization: Bearer Access-Token"Sample Get Orders List Response: STATUS CODE - 200
{ "success": true, "data": { "all_orders": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/orders?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/orders?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/orders?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/orders", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Orders Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Open Order List
Get all open orders for a given coinPair or market. Required GET method and Required URL parameter is currency symbol. If successful, the method will return open order list with 200 HTTP.
Get Order Endpoint: https://yourdomain.com/api/user/orders/{coinPair}/open
Sample Get Open Orders Request:
curl -v -X GET https://yourdomain.com/api/user/orders/BTC_USD/open \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Open Orders Response: STATUS CODE - 200
{ "success": true, "data": { "open_orders": [] } }Sample Get Open Orders Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Place Order
Places a buy or sell order for a category (Limit, Stop Limit, Market) in a given market. Required POST method and the parameters are “order_type”, “category”, “trade_pair”, “price”, “amount”, “total” and “stop”. If successful, the method will return the order number
phFieldDescriptionorder_typeRequired - Available order types are buy, sell.categoryRequired - Available categories are limit, stop_limt, market.trade_pairRequired - A pair like BTC_USDpriceRequired if order category is not market - Numeric between 0.000000001, 99999999999.99999999amountRequired if order category is not market and order type is not sell - Numeric between 0.000000001, 99999999999.99999999totalRequired if order category is not market and order type is not sell - Numeric between 0.000000001, 99999999999.99999999stopRequired if order category is stop_limit - Numerice between 0.000000001, 99999999999.99999999Place Order Endpoint: https://yourdomain.com/api/user/orders/place
Sample Limit Order Request:
curl -v -X POST https://yourdomain.com/api/user/orders/place \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "order_type": "sell", "category": "limit", "trade_pair": "BTC_USD", "price": "7500.00000000", "amount": "0.5", "total": "3750.00000000", }'Sample Limit order Successful Response : STATUS CODE - 201
{ "success": true, "message": "Your order has been placed successfully.", "data": { "order_id": "624200fa-47f2-4e66-b02f-49a2d0f5db47", "order_type": "sell", "price": "7500.00000000", "amount": "0.50000000", "total": "3750.00000000", "open_amount": "0.50000000", "exchanged": "0", "stop_limit": null, "date": "2020-05-21 22:00:00", "category": "limit" } }Sample Market Order Request:
curl -v -X POST https://yourdomain.com/api/user/orders/place \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "order_type": "buy", "category": "market", "trade_pair": "BTC_USD", "amount": "0.5" }'Sample Market Order Successful Response : STATUS CODE - 201
{ "success": true, "message": "Your order has been placed successfully.", "data": { "order_id": "624200fa-47f2-4e66-b02f-49a2d0f5db47", "order_type": "buy", "price": "0", "amount": "0.50000000", "total": "0", "open_amount": "0.50000000", "exchanged": "0", "stop_limit": null, "date": "2020-05-21 22:00:00", "category": "market" } }Sample Stop Limit Order Request:
curl -v -X POST https://yourdomain.com/api/user/orders/place \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "order_type": "buy", "category": "stop_limit", "trade_pair": "BTC_USD", "price": "7500.00000000", "amount": "0.5", "total": "3750.00000000", "stop": "7600.00000000" }'Sample Stop Limit Order Successful Response : STATUS CODE - 201
{ "success": true, "message": "Your order has been placed successfully.", "data": { "order_id": "624200fa-47f2-4e66-b02f-49a2d0f5db47", "order_type": "buy", "price": "7500.00000000", "amount": "0.50000000", "total": "3750.00000000", "open_amount": "0.50000000", "exchanged": "0", "stop_limit": "7600.00000000", "date": "2020-05-21 22:00:00", "category": "stop_limit" } }Sample Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Cancel Order
Places an order cancel (both buy and sell) request for a any category (Limit, Stop Limit, Market) in a given market. Required DELETE method and the required URL parameter is the order ID. If successful, the method will return a success message with 200 HTTP status.
Cancel Order Endpoint: https://yourdomain.com/api/user/orders/{orderID}/destroy
Sample Cancel Order Request:
curl -v -X DELETE https://yourdomain.com/api/user/orders/624200fa-47f2-4e66-b02f-49a2d0f5db47/destroy \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Cancel Orders Successful Response: STATUS CODE - 200
{ "success": true, "message": "The order cancellation request has been placed successfully." }Sample Get Orders Error Response: STATUS CODE - 400
{ "success": false, "message": "The order cancellation request has been placed successfully." }Get Trade History
Sends request to get trade history. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return trade history.
Get Trade History Endpoint: https://yourdomain.com/api/user/trade-history
Sample Get Trade History Order Request:
curl -v -X GET https://yourdomain.com/api/user/trade-history \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Trade History Successful Response: STATUS CODE - 200
{ "success": true, "data": { "trade_history": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/trade-history?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/trade-history?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/trade-history?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/trade-history", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Trade History Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Withdrawal List
Sends request to get withdrawal list for given wallet / currency. Required GET method and Required URL parameter is currency symbol. If successful, the method will return a list of withdrawals message with 200 HTTP.
Get Withdrawal List Endpoint: https://yourdomain.com/api/user/wallets/{currencySymbol}/withdrawals
Sample Get Withdrawal List Request:
curl -v -X GET https://yourdomain.com/api/user/wallets/USD/withdrawals \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Withdrawal List Successful Response: STATUS CODE - 200
{ "success": true, "data": { "current_page": 1, "data": [ { "id": "086aa961-41aa-403e-a2de-5c5b9f78115e", "user_id": "658532d7-3aa2-4e3c-bb30-4d2b60a61440", "wallet_id": "ec048965-2206-4680-9b11-8aaba17ca9fc", "bank_account_id": "37d0e460-9813-4fc8-8e6c-7658e5dbd1ba", "symbol": "USD", "address": null, "amount": "1443.49232849", "system_fee": "28.86984656", "txn_id": "5d04d0ae-5f31-4d9e-b3a6-15499d72cfa8", "api": "BankApi", "status": "completed", "created_at": "2020-10-13T17:44:01.000000Z", "updated_at": "2020-10-04T00:01:52.000000Z", "bank_account": { "id": "37d0e460-9813-4fc8-8e6c-7658e5dbd1ba", "user_id": "658532d7-3aa2-4e3c-bb30-4d2b60a61440", "country_id": 190, "bank_name": "Pagac and Sons", "iban": "LV55ZSQZZ682H91BID460", "swift": "QOQLZUKP5JT", "reference_number": "49093775212", "account_holder": "Prof. Axel Ebert", "bank_address": "4463 Jones Burgs\nPort Lonniefort, OH 75119-9136", "account_holder_address": "64284 Annabel Course\nSouth Joan, MT 89057-3689", "is_verified": 1, "is_active": 1, "created_at": "2020-10-27T09:26:30.000000Z", "updated_at": "2020-10-27T09:26:30.000000Z" } }, ... ], "first_page_url": "http://trademen.local/api/user/wallets/USD/withdrawals?page=1", "from": 1, "last_page": 1, "last_page_url": "http://trademen.local/api/user/wallets/USD/withdrawals?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/wallets/USD/withdrawals?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/wallets/USD/withdrawals", "per_page": 15, "prev_page_url": null, "to": 4, "total": 4 } }Sample Get Withdrawal List Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Withdraw Balance
Places withdraw request for given wallet / currency. Required POST method and Required URL parameter is currency symbol and request form data are “amount”, “withdrawal_policy”, “address” (required if the currency is crypto), “api” (required if the currency is fiat), “bank_account_id” (user bank account id is required if the api value is Bank) . If successful, the method will return a success message with 200 HTTP.
FieldDescriptionamountRequired - The amount user wants to withdraw/td>withdrawal_policyRequired - Accepted value is 1addressRequired if currency is crypto - Relevant crypto wallet address which receive the withdrawal amountapiRequired if the currency is fiat - The available payment methods for the given currency. To get available payment methods see Get System's Available Payment Methods APIWithdrawal Request for Crypto Wallet Endpoint: https://yourdomain.com/api/user/wallets/{CurrencySymbol}/withdrawals
Sample Withdrawal Request for Crypto Wallet:
curl -v -X POST https://yourdomain.com/api/user/wallets/BTC/withdrawals/store \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "amount": "0.50000000", "withdrawal_policy": 1, "address": "0x24200fa47f24e66b02f49a2d0f5db47" }'Sample Withdrawal Request for Fiat Wallet:
curl -v -X POST https://yourdomain.com/api/user/wallets/USD/withdrawals/store \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '{ "amount": "0.50000000", "withdrawal_policy": 1, "api": "BankApi", "bank_account_id": "724200fa-47f2-4e66-b02f-49a2d0f5db47" }'Sample Withdraw Balance Response: STATUS CODE - 200
{ "success": true, "message": "Your withdrawal has been placed successfully." }Sample Withdraw Balance Error Response: STATUS CODE - 400
{ "success": false, "message": "Unable to withdraw amount." }Cancel Bank Withdrawal Request
Places a bank withdrawal cancel request for fiat currencies. Required DELETE method and the required url parameter is the currency symbol and withdrawal ID. If successful, the method will return a success message with 200 HTTP status.
Withdrawal Request for Crypto Wallet Endpoint: https://yourdomain.com/api/user/wallets/{CurrencySymbol}/withdrawals/destroy
Sample Cancel Bank Withdrawal Request:
curl -v -X DELETE https://yourdomain.com/api/user/wallets/USD/withdrawals/624200fa-47f2-4e66-b02f-49a2d0f5db47/destroy \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Cancel Bank Withdrawal Request Successful Response: STATUS CODE - 200
{ "success": true, "message": "The withdrawal cancellation will be processed shortly." }Sample Cancel Withdrawal Request Error Response: STATUS CODE - 400
{ "success": false, "message": "Failed to cancel the withdrawal." }Get Referral Link
Sends request to get referral link. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return a referral link.
Get Referral Link Endpoint: https://yourdomain.com/api/user/referral/get-link
Sample Get Referral Link Request:
curl -v -X GET https://yourdomain.com/api/user/referral/get-link \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Referral Link Request Successful Response: STATUS CODE - 200
{ "success": true, "data": { "referral_link": "http://trademen.local/register?ref=fcdd3595-6ebe-4668-a65b-6444344eae1a" } }Sample Cancel Withdrawal Request Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Referral Earnings
Sends request to get referral earnings. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return referral earnings.
Get Referral Earnings Endpoint: https://yourdomain.com/api/user/referral/earnings
Sample Get Referral Earnings Request:
curl -v -X GET https://yourdomain.com/api/user/referral/earnings \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Trade History Successful Response: STATUS CODE - 200
{ "success": true, "data": { "referral_earnings": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/referral/earnings?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/referral/earnings?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/referral/earnings?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/referral/earnings", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Trade History Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Referral Users
Sends request to get referral users. Required GET method with Bearer/Access-Token in HEADER request. If successful, the method will return referral users list.
Get Referral Users Endpoint: https://yourdomain.com/api/user/referral/users
Sample Get Referral Earnings Request:
curl -v -X GET https://yourdomain.com/api/user/referral/users \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token"Sample Get Referral Users Successful Response: STATUS CODE - 200
{ "success": true, "data": { "referral_users": { "current_page": 1, "data": [], "first_page_url": "http://trademen.local/api/user/referral/users?page=1", "from": null, "last_page": 1, "last_page_url": "http://trademen.local/api/user/referral/users?page=1", "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http://trademen.local/api/user/referral/users?page=1", "label": 1, "active": true }, { "url": null, "label": "Next »", "active": false } ], "next_page_url": null, "path": "http://trademen.local/api/user/referral/users", "per_page": 15, "prev_page_url": null, "to": null, "total": 0 } } }Sample Get Referral Users Error Response: STATUS CODE - 400
{ "message": "Unauthenticated." }Get Referral Earnings Through User
Sends request to get referral earnings through user. Required GET method with Bearer/Access-Token in HEADER request and url parameter is user id. If successful, the method will return earnings through that user.
Get Referral Users Endpoint: https://yourdomain.com/api/user/referral/users/{userID}/earnings