Lydiax REST API
The Lydiax API is designed to be a predictable and intuitive interface to enable merchants to buy/sell supported cryptocurrencies.
Sandbox REST API URL: https://sandbox-api.lydiax.com/
Production REST API URL: https://api.lydiax.com/
Authorization
The Lydiax API implements OAuth 2.0 to allow clients to log in without exposing their credentials. The process involves several steps:
Acquire an access token
- Use the access token to make authenticated requests
- Before you begin, you will need to get the client credentials from our staff.
- Before you begin, you will need to get the client credentials from our staff.
Acquire an access token
The authentication key consists of your client id and client secret.
Note: The concatenated client id (public key) and client secret (private key) must be separated by a colon.
curl -X POST 'https://sandbox-api.lydiax.com/oauth/token?grant_type=client_credentials'
-u LYDIAX_CLIENT_ID:LYDIAX_CLIENT_SECRET
Note: You can also log in with the basic authentication. You just need to encode the concatenated client id and client secret with Base64.
curl -X POST 'https://sandbox-api.lydiax.com/oauth/token?grant_type=client_credentials'
-H 'Authorization: Basic NTQwMDcyNTFkYWI0NDEzOThhYjhjY2UwNzhjZjJkMGE6NGJlZGZiYWViMGE2NDBlMmI4NzI0MWVjMDkzMzEwODE='
Exchanging an access token
The access token must be exchanged in any authorized request in the header parameters. For example:
curl -X POST 'https://sandbox-api.lydiax.com/rates/BTCEUR'
-H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJjdXN0b21lcl90eXBlIjoiQlVTSU5FU1MiLCJzY29wZSI6WyJ3cml0ZSJdLCJtZXJjaGFudF9pZCI6MzUwMCwiZXhwIjoxNTMyNTUyMzA1LCJhdXRob3JpdGllcyI6WyJNRVJDSEFOVF9XUklURSIsIk1FUkNIQU5UX1JFQUQiXSwianRpIjoiNDg5MTY5MTMtMDQ3Yi00YWNjLTk1ZmUtZjVhMjIzMDg5ZTk2IiwiY2xpZW50X2lkIjoiYjk3OGRkZTYyYzE2NDg2NjhhODIxMTEyNGI0MjJkN2UifQ.Ia9kALKsr094JFLNtRHcI4L9UuJu65aSt-doVmSK7Q3zH40pyrlGllcMVkp2dQRZrztD0ShSlYb7lIZygFPOthTfgf5LaFD6J3oKGY7lFcw312lAhQFIiyk-6'
Authentication
This endpoint is used to acquire access token.
Request headers
The concatenated client id (public key) and client secret (private key) must be separated by a colon and then encoded with Base64.
Basic Authentication (Basic Base64_Encode(CLIENT-ID:CLIENT-SECRET))
Responses
Body
Access Token
Token Type
Token Expire Duration in ms
Access Token Scope
PSP ID
JWT ID
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6WyJyZWFkIiwid3JpdGUiLCJwc3AiXSwicHNwX2lkIjoiMSIsImV4cCI6MTU0MTgwNjI2NCwiYXV0aG9yaXRpZXMiOlsiUk9MRV9QU1AiXSwianRpIjoiODE4NDg2OTUtMTc3ZC00NTVmLWI1M2YtMTZmNWFhMjRiZDRlIiwiY2xpZW50X2lkIjoiZGM5OWVhYzZjYWU0NzZiOTE4ZDM3ZGYxMTJhMzkxY2MxMWZmYTExMCJ9.KqzBMuiawZbYTE9FexmibkR_yVpQYQzsmQlh809f54c7UqyxniVHlPCFaLmog8YNm532mXPViTlO2evTtkINQu_tBFv6ds0Yl20XRaN4XElnUHAnGtumvpN4Tz8mDvHwRVFSE3GHsLFteaOZtFQBhHwoDw6Bs-ytAlit6cGytS-_fTESf59VA1GIAEvF1QY5SsS5ukLG7r04CtHdkGDdIoyWkFxhwOEzKquDx8KZaRn7P2anBMijmX0M89Sd5-4_c8ZFPwIQWxvNAVaKpn8z8LN8gpM5x7qctH7_ZaPlBJ6qiQAavzaakYm8WfmpVx_MA-ZwSjoillm_KHQsyeVTNQ",
"token_type": "bearer",
"expires_in": 1,
"scope": "read write psp",
"psp_id": 1,
"jti": "81848695-177d-455f-b53f-16f5aa24bd4e"
}
{currencyPairCode}
{currencyPairCode}
{currencyPairCode}
{currencyPairCode}
Retrieve the current market rate.
Path variables
Currency pair code: [BTCEUR, BCHEUR, XRPEUR, LTCEUR, ETHEUR]
Responses
OK
Body
Unauthorized
Forbidden
Not Found
{
"buy_price": 123.45,
"currency_pair": "BTCEUR",
"sell_price": 123.45
}
{currencyPairCode}
Retrieve the best current market rate for withdraw transactions.
Path variables
Currency pair code: [BTCEUR, BCHEUR, XRPEUR, LTCEUR, ETHEUR]
Responses
OK
Body
Currency pair code
Buy rate for withdraw
Unauthorized
Forbidden
Not Found
{
"buy_price": 123.45,
"currency_pair": "BTCEUR"
}
{currencyPairCode}
Retrieve the best current market rate for deposit transactions.
Path variables
Currency pair code: [BTCEUR, BCHEUR, XRPEUR, LTCEUR, ETHEUR]
Responses
OK
Body
Currency pair code
Sell rate for deposit
Unauthorized
Forbidden
Not Found
{
"currency_pair": "BTCEUR",
"sell_price": 123.45
}
{orderId}
PSPs can create conversion
Request body
Currency pair code
Transaction type
Cryptocurrency amount
Money amount
Responses
OK
Body
Cryptocurrency amount
Transaction total
Conversion token expiration time
Conversion token
Unauthorized
Forbidden
Not Found
PSPs users can create orders
Request body
orderData
Conversion token
Customer details
Customer reference id
Customer first name
Customer last name
Customer email address
Customer IP address
Responses
OK
Body
Order id
Order type
Order status
Unauthorized
Forbidden
Not Found
PSPs users can create withdraws
Request body
Customer withdrawal details
Conversion token
Customer wallet address
Customer details
Customer reference id
Customer first name
Customer last name
Customer email address
Customer IP address
Responses
OK
Body
Order id
Order type
Order status
Unauthorized
Forbidden
Not Found
{orderId}
PSPs users can create orders
Path variables
Order ID
Responses
OK
Body
Order ID
Order status
Order type
Currency pair code
Order amount
Order total
Customer reference id
Customer first name
Customer last name
Customer email address
Customer ip address
Unauthorized
Forbidden
Not Found
{referenceId}
/deposit/address/{cryptocurrencyCode}
Creates a deposit address for a customer
Request body
Create a wallet address for deposit transactions
Cryptocurrency code
Customer details
Customer reference id
Customer first name
Customer last name
Customer email address
Responses
OK
Body
Customer deposit wallet address id
Customer deposit wallet address
Cryptocurrency code
Unauthorized
Forbidden
Not Found
{paymentReferenceId}
/conversion{paymentReferenceId}
{paymentReferenceId}
/accept{paymentReferenceId}
/refundCreates a payment request and returns a hosted payment page url
Request body
Currency code
Payment amount
Payment reference
Customer details
Customer reference id
Customer first name
Customer last name
Customer email addres
Customer ip address
Merchant name
Payment description
Responses
Body
Payment amount
Currency code
Payment status
Payment description
Payment expiration timestamp
Payment reference id
The URL where the customer will be redirected to complete the payment
Creates a payment request
Request body
Currency code
The URL where the customer will return to your website after a successful payment
The URL where the customer will return to your website after a failed payment
Payment amount
Payment reference
Customer details
Customer reference id
Customer first name
Customer last name
Customer email addres
Customer ip address
Merchant name
Payment description
Responses
Body
Payment amount
Currency code
Payment status
Payment description
Payment expiration timestamp
Payment reference id
Supported payment methods
Cryptocurrency name
Cryptocurrency code
{paymentReferenceId}
/conversionPath variables
Payment reference number
Request body
Cryptocurrency code
Responses
Body
Payment reference number
Payment currency
Payment amount
Cryptocurrency amount
Merchant name
Payment status
Cryptocurrency code
Payment cryptocurrency address
Payment expire duration in seconds
{paymentReferenceId}
Path variables
Payment reference number
Responses
Body
Payment reference number
Payment currency
Payment amount
Cryptocurrency amount
Merchant name
Payment status
Cryptocurrency code
Payment cryptocurrency address
Payment expire duration in seconds
The URL where the customer will return to your website after a successful payment
The URL where the customer will return to your website after a failed payment
Payment refundable status
Refundable amount
Payment acceptable status
Acceptable amount
{paymentReferenceId}
/acceptCreates a refund
Path variables
Payment reference id
Responses
Body
Payment currency code
Payment total
Payment cryptocurrency amount
Payment cryptocurrency
Payment address
Blockchain transaction id
{paymentReferenceId}
/refundCreates a refund
Path variables
Payment reference id
Request body
Refund address
Refund reason
Responses
Body
Refund id
Total refund amount
Payment reference id
Refund address
Webhook details
Request headers
Webhook user agent
Webhook id
Request body
Order id
Order status
Order transaction type
Currency pair code
Cyyptocurrency amount
Order total
Customer reference id
Customer first name
Customer last name
Customer email address
Customer ip address
Payment address
Blockchain transaction id
Payment reference id