To generate a signature for an HTTP request, you must create a hash-based message authentication code (HMAC
) that uses the hash function SHA-256
.
To create an SHA-256 HMAC
, use your generated Bitso API Secret as the cryptographic key on the concatenation of
nonce + HTTP method + request path + JSON payload
Do not include the plus signs, +, in the concatenated string. Hex encode the obtained output.
Ensure the following is true when creating the signature:
nonce
field in the Authorization header.Construct the header with the fields described at the beginning of the article as follows:
`Auth_Header`: Bitso <`key`>:<`nonce`>:<`signature`>
This documentation explains how to use the Bitso API to place an order for buying or selling cryptocurrencies.
HTTP Request:
https://sandbox.bitso.com/api/v3/orders/
Body Parameters:
Required parameters
book
: Specifies the trading pair (e.g., BTC/USD
side
: Specifies whether the order is a buy or sell ordertype
: Specifies the order type, either market or limit.Optional parameters
major
: The amount of major currency for the order (e.g., BTC
).minor
: The amount of minor currency for the order (e.g., USD
origin_id
: A client-supplied unique ID for the orderprice
: The price per unit of major currency. Only used with Limit Ordersstop
: The price per unit of major currency at which to trigger a stop ordertime_in_force
: Specifies how long the order will remain active before it's executed or expires.Depending on the type of order (market or limit), different parameters are required
book
), the side (buy
or sell
), and the order type (market
). Optionally, you can include the major
or minor
parameters to specify the amount.price
parameter to specify the price at which you want the order to be executed.stop
for stop orders and time_in_force
to specify how long the order will remain active.Major and minor currencies
BTC/USD.
BTC
is the major currency.USD
is the minor currency.BTC
in this example) or the minor currency (USD
in this example).BTC
), you're indicating how much of that major currency you want to buy or sell.USD
), you're indicating how much of that minor currency you want to spend or receive in exchange.