Skip to main content

Purchase

3 endpoints

POST /users/{user}/wallets/{wallet}/purchases Create a purchase

Create new purchase order

Parameters

user required
string · path
id parameter must be included in the URI
wallet required
string · path

Request Body

operation required
string (enum)
Type of the operation.
amount required
string
Total amount of the purchase operation. In Fiat for buy orders, in crypto for sell orders
device required
string
Device name or user agent
ip required
string
User's IP address
externalReference
string
Reference to external purchase ID
fiatCurrency
string (enum)
Fiat currency used in the purchase operation (propagated from Core baseCurrency)

Responses

201
400 Bad request
401 Unauthorized
POST https://api.qa.onyze.pro/v1/users/{user}/wallets/{wallet}/purchases
Request body
{
"operation": "buy",
"amount": "10.01",
"device": "Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0",
"ip": "167.145.132.65",
"externalReference": "External Purchase ID",
"fiatCurrency": "EUR"
}
Response 201
{
"id": "2cdc8ab1-6d50-49cc-ba14-54e4ac7ec231"
}
GET /users/{user}/wallets/{wallet}/purchases List all purchases

List all existing purchases. Admin audience is required to list all purchases for all users with userId=* and walletId=*.

Parameters

user required
string · path
id parameter must be included in the URI
wallet required
string · path
id parameter must be included in the URI
page
number · query
Page number of the records list
limit
number · query
Max number of records by page. limit=0 to return all records
sort
string · query
Sort the response PARAM or -PARAM
createdAfter
string · query
Created after date
createdBefore
string · query
Created before date
assetId
string · query
Asset Id type
externalReference
string · query
Reference to external purchase ID

Responses

200
400 Bad request
401 Unauthorized
404 Not found
GET https://api.qa.onyze.pro/v1/users/{user}/wallets/{wallet}/purchases
Response 200
[
{
"id": "d8vJIh-H",
"createdAt": "2018-08-17T17:04:55.626Z",
"updatedAt": "2018-08-21T18:24:17.185Z",
"user": "yiY4p02QP",
"wallet": "yiY4p02QP",
"status": "approved",
"operation": "buy",
"asset": "yiY4p02QP",
"amount": "10",
"purchased": "10",
"netAmount": "10",
"fee": "0.3"
}
]
GET /users/{user}/wallets/{wallet}/purchases/{purchase} Find a purchase by id

Find an existing purchase by its id.

Parameters

user required
string · path
id parameter must be included in the URI
wallet required
string · path
id parameter must be included in the URI
purchase required
string · path
id parameter must be included in the URI

Responses

200
401 Unauthorized
404 Not found
GET https://api.qa.onyze.pro/v1/users/{user}/wallets/{wallet}/purchases/{purchase}
Response 200
{
"id": "d8vJIh-H",
"createdAt": "2018-08-17T17:04:55.626Z",
"updatedAt": "2018-08-21T18:24:17.185Z",
"user": "yiY4p02QP",
"wallet": "yiY4p02QP",
"status": "approved",
"operation": "buy",
"asset": "yiY4p02QP",
"amount": "10",
"purchased": "10",
"netAmount": "10",
"fee": "0.3"
}