Don't Panic

A developer's guide to Bitex.

Our JSON REST API lets you build applications that leverage Bitex liquidity and funding options.

Language specific wrappers and code samples can be found in our GitHub repositories, we'll gladly take requests for your favourite language, but ultimately we rely on your contributions to expand our language specific catalog.

We're looking to hear from you, tell us what you need and we'll add it. We're always reachable at [email protected]

Our API endpoints support params in both application/x-www-form-urlencoded and application/json formats.

We have a sandbox environment running at https://sandbox.bitex.la you can sign up there, make dummy cash deposits and deposit bitcoins from the Bitcoin testnet. You can get sandbox coins using this Testnet Bitcoin Faucet

You should limit your use to under 5 requests a second, if you run over your usage limit you'll start getting a 429 HTTP response status. Also, beware of Cloudflare.com which is our DDOS mitigation provider. You may find yourself being blocked by them if your IP has been blacklisted or if your usage pattern seems malicious, even when it's not. If you're being blocked by cloudflare please contact us at [email protected] and we'll review your case and whitelist your IP accordingly.



Example Use Cases

Our API is the result of working hand in hand with developers of real world, business critical applications. These are just some examples of what developers are building, we can't wait to see what you'll do with it. We want to expose as much functionality as possible, but at the same time we want to get out of your way and make things simple for you, please contact us at [email protected] with suggestions on how to make your life easier.



Market Watch

A good example of a Market Watch is bitcoinaverage.com, it's a website providing real-time price and trade volume data about several bitcoin exchanges, and Bitex is one of them.

They get our market summary from the Ticker endpoint.

If you're building something similar you may also have a look at our Orderbook for market depth and Transactions for last hour traded volume, or even better, the Last 24 Hours of aggregated data in a format that is friendly for candlestick graphs.

Trading and Arbitrage

Before you start trading or arbitraging Bitcoin you should get a full view of the current market and your position using the Transactions endpoint to learn about the most recent volatility, Orderbook to get the current market depth and Profile & Balances to check your BTC and USD available balances.

Once that's done it's easy to place Bids and Asks in Bitex, as well as following their execution status in your Active Order List

Or you can check your recent Individual Trades. to see what got bought and/or sold.

We have an open source robot that can be used as an example of our API usage, and can also be used to do arbitrage between Bitex and other exchanges Fork it on github.

Accept Bitcoin Payments

You can start accepting bitcoin payments using our Payments Endpoint

We can quote your customer local currency into bitcoin so you can request them to pay "100 EUR in Bitcoin".

Once you receive the Bitcoin we can convert it to USD at the best BTC/USD bitex price, or keep it as Bitcoin if you want to.

We even give you your own Web Point of Sale where customers can create a new Payment to you in a self-service way, or pay for an existing one you created via API.

All funds will be credited to your bitex account and from there you can proceed to request a withdrawal to your own Bitcoin wallet or to your bank account.

All exchange rates used for quoting come from our Rates API.

Remittances

Remittance workflows with bitcoin usually require exchanges to take either one of two roles:
1) Turning fiat into bitcoin at the sender's request and then forwarding the produced bitcoin to another exchange which will...
2) Sell the bitcoin for fiat and then process a withdrawal on the receiving party's behalf.

Bitex can take any of those roles, provided the sender or receiver has an account and an accepted KYC Profile in Bitex.

Our Reseller API lets you create new accounts in Bitex and you can then use the KYC Profile endpoints to produce a valid profile.

For sending a remmittance your can instruct the person to Deposit Fiat into their Bitex balance using one of the supported mechanisms, Buy Bitcoin in the BTC/USD orderbook and then Withdraw Bitcoin to the desired bitcoin address.

For receiving a remmitance you can use our Payments API to get a fresh bitcoin address to receive the money to and automatically convert it from BTC to USD at the best market price in Bitex, then request a USD Withdrawal to their bank account, or whatever other withdrawal method is supported by Bitex in the customer's country.

Asset Management

Our best example in this area is Koibanx, which is a company managing investment funds, receiving USD from their customers to be invested in Bitcoin.

They use our Reseller API to create and manage accounts for their customers, thus leveraging Bitex KYC and AML, and safe Bitcoin vault.



Your API keys

You authenticate to the Bitex API by provinding one of your API keys as a POST or GET parameter called api_key. You can have several active API keys at once.

It's your responsibility to keep all your API keys safe. Always use the https protocol when making your requests. Revoke your API keys immediately if you think they're compromised.



Public Market Data

Our public market data endpoints let anyone check our market's volume, prices and transaction history. It also provides aggregateted candlestick-like data points for the last 24 hours, 7 days and 30 days of trading.

You don't need an API key (or even sign up to Bitex) to access the public market data.



Ticker

Overview of current market prices and trade volume.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/ticker
JSON RESPONSE
{  
"last": 1035.3, Last transaction price
"price_before_last": 1035.0, Helps you tell if price is going up or down.
"open": 975.0, What the price was 24 hours ago.
"high": 1035.3, Highest price for the past 24 hours.
"low": 975.0, Lowest price for the past 24 hours.
"vwap": 1024.07361782, Volume-Weighted Average Price for the past 24 hours.
"volume": 30.08353866, Transacted volume for the last 24 hours.
"bid": 1041.50583761, Highest current buy order.
"ask": 1047.51151612, Lowest current ask order.
}  
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/ticker

Order Book

Returns a JSON object with all bids and asks grouped by price, represented as a list of price and amount.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/order_book
JSON RESPONSE
{  
"bids": [
  [1041.50583761, 4.10027467],
  [1030.2000951, 4.92248062],
  [1020.0, 4.82047059],
  ...
],

List of Bids represented as [price, bitcoin_amount] pairs.
Notice this is counter-intuitive to the way you place Bids in bitex, where you say how much USD to spend instead of how much BTC you expect to buy.
"asks": [
  [1047.51151612, 4.327046],
  [1055.12, 2.0],
  [1055.82864322, 4.516654],
  ...
],

List of Asks represented as [price, bitcoin_amount] pairs.
}  
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/order_book

Transactions

Returns a JSON list of lists representing all individual trades for the past 60 minutes, sorted by descending date.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/transactions
JSON RESPONSE
[  
[  
946685400, UNIX timestamp.
2, Transaction ID.
210.0, Price Paid.
0.1, Amount Sold.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/transactions

Transactions Archive

Returns a JSON list of lists representing all individual trades that took place since Bitex started trading until the beginning of the current hour, sorted by descending date.

This may be a large download so keep in mind we may not let you retrieve it more than a few times per hour. Don't worry though, it only changes once an hour.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/transactions_archive
JSON RESPONSE
[  
[  
946685400, UNIX timestamp.
2, Transaction ID.
210.0, Price Paid.
0.1, Amount Sold.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/transactions_archive

Last 24 Hourly Candles

Returns a JSON list of lists with aggregated transaction data for each hour for the last 24 hours.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/last_24_hours
JSON RESPONSE
[  
[  
1490605200, UNIX timestamp when this period started.
975.0, Lowest price in period.
975.0, Opening price for period.
975.0, Closing price for period.
975.0, Highest price in period.
0.0, Volume of Base currency (ie: BTC) sold.
965.78894472, What the price was before the closing price above.
0.0, Volume-Weighted Average Price.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/last_24_hours

Last 7 Days Candles

Returns a JSON list of lists with aggregated transaction data for each 4 hour period for the last 7 days.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/last_7_days
JSON RESPONSE
[  
[  
1490083200, UNIX timestamp when this period started.
1069.59881157, Lowest price in period.
1069.59881157, Opening price for period.
1073.98650015, Closing price for period.
1073.98650015, Highest price in period.
4.32635172, Volume of Base currency (ie: BTC) sold.
1073.97652813, What the price was before the closing price above.
1073.98421753, Volume-Weighted Average Price.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/last_7_days

Last 30 Days Candles

Returns a JSON list of lists with aggregated transaction data for each 24 hour periods for the last 30 days.

url
GET https://bitex.la/api-v1/rest/btc_usd/market/last_30_days
JSON RESPONSE
[  
[  
1488067200, UNIX timestamp when this period started.
1150.0, Lowest price in period.
1150.0, Opening price for period.
1165.0, Closing price for period.
1165.0, Highest price in period.
3.045, Volume of Base currency (ie: BTC) sold.
1150.0, What the price was before the closing price above.
1165.0, Volume-Weighted Average Price.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/btc_usd/market/last_30_days


Exchange Rates

Our exchange and funding rates API helps you get the most accurate price estimates when transfering money between services and performing currency exchanges.

As Bitex provides several cash in and cash out options through several third party providers, and each of those charges their own fees and may offer a different exchange rate from and to local currencies, you will find it useful to understand all the steps involved in each funding/withdrawal and buy/sell operation.

We offer a tree structure where you can lookup the steps for going from one currency to another as follows:
from_what/from_where/what_to/where_to/method

For example, if you have Argentine pesos in cash and you want to get United States Dollars credited to your Bitex account, using MoreMt as the funding option, you can look up the conversion in the JSON tree as follows: tree.ars.cash.usd.bitex.more_mt

You can also explore the full tree through our own Calculator.

Some of the provided strategies are for reference only and are not tied to any particular service, for example: usd/cash/vef/cash/reference



Rates Tree

Retrieves the full exchange rates tree, we suggest you explore it in your favorite REPL console, or alternatively check which paths are available using our Calculator

url
GET https://bitex.la/api-v1/rest/rates/tree
cURL example

curl -G https://bitex.la/api-v1/rest/rates/tree

Using the Tree

Each conversion strategy is a list of operations to be applied to the original amount in the original currency, once all operations have been applied, you'll get the resulting amount expressed in the destination currency.

Operations are a list of single steps, each one with it's own type representing a currency exchange for a given rate, a fixed or percentual fee to be substracted, or a minimum fee scheme where a percentage is charged unless it's lower than the minimum.

Javascript Calculator Example Implementation
function calculate(original_amount, operations){
  var result = original_amount;
  for(var i = 0; i < operations.length; i++){
    var step = operations[i];
    switch(step.type){
      case 'exchange':
        // Apply a currency exchange for the given rate.
        result *= step.rate;
        break;
      case 'percentual_fee':
        // Substract the given percentage.
        result -= result * step.percentage / 100.0;
        break;
      case 'fixed_fee':
        // Substract a fixed amount.
        result *= step.amount;
        break;
      case 'minimum_fee':
        // Either substract a percentage or a fixed amount, whichever is higher.
        var fixed = step.minimum;
        var percentual = result * step.percentage / 100;
        result -= fixed > percentual ? fixed : percentual;
        break;
    }
  }
  return result;
}

// Estimate how much bitcoin can be obtained by
// sending 1000 ARS to bitex via More Mt.
var tree = ...; // The full tree with all possible conversions.
calculate(1000, tree.ars.cash.btc.bitex.more_mt);

Hosted Calculator

For convenience, we also offer a calculator endpoint which receives an initial amount and the path to the desired conversion.

url
GET https://bitex.la/api-v1/rest/rates/calculate_path
Params
amount: 1000 The amount to convert from.
path: "ars/cash/btc/bitex/more_mt" Path to calculator to use.
cURL example

curl -G https://bitex.la/api-v1/rest/rates/calculate_path \
  -d "amount=1000" \
  -d "path=ars/cash/btc/bitex/more_mt"


Account Information

These endpoints give you access general information about your account such as your balances, movements including deposits, withdrawals as well as executed bids and asks, and your list of KYC Profiles, a collection of all the people or legal entities associated to your bitex account in any capacity.

If you're looking for your individual trades see Your latest Trades.

Most accounts only need one KYC Profile, if you need to create sub-accounts have a look at our Reseller API.



Profile & Balances

Returns a JSON object with aggregated information about your account.

url
GET https://bitex.la/api-v1/rest/private/profile
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
"usd_balance": 10000.00, Total USD balance.
"usd_reserved": 2000.00, USD reserved in open orders.
"usd_available": 8000.00, USD available for trading.
"btc_balance": 20.00000000, Total BTC balance.
"btc_reserved": 5.00000000, BTC reserved in open orders.
"btc_available": 15.00000000, BTC available for trading.
"fee": 0.5, Your trading fee (0.5 means 0.5%).
"btc_deposit_address": "1XXXXXXXX...", Your BTC deposit address.
"more_mt_deposit_code": "BITEX0000000", Your BTC deposit address.
}  
cURL example

curl -G https://bitex.la/api-v1/rest/private/profile \
  -d "api_key=your_api_key"

Your Account Summary

Returns a heterogeneous JSON list of lists containing your account summary for the last 30 days, sorted by descending date. This includes Bitcoin and USD Deposits and Withdrawals as well as matched Bids and Asks (see our API class reference).

url
GET https://bitex.la/api-v1/rest/private/account_summary
Params
api_key: "your_api_key" Your Bitex.la API key.
full: "true" Optional. If present, the endpoint will show your full account summary, instead of just the last 30 days.
Please do not abuse this endpoint in full history mode.
JSON RESPONSE
[  
[  
1, 1 means it's a Bid, see our API class reference.
12345678, Bid's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to spend initially.
10.00000000, Remaining Amount to be spent.
1000.00000000, Price: Maximum price you're willing to pay per unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
1.1, Base currency amount (ie: BTC amount) produced by this Bid (so far). A sum of all the Base currency received on Buy Transactions. Fees are already deducted from this amount.
"ApiKey#1", Bid issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.01, Amount of Specie paid as fee (so far). A sum of all the fees paid on Buy Transactions.
],  
[  
2, 2 means it's an Ask, see our API class reference.
12345678, Ask's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to sell initially.
10.00000000, Remaining Amount to be sold.
1000.00000000, Price: Minimum price you're asking for each unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
200.0, USD produced by this ask (so far). A sum of all the USD received on Sale Transactions. Fees are already deducted from this amount.
"ApiKey#1", Ask issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.1, Amount of USD paid as fee (so far). A sum of all the fees paid on Sale Transactions.
],  
[  
5, It's a Specie Deposit, see our API class reference
12345678, Deposit id
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin).
100.00000000, Amount deposited.
],  
[  
6, It's a Specie Withdrawal, see our API class reference.
12345678, Withdrawal id.
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin)
100.00000000, Amount withdrawn.
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed.
This may take a few hours as our staff monitors all withdrawals.
3 Done, your withdrawal was processed and should appear on the network soon.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field.
0, An integer representing the cancellation reason
0 Not cancelled.
1 The instruction was received, but you didn't have enough funds
2 The destination address was invalid.
"1address..", Destination address for this withdrawal.
"my wallet", An optional custom label for the destination address.
1, Kyc Profile ID for which this withdrawal was instructed.
"ABCDEF...", Transaction ID, available once it's processed.
],  
[  
7, It's a USD Deposit, see our API class reference.
12345678, Deposit id
946685400, Creation time as UNIX timestamp
100.00000000, Intended amount, for customer pre-announced deposits.
100.00000000, Actual amount credited.
3, An integer representing the used deposit method:
2 Wire Transfer / Other
3 MoreMT
1, An integer representing this deposit status:
1 Pending, your deposit notice was received we're waiting for the funds to credit
2 Done, your deposit credited correctly, the funds are available in your balance.
3 Cancelled, your deposit did not credit, check the 'reason' field.
0, An integer representing the cancellation reason:
0 Not cancelled.
1 Deposit did not credit, funds never arrived to our account.
2 We could not accept these funds because the sender is unknown to us.
3 Other, we'll contact you regarding this deposit.
4 This deposit was cancelled per your request.
"UY", Country of origin for this deposit. Possible values are AR, BR, CL, CO, PE, UY, MX and US
"UYU", Currency in which the Intended amount was expressed. Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_in currency conversion rates
1, Kyc Profile ID for which this deposit was instructed.
"Bank of ...", Extra information about this deposit set by the user.
"{link:"..."}", (Deprecated) AstroPay response body, for astropay deposits only. It's a JSON containing a 'link' attribute which is AstroPay's payment page for this deposit.
"ABCDABCDEAB", Id of this deposit as set by the payment processor if any.
3, Id of the actual currency credited on bitex, as you may deposit local currency but it ends up credited as USD. '3' means you'll get United States Dollars. We may enable balances in other currencies in the future.
],  
[  
8, It's a USD Withdrawal, see our API class reference
12345678, Withdrawal id
946685400, Creation time as UNIX timestamp.
100.00000000, Requested withdrawal Amount in USD
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed, may take a few hours.
3 Done, your withdrawal was processed.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field"
0, An integer representing the cancellation reason:
0 Not cancelled.
1 The instruction was received, but could not be afforded.
2 We could not understand the instructions you provided.
3 We do not know the recipient of this withdrawal.
"UY", Country ouf destination for this withdrawal. Possible values are AR, BR, CL, CO, PE, UY, MX and US.
"UYU", Currency in which this withdrawal will be paid, Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_out currency conversion rates.
"bb", Cash Out method, one of:
"international_bank" International bank transfer.
"bb" Other payment method, to be arranged with our staff.
"Billy Bob", An optional custom label for this withdrawal info
1, Kyc Profile ID for which this deposit was instructed.
{...}, The Withdrawal Instructions provided for this withdrawal.
3, Id of the actual currency debited on bitex, as you may end up receiving local currency from a withdrawal to your USD balance. 3 means you'll be debited United States Dollars. We may enable balances in other currencies in the future.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/account_summary \
  -d "api_key=your_api_key" \
  -d "full=true"


KYC Profiles Overview

KYC Profiles hold all the Know Your Customer information and documentation for the account owner or owners.

USD deposits and withdrawals can only be from and to an account belonging to one of your Bitex account registered owners.

Deposit and withdrawal limits apply to your Bitex account. New KYC Profiles that have KYC Files associated to them are temporarily accepted into the 'micro' usage tier until they are reviewed by one of our compliance officers. Having a photo ID is the minimum requirement for a KYC Profile to be accepted.

You can request a usage tier higher than micro when creating or updating a KYC Profile. All changes done to KYC Profiles will be reviewed by a compliance officer and you'll be contacted through email or phone if any further information is required.

Most accounts only need one KYC Profile, if you need to create sub-accounts have a look at our Reseller API.



Create a KYC Profile

Create a new KYC Profile. Only usage tier presence is required, all other fields are optional and free form unless otherwise stated. We suggest you complete all of them. You want to make it easy for our compliance officers to accept your KYC Profiles.

You can create as many as you want, but you need to make sure each one created is for a real person willing to use the service. Mindless creation of KYC Profiles is considered abuse.

url
POST https://bitex.la/api-v1/rest/private/kyc_profiles
Params
api_key: "your_api_key" Your Bitex.la API key.
usage_tier: "micro" Usage tier you want to get into one of: micro, small, medium or large.
first_name: "Billy"
last_name: "Bob"
personal_id_number: "33222111N" No particular format expected, just make sure it's a valid id number.
personal_id_issuer_country: "AR" Uppercase ISO country code for the country that issued the ID
personal_id_type: "passport" Type of ID provided. It's free form but we suggest values like 'dni', 'passport', 'drivers_license'
tax_id: 4333222115 This persons tax id (cuit for argentina)
birth_date: "1970/1/30" Year/Month/Date
nationality: "brazilian"
gender: "male" We suggest male or female
occupation: "Singer"
home_address: "Argentina, Bue..." Full address, including zipcode
work_address: "Argentina, Bue..." Full address, including zipcode
phone_numbers: "555120921"
legal_entity: true Boolean: Wheter they will be # operating on behalf of a company # or other legal entity.
politically_exposed_person: true Boolean: Wheter they are what's # considered to be politically exposed.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/kyc_profiles \
  -d "api_key=your_api_key" \
  -d "usage_tier=micro" \
  -d "first_name=Billy" \
  -d "last_name=Bob" \
  -d "personal_id_number=33222111N" \
  -d "personal_id_issuer_country=AR" \
  -d "personal_id_type=passport" \
  -d "tax_id=4333222115" \
  -d "birth_date=1970/1/30" \
  -d "nationality=brazilian" \
  -d "gender=male" \
  -d "occupation=Singer" \
  -d "home_address=Argentina, Bue..." \
  -d "work_address=Argentina, Bue..." \
  -d "phone_numbers=555120921" \
  -d "legal_entity=true" \
  -d "politically_exposed_person=true"

Update a KYC Profile

Update a KYC Profile, all changes will be reviewed by a compliance officer

url
PUT https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id
Params
api_key: "your_api_key" Your Bitex.la API key.
usage_tier: "micro" Usage tier you want to get into one of: micro, small, medium or large.
first_name: "Billy"
last_name: "Bob"
personal_id_number: "33222111N" No particular format expected, just make sure it's a valid id number.
personal_id_issuer_country: "AR" Uppercase ISO country code for the country that issued the ID
personal_id_type: "passport" Type of ID provided. It's free form but we suggest values like 'dni', 'passport', 'drivers_license'
tax_id: 4333222115 This persons tax id (cuit for argentina)
birth_date: "1970/1/30" Year/Month/Date
nationality: "brazilian"
gender: "male" We suggest male or female
occupation: "Singer"
home_address: "Argentina, Bue..." Full address, including zipcode
work_address: "Argentina, Bue..." Full address, including zipcode
phone_numbers: "555120921"
legal_entity: true Boolean: Wheter they will be # operating on behalf of a company # or other legal entity.
politically_exposed_person: true Boolean: Wheter they are what's # considered to be politically exposed.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl -X PUT https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id \
  -d "api_key=your_api_key" \
  -d "usage_tier=micro" \
  -d "first_name=Billy" \
  -d "last_name=Bob" \
  -d "personal_id_number=33222111N" \
  -d "personal_id_issuer_country=AR" \
  -d "personal_id_type=passport" \
  -d "tax_id=4333222115" \
  -d "birth_date=1970/1/30" \
  -d "nationality=brazilian" \
  -d "gender=male" \
  -d "occupation=Singer" \
  -d "home_address=Argentina, Bue..." \
  -d "work_address=Argentina, Bue..." \
  -d "phone_numbers=555120921" \
  -d "legal_entity=true" \
  -d "politically_exposed_person=true"

Update the user's default KYC Profile

Update the default KYC Profile for the current user, all changes will be reviewed by a compliance officer

url
PUT https://bitex.la/api-v1/rest/private/kyc_profile
Params
api_key: "your_api_key" Your Bitex.la API key.
usage_tier: "micro" Usage tier you want to get into one of: micro, small, medium or large.
first_name: "Billy"
last_name: "Bob"
personal_id_number: "33222111N" No particular format expected, just make sure it's a valid id number.
personal_id_issuer_country: "AR" Uppercase ISO country code for the country that issued the ID
personal_id_type: "passport" Type of ID provided. It's free form but we suggest values like 'dni', 'passport', 'drivers_license'
tax_id: 4333222115 This persons tax id (cuit for argentina)
birth_date: "1970/1/30" Year/Month/Date
nationality: "brazilian"
gender: "male" We suggest male or female
occupation: "Singer"
home_address: "Argentina, Bue..." Full address, including zipcode
work_address: "Argentina, Bue..." Full address, including zipcode
phone_numbers: "555120921"
legal_entity: true Boolean: Wheter they will be # operating on behalf of a company # or other legal entity.
politically_exposed_person: true Boolean: Wheter they are what's # considered to be politically exposed.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl -X PUT https://bitex.la/api-v1/rest/private/kyc_profile \
  -d "api_key=your_api_key" \
  -d "usage_tier=micro" \
  -d "first_name=Billy" \
  -d "last_name=Bob" \
  -d "personal_id_number=33222111N" \
  -d "personal_id_issuer_country=AR" \
  -d "personal_id_type=passport" \
  -d "tax_id=4333222115" \
  -d "birth_date=1970/1/30" \
  -d "nationality=brazilian" \
  -d "gender=male" \
  -d "occupation=Singer" \
  -d "home_address=Argentina, Bue..." \
  -d "work_address=Argentina, Bue..." \
  -d "phone_numbers=555120921" \
  -d "legal_entity=true" \
  -d "politically_exposed_person=true"

Show a KYC Profile

Find a KYC Profile by it's unique ID.

url
GET https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id \
  -d "api_key=your_api_key"

Show the user's default KYC Profile

Find the default KYC Profile for the current user.

url
GET https://bitex.la/api-v1/rest/private/kyc_profile
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/kyc_profile \
  -d "api_key=your_api_key"

List your KYC Profiles

List all your KYC Profiles.

url
GET https://bitex.la/api-v1/rest/private/kyc_profiles
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/kyc_profiles \
  -d "api_key=your_api_key"

Create a KYC File

Create a new KYC File for a given KYC Profile, the minimal requirement for an account is a legible Photo ID. Accepted file formats are image/jpeg image/jpg image/png image/bmp image/gif application/pdf application/x-pdf

url
POST https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id/kyc_files
Params
api_key: "your_api_key" Your Bitex.la API key.
document: "@/home/you/Desktop/test.png"
document_content_type: "image/png"
JSON RESPONSE
[  
12345678, KYC File id.
1, KYC Profile id.
"http://..", Temporary URL to access this file expires in a few minutes.
"test.png", Filename
"image/png", Content Type
10000, File Size in bytes
]  
cURL example

curl https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id/kyc_files \
  -F "api_key=your_api_key" \
  -F "document=@/home/you/Desktop/test.png" \
  -F "document_content_type=image/png"

List a KYC Profile's Files

List all KYC files belonging to a specific KYC Profile.

url
GET https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id/kyc_files
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
12345678, KYC File id.
1, KYC Profile id.
"http://..", Temporary URL to access this file expires in a few minutes.
"test.png", Filename
"image/png", Content Type
10000, File Size in bytes
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id/kyc_files \
  -d "api_key=your_api_key"

List all KYC Files

List all KYC files in your account.

url
GET https://bitex.la/api-v1/rest/private/kyc_files
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
12345678, KYC File id.
1, KYC Profile id.
"http://..", Temporary URL to access this file expires in a few minutes.
"test.png", Filename
"image/png", Content Type
10000, File Size in bytes
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/kyc_files \
  -d "api_key=your_api_key"

List all KYC Rejection Reasons

All possible kyc rejection reasons can be queried with this endpoint. Besides the unique code, you get detailed text in English, Spanish and Portuguese. Feel free to use the detail or show your own text based on the 'code' field.

URL
GET https://bitex.la/api-v1/rest/private/kyc_rejection_reasons
JSON Request
{
  "api_key": "your_api_key"
}
JSON Response
{
  "data": [
    { "id":"1",
      "type":"kyc_rejection_reasons",
      "attributes":{
        "detail_es":"Algunos campos fueron inválidos",
        "detail_en":"Some fields were invalid",
        "detail_pt":"Alguns campos foram inválidos",
        "code":"invalid_fields"
      }
    },
    { "id":"2",
      "type":"kyc_rejection_reasons",
      "attributes":{
        "detail_es":"La foto del documento es ilegible",
        "detail_en":"The photo ID is illegible",
        "detail_pt":"Identificação é ilegível",
        "code":"photo_id_is_illegible"
      }
    }
  ]
}
cURL example pastebox


Trading

Trading endpoints have everything you need to place and cancel Buy or Sell orders, as well as listing your active orders and every trade you make.

We have an open source robot that can be used as an example to our Trading API usage, and could also be used to do arbitrage between Bitex and other exchanges Fork it on github.



Your Active Orders

Returns a JSON list of lists representing all your currently active orders, that is, orders where status is 'executing'.

url
GET https://bitex.la/api-v1/rest/private/orders
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
1, 1 means it's a Bid, see our API class reference.
12345678, Bid's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to spend initially.
10.00000000, Remaining Amount to be spent.
1000.00000000, Price: Maximum price you're willing to pay per unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
1.1, Base currency amount (ie: BTC amount) produced by this Bid (so far). A sum of all the Base currency received on Buy Transactions. Fees are already deducted from this amount.
"ApiKey#1", Bid issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.01, Amount of Specie paid as fee (so far). A sum of all the fees paid on Buy Transactions.
],  
[  
2, 2 means it's an Ask, see our API class reference.
12345678, Ask's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to sell initially.
10.00000000, Remaining Amount to be sold.
1000.00000000, Price: Minimum price you're asking for each unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
200.0, USD produced by this ask (so far). A sum of all the USD received on Sale Transactions. Fees are already deducted from this amount.
"ApiKey#1", Ask issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.1, Amount of USD paid as fee (so far). A sum of all the fees paid on Sale Transactions.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/orders \
  -d "api_key=your_api_key"

Your Latest Trades

Returns a heterogeneous JSON list of lists representing your most recent individual Buys and Sells for the past 7 days, with a hard limit on 500 items. This includes individual matches for any of your Bitcoin Bids and Asks. (see our API class reference).

url
GET https://bitex.la/api-v1/rest/private/trades
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
3, It's a Buy Transaction, see our API class reference
12345678, Buy id.
946685400, Creation time as UNIX timestamp.
1, Orderbook (1 for BTC/USD).
2.00000000, Amount of Specie bought.
600.00000000, Amount of USD spent.
0.05000000, Amount of Specie paid as transaction fee.
300.00000000, Price paid per unit.
1234, Id of your Bid that resulted in this purchase.
],  
[  
4, It's a Sale Transaction, see our API class reference
12345678, Sale id.
946685400, Creation time as UNIX timestamp.
1, Orderbook (1 for BTC/USD).
2.00000000, Amount of Specie sold.
600.00000000, Amount of USD received.
0.05000000, USD amount paid as transaction fee.
300.00000000, Price charged per unit.
3456, Id of your Ask that resulted in this sale.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/trades \
  -d "api_key=your_api_key"

Create a Bid (Buy Order)

Places a new buy limit order spending the USD amount specified and paying the specified price or less. Returns a list representing the newly created Bid.

Bids are executed until all the USD amount is spent or until you cancel them. If someone was selling below your price you'll end up buying more than anticipated.

All Bids are accepted in the 'Received (1)' state, and are moved into the 'Executing (2)' state by our trading engine once it checks your available USD sufices to place the order, only then your Bid becomes eligible to be matched. You can check this order status in your list of Orders

url
POST https://bitex.la/api-v1/rest/private/bids
Params
api_key: "your_api_key" Your Bitex.la API key.
amount: 10000.05 Amount of USD to spend. Must be at least 1 USD.
price: 500.00 Maximum price you're willing to pay per unit.
orderbook: 1 Orderbook ID. Optional. Defaults to 1 which is BTC/USD
JSON RESPONSE
[  
1, 1 means it's a Bid, see our API class reference.
12345678, Bid's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to spend initially.
10.00000000, Remaining Amount to be spent.
1000.00000000, Price: Maximum price you're willing to pay per unit.
1, Always 1, meaning the order was received and queued to check if you have enough funds.
0, Always 0, since this order has not been cancelled.
1.1, Base currency amount (ie: BTC amount) produced by this Bid (so far). A sum of all the Base currency received on Buy Transactions. Fees are already deducted from this amount.
"ApiKey#1", Bid issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.01, Amount of Specie paid as fee (so far). A sum of all the fees paid on Buy Transactions.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/bids \
  -d "api_key=your_api_key" \
  -d "amount=10000.05" \
  -d "price=500.00" \
  -d "orderbook=1"

Find a Bid

Retrieves a single Bid using its unique ID

url
GET https://bitex.la/api-v1/rest/private/bids/bid_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
1, 1 means it's a Bid, see our API class reference.
12345678, Bid's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to spend initially.
10.00000000, Remaining Amount to be spent.
1000.00000000, Price: Maximum price you're willing to pay per unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
1.1, Base currency amount (ie: BTC amount) produced by this Bid (so far). A sum of all the Base currency received on Buy Transactions. Fees are already deducted from this amount.
"ApiKey#1", Bid issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.01, Amount of Specie paid as fee (so far). A sum of all the fees paid on Buy Transactions.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/bids/bid_id \
  -d "api_key=your_api_key"

Cancel a Bid

Schedules a Bid for cancelation as soon as our Matching Engine unlocks it. It sets the order status to "To be cancelled (3)" immediately, and then you can check your Orders to see when it's actually cancelled.

url
POST https://bitex.la/api-v1/rest/private/bids/bid_id/cancel
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
1, 1 means it's a Bid, see our API class reference.
12345678, Bid's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to spend initially.
10.00000000, Remaining Amount to be spent.
1000.00000000, Price: Maximum price you're willing to pay per unit.
3, Always 3, meaning the order was scheduled for cancelation.
0, Always 0, since it has not been cancelled yet.
1.1, Base currency amount (ie: BTC amount) produced by this Bid (so far). A sum of all the Base currency received on Buy Transactions. Fees are already deducted from this amount.
"ApiKey#1", Bid issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.01, Amount of Specie paid as fee (so far). A sum of all the fees paid on Buy Transactions.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/bids/bid_id/cancel \
  -d "api_key=your_api_key"

Create an Ask (Sell Order)

Places a new sell limit order for the amount of Specie specified and charging the specified price or more. Returns a list representing the newly created Ask.

Asks are executed until all the Specie amount is sold or until you cancel them. If someone was buying above your price you'll end up getting more USD than anticipated.

All Asks are accepted in the 'Received (1)' state, and are moved into the 'Executing (2)' state by our trading engine once it checks your available Specie sufices to place the order, only then your Ask becomes eligible to be matched. You can check this order status in your list of Orders

url
POST https://bitex.la/api-v1/rest/private/asks
Params
api_key: "your_api_key" Your Bitex.la API key.
amount: 10.00 Amount of base currency (ie: BTC) to sell. Must be at least 0.005.
price: 500.00 Minimum price you're willing to charge per unit.
orderbook: 1 Orderbook ID. Optional. Defaults to 1 which is BTC/USD
JSON RESPONSE
[  
2, 2 means it's an Ask, see our API class reference.
12345678, Ask's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to sell initially.
10.00000000, Remaining Amount to be sold.
1000.00000000, Price: Minimum price you're asking for each unit.
1, Always 1, meaning the order was received and queued to check if you have enough funds.
0, Always 0, since this order has not been cancelled.
200.0, USD produced by this ask (so far). A sum of all the USD received on Sale Transactions. Fees are already deducted from this amount.
"ApiKey#1", Ask issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.1, Amount of USD paid as fee (so far). A sum of all the fees paid on Sale Transactions.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/asks \
  -d "api_key=your_api_key" \
  -d "amount=10.00" \
  -d "price=500.00" \
  -d "orderbook=1"

Find an Ask

Retrieves a single Ask using its unique ID

url
GET https://bitex.la/api-v1/rest/private/asks/ask_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
2, 2 means it's an Ask, see our API class reference.
12345678, Ask's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to sell initially.
10.00000000, Remaining Amount to be sold.
1000.00000000, Price: Minimum price you're asking for each unit.
1, An integer representing the order status:
1 Received, queued to check if you have enough funds.
2 Active and being executed.
3 To be cancelled as soon as possible.
4 Cancelled, no further executed. May have some Remaining Amount.
5 Completed. Fully executed, Remaining Amount should be 0.
0, An integer with the cancelation reason:
0 Not cancelled.
1 Not enough funds to place this order.
2 Cancelled per user's request.
3 Other, cancelled by bitex.
200.0, USD produced by this ask (so far). A sum of all the USD received on Sale Transactions. Fees are already deducted from this amount.
"ApiKey#1", Ask issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.1, Amount of USD paid as fee (so far). A sum of all the fees paid on Sale Transactions.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/asks/ask_id \
  -d "api_key=your_api_key"

Cancel an Ask

Schedules an Ask for cancelation as soon as our Matching Engine unlocks it. It sets the order status to "To be cancelled (3)" immediately, and then you can check your Orders to see when it's actually cancelled.

Returns the Ask with the new "To be cancelled (3)" status, notice your order may still be in use by our engine, so the Remaining amount may change between the time you request the cancelation and the order is really cancelled.

url
POST https://bitex.la/api-v1/rest/private/asks/ask_id/cancel
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
2, 2 means it's an Ask, see our API class reference.
12345678, Ask's unique ID
946685400, Creation time as UNIX timestamp
1, Orderbook (1 is BTC/USD)
100.00000000, Amount you wanted to sell initially.
10.00000000, Remaining Amount to be sold.
1000.00000000, Price: Minimum price you're asking for each unit.
3, Always 3, meaning the order was scheduled for cancelation.
0, Always 0, since it has not been cancelled yet.
200.0, USD produced by this ask (so far). A sum of all the USD received on Sale Transactions. Fees are already deducted from this amount.
"ApiKey#1", Ask issuer. If the order was entered via API it will be an ApiKey, if it was entered via the web UI it will be a User. May be empty for older orders.
0.1, Amount of USD paid as fee (so far). A sum of all the fees paid on Sale Transactions.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/asks/ask_id/cancel \
  -d "api_key=your_api_key"



Hosted Trading Bots

Trading Bots can manage a Bitcoin sale or buy to help you get a better pricing than you would get if you executed the full amount in a single order.

The strategy used by bots is rather simple: They split up the amount to buy or sell in chunks of a given size and place orders at the best market price.

Orders are spaced by time_to_live seconds to allow for new buyers and sellers to replenish the orderbook before executing again. Orders will be cancelled after time_to_live seconds if still executing.

Bots also make sure to prevent executing in low-liquidity conditions: they will not place new orders if the spread between the best Bid and the best Ask is over 10 USD.

Bots do not check or lock funds! If your robot fails to place an order because of insufficient funds or other, then it will be terminated prematurely. You'll find the termination reason in exit_status.



List your Buying Bots

List all bots created in the past 24 hours, newest first. Limited at 200 items.

url
GET https://bitex.la/api-v1/rest/private/buying_bots
Params
api_key: "your_api_key" Your Bitex.la API key.
full: "true" Include bots older than 24 hours. Results will still be limited to 200 items.
JSON RESPONSE
[  
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 1000.00, Amount to spend buying.
produced_amount: 0.0, Bitcoin amount produced by this bot.
remaining_amount: 1000.00, Amount remaining to be spent.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
},  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/buying_bots \
  -d "api_key=your_api_key" \
  -d "full=true"

Create a Buying Bot

Create a new Buying Bot to spend a given amount, split in orders no bigger than chunk_size, waiting time_to_live seconds between orders.

url
POST https://bitex.la/api-v1/rest/private/buying_bots
Params
api_key: "your_api_key" Your Bitex.la API key.
amount: 10000.05 Amount of USD to spend. Must be at least 1 USD.
chunk_size: 500.00 Split the amount in chunks this big. The reminder, if any will be executed last. Must be at least 1.
time_to_live: 20 Seconds to wait for an order to execute before placing a new one. The robot will still wait before placing a new order, even if the previous one completes before time_to_live. Must be an integer between 10 and 600.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 1000.00, Amount to spend buying.
produced_amount: 0.0, Bitcoin amount produced by this bot.
remaining_amount: 1000.00, Amount remaining to be spent.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl https://bitex.la/api-v1/rest/private/buying_bots \
  -d "api_key=your_api_key" \
  -d "amount=10000.05" \
  -d "chunk_size=500.00" \
  -d "time_to_live=20"

Show a Buying Bot

Show a Buying Bot.

url
GET https://bitex.la/api-v1/rest/private/buying_bots/bot_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 1000.00, Amount to spend buying.
produced_amount: 0.0, Bitcoin amount produced by this bot.
remaining_amount: 1000.00, Amount remaining to be spent.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl -G https://bitex.la/api-v1/rest/private/buying_bots/bot_id \
  -d "api_key=your_api_key"

Cancel a buying Bot

Schedules a bot (and all its outstanding orders) for cancellation. The bot will effectively cancel once any outstanding orders created by it are cancelled.

url
POST https://bitex.la/api-v1/rest/private/buying_bots/bot_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 1000.00, Amount to spend buying.
produced_amount: 0.0, Bitcoin amount produced by this bot.
remaining_amount: 1000.00, Amount remaining to be spent.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl https://bitex.la/api-v1/rest/private/buying_bots/bot_id \
  -d "api_key=your_api_key"


List your Selling Bots

List all bots created in the past 24 hours, newest first. Limited at 200 items.

url
GET https://bitex.la/api-v1/rest/private/selling_bots
Params
api_key: "your_api_key" Your Bitex.la API key.
full: "true" Include bots older than 24 hours. Results will still be limited to 200 items.
JSON RESPONSE
[  
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 10.0000, Amount to sell.
produced_amount: 200.00, USD amount produced by this bot.
remaining_amount: 10.00, Amount remaining to be sold.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
},  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/selling_bots \
  -d "api_key=your_api_key" \
  -d "full=true"

Create a Selling Bot

Create a new Selling Bot to sell a given amount, split in orders no bigger than chunk_size, waiting time_to_live seconds between orders.

url
POST https://bitex.la/api-v1/rest/private/selling_bots
Params
api_key: "your_api_key" Your Bitex.la API key.
amount: 10.0000 Amount of BTC to sell. Must be at least 0.005 BTC.
chunk_size: 1.00 Split the amount in chunks this big. The reminder, if any, will be executed last. Must be at least 0.005.
time_to_live: 20 Seconds to wait for an order to execute before placing a new one. The robot will still wait before placing a new order, even if the previous one completes before time_to_live. Must be an integer between 10 and 600.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 10.0000, Amount to sell.
produced_amount: 200.00, USD amount produced by this bot.
remaining_amount: 10.00, Amount remaining to be sold.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl https://bitex.la/api-v1/rest/private/selling_bots \
  -d "api_key=your_api_key" \
  -d "amount=10.0000" \
  -d "chunk_size=1.00" \
  -d "time_to_live=20"

Show a Selling Bot

Show a Selling Bot

url
GET https://bitex.la/api-v1/rest/private/selling_bots/bot_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 10.0000, Amount to sell.
produced_amount: 200.00, USD amount produced by this bot.
remaining_amount: 10.00, Amount remaining to be sold.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl -G https://bitex.la/api-v1/rest/private/selling_bots/bot_id \
  -d "api_key=your_api_key"

Cancel a selling Bot

Schedules a bot (and all its outstanding orders) for cancellation. The bot will effectively cancel once any outstanding orders created by it are cancelled.

url
POST https://bitex.la/api-v1/rest/private/selling_bots/bot_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
id: 1, Bitex id for this Bot.
created_at: 946685400, Creation time as UNIX timestamp.
updated_at: 946685400, Last change time as UNIX timestamp.
user_id: 1, This is you.
orderbook_id: 1, Orderbook ID. Defaults to 1 which is BTC/USD
amount: 10.0000, Amount to sell.
produced_amount: 200.00, USD amount produced by this bot.
remaining_amount: 10.00, Amount remaining to be sold.
chunk_size: 1.0, Size in which to split Amount.
time_to_live: 20, How long to wait for each order to execute, in seconds.
executing: true, Wether this bot is still running. A bot may stop executing due to one of several reasons, available in exit_status. Bots may have executed partially.
to_cancel: false, Wether this robot is scheduled to be cancelled as soon as any outstanding orders are cancelled.
exit_status: null, The reason for termination of this bot (when not executing).
"completed" The full amount was spent buying.
"cancelled" The order was cancelled per your request.
"cant_afford_order" An order could not be placed due to insufficient funds.
"order_was_invalid" Order could not be placed for unexpected reasons.
issuer_type: "ApiKey", Bots may be created explicitly by you, or implicitly when processing payments.
"User" A User created this bot through our Web UI.
"ApiKey" Someone created this bot using our API.
"Payment" This bot was created to settle an incoming payment.
"CoinDeposit" This order was created following an incoming Bitcoin deposit
issuer_id: 1, ID of the specific issuer for this bot, ie: Which ApiKey
}  
cURL example

curl https://bitex.la/api-v1/rest/private/selling_bots/bot_id \
  -d "api_key=your_api_key"



Deposit & Withdraw USD

Bitex offers a wide range of funding options to credit USD to your balance. Funding may be done through an international bank transfer or in cash through MoreMT where available.

Funds deposited in local currency will be converted to USD by the funding option provider at their own rate, which is usually provided at payment time.

All USD deposits and withdrawals should be to someone with an accepted KYC Profile in this account.

Deposits done via international bank transfer need to be announced using this endpoints.

MoreMT deposits don't need to be announced beforehand, the customer can walk in to any available MoreMT branch with a valid Photo ID and their Bitex MoreMT deposit code available in our Profile & Balances endpoint.



Create a USD Deposit

Announces your intent of depositing cash into your account, which is a required step for some funding options like international bank transfers.

When funding via bank transfer you need to tell us the source and amount, so that we can instruct our bank to receive the transfer, due to compliance concerns we may not accept bank transfers that have not been announced by the sender. You should use the request_details to provide sender's name, country, as well as the bank name and country.

All Deposits are accepted in the 'Pending (1)' state, and are moved into the 'Accepted (2)' or 'Rejected (3)' state when processed by our account officials.

url
POST https://bitex.la/api-v1/rest/private/usd/deposits
Params
api_key: "your_api_key" Your Bitex.la API key.
country: "UY" ISO country code of country of origin.
amount: 100.00 Amount to deposit, expressed in currency.
currency: "UYU" ISO currency code, should match country unless we state otherwise.
deposit_method: "bank" See MoreMT Branches for cash deposits.
request_details: "SWIFT: 899889..." Free form field for adding source bank account information or any other message to our account officers.
kyc_profile_id: 1 Optional: Unique ID for the KYC Profile sending this deposit, defaults to your main KYC Profile.
JSON RESPONSE
[  
7, It's a USD Deposit, see our API class reference.
12345678, Deposit id
946685400, Creation time as UNIX timestamp
100.00000000, Intended amount, for customer pre-announced deposits.
100.00000000, Actual amount credited.
3, An integer representing the used deposit method:
2 Wire Transfer / Other
3 MoreMT
1, Status, always 1 meaning we're waiting for funds to credit
0, Always 0, since it has not been cancelled.
"UY", Country of origin for this deposit. Possible values are AR, BR, CL, CO, PE, UY, MX and US
"UYU", Currency in which the Intended amount was expressed. Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_in currency conversion rates
1, Kyc Profile ID for which this deposit was instructed.
"Bank of ...", Extra information about this deposit set by the user.
"{link:"..."}", (Deprecated) AstroPay response body, for astropay deposits only. It's a JSON containing a 'link' attribute which is AstroPay's payment page for this deposit.
"ABCDABCDEAB", Id of this deposit as set by the payment processor if any.
3, Id of the actual currency credited on bitex, as you may deposit local currency but it ends up credited as USD. '3' means you'll get United States Dollars. We may enable balances in other currencies in the future.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/usd/deposits \
  -d "api_key=your_api_key" \
  -d "country=UY" \
  -d "amount=100.00" \
  -d "currency=UYU" \
  -d "deposit_method=bank" \
  -d "request_details=SWIFT: 899889..." \
  -d "kyc_profile_id=1"

Cancel a USD Deposit

Cancels a pending cash deposit, if you changed your mind about it. Beware you should not cancel a deposit if you have already paid and you're just waiting for it to be confirmed by us. If a deposit does not credit to your account contact us before cancelling it.

url
POST https://bitex.la/api-v1/rest/private/usd/deposits/deposit_id/cancel
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
7, It's a USD Deposit, see our API class reference.
12345678, Deposit id
946685400, Creation time as UNIX timestamp
100.00000000, Intended amount, for customer pre-announced deposits.
100.00000000, Actual amount credited.
3, An integer representing the used deposit method:
2 Wire Transfer / Other
3 MoreMT
1, An integer representing this deposit status:
1 Pending, your deposit notice was received we're waiting for the funds to credit
2 Done, your deposit credited correctly, the funds are available in your balance.
3 Cancelled, your deposit did not credit, check the 'reason' field.
0, An integer representing the cancellation reason:
0 Not cancelled.
1 Deposit did not credit, funds never arrived to our account.
2 We could not accept these funds because the sender is unknown to us.
3 Other, we'll contact you regarding this deposit.
4 This deposit was cancelled per your request.
"UY", Country of origin for this deposit. Possible values are AR, BR, CL, CO, PE, UY, MX and US
"UYU", Currency in which the Intended amount was expressed. Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_in currency conversion rates
1, Kyc Profile ID for which this deposit was instructed.
"Bank of ...", Extra information about this deposit set by the user.
"{link:"..."}", (Deprecated) AstroPay response body, for astropay deposits only. It's a JSON containing a 'link' attribute which is AstroPay's payment page for this deposit.
"ABCDABCDEAB", Id of this deposit as set by the payment processor if any.
3, Id of the actual currency credited on bitex, as you may deposit local currency but it ends up credited as USD. '3' means you'll get United States Dollars. We may enable balances in other currencies in the future.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/usd/deposits/deposit_id/cancel \
  -d "api_key=your_api_key"

Find a USD Deposit

Find a deposit by it's unique ID.

url
GET https://bitex.la/api-v1/rest/private/usd/deposits/deposit_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
7, It's a USD Deposit, see our API class reference.
12345678, Deposit id
946685400, Creation time as UNIX timestamp
100.00000000, Intended amount, for customer pre-announced deposits.
100.00000000, Actual amount credited.
3, An integer representing the used deposit method:
2 Wire Transfer / Other
3 MoreMT
1, An integer representing this deposit status:
1 Pending, your deposit notice was received we're waiting for the funds to credit
2 Done, your deposit credited correctly, the funds are available in your balance.
3 Cancelled, your deposit did not credit, check the 'reason' field.
0, An integer representing the cancellation reason:
0 Not cancelled.
1 Deposit did not credit, funds never arrived to our account.
2 We could not accept these funds because the sender is unknown to us.
3 Other, we'll contact you regarding this deposit.
4 This deposit was cancelled per your request.
"UY", Country of origin for this deposit. Possible values are AR, BR, CL, CO, PE, UY, MX and US
"UYU", Currency in which the Intended amount was expressed. Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_in currency conversion rates
1, Kyc Profile ID for which this deposit was instructed.
"Bank of ...", Extra information about this deposit set by the user.
"{link:"..."}", (Deprecated) AstroPay response body, for astropay deposits only. It's a JSON containing a 'link' attribute which is AstroPay's payment page for this deposit.
"ABCDABCDEAB", Id of this deposit as set by the payment processor if any.
3, Id of the actual currency credited on bitex, as you may deposit local currency but it ends up credited as USD. '3' means you'll get United States Dollars. We may enable balances in other currencies in the future.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/usd/deposits/deposit_id \
  -d "api_key=your_api_key"

List your USD Deposits

List all your deposits for the last 30 days.

url
GET https://bitex.la/api-v1/rest/private/usd/deposits
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
7, It's a USD Deposit, see our API class reference.
12345678, Deposit id
946685400, Creation time as UNIX timestamp
100.00000000, Intended amount, for customer pre-announced deposits.
100.00000000, Actual amount credited.
3, An integer representing the used deposit method:
2 Wire Transfer / Other
3 MoreMT
1, An integer representing this deposit status:
1 Pending, your deposit notice was received we're waiting for the funds to credit
2 Done, your deposit credited correctly, the funds are available in your balance.
3 Cancelled, your deposit did not credit, check the 'reason' field.
0, An integer representing the cancellation reason:
0 Not cancelled.
1 Deposit did not credit, funds never arrived to our account.
2 We could not accept these funds because the sender is unknown to us.
3 Other, we'll contact you regarding this deposit.
4 This deposit was cancelled per your request.
"UY", Country of origin for this deposit. Possible values are AR, BR, CL, CO, PE, UY, MX and US
"UYU", Currency in which the Intended amount was expressed. Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_in currency conversion rates
1, Kyc Profile ID for which this deposit was instructed.
"Bank of ...", Extra information about this deposit set by the user.
"{link:"..."}", (Deprecated) AstroPay response body, for astropay deposits only. It's a JSON containing a 'link' attribute which is AstroPay's payment page for this deposit.
"ABCDABCDEAB", Id of this deposit as set by the payment processor if any.
3, Id of the actual currency credited on bitex, as you may deposit local currency but it ends up credited as USD. '3' means you'll get United States Dollars. We may enable balances in other currencies in the future.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/usd/deposits \
  -d "api_key=your_api_key"

More MT Deposit Branches

All More MT branches able to process Bitex USD deposits worldwide. They are geolocated so you can find the nearest to your customer if you have their coordinates.

You may find a longer list of MoreMT branches somewhere else on the internet, but you must use this list because not all MoreMT branches can accept Bitex deposits.

url
GET https://bitex.la/api-v1/rest/private/usd/deposits/more_mt_branches
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
{  
name: "Pronto RED", Branch name. This may be a a More MT owned businnes or one of their corresponsals.
coords: {
  "longitude": -58.52853700000003,
  "latitude": -34.641743,
},

Coordinates for this branch.
address: "Ibarrola 7272...", Branch Street Address. It may also include their working hours in the string.
city: "Buenos Aires - Capital Federal", City name, long format. May include province name.
short_city: "Capital Federal", Short city name
country: "AR", ISO country code for the branch.
},  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/usd/deposits/more_mt_branches \
  -d "api_key=your_api_key"

Create a USD Withdrawal

Request a USD withdrawal from your bitex balance. You only need to set the amount and refer us to a previously created Withdrawal Instruction which specifies a domestic or international bank account, beneficiary details, etc. See the Withdrawal Instructions endpoints to learn more about them, and the available countries and withdrawal methods.

All Withdrawals are accepted in the 'Received (1)' state, and are moved into the 'Pending (2)' state immediately if you have enough funds, then they're moved the 'Accepted (2)' or 'Rejected (3)' state when processed by our account officials.

url
POST https://bitex.la/api-v1/rest/private/usd/withdrawals
Params
api_key: "your_api_key" Your Bitex.la API key.
amount: 100.00 Amount to withdraw in USD.
withdrawal_instruction_id: 1 Unique ID for the Withdrawal Instruction to use. See the Withdrawal Instructions section for more info.
kyc_profile_id: 1 Optional: Unique ID for the KYC Profile receiving this withdrawal, defaults to your main KYC Profile.
JSON RESPONSE
[  
8, It's a USD Withdrawal, see our API class reference
12345678, Withdrawal id
946685400, Creation time as UNIX timestamp.
100.00000000, Requested withdrawal Amount in USD
1, Status, always 1 meaning it was received and our engine is checking if you have enough funds.
0, Always 0, since it has not been cancelled.
"UY", Country ouf destination for this withdrawal. Possible values are AR, BR, CL, CO, PE, UY, MX and US.
"UYU", Currency in which this withdrawal will be paid, Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_out currency conversion rates.
"bb", Cash Out method, one of:
"international_bank" International bank transfer.
"bb" Other payment method, to be arranged with our staff.
"Billy Bob", An optional custom label for this withdrawal info
1, Kyc Profile ID for which this deposit was instructed.
{...}, The Withdrawal Instructions provided for this withdrawal.
3, Id of the actual currency debited on bitex, as you may end up receiving local currency from a withdrawal to your USD balance. 3 means you'll be debited United States Dollars. We may enable balances in other currencies in the future.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/usd/withdrawals \
  -d "api_key=your_api_key" \
  -d "amount=100.00" \
  -d "withdrawal_instruction_id=1" \
  -d "kyc_profile_id=1"

Show a USD Withdrawal

Find a withdrawal by it's unique ID.

url
GET https://bitex.la/api-v1/rest/private/usd/withdrawals/withdrawal_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
8, It's a USD Withdrawal, see our API class reference
12345678, Withdrawal id
946685400, Creation time as UNIX timestamp.
100.00000000, Requested withdrawal Amount in USD
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed, may take a few hours.
3 Done, your withdrawal was processed.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field"
0, An integer representing the cancellation reason:
0 Not cancelled.
1 The instruction was received, but could not be afforded.
2 We could not understand the instructions you provided.
3 We do not know the recipient of this withdrawal.
"UY", Country ouf destination for this withdrawal. Possible values are AR, BR, CL, CO, PE, UY, MX and US.
"UYU", Currency in which this withdrawal will be paid, Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_out currency conversion rates.
"bb", Cash Out method, one of:
"international_bank" International bank transfer.
"bb" Other payment method, to be arranged with our staff.
"Billy Bob", An optional custom label for this withdrawal info
1, Kyc Profile ID for which this deposit was instructed.
{...}, The Withdrawal Instructions provided for this withdrawal.
3, Id of the actual currency debited on bitex, as you may end up receiving local currency from a withdrawal to your USD balance. 3 means you'll be debited United States Dollars. We may enable balances in other currencies in the future.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/usd/withdrawals/withdrawal_id \
  -d "api_key=your_api_key"

List your USD Withdrawal

List all your withdrawals for the last 30 days.

url
GET https://bitex.la/api-v1/rest/private/usd/withdrawals
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
8, It's a USD Withdrawal, see our API class reference
12345678, Withdrawal id
946685400, Creation time as UNIX timestamp.
100.00000000, Requested withdrawal Amount in USD
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed, may take a few hours.
3 Done, your withdrawal was processed.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field"
0, An integer representing the cancellation reason:
0 Not cancelled.
1 The instruction was received, but could not be afforded.
2 We could not understand the instructions you provided.
3 We do not know the recipient of this withdrawal.
"UY", Country ouf destination for this withdrawal. Possible values are AR, BR, CL, CO, PE, UY, MX and US.
"UYU", Currency in which this withdrawal will be paid, Possible values are ARS, BRL, CLP, COP, PEN, UYU, MXN and USD. Check our rates API for cash_out currency conversion rates.
"bb", Cash Out method, one of:
"international_bank" International bank transfer.
"bb" Other payment method, to be arranged with our staff.
"Billy Bob", An optional custom label for this withdrawal info
1, Kyc Profile ID for which this deposit was instructed.
{...}, The Withdrawal Instructions provided for this withdrawal.
3, Id of the actual currency debited on bitex, as you may end up receiving local currency from a withdrawal to your USD balance. 3 means you'll be debited United States Dollars. We may enable balances in other currencies in the future.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/usd/withdrawals \
  -d "api_key=your_api_key"

Create a USD Withdrawal Instruction

Store a new set of instructions to be used when requesting cash withdrawals from Bitex or other brokers/exchanges in the Bitex Concierge network.

url
POST https://bitex.la/api-v1/rest/private/usd/withdrawal_instructions
Params
api_key: "your_api_key" Your Bitex.la API key.
body: {...} JSON with all the fields required to request a withdrawal from a broker in the concierge network. These may be your domestic or international bank account information. See below for some examples.
label: "Some Label" Optional. For your convenience.
schema: "bitex" Optional. Defaults to bitex. See the response description for more information.
JSON RESPONSE
{  
id: 1, This withdrawal instruction ID
body: {...}, The JSON fields you provided. See below for examples.
label: "Some Label", This instruction short label
schema: "bitex", Whose rules to use when validating the provided body. Each broker in the concierge network may offer different withdrawal methods, in different countries, and that means your instruction body should be initialy validated and sanity checked using that broker's rules. Other possible value is 'base' which is less strict but knows fewer payment methods.
created_at: 946685400, Creation time as UNIX timestamp
}  
cURL example

curl https://bitex.la/api-v1/rest/private/usd/withdrawal_instructions \
  -d "api_key=your_api_key" \
  -d "body={...}" \
  -d "label=Some Label" \
  -d "schema=bitex"

Example: Withdraw to a Domestic Bank

Example of instruction body to use when requesting bitex to issue a cash withdrawal to a domestic bank.

JSON
{  
payment_method: "domestic_bank",
country: "AR", Bank country. Choices are AR, PY or PE.
currency: "ARS", Which currency to withdraw to. Different choices available for each country.
AR: ARS or USD
PE: PEN or USD
bank: "bbva", Beneficiary bank name. Abbreviated and normalized, different choices available for each country.
AR: galicia, bbva, santander, itau, icbc, hsbc, patagonia, credicoop, supervielle, comafi, citi, macro, hipotecario, columbia, bind, nacion, ciudad, bapro, san_juan, santa_cruz, cordoba, santa_fe, entre_rios, la_pampa, neuquen, corrientes, santiago_del_estero, tierra_del_fuego, formosa, la_rioja, chaco, banco_de_valores, finansur
PE: credito, continental, nacion, scotia, interbank, mi_banco, trabajo, financiero, bbva_pe
name: "John Doe", The account holder name. Must be the same person that owns the source bitex account.
city: "Buenos Aires", City of residence of the account holder.
address: "Evergreen avenue 123 zip 1234", Home or work postal address for the account holder.
phone: "15-555-55-55", A contact phone number to reach the account holder.
cuit: "111111111", Tax ID, or other ID used on the given country tax agency. For Argentina this is 11 consecutive digits. no dashes.
cbu: "2220000200000000000002", Bank account ID for transfers across domestic banks. CBU for Argentina, 22 consecutive digits. No dashes, no spaces, leading zeros if needed.
bank_account_number: "33433333", Domestic bank account number. Consecutive digits, no dashes no spaces. Length varies between banks and countries.
account_type: "checking", Choices are: checking and savings
extra_fields: "You can add anything", You can include any extra fields you want, they will be stored but won't be validated
}  

Example: Pick up cash on a MoreMt branch

Example of instruction body to use when requesting a cash withdrawal to be picked up in cash at a MoreMt physical branch or other pickup location.

JSON
{  
payment_method: "more",
country: "AR", Branch country. Choices are AR, PY or PE.
currency: "ARS", Which currency to withdraw to. Different choices may available for each country.
AR: ARS
PY: PYG
PE: PEN
name: "John Doe", The person doing the pickup must be one of the available KYC profiles on the source bitex account.
city: "Buenos Aires", City of residence of the person doing the pickup.
address: "Evergreen avenue 123 zip 1234", Address of the person doing the pickup.
phone: "15-555-55-55", A contact phone number to reach the person doing the pickup.
extra_fields: "You can add anything", You can include any extra fields you want, they will be stored but won't be validated
}  

Example: Withdraw from bitex via international bank transfer.

Bitex.la can issue withdrawals as international bank transfers.

JSON
{  
payment_method: "international_bank",
country: "AR", Bank country. Choices are AR, CL, MX, PE, UY, US, ES, PY, CN, CO
currency: "USD", For now we're only issuing withdrawals in USD, that may be converted to local currency by the beneficiary bank
name: "John Doe", Beneficiary name. Must be the same person that owns the source bitex account.
city: "Buenos Aires", Beneficiary city of residence.
address: "Evergreen avenue 123 zip 1234", Beneficiary home or work postal address.
postal_code: "cxx-1233", Optional. Beneficiary postal code.
phone: "15-555-55-55", Beneficiary phone number.
bank: "Some Bank", Full Bank name.
bank_country: "US", Bank country. Free form. Can be a 2 letter country iso code.
bank_city: "some city", City of the branch where the bank account is registered, or main branch city.
bank_address: "Some address 123", Address of the branch where the bank account is registered, or main branch address.
bank_postal_code: "Some postal code", Postal code of the branch where the bank account is registered, or main branch postal code.
bank_swift: "BANKUS66", Bank SWIFT or other applicable BIC
bank_account_number: "334-33333", Domestic bank account number.
account_type: "checking", Choices are: checking and savings
extra_fields: "You can add anything", You can include any extra fields you want, they will be stored but won't be validated
}  

Example: Suggest a third party for your withdrawal

Bitex.la is open to work with third parties of your choice to issue withdrawals anywhere in the world if possible. We'll contact the beneficiary and work out the details.

JSON
{  
payment_method: "third_party",
country: "AR", Where do you want to withdraw. Any country.
name: "John Doe", Name of the person requesting the withdrawal, must be a Bitex.la known customer.
city: "Buenos Aires", City of residence of the person doing the withdrawal.
phone: "15-555-55-55", A contact phone number to reach the person requesting the withdrawal.
extra_fields: "You can add anything", You can include any extra fields you want, they will be stored but won't be validated
}  

Deposit & Withdraw BTC

You can deposit bitcoin to your Bitex account by either using your primary deposit address which you can find in your Profile. Or you can create a new deposit address, optionally instructing to have the received bitcoin sold at the best market price upon arrival.

Bitcoin deposits in Bitex are credited after 3 confirmations for most cases, but may take up to 6 confirmations in our own node. Each deposit corresponds to a transaction output in the bitcoin network.

Bitcoins received using our Payments API will ultimately credit in your bitex balance as BTC deposits. Keep in mind a single Payment may be fulfilled by a customer through several individual smaller transactions.

Withdrawals are human supervised so they may only be processed during work hours. Let us know if you need an exception.



Show a BTC Deposit

Find a BTC depoist by it's unique Bitex ID.

url
GET https://bitex.la/api-v1/rest/private/btc/deposits/deposit_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
5, It's a Specie Deposit, see our API class reference
12345678, Deposit id
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin).
100.00000000, Amount deposited.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/deposits/deposit_id \
  -d "api_key=your_api_key"

List your BTC Deposits

List all your BTC deposits for the last 30 days.

url
GET https://bitex.la/api-v1/rest/private/btc/deposits
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
5, It's a Specie Deposit, see our API class reference
12345678, Deposit id
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin).
100.00000000, Amount deposited.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/deposits \
  -d "api_key=your_api_key"

Create Address

Create a new payment address, optionally specifying wheter to automatically sell all bitcoins received with it.

url
POST https://bitex.la/api-v1/rest/private/btc/addresses
Params
api_key: "your_api_key" Your Bitex.la API key.
auto_sell: true If true, a new Selling Bot will be created for the full amount received from each deposit to this address.
JSON RESPONSE
{  
public_address: "1ABC...", Bitcoin address
auto_sell: false, If true, then a new Selling Bot will be created for each deposit received to this address.
payment_id: null, The Payment's ID. If this address was internally issued for a payment.
}  
cURL example

curl https://bitex.la/api-v1/rest/private/btc/addresses \
  -d "api_key=your_api_key" \
  -d "auto_sell=true"

Show Address

Query for a specific address.

url
GET https://bitex.la/api-v1/rest/private/btc/addresses/public_address
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
public_address: "1ABC...", Bitcoin address
auto_sell: false, If true, then a new Selling Bot will be created for each deposit received to this address.
payment_id: null, The Payment's ID. If this address was internally issued for a payment.
}  
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/addresses/public_address \
  -d "api_key=your_api_key"

List Addresses

List all your addresses. This list will include the default addresses created with your bitex account, any new addresses you create via API, and other addresses created for you by bitex internal processes, for example, addresses created for Payments.

url
GET https://bitex.la/api-v1/rest/private/btc/addresses
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
{  
public_address: "1ABC...", Bitcoin address
auto_sell: false, If true, then a new Selling Bot will be created for each deposit received to this address.
payment_id: null, The Payment's ID. If this address was internally issued for a payment.
},  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/addresses \
  -d "api_key=your_api_key"

Create a BTC Withdrawal

Request a Specie withdrawal to a given address.

All Withdrawals are accepted in the 'Received (1)' state, and are moved into the 'Pending (2)' state immediately if you have enough funds, then they're moved the 'Accepted (2)' or 'Rejected (3)' state when processed by our account officials.

url
POST https://bitex.la/api-v1/rest/private/btc/withdrawals
Params
api_key: "your_api_key" Your Bitex.la API key.
address: 1abcde... Destination bitcoin address.
amount: 100.00 Amount to withdraw.
label: some_label Optional: A label for tagging this withdrawal.
kyc_profile_id: 1 Optional: Unique ID for the KYC Profile receiving this withdrawal, defaults to your main KYC Profile.
JSON RESPONSE
[  
6, It's a Specie Withdrawal, see our API class reference.
12345678, Withdrawal id.
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin)
100.00000000, Amount withdrawn.
1, Status, always 1, meaning it was received and our engine is checking if you have enough funds.
0, Always 0 as it was not cancelled.
"1address..", Destination address for this withdrawal.
"my wallet", An optional custom label for the destination address.
1, Kyc Profile ID for which this withdrawal was instructed.
"ABCDEF...", Transaction ID, available once it's processed.
]  
cURL example

curl https://bitex.la/api-v1/rest/private/btc/withdrawals \
  -d "api_key=your_api_key" \
  -d "address=1abcde..." \
  -d "amount=100.00" \
  -d "label=some_label" \
  -d "kyc_profile_id=1"

Show a BTC Withdrawal

Find a BTC withdrawal by it's unique Bitex ID.

url
GET https://bitex.la/api-v1/rest/private/btc/withdrawals/deposit_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
6, It's a Specie Withdrawal, see our API class reference.
12345678, Withdrawal id.
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin)
100.00000000, Amount withdrawn.
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed.
This may take a few hours as our staff monitors all withdrawals.
3 Done, your withdrawal was processed and should appear on the network soon.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field.
0, An integer representing the cancellation reason
0 Not cancelled.
1 The instruction was received, but you didn't have enough funds
2 The destination address was invalid.
"1address..", Destination address for this withdrawal.
"my wallet", An optional custom label for the destination address.
1, Kyc Profile ID for which this withdrawal was instructed.
"ABCDEF...", Transaction ID, available once it's processed.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/withdrawals/deposit_id \
  -d "api_key=your_api_key"

List your BTC Withdrawals

List all your BTC withdrawals for the last 30 days.

url
GET https://bitex.la/api-v1/rest/private/btc/withdrawals
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
[  
6, It's a Specie Withdrawal, see our API class reference.
12345678, Withdrawal id.
946685400, Creation time as UNIX timestamp.
1, Specie (1 for Bitcoin)
100.00000000, Amount withdrawn.
1, An integer representing this withdrawal status:
1 Received, our engine is checking if you have enough funds, should be quick.
2 Pending, your withdrawal was accepted and is being processed.
This may take a few hours as our staff monitors all withdrawals.
3 Done, your withdrawal was processed and should appear on the network soon.
4 Cancelled, your withdrawal could not be processed, check the 'reason' field.
0, An integer representing the cancellation reason
0 Not cancelled.
1 The instruction was received, but you didn't have enough funds
2 The destination address was invalid.
"1address..", Destination address for this withdrawal.
"my wallet", An optional custom label for the destination address.
1, Kyc Profile ID for which this withdrawal was instructed.
"ABCDEF...", Transaction ID, available once it's processed.
],  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/btc/withdrawals \
  -d "api_key=your_api_key"



Payments API

Our payments API lets you accept bitcoin without worrying about the inner workings of the bitcoin Price and the bitcoin Network.

You just tell us the amount to charge in the customer's currency and we'll quote the bitcoin equivalent and set up a unique Bitcoin Address for the bitcoin to be sent to. Each payment corresponds to a different bitcoin address.

You can send bitcoin addresses via email, show them in your checkout using your own UI libraries, or easier yet: You can setup your own Bitex powered point of sale and use the user friendly Payment's Page.

All Bitcoins received as payment will be sold automatically at the best BTC/USD market price in Bitex. You can optionally decide to keep part of the received Bitcoin and withdraw or sell them at a later date.

Both USD and/or BTC received as payment will be credited to your Bitex Balance and can be withdrawn as per our supported cash-out methods.

Payments which are too small for our orderbook (roughly 2 USD or less) will not be settled automatically. They will be kept as bitcoin in your balance and it's up to you to decide when to sell them.

Contact us if you need settlements in currencies other than BTC or USD; if you need to have a guaranteed price instead of settling at the best BTC/USD price; or if you need to automatically settle lots of micro-payments.



Create a Payment

Send us an amount and currency, and we'll quote it in bitcoin and give you an address where the payment is expected. The bitcoins will credit to your Bitex account and can be sold automatically to get the original amount in your requested currency.

Payments have an expiration of 1 hour, the bitcoin transaction must be initiated within that timeframe, if your customer takes longer you can always create a new payment and get a new quote and bitcoin address. If someone pays to an address after the payment is expired the bitcoin quantity will still be credited to your bitex.la, so it's possible for you to issue a refund and/or forward the received bitcoin to a new payment address yourself.

You can provide a callback_url to get notifications about a payment, read more in the Payment Callbacks section.

url
POST https://bitex.la/api-v1/rest/private/payments
Params
api_key: "your_api_key" Your Bitex.la API key.
currency_id: 3 Currency in which the amount to be quoted is expresse, possible values are:
amount: 1000 Amount to be quoted, in currency. If currency_id is 1 (BTC) then no quotation will be made and this exact bitcoin amount will be expected as payment
callback_url: "https://example.com/ipn" Optional. We'll POST your full payment as JSON to this URL everytime its status changes. Your callback_url must be https
keep: 25 Optional. Percentage of the received bitcoin to keep as such, instead of converting it to Fiat when payment is settled. This is ignored when you quote your payment in Bitcoin (passing currency_id=1), as it's assumed you're keeping 100% of the bitcoin received as bitcoin.
customer_reference: "An Alto latte, no sugar" Optional. Reason for this payment, as understood by the payer.
merchant_reference: "invoice#1234" Optional. Reason for this payment, as understood by you, payee.
JSON RESPONSE
{  
id: 1, Bitex id for this payment.
user_id: 1, This is you.
amount: 100.00, Amount that was quoted to its BTC equivalent
currency_id: 1, Currency you requested to quote to BTC., This is not the settlement currency, You could quote the equivalent of 100 UYU in BTC, but when payment clears we'll sell the received bitcoin for USD, not UYU, and credit USD to your balance. Possible values are:
1 Bitcoin (BTC, No need to quote)
3 United States Dollar (USD)
4 Argentine Peso (ARS)
5 Uruguayan Peso (UYU)
6 Euro (EUR)
7 Chilean Peso (CLP)
8 Peruvian New Sol (PEN)
9 Brazilian Real (BRL)
10 Colombian Peso (COP)
11 Mexican Peso (MXN)
expected_quantity: 0.02, Quoted amount in BTC. Payment will be considered done if at least this much bitcoin credits in the provided address
previous_expected_quantity: 0.018, Previous expected quantity, before this payment's quote was updated. Starts as null. Payment will be considered done if at least this much bitcoin credits in the provided address
confirmed_quantity: 0.0, Bitcoin quantity received (so far)
unconfirmed_quantity: 0.0, Next Bitcoin quantity, after funds in transit have credited.
valid_until: 1430226201, Payment expiration date as a unix epoch. The confirmed_quantity must be equal (or greater than) the expected_quantity before the valid_until date, otherwise the payment is expired. Unfulfilled payments expire after an hour of being created.
quote_valid_until: 1430226201, Unix epoch when the quote_valid_until time is reached, the payment will be re-quoted, changing the expected_quantity. The previous_expected_quantity is kept around, and is still a valid expected quantity for payment processing purposes until the next expiration. When currency_id is 1 (BTC) quote_valid_until is the same as the valid_until, as the payment is never re-quoted
last_quoted_on: 1430220201, Unix epoch for the time this payment was last quoted. Starts out as the payment creation time
status: "pending", This payment's status, one of:
"pending" Just created.
"seen" The expected_quantity is in transit.
"done" The expected_quantity was received.
"settled" Funds were credited to your balance
"expired" Payment was not seen before expiration date.
"cancelled" Payment was seen but didn't confirm for 2 hours, due to unknown or unexpected circumstances.
address: {
  "public_address": "1ABC...",
  "payment_id": 1,
  "auto_sell": false,
},

Bitcoin address where payment is expected.
settlement_currency_id: null, A payment may be settled to a currency different than the quoted one. Most payments will be settled to USD at the current Bitex market price, or left as BTC. Select Bitex clients may have their payments settled to another currency of their choice.
1 Bitcoin (BTC)
3 United States Dollar (USD)
settlement_amount: null, The amount of settlement_currency credited to your corresponding balance for this payment when settled
keep: 1.5, You can choose to keep a percentage of the bitcoin received and only settle the rest. This has no effect if you quoted BTC as we assume you were intending on keeping 100% of it as settlement
kept: 0.0003, The Bitcoin quantity that was not settled to Fiat and kept as bitcoin instead, as configured in the keep field. You may also end up keeping bitcoin if the amount to settle is less than 2 USD or if any other unexpected situation is encountered at settlement time.
overpaid: 0.0, If a customer accidentally pays more than expected the amount will be registered here. If that happens they will probably contact you for a refund, which you can issue by requesting a bitcoin withdrawal to a bitcoin address they provide.
merchant_reference: null, Optional. Reason for this payment as understood by you, the merchant. This is not modifiable by the customer
customer_reference: null, Optional. Reason for this payment as understood by the customer.
}  
cURL example

curl https://bitex.la/api-v1/rest/private/payments \
  -d "api_key=your_api_key" \
  -d "currency_id=3" \
  -d "amount=1000" \
  -d "callback_url=https://example.com/ipn" \
  -d "keep=25" \
  -d "customer_reference=An Alto latte, no sugar" \
  -d "merchant_reference=invoice#1234"

Show a Payment

If you rather use a Pull model instead of callbacks, or if you think you've missed something, you can always query your payment information like this.

url
GET https://bitex.la/api-v1/rest/private/payments/payment_id
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
{  
id: 1, Bitex id for this payment.
user_id: 1, This is you.
amount: 100.00, Amount that was quoted to its BTC equivalent
currency_id: 1, Currency you requested to quote to BTC., This is not the settlement currency, You could quote the equivalent of 100 UYU in BTC, but when payment clears we'll sell the received bitcoin for USD, not UYU, and credit USD to your balance. Possible values are:
1 Bitcoin (BTC, No need to quote)
3 United States Dollar (USD)
4 Argentine Peso (ARS)
5 Uruguayan Peso (UYU)
6 Euro (EUR)
7 Chilean Peso (CLP)
8 Peruvian New Sol (PEN)
9 Brazilian Real (BRL)
10 Colombian Peso (COP)
11 Mexican Peso (MXN)
expected_quantity: 0.02, Quoted amount in BTC. Payment will be considered done if at least this much bitcoin credits in the provided address
previous_expected_quantity: 0.018, Previous expected quantity, before this payment's quote was updated. Starts as null. Payment will be considered done if at least this much bitcoin credits in the provided address
confirmed_quantity: 0.0, Bitcoin quantity received (so far)
unconfirmed_quantity: 0.0, Next Bitcoin quantity, after funds in transit have credited.
valid_until: 1430226201, Payment expiration date as a unix epoch. The confirmed_quantity must be equal (or greater than) the expected_quantity before the valid_until date, otherwise the payment is expired. Unfulfilled payments expire after an hour of being created.
quote_valid_until: 1430226201, Unix epoch when the quote_valid_until time is reached, the payment will be re-quoted, changing the expected_quantity. The previous_expected_quantity is kept around, and is still a valid expected quantity for payment processing purposes until the next expiration. When currency_id is 1 (BTC) quote_valid_until is the same as the valid_until, as the payment is never re-quoted
last_quoted_on: 1430220201, Unix epoch for the time this payment was last quoted. Starts out as the payment creation time
status: "pending", This payment's status, one of:
"pending" Just created.
"seen" The expected_quantity is in transit.
"done" The expected_quantity was received.
"settled" Funds were credited to your balance
"expired" Payment was not seen before expiration date.
"cancelled" Payment was seen but didn't confirm for 2 hours, due to unknown or unexpected circumstances.
address: {
  "public_address": "1ABC...",
  "payment_id": 1,
  "auto_sell": false,
},

Bitcoin address where payment is expected.
settlement_currency_id: null, A payment may be settled to a currency different than the quoted one. Most payments will be settled to USD at the current Bitex market price, or left as BTC. Select Bitex clients may have their payments settled to another currency of their choice.
1 Bitcoin (BTC)
3 United States Dollar (USD)
settlement_amount: null, The amount of settlement_currency credited to your corresponding balance for this payment when settled
keep: 1.5, You can choose to keep a percentage of the bitcoin received and only settle the rest. This has no effect if you quoted BTC as we assume you were intending on keeping 100% of it as settlement
kept: 0.0003, The Bitcoin quantity that was not settled to Fiat and kept as bitcoin instead, as configured in the keep field. You may also end up keeping bitcoin if the amount to settle is less than 2 USD or if any other unexpected situation is encountered at settlement time.
overpaid: 0.0, If a customer accidentally pays more than expected the amount will be registered here. If that happens they will probably contact you for a refund, which you can issue by requesting a bitcoin withdrawal to a bitcoin address they provide.
merchant_reference: null, Optional. Reason for this payment as understood by you, the merchant. This is not modifiable by the customer
customer_reference: null, Optional. Reason for this payment as understood by the customer.
}  
cURL example

curl -G https://bitex.la/api-v1/rest/private/payments/payment_id \
  -d "api_key=your_api_key"

List all Payments

List all your latest payments, newest first. You can optionally filter by status. Results may be truncated after 500 rows.

url
GET https://bitex.la/api-v1/rest/private/payments
Params
api_key: "your_api_key" Your Bitex.la API key.
status: "done" Optional. You can filter payments by status.
JSON RESPONSE
[  
{  
id: 1, Bitex id for this payment.
user_id: 1, This is you.
amount: 100.00, Amount that was quoted to its BTC equivalent
currency_id: 1, Currency you requested to quote to BTC., This is not the settlement currency, You could quote the equivalent of 100 UYU in BTC, but when payment clears we'll sell the received bitcoin for USD, not UYU, and credit USD to your balance. Possible values are:
1 Bitcoin (BTC, No need to quote)
3 United States Dollar (USD)
4 Argentine Peso (ARS)
5 Uruguayan Peso (UYU)
6 Euro (EUR)
7 Chilean Peso (CLP)
8 Peruvian New Sol (PEN)
9 Brazilian Real (BRL)
10 Colombian Peso (COP)
11 Mexican Peso (MXN)
expected_quantity: 0.02, Quoted amount in BTC. Payment will be considered done if at least this much bitcoin credits in the provided address
previous_expected_quantity: 0.018, Previous expected quantity, before this payment's quote was updated. Starts as null. Payment will be considered done if at least this much bitcoin credits in the provided address
confirmed_quantity: 0.0, Bitcoin quantity received (so far)
unconfirmed_quantity: 0.0, Next Bitcoin quantity, after funds in transit have credited.
valid_until: 1430226201, Payment expiration date as a unix epoch. The confirmed_quantity must be equal (or greater than) the expected_quantity before the valid_until date, otherwise the payment is expired. Unfulfilled payments expire after an hour of being created.
quote_valid_until: 1430226201, Unix epoch when the quote_valid_until time is reached, the payment will be re-quoted, changing the expected_quantity. The previous_expected_quantity is kept around, and is still a valid expected quantity for payment processing purposes until the next expiration. When currency_id is 1 (BTC) quote_valid_until is the same as the valid_until, as the payment is never re-quoted
last_quoted_on: 1430220201, Unix epoch for the time this payment was last quoted. Starts out as the payment creation time
status: "pending", This payment's status, one of:
"pending" Just created.
"seen" The expected_quantity is in transit.
"done" The expected_quantity was received.
"settled" Funds were credited to your balance
"expired" Payment was not seen before expiration date.
"cancelled" Payment was seen but didn't confirm for 2 hours, due to unknown or unexpected circumstances.
address: {
  "public_address": "1ABC...",
  "payment_id": 1,
  "auto_sell": false,
},

Bitcoin address where payment is expected.
settlement_currency_id: null, A payment may be settled to a currency different than the quoted one. Most payments will be settled to USD at the current Bitex market price, or left as BTC. Select Bitex clients may have their payments settled to another currency of their choice.
1 Bitcoin (BTC)
3 United States Dollar (USD)
settlement_amount: null, The amount of settlement_currency credited to your corresponding balance for this payment when settled
keep: 1.5, You can choose to keep a percentage of the bitcoin received and only settle the rest. This has no effect if you quoted BTC as we assume you were intending on keeping 100% of it as settlement
kept: 0.0003, The Bitcoin quantity that was not settled to Fiat and kept as bitcoin instead, as configured in the keep field. You may also end up keeping bitcoin if the amount to settle is less than 2 USD or if any other unexpected situation is encountered at settlement time.
overpaid: 0.0, If a customer accidentally pays more than expected the amount will be registered here. If that happens they will probably contact you for a refund, which you can issue by requesting a bitcoin withdrawal to a bitcoin address they provide.
merchant_reference: null, Optional. Reason for this payment as understood by you, the merchant. This is not modifiable by the customer
customer_reference: null, Optional. Reason for this payment as understood by the customer.
},  
...
]
 
cURL example

curl -G https://bitex.la/api-v1/rest/private/payments \
  -d "api_key=your_api_key" \
  -d "status=done"

Payment Callbacks

When a callback_url is set for a payment Bitex will POST updates to it everytime a payment status changes.

Your callback_url must be HTTPS because we want to make sure we're only contacting you, and it will include your first active API key in it, so that you know it's us sending the callback. Your API key is our shared secret, so you may want to handle it the same way you handle your users login credentials, hiding it from web server request logs for example.

Our request's content type will be application/json and the content will be a structure containing your API key and the payment is it would be returned when querying its status.

Here's a curl invokation that mimics a Bitex callback, you can copy and paste it directly into your terminal.

CURL Callback STUB
curl -s -H 'Content-Type: application/json' -d \
'{ "api_key": "your_api_key",
   "payment": {
     "id":1,
     "user_id":1,
     "amount":100.0,
     "currency_id": 1,
     "expected_quantity":0.01936,
     "previous_expected_quantity":0.019,
     "confirmed_quantity":0.0,
     "unconfirmed_quantity":0.0,
     "status":"pending",
     "address": {
       "id":11012,
       "public_address":"mgj8dsnp48iGA8WNfk4y2PHj8HcugvxUj2"
     },
     "valid_until": 1430230348,
     "quote_valid_until": 1430230348,
     "last_quoted_on": 1430210000,
     "settlement_amount": null,
     "settlement_currency_id": null,
     "keep": 0.0,
     "customer_reference": null,
     "merchant_reference": null,
   }
}' \
'https://your_url/callback_handler'

Web Point of Sale

We have a Web Point of Sale you can use to display your payment's information to customers.

Your point of sale conveniently displays any payment address and amount as a QR code that can be scanned with a standard bitcoin wallet. It can even be embedded in your e-commerce checkout page and report back on the payment status for a seamless integration.

The point of sale can also be used for self-service payment request from your customers, where they can specify how much they want to pay and the payment reason.

You need to configure your Web Point of Sale before you can start using it, please reffer to Setup Web POS.



Payment Page

Your virtual Point of Sale can display all your payment information for your customers to conveniently pay using their Bitcoin wallet.

Payment pages can be loaded stand alone or within an iframe inside your own checkout flow, using the postMessage Web API to report the full JSON payment to the parent window.

Check out this example in jsfiddle.net using jQuery and Twitter Bootstrap to show a Payment Page in a modal iframe and closing it a few seconds after the payment is recognized as paid.

URL
GET https://bitex.la/pos/merchant_slug/payment_bitcoin_address
Screenshots
Payment pending
Payment done

Self Service POS

By configuring your web POS you get a user friendly page where either you or your customers can create new payments at will.

They just need to specify an amount and currency to quote, and a reference for the payment so you know where it's from. The amount and reference can be pre-configured in the URL.

Your Self Service POS is the most frictionless way to start accepting payments with bitex.

You can also accept donations via the self service pos, we have a special URL that shows the standard POS but calls the payment a 'Donation' which is friendlier for your donors. This is just cosmetic, there's no internal distinction between payments and donations in your bitex payments dashboard.

Standard URL
GET https://bitex.la/pos/merchant_slug
Screenshots
Self service empty
URL with prepopulated fields
GET https://bitex.la/pos/merchant_slug?amount=150&currency_id=4&customer_reference=Fruit Basket
Screenshots with prepopulated fields
Self service filled
Donations URL
GET https://bitex.la/donate/merchant_slug

Setup Web POS

Configures your Web POS in a url of your choice. You should set all fields for the first time so that your POS is enabled.

After the initial setup you can change each field independently by only posting the field you wish to change.

url
POST https://bitex.la/api-v1/rest/private/payments/pos_setup
Params
api_key: "your_api_key" Your Bitex.la API key.
merchant_name: "Tierra Buena" Your business name
merchant_slug: "tierrabuena" Last part of your POS URL. Lowercase letters, numbers and dashes only. Must not be taken by someone else.
You can check if it already exists visiting https://bitex.la/pos/your_desired_name
merchant_logo: "https://t.co/logo.png" Public URL of your logo.
We reccommend your logo to be at least 200px in height and no more than 300px in width. It should look good in a Bitex blue background. Also, try to keep the file-size as small as possible otherwise it may slow down your POS loading time.
merchant_keep: 0 The bitcoin percentage to keep instead of settling to USD for payments created in the self service POS. Defaults to 0, which means you won't keep any bitcoin.
merchant_site: "https://example.com" Your website URL. A link to it will be shown in your self service point of sale
JSON RESPONSE
{  
"merchant_name": "Tierra Buena", Your business name
"merchant_slug": "tierrabuena", Last part of your POS URL.
"merchant_logo": "https://t.co/logo.png", Public URL of your logo.
"merchant_keep": 0, How much bitcoin to keep for Payments created via Web POS
"merchant_site": "https://example.com", Your website URL.
}  
cURL example

curl https://bitex.la/api-v1/rest/private/payments/pos_setup \
  -d "api_key=your_api_key" \
  -d "merchant_name=Tierra Buena" \
  -d "merchant_slug=tierrabuena" \
  -d "merchant_logo=https://t.co/logo.png" \
  -d "merchant_keep=0" \
  -d "merchant_site=https://example.com"


Resellers

Bitex resellers can create and manage Bitex Users (accounts) through specially issued API Keys. If you need to manage several Bitex accounts please contact us at [email protected] to get a reseller API key.

A reseller API key has all permissions to do anything on a given user's behalf. All API endpoints remain the same, but a new as_user parameter is introduced to specify which of the reseller's users is being impersonated.

Users created by a reseller act the same as regular users that signup through the website. They need to provide a full KYC, they have their own balances, and if they know their email and password they can even log-in to the website.

If you don't want your users to log-in and want to use their accounts through API you can just craete them with a random password that you don't store anywhere.



Create User

Registers a new user for your reseller, returning the newly created user_id and kyc_profile_id.

Your next step should be impersonating this user to complete their KYC Profile.

url
POST https://bitex.la/api-v1/rest/reseller/users
Params
api_key: "your_api_key" Your Bitex.la API key.
email: "[email protected]" The customer email. They may receive email notifications to this address. If you'd rather receive the emails yourself you can sign them up with a tagged address like [email protected]
password: "5up3r53cr37" Their password to log-in through the Bitex website. You can set it to some random long string if you don't plan to log-in as this user.
JSON RESPONSE
{  
"user_id": 5000, The newly created user ID.
"kyc_profile_id": 5010, The user's default KYC Profile id. Your next step should be impersonating this user to complete their KYC Profile.
}  
cURL example

curl https://bitex.la/api-v1/rest/reseller/users \
  -d "api_key=your_api_key" \
  -d "[email protected]" \
  -d "password=5up3r53cr37"

List your users

List all users associated to this reseller. Can be retrieved both as JSON or CSV.

Your next step should be impersonating this user to complete their KYC Profile.

JSON URL
GET https://bitex.la/api-v1/rest/reseller/users
CSV URL
GET https://bitex.la/api-v1/rest/reseller/users.csv
Params
api_key: "your_api_key" Your Bitex.la API key.
JSON RESPONSE
[  
1, User ID.
"[email protected]", User email.
10000.00000000, Total USD.
500.00000000, Available USD.
20.00000000, Total BTC.
1.00000000, Available BTC.
"1aBcdeF...", Default BTC deposit address.
]  
cURL example

curl -G https://bitex.la/api-v1/rest/reseller/users \
  -d "api_key=your_api_key"

Impersonating Users

Resellers can impersonate their users for regular API endpoints using their special reseller API key and including an as_user parameter with the ID of the user to impersonate.

See this example updating a KYC Profile for a user as a Reseller.

url
POST https://bitex.la/api-v1/rest/private/...
Params
api_key: "your_api_key" Your Bitex.la API key.
as_user: 5000 User ID to impersonate in this call
...: ... Extra parameters for the API endpoint.
cURL example

curl https://bitex.la/api-v1/rest/private/... \
  -d "api_key=your_api_key" \
  -d "as_user=5000" \
  -d "...=..."

Example: Impersonating to update KYC

This is an example of how to impersonate one of your users to complete their KYC Profile.

All changes will be reviewed by a compliance officer, as with any other request to update a KYC Profile.

url
PUT https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id
Params
api_key: "your_api_key" Your Bitex.la API key.
as_user: 5000 User ID to impersonate in this call
usage_tier: "micro" Usage tier you want to get into one of: micro, small, medium or large.
first_name: "Billy"
last_name: "Bob"
personal_id_number: "33222111N" No particular format expected, just make sure it's a valid id number.
personal_id_issuer_country: "AR" Uppercase ISO country code for the country that issued the ID
personal_id_type: "passport" Type of ID provided. It's free form but we suggest values like 'dni', 'passport', 'drivers_license'
tax_id: 4333222115 This persons tax id (cuit for argentina)
birth_date: "1970/1/30" Year/Month/Date
nationality: "brazilian"
gender: "male" We suggest male or female
occupation: "Singer"
home_address: "Argentina, Bue..." Full address, including zipcode
work_address: "Argentina, Bue..." Full address, including zipcode
phone_numbers: "555120921"
legal_entity: true Boolean: Wheter they will be # operating on behalf of a company # or other legal entity.
politically_exposed_person: true Boolean: Wheter they are what's # considered to be politically exposed.
JSON RESPONSE
[  
12345678, Kyc Profile id.
"Billy", Name
"Bob", Last Name.
"33222111N", Personal ID Number
"AR", ISO country code for the issuer of this ID.
"passport", Type of ID
"4332221115", Tax Id
946685400, Birth date as unix timestamp.
"brazilian", Nationality
"male", Gender
"Singer", Occupation
"Argentina, Bue...", Home address.
"Argentina, Bue...", Work address.
"+51 555 120921", Phone
true, Is legal entity.
true, Is politically exposed.
"micro", Requested usage tier.
"micro", Current usage tier as accepted by our compliance officers.
]  
cURL example

curl -X PUT https://bitex.la/api-v1/rest/private/kyc_profiles/kyc_profile_id \
  -d "api_key=your_api_key" \
  -d "as_user=5000" \
  -d "usage_tier=micro" \
  -d "first_name=Billy" \
  -d "last_name=Bob" \
  -d "personal_id_number=33222111N" \
  -d "personal_id_issuer_country=AR" \
  -d "personal_id_type=passport" \
  -d "tax_id=4333222115" \
  -d "birth_date=1970/1/30" \
  -d "nationality=brazilian" \
  -d "gender=male" \
  -d "occupation=Singer" \
  -d "home_address=Argentina, Bue..." \
  -d "work_address=Argentina, Bue..." \
  -d "phone_numbers=555120921" \
  -d "legal_entity=true" \
  -d "politically_exposed_person=true"


Concierge

Our Concierge service let's you issue one-to-many payments in local currency, using a network of partners built by Bitex.la. Learn more here.

The concierge service focuses on lowering costs and offering transparency. Therefore, each Work Order Request is quoted independently and all the fees involved are shared with you in full detail.

How to use the Concierge service?

  1. Become a reseller
    Contact us so that we give you a Reseller API. Also, read up on our Reseller API usage here
  2. Create your Users
    Both the Payer and the Payees must belong to your Reseller. Learn more here.
  3. Create Withdrawal Instructions
    At least one for each one of your payees too. Learn more here.
  4. Create your Work Order Request.
    You'll specify inputs (the money you send to concierge) and outputs (the money concierge should send to each payee).
  5. Wait for us to acknowledge
    After that, keep refreshing your Work Order Request to see if we've accepted it (we usually will).
    If it's accepted one of our account officers may contact you to quote how much money you need to use to fund your "inputs" and give you the bank instructions. This information may also be available for each 'input' in the data returned by the API.
    The Concierge process may end up being cheaper than quoted, if so, you'll get a rebate in your Bitex.la balance.
  6. Optionally, wait for a better price.
    Since our prices fluctuate constantly, the quoted amounts in your inputs or outputs may change from the time you send funds to your inputs to the time we receive them and are ready to start the process on our end. We can call you and give you a chance to delay the process waiting for a more favorable price. You'll probably want to do this confirmation step for your first Work Order Requests, but may want to skip it once you become familiar with the Concierge service and pricing.
  7. Finally, wait while we do our magic.
    Periodically refresh your Work Order Request. Look at the outputs as all the payees get paid, until the status becomes 'done'. If any problems should arise an account officer will contact you or the payee, depending on your preference.
    Concierge will do everything it can to get the money to each payee.

When sending money using concierge, you may fall into one of the following two use cases. The way you construct your inputs and outputs will determine which one. Exactly one input or one output amount should be left empty to note who's bearing the cost for this transaction.

You need to pay a number of people, bearing all the costs yourself.

For this, you'll leave one of your input amounts empty. We'll calculate the cost for sending the money to all the payees and quote how much to need to send for that.

You have a fixed amount to spend, one of the payees will bear the cost of the transaction.

For this, you'll leave one of your output amounts empty. We'll ensure all your payees get the specified amount, and send the rest to the remaining one. This kind of transfer is trickier to calculate as you may not want one payee to bear the cost for all the others, you may want to instruct less money to go to each payee to lighten the burden on the payee whose amount you leave empty. Future versions of this API will allow you to more fairly distribute the costs between payees.



Create Work Order Request

Creates a new work order request to receive one payment from you (inputs) and issue several payments to a number of payees (outputs).

Responses use the json:api format, learn more at http://jsonapi.org

URL
POST https://bitex.la/api-v1/rest/reseller/work_order_requests
JSON Request
{
  "api_key": "your_reseller_api_key",
  "payer_id": 123, // The payer must belong to your reseller.
  // Once inputs credit, we can call you and confirm how much will be spent from each input,
  // and how much will be received by each payee. If not set, you can trust us to always look
  // for the best price available to deliver all payments as soon as possible.
  "should_confirm_quote": true,
  "inputs": [ // Inputs are called that because that's how money gets into the concierge network.
    { 
      // Amount should be null in one input if all outputs have amounts.
      "amount": 1000.0,
      // ISO Alpha2 country code. One of:
      // AD, AR, AT, AU, BE, BG, BR, CL, CN, CY, CZ, DE, DK, EE, ES, FI, FR, GB
      // GR, HK, HR, HU, IE, IL, IN, IT, KE, KR, LI, LT, LU, LV, MT, MX, NG, NL
      // NO, NZ, PE, PH, PL, PT, PY, RO, SE, SI, SK, TZ, UG, US, VE
      "country": "AR",
      // ISO 4217 currency code. One of:
      // ARS, AUD, BGN, BRL, BTC, CHF, CLP, CNY, CZK, DKK, EUR, GBP, HKD, HRK, HUF, ILS, INR, KES
      // KRW, MXN, NGN, NOK, NZD, PEN, PHP, PLN, PYG, RON, SEK, TZS, UGX, USD, VEF
      "currency": "ARS"
    }
  ],
  "bitcoin_inputs": [ // If you have Bitcoin you can use those as input too.
    // No need to specify country or currency. If you want us to tell you the amount, make it null.
    { "amount": null }
  ],
  "outputs": [ // This is your list of payees. Specify Who, How much, and How they're getting paid.
    {
      "user_id": 1, // This is the payee. It must belongs to the reseller.
      "country": "US", // Countries available are the same as for Inputs.
      "currency": "USD", // Currencies available are the same as for Inputs.
      "amount": 100.0, // This amount is expressed in the currency defined above.
      "withdrawal_instruction_id": 2 // The withdrawal instruction must be for this user.
    },
    { "currency": "MXN", "amount": 400.0, "country": "MX",
      "user_id": 2, "withdrawal_instruction_id": 3 }
  ]
}
JSON Response
{
  "data": {
    "id": "1", // The work order request ID.
    "type": "work_order_requests",
    "attributes": {
      "payer_id": 1,
      // The status will change as your order progresses
      // received: We received your request and are doing sanity checks on it.
      // waiting_for_inputs: We're contacting you to give you instructions to fund your inputs.
      // sending_to_outputs: We're in the process of issuing all payments to payees.
      // done: This Work Order Request has been completed, nothing else to do here.
      // cancelled: Orders can be cancelled, usually before you fund your inputs.
      "status": "received",
      // Our pricing fluctuates slightly throughout the day. Input and output amounts
      // may change between the time que request funding for your inputs and the time
      // those funds credit and we can move forward issuing the payouts.
      // We can call you once all your inputs are funded so you can decide to move
      // forward, or wait until the price changes in your favor.
      "should_confirm_quote": false,
      // Any input excess will be returned to your Bitex.la balance as Bitcoin.
      // We can configure your Bitex account so that these bitcoin are converted
      // to USD upon arrival just contact us to make that change.
      "bitcoin_rebate": 0,
      // Last time your request saw any updates.
      "updated_at": "2000-01-01T00:00:00.000Z"
    },
    // As per the JSON API specification, relatioships are defined as references
    // When parsing, you may want to look at "included" for each input and output.
    "relationships": {
      "inputs": {
        "data": [{"id": "1", "type": "work_order_request_inputs"}]
      },
      "bitcoin_inputs": {
        "data": [{"id": "1", "type": "work_order_request_bitcoin_inputs"}]
      },
      "outputs": {
        "data": [
          {"id": "1", "type": "work_order_request_outputs"},
          {"id": "2", "type": "work_order_request_outputs"}
        ]
      }
    }
  },
  "included": [
    // Your work order request input will look like this.
    { "id": "1",
      "type": "work_order_request_inputs",
      "attributes": {
        // The amount and currency you have. Currency will usually be associated with country.
        "currency": "ARS",
        "amount": 1000.0,
        "country": "AR",
        // Instructions on how to fund this input will be available when
        // the request moves to the waiting_for_inputs state.
        "instructions": { "method": "bank_transfer", "comments": null },
        // Cash_in fees are taken by your bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_in_fee_percent": null,
        "cash_in_fee_fixed": null,
        // The amount received by our partner with all fees deducted.
        // This amount may be expressed in a different currency than what
        // you sent as it may get converted during Cash In.
        "fiat_received_by_partner": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        "bitcoins_produced": null,
        // The fee taken by the concierge partner when sending your money
        // to the bitcoin clearing network.
        "partner_fee_percent": null,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        "tax_invoice_number": null
      }
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    { "id": "1",
      "type": "work_order_request_bitcoin_inputs",
      "attributes": {
        // The bitcoin amount you'll need to fund your input with.
        "amount": null,
        // Instructions will primarily contain the address to which the bitcoins
        // should be sent.
        "instructions": {
          "method": "bitcoin",
          "address": "1...",
          "comments": "This is a bitcoin address provided to you by Bitex.la"
        },
        // The bitcoin amount received and confirmed so far.
        "bitcoins_credited": 0.0,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": 1.0
      },
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    // Your work order request output will look like this.
    { "id": "1",
      "type": "work_order_request_outputs",
      "attributes": {
        // The net amount the payee should receive in their bank account after fees.
        "amount": 100.0,
        // Currency will usually match that of the country where the bank account is,
        // although some countries offer local currency and USD bank accounts.
        "country": "US",
        "currency": "USD",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        // The fee taken by the concierge network partner when receiving
        // money from the bitcoin clearing network.
        "partner_fee_percent": null,
        // The final amount in local currency sent by our partner. It may be
        // expressed in a different currency than the final currency received
        // by the payee.
        "fiat_sent_by_partner": null,
        // Cash_out fees are taken by the payee's bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        
        // Eligible outputs also feature a 'friendly_pricing_summary',
        // when available, it shows how much of the input amount
        // was spent on this output, what was the exchange rate and
        // how much was paid in fees, expressed in the output currency.
        // Notice: The friendly pricing summary is less precise than
        // the per-input and per-output breakdown, which remains always available.
        "friendly_pricing_summary": {
          "amount_received": 960.12,
          "amount_sent": 10182.13,
          "currency_received": "usd",
          "currency_sent": "ars",
          "exchange_rate": 0.1,
          "fee": 58.08
        }
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    { "id": "2",
      "type": "work_order_request_outputs",
      "attributes": {
        "amount": 400.0,
        "country": "MX",
        "currency": "MXN",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        "concierge_fee_percent": null,
        "broker_bitcoin_price": null,
        "partner_fee_percent": null,
        "fiat_sent_by_partner": null,
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        "friendly_pricing_summary": null,
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    {
      "id": 1,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 101,
        "name": "John Doe"
      }
    },
    {
      "id": 5,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 105,
        "name": "Susan Doe"
      }
    }
  ]
}
cURL example pastebox

Show Work Order Request

Show a work order request in JSON API format.

URL
GET https://bitex.la/api-v1/rest/reseller/work_order_requests/work_order_requests_id
JSON Request
{
  "api_key": "your_reseller_api_key"
}
JSON Response
{
  "data": {
    "id": "1", // The work order request ID.
    "type": "work_order_requests",
    "attributes": {
      "payer_id": 1,
      // The status will change as your order progresses
      // received: We received your request and are doing sanity checks on it.
      // waiting_for_inputs: We're contacting you to give you instructions to fund your inputs.
      // sending_to_outputs: We're in the process of issuing all payments to payees.
      // done: This Work Order Request has been completed, nothing else to do here.
      // cancelled: Orders can be cancelled, usually before you fund your inputs.
      "status": "received",
      // Our pricing fluctuates slightly throughout the day. Input and output amounts
      // may change between the time que request funding for your inputs and the time
      // those funds credit and we can move forward issuing the payouts.
      // We can call you once all your inputs are funded so you can decide to move
      // forward, or wait until the price changes in your favor.
      "should_confirm_quote": false,
      // Any input excess will be returned to your Bitex.la balance as Bitcoin.
      // We can configure your Bitex account so that these bitcoin are converted
      // to USD upon arrival just contact us to make that change.
      "bitcoin_rebate": 0,
      // Last time your request saw any updates.
      "updated_at": "2000-01-01T00:00:00.000Z"
    },
    // As per the JSON API specification, relatioships are defined as references
    // When parsing, you may want to look at "included" for each input and output.
    "relationships": {
      "inputs": {
        "data": [{"id": "1", "type": "work_order_request_inputs"}]
      },
      "bitcoin_inputs": {
        "data": [{"id": "1", "type": "work_order_request_bitcoin_inputs"}]
      },
      "outputs": {
        "data": [
          {"id": "1", "type": "work_order_request_outputs"},
          {"id": "2", "type": "work_order_request_outputs"}
        ]
      }
    }
  },
  "included": [
    // Your work order request input will look like this.
    { "id": "1",
      "type": "work_order_request_inputs",
      "attributes": {
        // The amount and currency you have. Currency will usually be associated with country.
        "currency": "ARS",
        "amount": 1000.0,
        "country": "AR",
        // Instructions on how to fund this input will be available when
        // the request moves to the waiting_for_inputs state.
        "instructions": { "method": "bank_transfer", "comments": null },
        // Cash_in fees are taken by your bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_in_fee_percent": null,
        "cash_in_fee_fixed": null,
        // The amount received by our partner with all fees deducted.
        // This amount may be expressed in a different currency than what
        // you sent as it may get converted during Cash In.
        "fiat_received_by_partner": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        "bitcoins_produced": null,
        // The fee taken by the concierge partner when sending your money
        // to the bitcoin clearing network.
        "partner_fee_percent": null,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        "tax_invoice_number": null
      }
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    { "id": "1",
      "type": "work_order_request_bitcoin_inputs",
      "attributes": {
        // The bitcoin amount you'll need to fund your input with.
        "amount": null,
        // Instructions will primarily contain the address to which the bitcoins
        // should be sent.
        "instructions": {
          "method": "bitcoin",
          "address": "1...",
          "comments": "This is a bitcoin address provided to you by Bitex.la"
        },
        // The bitcoin amount received and confirmed so far.
        "bitcoins_credited": 0.0,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": 1.0
      },
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    // Your work order request output will look like this.
    { "id": "1",
      "type": "work_order_request_outputs",
      "attributes": {
        // The net amount the payee should receive in their bank account after fees.
        "amount": 100.0,
        // Currency will usually match that of the country where the bank account is,
        // although some countries offer local currency and USD bank accounts.
        "country": "US",
        "currency": "USD",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        // The fee taken by the concierge network partner when receiving
        // money from the bitcoin clearing network.
        "partner_fee_percent": null,
        // The final amount in local currency sent by our partner. It may be
        // expressed in a different currency than the final currency received
        // by the payee.
        "fiat_sent_by_partner": null,
        // Cash_out fees are taken by the payee's bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        
        // Eligible outputs also feature a 'friendly_pricing_summary',
        // when available, it shows how much of the input amount
        // was spent on this output, what was the exchange rate and
        // how much was paid in fees, expressed in the output currency.
        // Notice: The friendly pricing summary is less precise than
        // the per-input and per-output breakdown, which remains always available.
        "friendly_pricing_summary": {
          "amount_received": 960.12,
          "amount_sent": 10182.13,
          "currency_received": "usd",
          "currency_sent": "ars",
          "exchange_rate": 0.1,
          "fee": 58.08
        }
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    { "id": "2",
      "type": "work_order_request_outputs",
      "attributes": {
        "amount": 400.0,
        "country": "MX",
        "currency": "MXN",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        "concierge_fee_percent": null,
        "broker_bitcoin_price": null,
        "partner_fee_percent": null,
        "fiat_sent_by_partner": null,
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        "friendly_pricing_summary": null,
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    {
      "id": 1,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 101,
        "name": "John Doe"
      }
    },
    {
      "id": 5,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 105,
        "name": "Susan Doe"
      }
    }
  ]
}
cURL example pastebox

List Work Order Requests

Show a work order request in JSON API format.

URL
GET https://bitex.la/api-v1/rest/reseller/work_order_requests
JSON Request
{
  "api_key": "your_reseller_api_key"
}
JSON Response
{
  "data": [
    {
      "id": "1", // The work order request ID.
      "type": "work_order_requests",
      "attributes": {
        "payer_id": 1,
        // The status will change as your order progresses
        // received: We received your request and are doing sanity checks on it.
        // waiting_for_inputs: We're contacting you to give you instructions to fund your inputs.
        // sending_to_outputs: We're in the process of issuing all payments to payees.
        // done: This Work Order Request has been completed, nothing else to do here.
        // cancelled: Orders can be cancelled, usually before you fund your inputs.
        "status": "received",
        // Our pricing fluctuates slightly throughout the day. Input and output amounts
        // may change between the time que request funding for your inputs and the time
        // those funds credit and we can move forward issuing the payouts.
        // We can call you once all your inputs are funded so you can decide to move
        // forward, or wait until the price changes in your favor.
        "should_confirm_quote": false,
        // Any input excess will be returned to your Bitex.la balance as Bitcoin.
        // We can configure your Bitex account so that these bitcoin are converted
        // to USD upon arrival just contact us to make that change.
        "bitcoin_rebate": 0,
        // Last time your request saw any updates.
        "updated_at": "2000-01-01T00:00:00.000Z"
      },
      // As per the JSON API specification, relatioships are defined as references
      // When parsing, you may want to look at "included" for each input and output.
      "relationships": {
        "inputs": {
          "data": [{"id": "1", "type": "work_order_request_inputs"}]
        },
        "bitcoin_inputs": {
          "data": [{"id": "1", "type": "work_order_request_bitcoin_inputs"}]
        },
        "outputs": {
          "data": [
            {"id": "1", "type": "work_order_request_outputs"},
            {"id": "2", "type": "work_order_request_outputs"}
          ]
        }
      }
    }
  ],
  "included": [
    // Your work order request input will look like this.
    { "id": "1",
      "type": "work_order_request_inputs",
      "attributes": {
        // The amount and currency you have. Currency will usually be associated with country.
        "currency": "ARS",
        "amount": 1000.0,
        "country": "AR",
        // Instructions on how to fund this input will be available when
        // the request moves to the waiting_for_inputs state.
        "instructions": { "method": "bank_transfer", "comments": null },
        // Cash_in fees are taken by your bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_in_fee_percent": null,
        "cash_in_fee_fixed": null,
        // The amount received by our partner with all fees deducted.
        // This amount may be expressed in a different currency than what
        // you sent as it may get converted during Cash In.
        "fiat_received_by_partner": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        "bitcoins_produced": null,
        // The fee taken by the concierge partner when sending your money
        // to the bitcoin clearing network.
        "partner_fee_percent": null,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        "tax_invoice_number": null
      }
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    { "id": "1",
      "type": "work_order_request_bitcoin_inputs",
      "attributes": {
        // The bitcoin amount you'll need to fund your input with.
        "amount": null,
        // Instructions will primarily contain the address to which the bitcoins
        // should be sent.
        "instructions": {
          "method": "bitcoin",
          "address": "1...",
          "comments": "This is a bitcoin address provided to you by Bitex.la"
        },
        // The bitcoin amount received and confirmed so far.
        "bitcoins_credited": 0.0,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": 1.0
      },
      "relationships" => {"user"=>{"data"=>{"id"=>1, "type"=>"users"}}}
    },
    // Your work order request output will look like this.
    { "id": "1",
      "type": "work_order_request_outputs",
      "attributes": {
        // The net amount the payee should receive in their bank account after fees.
        "amount": 100.0,
        // Currency will usually match that of the country where the bank account is,
        // although some countries offer local currency and USD bank accounts.
        "country": "US",
        "currency": "USD",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        // The fee taken by the concierge service itself.
        "concierge_fee_percent": null,
        // We use bitcoin as our underlying asset, differences in bitcoin
        // prices on the inputs vs the outputs could be considered as the
        // cost of the international clearing network.
        "broker_bitcoin_price": null,
        // The fee taken by the concierge network partner when receiving
        // money from the bitcoin clearing network.
        "partner_fee_percent": null,
        // The final amount in local currency sent by our partner. It may be
        // expressed in a different currency than the final currency received
        // by the payee.
        "fiat_sent_by_partner": null,
        // Cash_out fees are taken by the payee's bank and our partner's bank.
        // These fees are percentual and/or fixed, and start out as null.
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        
        // Eligible outputs also feature a 'friendly_pricing_summary',
        // when available, it shows how much of the input amount
        // was spent on this output, what was the exchange rate and
        // how much was paid in fees, expressed in the output currency.
        // Notice: The friendly pricing summary is less precise than
        // the per-input and per-output breakdown, which remains always available.
        "friendly_pricing_summary": {
          "amount_received": 960.12,
          "amount_sent": 10182.13,
          "currency_received": "usd",
          "currency_sent": "ars",
          "exchange_rate": 0.1,
          "fee": 58.08
        }
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    { "id": "2",
      "type": "work_order_request_outputs",
      "attributes": {
        "amount": 400.0,
        "country": "MX",
        "currency": "MXN",
        "user_id": 5,
        "withdrawal_instruction_id": 1,
        "concierge_fee_percent": null,
        "broker_bitcoin_price": null,
        "partner_fee_percent": null,
        "fiat_sent_by_partner": null,
        "cash_out_fee_percent": null,
        "cash_out_fee_fixed": null,
        "tax_invoice_number": null,
        "friendly_pricing_summary": null,
      },
      "relationships" => {"user"=>{"data"=>{"id"=>5, "type"=>"users"}}}
    },
    {
      "id": 1,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 101,
        "name": "John Doe"
      }
    },
    {
      "id": 5,
      "type": "users",
      "attributes": {
        "email": "[email protected]",
        "kyc_profile_id": 105,
        "name": "Susan Doe"
      }
    }
  ]
}
cURL example pastebox

Webhooks

Resellers can configure a single webhook URL to receive updates about their changing entities.

Updates will be sent via a POST request to your URL. The body of the request will contain the full entity in json-api format.

The request will contain a 'Webhook-Auth' header, with a SHA256 hexdigest of your first API key, so you can authenticate the callback originates on our end. You can calculate your API key's SHA256 in *nix like so:

'$ echo -n your_api_key | sha256sum'
Alternatively, you can use the Test Webhook endpoint and check the 'Webhook-Auth' being posted to your URL.

WorkOrderRequest callbacks

WorkOrderRequests trigger callbacks whenever they are created and as they move through the flow until being done

KycProfile callbacks

KycProfiles trigger callbacks whenever they are accepted or rejected by one of our admins. You can check the 'data.attributes.accepted_usage_tier' field in in the callback body to know if a user was accepted or rejected. It's null when it was rejected, and a string describing the usage tier when it's accepted. Notice a KycProfile may change from accepted to rejected at any time, it may be accepted when first created then get rejected by further compliance procedures.

Show Webhook URL

Shows the webhook URL currently configured for this reseller.

URL
GET https://bitex.la/api-v1/rest/reseller/webhook
JSON Request
{
  "api_key": "your_reseller_api_key"
}
JSON Response
{"webhook_url": "https://example.com/webhook"}
cURL example pastebox

Update Webhook URL

Setup a webhook URL to receive callbacks. The URL must be https

URL
PUT https://bitex.la/api-v1/rest/reseller/webhook
JSON Request
{
  "api_key": "your_reseller_api_key",
  "webhook_url": "https://example.com/webhook" // Any HTTPS url.
}
JSON Response
{"webhook_url": "https://example.com/webhook"}
cURL example pastebox

Test Webhook URL

Test your URL, this will trigger a callback with a simple JSON body, echoing your params.

URL
POST https://bitex.la/api-v1/rest/reseller/webhook/test
JSON Request
{
  "api_key": "your_reseller_api_key",
  "echo": "hello world" // Any message you want echoed.
}
JSON Response
{"echo": "hello world"} // The same thing you'll get posted to your URL
cURL example pastebox

Example Rejected KYC callback

Here's a curl invokation that mimics a Bitex callback when a Kyc profile is rejected. You can copy and paste it directly into your terminal.

You can check the 'data.attributes.accepted_usage_tier' field in in the callback body to know if a user was accepted or rejected. It's null when it was rejected, and a string describing the usage tier when it's accepted.

Notice a KycProfile may change from accepted to rejected at any time, it may be accepted when first created then get rejected by further compliance procedures.

There's an API endpoint to lookup all possible rejection reasons.

CURL Callback STUB

Example Completed WorkOrderRequest callback

Here's a curl invokation that mimics a Bitex callback when a WorkOrderRequest is completed. You can copy and paste it directly into your terminal.

CURL Callback STUB

API Class Reference

Some of our API methods return heterogeneous lists of objects, each object belongs to a given Class. Each Class has its own set of fields and possible field values. A USD Deposit, a Bid or a Sell Transaction are all examples of Classes used in our API.
In order to optimize data transfers we serialize Instances of these Classes as lists of numbers and text, but to help you deserializing them we came up with the following conventions:

  • The first value on the list represents the Class
    1. Bid
    2. Ask
    3. Buy Transaction (created when one of your Bids is executed)
    4. Sell Transaction (created when one of your Asks is executed)
    5. Specie Deposit
    6. Specie Withdrawal
    7. USD Deposit
    8. USD Withdrawal
  • The second value on the list represents the Instance id
  • The third value is the creation time as a UNIX timestamp
  • All the remaining values may vary depending on which Class it is.