Initiate token purchase

Initiate a new token purchase - exchange real currency for virtual tokens.

Securitytilia_auth
Request
Request Body schema: application/json
required

Create Token Purchase request

payment_method_id
required
string <= 36 characters

The payment method id to charge for purchasing tokens.

amount
required
integer

The number of virtual tokens to purchase. Specified in your virtual currency.

currency
required
string

Your virtual currency code.

destination_account_id
string <= 36 characters

An optional account ID for who should receive the tokens upon purchase. If this field is omitted, the funds will go the payment method owner. This field allows you to purchase tokens for somebody else.

tax_inclusive
boolean
Default: false

An optional boolean flag indicating whether taxes should be calculated. If exclusive (false), the tax amount will be added to each line item amount. If inclusive (true), the line item amount you pass in is inclusive of the tax amount. For example, consider the following token purchase of 1000 TOK and 10% tax (where, for simplicity, 1 TOK = 1 USD):

  • Tax exclusive: 1100 USD total (1000 USD net + 100 tax)
  • Tax inclusive: 1000 USD total (909 USD net + 91 tax)

Important: When fees are assessed, they are calculated based on the net amount of the token purchase. If the fee is 5%, using the same example above, the fees would be calculated as follows:

  • Tax exclusive: 50 USD fee (1000 USD * 0.05)
  • Tax inclusive: 46 USD fee (909 USD * 0.05)
object

An optional object used for tax determination calculation. If none is provided, the address associated with a user's account details or payment method will be used.

Responses
201

Successfully created token purchase.

400

Invalid input

401

Unauthorized access.

403

Disallowed from transacting.

500

Service unavailable or server error.

post/v2/token/purchase
Request samples
application/json
{
  • "payment_method_id": "pm_2V2bA0r2hJpUnCA9HeTgOl0rONr",
  • "amount": 250,
  • "currency": "VCD",
  • "destination_account_id": "acct_2TiDFXHVFMlAuyy7ovvz3YPKv9b",
  • "tax_inclusive": false,
  • "location": {
    }
}
Response samples
application/json
{
  • "status": "Success",
  • "payload": {
    }
}