πŸ’ΈPurchasing In-Game Items

Direct Purchase with SHARD

  • This API limited to 100,000 SHARD per transaction

  • This API does not need user interaction to confirm the purchase, if you want to have user confirmation, you will need to do it from the game

Pay Transaction with SHARD

POST [endpoint]/v3/transaction/pay-with-shard

Headers

NameTypeDescription

Authorization*

String

Bearer token

X-Api-Key*

String

API key

Request Body

NameTypeDescription

description*

String

Description of purchase, can be transaction ID generated from your game

shard_price*

Integer

Price to purchase in SHARD

{
    "status": "success",
    "message": "Payment with SHARD Success",
    "data": {
        "KOMO_TX_ID": "48CBD65AC89E4D62260DD95A0A5680F7",
        "shard_price": "100",
        "description": "TEST1"
    }
}

Create Item Purchase Transaction

Another method to purchase game item with SHARD is using this API

  1. Create transaction using /v3/cashier/create API. Notes: when you set callback_url to your own server, you will receive webhook notification when user completed the payment. Otherwise, you will need to check if the payment has been done via /v3/cashier/check API.

  2. After creating the transaction, you will be given URL to KOMO Cashier

  3. Your game need to open this URL either with webview or open on the browser

  4. If the user does not have enough SHARD to pay, then user can use other payment method to fulfill the transaction

Create Transaction

POST [endpoint]/v3/cashier/create

Request Body

NameTypeDescription

game_transaction_id*

String

Transaction ID for your own purpose

list_items*

JSON

JSON array for list of purchased items see below format

callback_url

String

Your own webhook URL to receive confirmation callback

{
    "status": "success",
    "messages": "Transaction created. Please open the URL below.",
    "data": {
        "game_tx_id": "KC-XXXXXX",
        "komo_tx_id": "A5B08BC5A5EA2645AE506E34DF56B03A",
        "webview_url": "https://cashier.komoverse.io?tx_id=A5B08BC5A5EA2645AE506E34DF56B03A"
    }
}

Check Transaction Status

GET [endpoint]/v3/cashier/check

Query Parameters

NameTypeDescription

komo_tx_id*

String

Komoverse Transaction ID

{
    "status": "success",
    "data": {
        "komo_tx_id": "A5B08BC5A5EA2645AE506E34DF56B03A",
        "game_tx_id": "KC-XXXXXX",
        "total_price": 40000,
        "payment_status": "pending"
    }
}

Example of list_items payload

[
  {
    "item_image_url": "https://via.placeholder.com/200",
    "item_name": "Booster Item",
    "quantity": 2,
    "price": 5000
  },
  {
    "item_image_url": "https://via.placeholder.com/200",
    "item_name": "Booster XP",
    "quantity": 3,
    "price": 10000
  }
]

Please serialize / stringify the JSON array if you are sending payload as json instead of form-data

Last updated