Gold
Purchase
Purchase gold by gold quantity or currency amount. Requires Authentication.
Purchase gold by gold quantity or currency amount. Requires Authentication.
This endpoint requires authentication. You are required to pass session cookie
qbix-mock-session in the header of this request.Request
Purchase gold with a specific gold quantity or amount in specific currency. If currency amount is specified, only user's currency is accepted, specifying any other currency will return an error.
Purchase by Gold Quantity
POST /gold/purchase HTTP/1.1
Host: mock.qbix.dev/api
Accept: application/json
Content-Type: application/json
Cookie: qbix-mock-session=<session token>
{
"use": "gold",
"goldQuantity": 1.0000
}
Body
Content-Type:
application/json| Property | Type | Description |
|---|---|---|
use | string[enum] | Either "gold" or "currency". |
goldQuantity | number | The quantity amount in gold to purchase. |
Purchase by Currency Amount
POST /gold/purchase HTTP/1.1
Host: mock.qbix.dev/api
Accept: application/json
Content-Type: application/json
Cookie: qbix-mock-session=<session token>
{
"use": "currency",
"currency": "USD",
"amount": 1.00
}
Body
Content-Type:
application/json| Property | Type | Description |
|---|---|---|
use | string[enum] | Either "gold" or "currency". |
currency | string | The currency of the amount in ISO-3. Only user's currency is accepted. |
amount | number | The amount in specified currency. |
Response
Body
Accepts:
application/json{
"error": null,
"data": {
"message": "Purchase successful."
}
}
| Property | Type | Description |
|---|---|---|
error | object or null | If there's an error, this will be returned. |
error.message | string | The error message. |
data | object or null | If successful, this will be returned. |
data.message | object | Success message. |