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
PropertyTypeDescription
usestring[enum]Either "gold" or "currency".
goldQuantitynumberThe 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
PropertyTypeDescription
usestring[enum]Either "gold" or "currency".
currencystringThe currency of the amount in ISO-3. Only user's currency is accepted.
amountnumberThe amount in specified currency.

Response

Body

Accepts:

application/json
{
  "error": null,
  "data": {
    "message": "Purchase successful."
  }
}
PropertyTypeDescription
errorobject or nullIf there's an error, this will be returned.
error.messagestringThe error message.
dataobject or nullIf successful, this will be returned.
data.messageobjectSuccess message.

Copyright © 2024 Qbix Technology Sdn. Bhd. All rights reserved.