You can have a look at the general sequence diagram.
API Key
Step 1: Add API Key to Request Header
You will need to add API Key field to Header of every Requests as following:
"x-api-key":"api_key"
User Registeration flow
With this flow follow User path
Step 1: User Register
Step 1.1: User Register (Register and KYC on Gaian side)
You will need to make a POST request to /api/v1/user/register
Step 1.2: KYC Sharing (KYC on Partner side)
If you want to do KYC on your side and want to share it, make user flow more smoothly, you can use this KYC Sharing API
Users must be registered via the /user/register API; automatic creation is no longer supported.
You need to make a POST request to api/v1/submit-kyc-information
Step 2: User KYC
User need to be KYC-ed to be able to make a payment. You will need to make a POST request to /api/v1/kyc/link
Payment Flow
With this flow follow Payment path
Step 1: Place Order
Step 1.1: Place Order (Without Prefunded)
You will need to make a POST request to /api/v1/placeOrder
⚠️Please be caution: These QR string was meant to be use in SANDBOX. DO NOT USE IT IN PRODUCTION
To test with VND please use this QR String:
To test with PHP please use this QR String:
Step 1.2: Place Order (With Prefunded)
To use this flow please reach out to us.
You will need to make a POST request to /api/v1/placeOrder/prefund
After place an order, it will be proceeded automatically.
⚠️Please be caution: These QR string was meant to be use in SANDBOX. DO NOT USE IT IN PRODUCTION
To test with VND please use this QR String:
To test with PHP please use this QR String:
Step 2: Build and Sign the Transaction
Please notice⚠️: Skip this step if you’re using Prefunded flow.
This will need to be perform on your side. You will need a build instruction function, example in TypeScript:
Then sign and submit the transaction to chain.
Step 3: Verify Order
Please notice⚠️: Skip this step if you’re using Prefunded flow.
After submitting the transaction to chain, you will need to make a POST request with the transaction hash (tx_Hash) hash and order Id ( order_id_string), to /api/v1/verifyOrder
Step 4: Polling the Status
After the order is verified , it will be auto-processing. Then you will need to make a polling function to make a GET request to /api/v1/status after an amount of time
Additional API
Parse QR API
With this flow follow Payment path
You will need to make a POST request to /api/v1/parseQr
Calculate Exchange
With this flow follow Payment path
Calculate cryptocurrency equivalent for fiat amount with current exchange rates
You will need to make a POST request to /api/v1/calculateExchange
Get Transaction History
With this flow follow User path
By User Email
You will need to make a GET request to /api/v1/users/{User_Email}/orders
By User Wallet
You will need to make a GET request to /api/v1/users/wallet/{User_Wallet}/orders
Get User Infomation
With this flow follow User path
By User Email or User Wallet Address
You will need to make a GET request to /api/v1/users/?email="?"
Or, you will need to make a GET request to /api/v1/users/?walletAddress="?"