# What is Gluwa

Gluwa is a borderless financial platform where anyone with a smartphone can transact with each other across the border.

Welcome to [Gluwa](https://www.gluwa.com/)! Our goal is to give you access to financial opportunity anywhere in the world. We power the platform with the blockchain-technology, but our goal is to create a simple black box. Great products don't make you think.

The best way to discover Gluwa is to try it out. Whether you were already experienced with cryptocurrency or not, get started with Gluwa with the following guide:

{% content-ref url="/pages/-Ls0DuRqBdzCdbYmMGiw" %}
[Gluwacoin](/get-started/gluwacoin)
{% endcontent-ref %}

{% content-ref url="/pages/-Lp2PBvNgU9nfJ3CvxB0" %}
[Gluwa Mobile App](/get-started/gluwa)
{% endcontent-ref %}

{% content-ref url="/pages/-LrSgeOX\_9Fj1XNo109\_" %}
[Gluwa Dashboard](/get-started/dashboard)
{% endcontent-ref %}


# Change Log

This section provides an overview of user-facing/impacting release notes.

Select product group from the menu to the left to see relevant changes, or click one of the options below:

{% content-ref url="/pages/-MYAYLVLitX\_lIt4OsXe" %}
[Gluwa API Change Log](/change-log/gluwa-api)
{% endcontent-ref %}

{% content-ref url="/pages/-MYAYQRpvIDdb-gRPB59" %}
[Gluwa Wallet Change Log](/change-log/gluwa-wallet)
{% endcontent-ref %}

{% content-ref url="/pages/-MjBNBFJhLZtpY25qkMC" %}
[Gluwa Exchange Change Log](/change-log/gluwa-exchange)
{% endcontent-ref %}


# Gluwa API Change Log

All release notes pertaining to Gluwa API and Dashboard

## 05-16-2022 - Version 2022.05.01

### API

* Launched ETH token support (getbalance/payment/transfer)
* Launched USDC token support (getbalance/payment/transfer)
* Launched USDT token support (getbalance/payment/transfer)
* Launched CTC token support (payments/transfers)
* Lottery Account fixes
* Fixed amount and fee display for exchange transactions&#x20;
* Fixed currency amount and added pagination for push notifications
* Updated transaction history for Invest
* Added error handling for BrokenCircuitException where Polly HttpClients are used
* Improved an error handling of "No minimumBlockchainFee"

## 03-21-2022 - Version 2022.03.02

### API&#x20;

* Fixed amount and fee for exchange transactions

## 03-21-2022 - Version 2022.03.01

### API&#x20;

* Added pagination and fixed negative values + currency amount for push notifications
* Updated maturity date and deposits + withdrawals in transaction history
* Improved an error handling of "No minimumBlockchainFee"

## 02-16-2022 - Version 2022.02

### API&#x20;

* Launched new Transaction History API endpoint for V7 app redesign
* Launched API endpoint that displays rate/fee amount per token
* Launched API endpoint to return current price in USD&#x20;
* Launched PushNotificationHistory endpoint supporting 'All' currencies
* Updated QR code to include payload in the response&#x20;
* Updated blockchain.info 429 (Over limit) responses

## 01-19-2022 - Version 2022-01

### API&#x20;

* Unified ECurrency used by Gluwa API and MarketMaker&#x20;
* Improved handling of Luniverse and Infura 429 (Over limit) responses&#x20;
* Added alerts for the addresses monitored&#x20;
* Added GCRE (CTC ERC-20 Token) support on QR Code endpoint&#x20;

### API - Dashboard

* Updated password policy

## 12-06-2021 - Version 2021.12

### API&#x20;

* Updated CircuitBreaker policy on RPC clients
* Fixed some minor code smells

### API  - Dashboard

* Updated password policy

## 10-13-2021 - Version 2021.10-1

### API - Gluwa Invest

* Fixed Bond Account deposits showing in push notifications

### API&#x20;

* Launched peg/unpeg (USDC-G <> sUSDC-G)
* Launched USDC-G support&#x20;
* Updated Peg/Unpeg daily limit and minimum amount&#x20;
* Fixed API signature format&#x20;
* Implemented send fee of 0.1% for sUSDC-G&#x20;
* Replaced GasNow by Etherscan Gas Tracker&#x20;
* Replaced ETHless Mint in API by user self-service Mint&#x20;
* Updated GetBalance endpoint
* Added API endpoint for returning all token balances
* Added Gluwa API localization for Push Notifications

## 09-04-2021 - Version 2021.09.1

### API - Gluwa Invest

* Added API endpoints to support Gluwa Invest Bond Account functionality
* Added OTP endpoints for Terms and Conditions Onboarding
* Added user agreement endpoints to manage user data and documents for account sign-up
* Updated and expanded the Account Setup checklist endpoint
* Added Bond Account smart contract support
* Added sUSDC-G deposit endpoint functionality
* Updated push notifications for Veriff sessions
* Fixed several InternalServerError issues
* Fixed some UI flow issues including Verification Failed for iOS devices and Log In navigation issues

### API

* Added API to convert USDC to USDC-G&#x20;
* Refactored code for peg/unpeg&#x20;
* Fixed peg endpoint nonce format&#x20;
* Fixed peg notifications
* Updated queue client factory in the retry function&#x20;
* Fixed wrong hashes passed when calling processUnpeg&#x20;
* Added support for longer nonce in Gluwa API
* Fixed validating transaction hash before attempting to process&#x20;
* Fixed peg notifications&#x20;
* Fixed error in Internal transaction controller for BTC transactions

## 08-30-2021 - Version 2021.08.2

### API

* Fixed transfers on successful peg

## 08-12-2021 - Version 2021.08.1

### API

* Fixed Webhookreceiver Signature endpoint&#x20;
* Enhanced Cloudflare IP Address logging&#x20;
* Fixed USDC-G transaction signature validation&#x20;
* Removed unused OTP validation from SNGNG and PegUnpeg&#x20;
* Added Balance Check before processing the transaction

## 07-28-2021 - Version 2021.07.1

### Dashboard

* Fixed secure flag set on all cookies for tools and dashboard&#x20;

### API

* Updates SDKs in accordance with contracts so that updates are aligned
* Implemented Web3ClientFactory and improved RetryQueue and API to handle an increased load in TPS&#x20;
* Installed USDC-G support&#x20;
* Updated Peg/Unpeg for USDC-G and sUSDC-G gateway
* Installed Peg/Unpeg related features and updates for the Gluwa Internal API, Gluwa public API and interaction endpoints with the Luniverse Gatekeeper
* Fixed GetBalance API to get correct address and balance
* Added additional logging/metrics for GluwaExchangeRequests

## 06-01-2021

### Dashboard

* Updated jQuery to latest version&#x20;
* Fixed (export) transaction bugs&#x20;

### API

* Included HTTP request/response in the logs
* Launched toggle App Settings for currency releases&#x20;
* Updated gas price calculation

## 10-13-2020

### Dashboard

* Updated the Transaction History and Details pages with additional information and options

### API

* Updated QR code generation endpoint&#x20;
* Updated Webhook responses to V2 (Opt-in update for Dashboard coming in the near future)

## 08-09-2020

### API

* Performance improvements
* Backend bug-fixes and enhancements
* Transaction signature validation improvements

## 08-27-2020

### API

* Added additional logging to API backend&#x20;
* Improved Bitcoin unspent output handling in exchange API&#x20;
* Misc bugfixes

### Dashboard

* Added ability to export transaction history to a comma-separated values (.CSV) file&#x20;
* Added additional transaction filtering options (Date, Amount, Order ID)&#x20;
* Improved transaction history filtering Misc bugfixes


# Gluwa Wallet Change Log

All release notes pertaining to Gluwa Wallet

## 05-26-2022 - Version 7.3.0

* Launched Fixed-Term Interest Account (previously named Bond Account)
* Fixed FTA drawdowns and transaction history/details pages&#x20;
* Fixed Lottery Account error message "Insufficient balance to deposit"&#x20;
* Updated display of token with balance 0 and fee for QR code payments

## 05-23-2022 - Version 7.2.1

* Fixed side-letter agreement Lottery Account link
* Updated AndroidManifest.xml

## 05-19-2022 - Version 7.2.0

* Launched ETH, USDC, USDT and CTC token support (payments/transfers)

## 05-02-2022 - Version 7.1.0

* Launched Lottery Account
* Updated Pay to Send

## 03-30-2022 - Version 7.0.1

* Fixed next / max feature
* Added support for status 'Submitted'
* Fixed remaining localisation bugs
* Fixed deposits on Test environment

## 03-21-2022 - Version 7.0.0

* Launched renewal design: revamped UI
* Fixed localisation bugs

## 12-06-2021 - Version 6.2.7

* Launched G-CRE support (get balance)&#x20;
* Updated email address referenced on Address Document screen

## 11-24-2021 - Version 6.2.6

* Launched USDC-G&#x20;
* Disabled KRW-G and USD-G
* Gluwa Invest Product
  * Replaced `approve` txn signature with `increaseAllowance` for Bond Account deposits

## 11-16-2021 - Version 6.2.5

* Gluwa Invest Product
  * Added proof-of-address status field for Gluwa Invest
  * Fixed double transaction notifications issue
  * Fixed Invest-related deposit UI issues
  * Updated Bond Account transactions screen text
  * Removed redundant 'amount' field from drawdown screen
  * Removed ability to specify wallet address for draw down
* Set send fee to 0.1% for sUSDC-G

## 09-21-2021 -Version 6.2.3

* Fixed enabled currencies list

## 09-09-2021 -Version 6.2.1

* Fixed UI logic for Account Setup checklist
* Fixed incorrect UI text for Account Setup checklist

## 09-08-2021 -Version 6.2.0

* Launched Gluwa Invest Bond Account
* Enabled Account Setup/Onboarding including Terms and Conditions
* Enabled sUSDC-G deposit to Bond Account
* Enabled Portfolio Dashboard for account performance tracking
* Fixed some non-optional data fields to be optional
* Disabled USA as Country option (Product not available in US)
* Fixed many cosmetic/UI bugs and inconsistencies

## 08-23-2021 - Version 6.1.5

* Fixed identity verification referral code expiration
* Fixed erroneous verification declined screen pop-up during flow
* Fixed deprecated APIs being called
* Enhanced password character compatibility
* Fixed verified Veriff status display on initial app launch

## 08-12-2021 - Version 6.1.4

* Launched Gluwa Invest identity verification (Veriff) and in app status display
* Launched identity verification referral reward campaign
* Fixed verification failed flow for iOS
* Fixed navigation issue after selecting 'log in'

## 08-07-2021 - Version 6.1.3

* Enhanced user's safety by adding access to the recovery phrase via the Additional Security Menu&#x20;

## 07-06-2021 - Version 6.1.2

* Improved testing for sKRWC-G and sNGN-G&#x20;
* Enhanced fingerprint and face ID features
* Fixed minimum of BTC in transaction&#x20;
* Fixed privacy and terms page

## 05-03-2021 - Version 6.1.1

* Fixed entering .(dot) on Exchange view

## 04-28-2021 - Version 6.1.0

* Launched support for sNGN-G
* Fixed onChangeView event on Android&#x20;
* Fixed toggle switches that were cropped&#x20;
* Enabled users to enter an amount below the minimum amount of BTC&#x20;

## 04-15-2021 - Version 6.0.4

* Fixed popup is showing "latestVersion: 6.0.1, currentVersion: 6.0.0"
* Fixed view shows title when address is read by scanning (ei, through universal URL)
* Prevented the app from wrapping on hyphens (e.g. USD-G)
* Users will be automatically updated when a new app version becomes available


# Gluwa Exchange Change Log

## 01-19-2022 - 2022-01-GEX

* Fixed CreateOrder endpoint&#x20;
* Fixed circuit breaker policy&#x20;
* Fixed BrokenCircuitExceptions with Gemini clients

## 02-09-2021 - Version 2021.8.1

* Launched BTC <-> sUSDC-G MM&#x20;
* Fixed minimum amount required for BTC orders&#x20;
* Delisted Gluwacoins from Hanbitco and Charmbit&#x20;
* Fixed failed order messages from Gluwa BTC
* Fixed BTC Balance Tracker


# Gluwa Mobile App

Learn how to use Gluwa mobile app

Gluwa provides a mobile application for [iOS](https://itunes.apple.com/us/app/gluwa/id1021292326) and [Android](https://play.google.com/store/apps/details?id=com.gluwa.android) under the same name. Gluwa mobile app (Gluwa) is a smartphone interface that allows users to interact directly with Gluwacoins without having to join a centralized system. In other words, the app is a [non-custodial wallet](/get-started/gluwa/non-custodial-wallet) for Gluwacoins.

### **With Gluwa, users can:**

* [Create](/get-started/gluwa/create-a-new-gluwa-wallet) a new Gluwacoin wallet
* [Restore](/get-started/gluwa/restore-wallet) an old wallet
* [Send](/get-started/gluwa/send-gluwacoin-to-an-address) and receive Gluwacoins
* [Make a payment](/get-started/gluwa/make-qr-code-payments-1) by scanning a QR code
* [Sign a message](/get-started/gluwa/create-a-signature) with a private key
* [Access your private keys](/get-started/gluwa/wallet-credentials)


# Gluwa Invest (Investor DAO) FAQ

A list of frequently asked question about how our Investor DAO operates

<figure><img src="/files/5E66gagT2EIOuP7I4CQ6" alt=""><figcaption></figcaption></figure>

## What is Investor DAO?

Investor DAO is a decentralized autonomous organization (DAO) protocol designed to democratize the investment process by allowing an investment offeror (hereafter: “Offeror”) to propose high-yield, real-world, investment opportunities to DAO members. Please check out the official whitepaper [here](https://docsend.com/view/z39twbv4bbhwtfaf).

## What am I investing in?

Our real-world assets (RWAs) are specifically debt investments to fintech companies. Please check out details of each investment opportunity on Gluwa App.

## How are you able to offer up to 20% APR?

The yields you receive come from lending your USDC to real businesses worldwide. As those businesses create value within their communities and repay back their loans, you’re rewarded for funding their loans.

## Can US citizens or US residents invest?

We apologize, but US citizens and US residents are currently restricted from investing via the Gluwa app.

## Is there a minimum investment?

You can get started for as little as $1! However, it is not economically recommended due to the gas fees you will incur while interacting with the blockchain networks.

Once you’re comfortable with our investment products, you can always choose to contribute more and diversify your holdings across several offerings.

For reference, our most active investors average approximately $3,000 USD per investment made.

## Is my principal protected when earning yields?

No, you are investing in alternative investments in the form of RWAs that are debt investments. It can default.

## How liquid are my investments?

Investing through the Investor DAO locks up your principal until the repayment date and interest earned will also be released on the repayment date. However, we are working on improving your investor experience by releasing earned interest monthly - stay tuned!

## Why do I have to provide documents for the KYC/AML compliance and what’s the process?

Our RWAs operate under strict compliance and regulations. Traditionally, debt investments have not been available to the everyday investor, however, Gluwa is able to provide the gateway to these exclusive investment opportunities.\
\
**The KYC process is completed in two steps:**\
\
1\) Upload your government-issued ID\
2\) Upload your proof of address

## What documents are acceptable for proof of address?

The below document types are acceptable forms of proof of address.

**Acceptable Form of Proof of Address** (must be issued/dated within last 3 months)&#x20;

* Utility bill/invoice (water, gas or electric)&#x20;
* Phone/Cell Phone bill
* Bank statement&#x20;
* Credit card statement
* Letter/Certificate/Statement from a Tax Authority or other government agencies
* Housing/Apartment lease agreement

All documents must show your official name and a residential address.

If you're not sure about this step, please reach out to us at <investorDAO@gluwa.com>.

## What is the Minimum Investment Threshold?

It is the minimum amount of USDC required to pass an Investment Opportunity. In the event that the DAO is unable to raise at least the minimum investment threshold amount, the Investment Opportunity will be ‘rejected’ and the DAO will inform its members that they are allowed to withdraw, at any time, the amount they committed to the Investment Opportunity.

## What does 'Available to Drawdown' mean?

The 'Available to Drawdown' balance is the amount you are able to draw down at that time. In other words, it is the total of your deposits that have matured, plus any interest you’ve earned.

## How is 'Total Expected Interest' calculated?

The ‘Total Expected Interest’ displays your total expected interest earned when all of your active investment opportunities mature. It is calculated by aggregating your expected returns across all of your active investment opportunities. Please note that this figure only measures your active investment opportunities that haven’t matured yet.

For example, if a user had three active investments with the following interest rates:

* $10,000 USD - 12.5% APR&#x20;
* $10,000 USD - 20% APR&#x20;
* $20,000 USD - 15% APR

Their ‘Total Expected Interest’ would be calculated as such:&#x20;

($10,000 \* 12.5%) + ($10,000 \* 20%) + ($20,000 \* 15%) = $6,250 USD

## How is 'Average Yield’ calculated?

The ‘Average Yield’ displays the average expected yield of all of the active investment opportunities that you participated within Investor DAO. It is an investment-weighted average expected return. Please note that it only measures your active investment opportunities that haven’t matured yet.

For example, if a user had three active investments with the following interest rates:

* $10,000 USD - 12.5% APR&#x20;
* $10,000 USD - 20% APR&#x20;
* $20,000 USD - 15% APR

Their ‘Average Yield’ would be calculated as such:&#x20;

{($10,000 \* 12.5%) + ($10,000 \* 20%) + ($20,000 \* 15%)} / ($10,000 + $10,000 + $20,000) = 15.625%

## What is Remaining Capacity?

It is the difference between the maximum investment amount (fundraising target) and current committed investment by the DAO members.


# Gluwa Invest (Fixed-Term Interest Account) FAQ

A list of frequently asked question about how our Fixed-Term Interest Account operates

<figure><img src="/files/xhskXyCemOW23UsoUKef" alt=""><figcaption></figcaption></figure>

## What is the Fixed-Term Interest Account?

The Fixed-Term Interest Account (FTA) is an interest-bearing account that offers market-leading yields to investors by connecting you directly to world leading debt investment opportunities. Users must choose which investment deals they wish to partake in, and can then deposit their USDC stablecoins into the specified account to start accruing interest daily. Your deposit plus the interest you've earned can be drawn down when the deal matures.

## **How does the Fixed-Term Interest Account work?**

Gluwa vets and works with various best-in-class, VC-backed fintech lenders whose mission is to improve financial inclusion by serving the underbanked/unbanked in developing countries. Once vetted and approved, these fintech lenders can raise debt-financing through the FTA by opening an FTA investment pool, offering investors various deal terms to attract deposits.

When you deposit your USDC into one of these FTA investment pools, you are supplying these fintech lenders with junior tranche lending capital which they will then use as capital to fund their lending business operations. Upon completion of the deal, these fintech lenders will pay back the principal plus any interest earned.

In addition to comprehensive due diligence and legal repayment enforcement mechanisms, Gluwa also offers investors public risk assessments for every approved fintech fundraiser. Furthermore, you can also view certain approved fintechs’ credit performance live on the Creditcoin blockchain. If you’d like more information on how we generate our yields and protect our investors, please read [this](https://medium.com/gluwa-blog/gluwa-invest-our-approach-to-yield-4b9fef46744d) article.

## When can I draw down my funds after my investment?

After you have deposited your investment into an FTA investment pool and the deal has been closed, your principal, plus any interest earned, can be drawn down into your wallet after the specified investment maturity period. This can vary depending on the individual deal. This means that you will not be able to draw down your deposited funds plus any interest until the full deal maturity period has elapsed.

Exceptions to this rule occur when the FTA investment pool is ‘rejected’ or its minimum investment threshold is not reached. In these cases your funds will be available for immediate drawdown.

## Why do I have to provide proof-of-address?

We require certified proof of address in order to meet our AML/KYC compliance obligations.

## What is KYC and why do I have to do it?

KYC or Know Your Customer is a procedure any financial services company is obligated to go through to verify the identity of its users. The procedure fits within the broader scope of Anti-Money Laundering (AML) policy.

## What documents are acceptable for proof of address?

The below document types are acceptable address proofs, however, they are not sufficient on their own - we require the address proof to be **certified as a true copy of the original**.

This means, you will need to take the address proof to any professional to be 'certified' e.g. Attorney, Accountant, Broker, Auditor, Medical Doctor, Bank Manager, Broker, Actuary etc. It is this **certified address proof** that you will need to email to <verification@gluwa.com> prior to pay out of funds.

The document must clearly show your name and must match the residential address you provided during user sign-up.

**Single Document Address Proofs** (must be issued/dated within last 3 months)&#x20;

* *Utility bill/invoice (water or electric)*&#x20;
* *Bank statement*&#x20;
* *Letter/Certificate/Statement from a Tax Authority*&#x20;

**Combination Documents Address Proofs** (addresses must match and must be issued/dated within last 3 months where applicable)&#x20;

* *Credit card statement + Driving license*&#x20;
* *Cell phone statement + Credit card statement **OR** Driving license*&#x20;
* *Lease agreement + Cell phone statement*&#x20;
* *Letter from medical doctor + credit card statement **OR** Driving license*&#x20;
* *Reference letter signed by licensed professional (e.g. Accountant, Lawyer, Actuary, Broker, Banker) + credit card statement **OR** Driving license*&#x20;

All documents must show a residential address.

If you're not sure about this step, please reach out to us at <verification@gluwa.com>.

## Can I open a Fixed-Term Interest Account if I'm a U.S Citizen?

No. The Fixed-Term Interest Account is available in most countries worldwide except for the United States. We are currently working with our partners to make our products available to U.S. citizens. Join our waitlist [here](https://docs.google.com/forms/d/e/1FAIpQLScYLbJDO-B60Nq4kbfNrwmrv8tbgI-qdkHENgatvVqSFnc35A/viewform?usp=pp_url) to get notified when this happens.

## **What is the ‘approval’ transaction for?**

Before making your investment into an FTA investment pool, you must submit an approval transaction specifying the amount you wish to invest. Please be aware that this will cost ETH, and that you can only have one outstanding investment approval at any time.&#x20;

This approval transaction interacts with the FTA smart contract to 1) give it permission to draw the specified funds from your wallet and 2) provide the smart contract a way to uniquely identify you and your investment deposit.

## What does 'Available to Drawdown' mean?

The 'Available to Drawdown' balance is the amount you are able to draw down at that time. In other words, it is the total of your deposits that have matured, plus any interest you’ve earned.

## How is 'Average Yield’ calculated?

The ‘Average Yield’ displays the average expected yield of all of your active FTA investment deals. It is calculated by weighting your investment total against their average expected returns (interest rate). Please note that it only measures your active deals (non-matured).

For example, if a user had three active investment deals with the following deal terms:

* $10,000 USD - 12.5% APR&#x20;
* $10,000 USD - 20% APR&#x20;
* $20,000 USD - 15% APR

Their ‘Average Yield’ would be calculated as such:&#x20;

{($10,000 \* 12.5%) + ($10,000 \* 20%) + ($20,000 \* 15%)} / ($10,000 + $10,000 + $20,000 = $40,000) = 15.625%

## **How is 'Total Expected Interest' calculated?**

The ‘Total Expected Interest’ displays your total expected interest earned when all of your active FTA investment deals mature. It is calculated by aggregating your expected returns across all of your active FTA investment deals. Please note that this figure only measures your active deals (non-matured).

For example, if a user had three active investment deals with the following deal terms:&#x20;

* $10,000 USD - 12.5% APR&#x20;
* $10,000 USD - 20% APR&#x20;
* $20,000 USD - 15% APR

Their ‘Total Expected Interest’ would be calculated as such:&#x20;

($10,000 \* 0.125) + ($10,000 \* 0.2) + ($20,000 \* 0.15) = $6,250 USD

## Are there any tax implications for me using the Fixed-Term Interest Account?

Gluwa cannot provide any tax, legal or accounting advice. You should always consult your own tax, legal and accounting professional before engaging in any transaction.

We are required to collect tax information from you in the Subscription Agreement during Gluwa Invest user sign-up and verification.

## What is the maximum amount I am able to invest? Why is there an investment cap?

It depends. Our fintech lenders’ have specific fundraising requirements, meaning there is a limit to how much you can invest in any one Fixed-Term Interest Account. The maximum investment amount available to you is based on the total investment cap remaining for any given investment round. Once this round is fully funded and the investment cap is reached, no further investment will be accepted until we open the next investment round.

An investment cap exists to ensure we can accurately match the supply of investment funds with the corresponding demand for liquidity from our fintech lenders, ensuring that we only raise as much as they need. This supports our business model and ensures we can grow sustainably while finding the best impact investments out there!

<figure><img src="/files/qVCLilmqy7liP5KEWHk2" alt=""><figcaption></figcaption></figure>


# Create a New Gluwa Wallet

All you need is a smartphone to create Gluwa wallet.

![](/files/pKn1qIH4ZPgwMoDNKVnH)

## Install Gluwa Mobile Application

Download and install Gluwa mobile application for either [iOS](https://itunes.apple.com/us/app/gluwa/id1021292326) or [Android](https://play.google.com/store/apps/details?id=com.gluwa.android).

## Enter a Password and Create a New Wallet

All you need to create a new wallet is a password. We recommend using a long password to enhance your security. Make sure to write the password down in a safe place. You will need to re-enter the password to open your wallet again or make transfers.

{% hint style="warning" %}
Remember, you need both your smartphone and the password to open the wallet.

When you request to create a new wallet, Gluwa mobile app creates a random set of a private key and public key, which is your new wallet. The wallet is stored safely in the secure vault of your smartphone guarded by your password.

Also, the password is encrypted irreversibly using a hashing algorithm and the unique key of your device. Therefore, you need both your device and your password to access your wallet.
{% endhint %}

![](/files/mgqVHAP1YtmQ1LcqbO0Q)

## Backup the Recovery Phrase

Right after creating a new wallet, Gluwa shows a recovery phrase of your wallet. If you either lose your device or the password, you can retrieve your wallet by submitting the recovery phrase. Nobody without the recovery phrase can recover your wallet for you.

{% hint style="danger" %}
Make sure to backup your recovery phrase. You can submit the recovery phrase to restore the wallet. This is the ONLY way to restore your wallet if you lose access to your wallet for some reason (e.g., forgetting your password or your smartphone malfunctioning). It is impossible for Gluwa or anyone to restore the wallet for you.
{% endhint %}


# Restore Wallet

If you forgot your password, you can recover you wallet using the Recovery Phrase.

![](/files/geEjrnzR8kJER7C3NI27)

When you created a new Gluwa Wallet, you were prompted to note down the generated [Recovery Passphrase.](https://docs.gluwa.com/get-started/gluwa/create-a-new-gluwa-wallet#backup-the-recovery-phrase) In case you forgot your password, you can recover by entering all the Recovery Passphrase words.

1. On the Gluwa login screen, click on **Recover**
2. In the following screen, press on **Recover Wallet**
3. On the 'Enter Recovery Phrase' screen:
   1. Provide a new password
   2. Enter the recovery Phrase

<figure><img src="/files/ABZV2gLCZOKlLPo60BZj" alt=""><figcaption></figcaption></figure>


# Send Gluwacoin to an address

![](/files/kMOPDt3ognkLKn72hFPJ)

To send Gluwacoin to an address manually, you will need the receiver's ETH public address, which always starts `0x`.

1. From the **Send** section, type in the amount you want to transfer and press on **Next**
2. Paste or type in your receiver's ETH public address and press on **Next**
3. The Preview window will display the transaction details before completing the transfer
4. Re-enter your Gluwa password

{% hint style="info" %}
There is a transfer fee applied when you initiate a send transaction to another user.[ Read more about it here.](https://help.gluwa.com/hc/en-us/articles/360009770054?fbclid=IwAR3Qx62ZWa3-8A7mGxwKb7AvuURbJtoIAIEQ7xxM4cdqSsT5BYnLSdjaC-4)
{% endhint %}

You will see a confirmation screen once the transfer has been completed.

<figure><img src="/files/HFAWq6BkWyVfi0eZNXbN" alt=""><figcaption></figcaption></figure>


# Make QR Code Payments

You can simply scan a QR code to make a payment.

![](/files/cfHR2gvForh2NCBgOaqe)

## Scanning a QR Code

You can make payments to merchants via scanning their Gluwa QR Code. Open your Gluwa mobile app and scan the QR code to initiate a payment.

<figure><img src="/files/GbHu6NZwH24umxjfU0FQ" alt=""><figcaption></figcaption></figure>

## Making a Payment

Once you scan the QR code, Gluwa will show you a preview of the payment. Review and confirm the payment by submitting your Gluwa password.

<figure><img src="/files/uDbMDIt2qsyv3hzHm8eU" alt=""><figcaption></figcaption></figure>

## Payment Receipt

You will receive a receipt for your payment as soon as you submit your password. The merchant will get notified of your payment automatically. Since the payment was made on a blockchain, some merchants may choose to wait until your payment get confirmed by the blockchain. The confirmation time usually takes about a minute for Gluwacoins and ten minutes for Bitcoin.

<figure><img src="/files/SoGknXmMcSN6iZPArtEP" alt=""><figcaption></figcaption></figure>


# Create a Signature

You can sign a message with your wallet's private key

![](/files/hls4e8bYAzIuJJmXqP3z)

Just like signing a contract with a pen to authorize it, you can create a digital signature using the secret key of your wallet. A 3rd party can cryptographically verify that the signature was created by your secret key. Thus, the signature can be used approve a certain message.

## Signing a Message

Gluwa mobile app provides a simple interface for signing a message.

First, enter the menu screen from the bottom navigation tab. Find the Signature menu on the menu list and select it.

You will see the Sign screen.

Now, Gluwa app will display your address, message and signature.

![](/files/WE3cwHstmaC4uvWrLctM)


# Access Private Keys

Access your private keys

## Get Ethereum Wallet Address and Private Key from Gluwa

1. Open the Gluwa mobile app.
2. Open the wallet with the password you used to create the wallet.
3. Navigate \`Menu -> Private key and address\`
4. Submit your password again to review your private key and address.
5. You will see the private key and address of your Gluwacoin wallets (e.g., USD-G, KRW-G) which are Ethereum wallets. Note that you will see the same private key and address for all Gluwacoin wallets since they coexist in the same Ethereum wallet.


# Non-Custodial Wallet

Only you have access to your funds

Gluwa is a non-custodial wallet for Gluwacoins. The mobile application generates and stores your cryptocurrency wallet locally on your device and does not share it with anyone.

## Cryptocurrency Wallet

A cryptocurrency wallet is a set of private and public keys. You can think of the public key as the username and the private key as its password. You may share your username, but you will lose the sole-control of your wallet if you share your password.

### Software Wallet

A software wallet is a program that stores a cryptocurrency wallet. Also, the program provides a user interface to use your cryptocurrency wallet.

There are two categories of software wallet based on how they store secret keys: custodial and non-custodial.

### Custodial Wallet

A custodial wallet provider holds a copy of your secret key. Since the provider has the secret key, they also have access to your funds in the wallet.

### Non-custodial Wallet

A non-custodial wallet does not share your secret key with anyone but you. Therefore, only you have control of your funds in the wallet.


# Gluwa Lottery Account FAQ

Frequently Asked Questions regarding Gluwa's Lottery Account

## My Winnings

This is the total of all of your winnings or prizes won from the Lottery prize draws (in sUSDC-G).

## My Odds

This is the probability of you winning the prize draw. It is calculated after cut-off time (i.e. \~24 hours prior to the draw you have entered) and is a calculated based off total deposits in prize pool, total number of participants and the ticket range gap factor.


# Fees

Learn about transaction fees in Gluwa

There are two types of transaction fees in Gluwa: a transfer fee and a payment fee. The baseline is that fees are paid by whoever initiates the transaction. Note that we consider merchants to start payments, not customers, so the merchant pays the payment fee.

## Transfer fee

A transfer fee is applied when you initiate a send transaction to another user.

| **Currency**                     | **Transfer Fee**                                  |
| -------------------------------- | ------------------------------------------------- |
| USDC-G                           | 0.5 USDC-G                                        |
| sUSDC-G                          | 0.1%                                              |
| NGN-G                            | 100 NGN-G                                         |
| sNGN-G                           | 0 NGN-G                                           |
| BTC                              | [Market Price (BTC)](https://bitcoinfees.info/)   |
| ETH & ERC-20 (USDC - USDT - CTC) | [Market Price (ETH)](https://ethgasstation.info/) |

For Gluwacoin, the fee is almost fixed as above. The fee may increase if the Ethereum transaction fee [market price](https://ethgasstation.info/) gets unusually high.

For Bitcoin, the fee follows the [market price](https://bitcoinfees.info/). The same is true for Ethereum and ERC-20 token transfers. The network requires you to pay a transaction (*i.e.* gas) fee so you can interact with it. These fees are used to compensate miners for the energy required to verify a transaction and also provide an additional layer of security. There are no other fees.

By default, Gluwa mobile application adds the fee amount suggested by Gluwa. The transaction fee market of the blockchain determines the amount of its transaction fee, and the amount evolves. Gluwa follows the latest fee information and suggests an amount that is expected to process your transaction in a reasonable amount of time.

## Payment Fee

You may start making a payment by scanning a payment QR code with the Gluwa app. Since the merchant initiated the transaction by requesting it, the payer will not pay or see the fee information, but the merchant will.

| **Currency**                     | **Payment Fee**  |
| -------------------------------- | ---------------- |
| USDC-G                           | 1% + 0.5 USDC-G  |
| sUSDC-G                          | 1% + 0.5 sUSDC-G |
| NGN-G                            | 1% + 100 NGN-G   |
| sNGN-G                           | 1% + 100 NGN-G   |
| BTC                              | N/A              |
| ETH & ERC-20 (USDC - USDT - CTC) | N/A              |

For Gluwacoin, the fee is almost fixed as above. The fee may increase if the Ethereum transaction fee [market price](https://ethgasstation.info/) gets unusually high.

Gluwa does not support Bitcoin, ETH, USDC, USDT, or CTC payments.


# Transaction Status

Learn about types of transactions status

In Gluwa, there are three types of transaction status: complete, submitted, and failed.

* Confirmed: the transaction has one or more block-confirmation(s).
* Submitted: the transaction has been submitted but not yet confirmed (mined) on the blockchain. *Note: submitted ETH, USDT, and USDC transactions will not appear in your transaction history.*
* Failed: the transaction has failed, and you cannot expect it to get processed in the future. You will have to submit it again.

After creating a transaction, Gluwa periodically pulls information from the blockchain to confirm the transaction's status. We will update the status if we find any change.


# Delete your Gluwa Account

Learn how to delete your account

Please feel free to ask for your account to be deleted anytime. Send us an e-mail at <support@gluwa.com> stating that you would like to delete your account. Please include your User ID in the email. You must send the e-mail from the e-mail you used to create your account. Please also include the reason for your deletion request.

Our team will proceed with the account deletion within 3 business days and will let you know by e-mail when it is done.

Just so you know, if you have any active investments on our platform, we will not be able to proceed with your account deletion since that would mean losing access to your funds.


# Gluwa Dashboard

Learn how to acquire credentials necessary to use Gluwa.

Enhance your operation with Gluwa API's powerful features. With Gluwa dashboard, you can manage your Gluwa API credentials, webhook setup, and addresses.

## API Keys

Use API key and secret to use Gluwa's REST API and automate your business logic.

{% content-ref url="/pages/-LrWhfxQgdDcr8Oc-8vS" %}
[API Keys](/get-started/dashboard/api-keys)
{% endcontent-ref %}

## Webhook

Receive webhook notifications when you get a new transfer to your Gluwacoin address.

{% content-ref url="/pages/-LrWhVOkDSaexDS-G46W" %}
[Webhooks](/get-started/dashboard/webhooks)
{% endcontent-ref %}

## Addresses

Verify your ownership of a Gluwacoin address in order to receive webhook notifications, and transaction history for it.

{% content-ref url="/pages/-LrWsNDn4-pvq46skIX7" %}
[Addresses](/get-started/dashboard/addresses)
{% endcontent-ref %}

## Transactions

Easily view your transaction history for a registered address/currency

{% content-ref url="/pages/8epJLSxuuacykR0PDfoX" %}
[Transactions](/get-started/dashboard/transactions)
{% endcontent-ref %}


# API Keys

Acquire API key and secret to use the Gluwa API

## **Get Your API Key and Secret**

### Login to [Gluwa dashboard](http://dashboard.gluwa.com)

1. Visit the dashboard at <https://dashboard.gluwa.com>.
2. If you are not logged in already, you will get redirected to a login page.
3. Sign up to Gluwa if you do not have a Gluwa account yet.

![Login to Gluwa Dashboard](/files/-LrWjTTlNV6sl6tTGHR5)

### Open the [API Keys page](http://dashboard.gluwa.com/APIKey)

1. Visit the API Keys page at [https://dashboard.gluwa.com/apikey](https://dashboard.gluwa.com/ApiKey).
2. You will see an auto-generated API Key and secret of your account on the page.
3. Your API secret is covered in grey boxes by default for your security. Click on the eye shaped icon to reveal your API secret.

![API Keys Page on Gluwa Dashboard](/files/-LnhTmOvC7-TtUC28y9t)

{% hint style="danger" %}
Anyone with your API key and secret can make any API call on your behalf, such as creating a payment request. You should limit access to your API key and secret as much as possible. Do not store them in a shared repository such as your version control system.
{% endhint %}

{% hint style="warning" %}
**Sandbox API keys and Production API keys are different**. This ensures that you don't modify your live customers data or charge them accidentally.

Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.
{% endhint %}


# Webhooks

Set up webhook to your wallet and get notified

You can receive webhook notifications from Gluwa whenever an event associated with your Gluwacoin or Bitcoin wallet is triggered.

## Get Webhook Secret

1. Visit the Webhook Management page at <https://dashboard.gluwa.com/webhook>.
2. You will see an auto-generated Webhook Secret of your account on the page.
3. Your Webhook Secret is covered in grey boxes by default for your security. Click on the eye-shaped icon to reveal your Webhook Secret.

![Gluwa Dashboard Webhooks Page](/files/-Lnh_ASruWGradKPmXTL)

{% hint style="warning" %}
**Sandbox API keys and Production API keys are different.** This ensures that you don't modify your live customers data or charge them accidentally.

Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.
{% endhint %}

## Register Webhook Endpoint

1. Visit the Webhook Management page at <https://dashboard.gluwa.com/webhook>.
2. Click "REGISTER NEW URL" button.
3. Register your webhook endpoints.

![Webhook Endpoint Registration Page](/files/-LrWmBGMF2a7Tl9rPGTi)

After you've registered webhook endpoints, you must whitelist the wallet addresses to receive webhooks.

{% content-ref url="/pages/-LrWsNDn4-pvq46skIX7" %}
[Addresses](/get-started/dashboard/addresses)
{% endcontent-ref %}


# Addresses

Whitelist your wallet address and get webhook notifications

This guide assumes that you've setup your webhook endpoints already. If you haven't, follow the Webhook guide below first.

{% content-ref url="/pages/-LrWhVOkDSaexDS-G46W" %}
[Webhooks](/get-started/dashboard/webhooks)
{% endcontent-ref %}

## Register Your Wallet Address

Gluwa will listen to any event that occurs to registered addresses and send webhook notifications to the registered webhook URLs. Open [Gluwa Dashboard Registered Addresses](https://dashboard.gluwa.com/addresses) page to register your addresses.

![Register New Address Page](/files/-Lnk6KkpYgqakhQ98m_h)

Note that the form requires you to sign an arbitrary message with the private key of the address. The signature will prove your ownership of the address.

You can create the signature on Gluwa mobile application, or using any other third party apps like below:

1. MyEtherWallet (Ethereum)
2. MetaMask (Ethereum)
3. Electrum (Bitcoin)

{% hint style="info" %}
The above list of third party apps is not a comprehensive list. There are many other apps that provide message signing functionality, so you can use any of them.
{% endhint %}

{% content-ref url="/pages/-LrWmQMlAov5xy4MgGjb" %}
[Create a Signature](/get-started/gluwa/create-a-signature)
{% endcontent-ref %}

![Gluwa Dashboard Registered Addresses Page](/files/-Lnh_jTO78dIgpxEKkCU)

Once you register your address, Gluwa will send a webhook to your registered webhook URL each time any of the supported events occur on your address. You can find the supported events [here](/get-started/dashboard/webhooks#supported-events).


# Transactions

Easily view your transaction history for a registered address from the Gluwa Dashboard

This guide assumes that you've registered your wallet address already. If you haven't, follow the Addresses guide below first.

{% content-ref url="/pages/-LrWsNDn4-pvq46skIX7" %}
[Addresses](/get-started/dashboard/addresses)
{% endcontent-ref %}

## Access your Transaction History

To access your transaction history, simply click the Transactions option in the left menu:

![](/files/0eODptlqjFUq3F7eW6O0)

## Switch Addresses or Currencies

If you've registered multiple addresses on currencies, you can switch between them using the `Address` dropdown menu on the *Transaction History* page:\
![](/files/fMx4Ks3iS07ubR98Icdr)

## Filter Transactions

The Gluwa Dashboard gives you the ability to filter transactions using a variety of options, including:

* Merchant Order ID
* Date/time
* Payments only
* Amount (Min and/or Max)

To access the filters, press the Filter button on the far-right of the Transaction History view:

![](/files/uGw6P5F6wLb56Ei5RAkK)

## Export Transactions to a CSV File

The Gluwa Dashboard provides the ability to export your transactions to a comma-separated values ("CSV") file. To do this, select the address/currency you wish to export, then click the Export button on the far-right of the Transaction History view:<br>

![](/files/F6kT4N6a6NlPhcR0Z0ID)


# Gluwacoin

Learn what Gluwacoin is and how it works

Gluwacoin is a cryptographic token standard. It extends the ERC20 standard for tokens and adds functions for cross-blockchain exchanges. The issuer can create Gluwacoin by different types of minting mechanisms such as wrapping, locking, or pegging and by pegging it to a different underlying asset. For example, you can wrap USD Coin into a Gluwacoin. Further, Gluwacoin supports its users to pay network fees in the token, not the cryptocurrency of the network.

Learn more about Gluwacoin [here](https://www.gluwacoin.com).


# Buttons and Marks

Learn how to use Gluwa buttons and marks

The system provides several Gluwa button types and styles you can use in your app or website. In contrast to the Gluwa buttons, you use the Gluwa mark to communicate the availability of Gluwa as a payment option.

Don't create your own Gluwa button design or attempt to mimic the system-provided button designs.

## Button

Gluwa button let users know they can initiate Gluwa payment. Gluwa designed several types of buttons so that you can choose the button type that fits best with the design of your purchase experience.

{% file src="/files/-MXWX\_-hkKpPZkbdwIPx" %}

### Button Types

#### Gluwa Blue

Use on white or very light-colored backgrounds that provide sufficient contrast. Don’t use on black or dark backgrounds.

![Gluwa Blue](/files/-MXW4kk8g3EdPa2dpaIX)

#### Gluwa Navy

Use on white or light-colored backgrounds that provide sufficient contrast. Don’t use on black or dark backgrounds.

![Gluwa Navy](/files/-MXW4yGLqKi_6GcBW6VW)

#### White with Outline

Use on white or light-colored backgrounds that don’t provide sufficient contrast. Don’t place on dark or saturated backgrounds.

![](/files/-MXW5agRjY8QDmZuIune)

#### White

Use on dark or colored backgrounds that provide sufficient contrast.

![White](/files/-MXW58FuIiLODJTE3bfd)

## Mark

Use the Gluwa mark graphic to show that Gluwa is an available payment option when showing other payment options in a similar manner. The Gluwa mark is not a button; if you need a Gluwa button, choose one of the buttons described in [Button Types](/design/buttons-and-marks#button-types).

{% file src="/files/-MXW7FUV7JIzZUWaadHg" %}

![](/files/-MXWWlvrtjoLrMf8oiAC)


# Environments

Gluwa currently only supports the Production environment.

In the future, we tentatively plan to add support for Testnet chains, if there is demand for such functionality.

**Production Environment**

* Dashboard: <https://dashboard.gluwa.com>
* API: <https://api.gluwa.com>


# QR Codes

Explore ways to integrate Gluwa QR code payments in your website or mobile app.

Collecting payments on Gluwa consists of creating a payment [QR code](https://en.wikipedia.org/wiki/QR_code) and having the user scan the QR code with Gluwa mobile application to make a payment. You can optionally sign up for a webhook notification to get notified when you receive payments.

This guide shows you how to include Gluwa QR codes on your checkout pages.

## Types of QR Code

Gluwa has three types of QR code:

* **Transfer QR Code**: A user can generate Transfer QR code using Gluwa mobile application. If you scan the QR code using Gluwa mobile application, you initiate a transfer to the user. This QR code initiates an exact amount transfer. So you see the fee information on the transaction summary page.
* **Payment QR Code**: A user can generate Payment QR code using Gluwa API. The user needs to obtain API keys to do this. This QR code forces the receiver to pay the fee. This means that Gluwa mobile application does not show the fee information on the transaction summary page.
* [**Send Address QR Code**](/development/sending-address): A user can create a QR code to trigger Gluwa mobile application to send its address. If a user scans the QR code, Gluwa mobile application will send its address to the predefined target URL.

## Creating Payment QR Codes

To create a new QR code, submit an API request to the [Create Payment QR Code endpoint](/api/qr-code) with the API key and secret.

{% content-ref url="/pages/-LrWhfxQgdDcr8Oc-8vS" %}
[API Keys](/get-started/dashboard/api-keys)
{% endcontent-ref %}

You will need to generate a new QR code each time you need to receive a payment from a user.

### QR Code Example

After successfully submitting your API request, you will get a QR code image file like below:

![Payment QR Code Example](/files/-LojSq-0fOzAWU8x0PjV)

## Display Payment QR Code

Now, display the QR code to your customers and ask for a payment. They can simply scan the QR code to make the payment.

{% content-ref url="/pages/-Lonid9wMQvaXTmwCANt" %}
[Make QR Code Payments](/get-started/gluwa/make-qr-code-payments-1)
{% endcontent-ref %}


# Webhooks

Use webhooks to be notified about events that happen in a Gluwa account.

You can receive a webhook notification from Gluwa when there is a transaction associated with your account. Note that Gluwa only notifies you if the transaction or an exchange was created by using Gluwa API.

To integrate Gluwa webhook to your service you need to:

1. Create a webhook endpoint and on your server
2. Register your webhook endpoint
3. Verify your address

## Step 1: Create a Webhook Endpoint

Create an endpoint that would accept the webhook requests and process them according to your business logic.

Webhook is sent as a POST request to the URL you will register in [Step 2](/get-started/dashboard/webhooks#register-webhook-endpoint). The webhook may or may not have a request body depending on the type of the event. For more information, see [Supported Webhook Events](/development/webhooks#supported-webhook-events).

### Checking the veracity of a request using X-REQUEST-SIGNATURE

To verify that the webhook is actually sent by Gluwa, you must check the validity of`X-REQUEST-SIGNATURE` header. This involves generating `X-REQUEST-SIGNATURE` value on your own server and comparing it against the value of the `X-REQUEST-SIGNATURE` header sent with the webhook.

To generate `X-REQUEST-SIGNATURE`:

1. Get your webhook secret from the [Gluwa Dashboard Webhooks](https://dashboard.gluwa.com/Webhook) page&#x20;
2. Get the request body you received
3. Run the following formula:

{% code title="Generating X-REQUEST-SIGNATURE for a Webhook" %}

```csharp
Base64UrlSafeEncode(HMACSha256({request body in JSON string}, {webhook secret}))
```

{% endcode %}

{% hint style="warning" %}
The request body JSON string must be in minified format, meaning no spaces and line breaks between JSON keys and values.
{% endhint %}

Compare the resulting value with the `X-REQUEST-SIGNATURE` header from the webhook. If identical, you have successfully verified the signature.

## Step 2: Register your webhook endpoint

The webhook will be sent to URLs that are registered through [Gluwa Dashboard](https://dashboard.gluwa.com). Visit the page below to learn how to register your webhook endpoint.

You may use online webhook testing tools such as [Webhook.site](https://webhook.site/) to test the webhook.

{% content-ref url="/pages/-LrWhVOkDSaexDS-G46W" %}
[Webhooks](/get-started/dashboard/webhooks)
{% endcontent-ref %}

## Step 3: Whitelist your wallet address

You will receive webhooks only for the events involving whitelisted wallet addresses. Visit the page below to learn how to whitelist your wallet address.

{% content-ref url="/pages/-LrWsNDn4-pvq46skIX7" %}
[Addresses](/get-started/dashboard/addresses)
{% endcontent-ref %}

## Supported Webhook Events

Currently, we support webhooks for the following events:

1. Transaction Confirmed
2. Transaction Created
3. Transaction Failed
4. Exchange Success
5. Exchange Failed

{% hint style="info" %}
If you generated your webhook secret prior to October 8th, 2020, see [V1 webhook](/development/webhooks#version-1-v-1-webhook-events). Else, see [V2 webhook](/development/webhooks#version-2-v-2-webhook-events).
{% endhint %}

### Version 1 (V1) Webhook Events

#### Common Fields For All Webhook Requests

| Attribute  | Type     | Description                                                                                                                                                                                                                                                              |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| EventType  | `string` | <p>The event type<br></p><p><code>TransactionConfirmed</code>, <code>TransactionCreated</code>, <code>TransactionFailed</code>, <code>ExchangeSuccess</code>, <code>ExchangeFailed</code></p>                                                                            |
| Type       | `string` | Always "Webhook"                                                                                                                                                                                                                                                         |
| ResourceID | `string` | <p>The ID of the resource.<br></p><p>For <code>TransactionConfirmed</code>, <code>TransactionCreated</code>, <code>TransactionFailed</code>, this is the transaction hash.</p><p>For <code>ExchangeSuccess</code>, <code>ExchangeFailed</code>, this is the order ID</p> |

#### Transactions Related Events Only

| Attribute       | Type     | Description                   |
| --------------- | -------- | ----------------------------- |
| MerchantOrderID | `string` | The merchant order ID         |
| Amount          | `string` | The amount that was received. |

#### Exchanges Related Events Only

| Attribute            | Type     | Description                                                                                                 |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| OrderAmountRemaining | `string` | Amount remaining in the order                                                                               |
| Conversion           | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols). |
| SendingAddress       | `string` | The address where the source amount was sent from.                                                          |
| ReceivingAddress     | `string` | The address where the exchanged amount was received.                                                        |
| SourceAmount         | `string` | The amount that was sent in source currency.                                                                |
| Price                | `string` | The price used for the exchange. The unit is `<exchanged currency>/<source currency>`.                      |
| ExchangedAmount      | `string` | The amount that was received in exchanged currency.                                                         |

### Version 2 (V2) Webhook Events

#### Common Fields For All Webhook Requests

| Attribute       | Type       | Description                                                                                                                                                                                                                 |
| --------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID              | `UUID`     | The ID of the webhook.                                                                                                                                                                                                      |
| CreatedDateTime | `datetime` | The created date and time of the webhook.                                                                                                                                                                                   |
| ResourceType    | `string`   | <p>The type of the resource.</p><p></p><p><code>Transaction</code>, <code>Exchange</code></p>                                                                                                                               |
| EventName       | `string`   | <p>The name of the event.</p><p></p><p><code>TRANSACTION.CONFIRMED</code></p><p><code>TRANSACTION.CREATED</code></p><p><code>EXCHANGE.SUCCESS</code></p><p><code>EXCHANGE.FAILED</code></p>                                 |
| Summary         | `string`   | The summary of the webhook.                                                                                                                                                                                                 |
| Resource        | `obj`      | <p>The resource associated with the webhook. This can be either:</p><ol><li><a href="/pages/-LnhVIoB6u1R6CHDX0S0#transaction">Transaction</a></li><li><a href="/pages/-LnhVIoB6u1R6CHDX0S0#exchange">Exchange</a></li></ol> |

#### Transaction

| Attribute       | Type     | Description                                                                                                                                                                                                                                                                                                                                                                  |
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID              | `UUID`   | Gluwa's internal transaction ID.                                                                                                                                                                                                                                                                                                                                             |
| TxHash          | `string` | The created date and time of the webhook.                                                                                                                                                                                                                                                                                                                                    |
| Source          | `string` | The address of the sender.                                                                                                                                                                                                                                                                                                                                                   |
| Target          | `string` | The address of the receiver.                                                                                                                                                                                                                                                                                                                                                 |
| Amount          | `string` | Transaction amount, not including the fee. This is the amount that the receiver receives.                                                                                                                                                                                                                                                                                    |
| Fee             | `string` | The fee amount.                                                                                                                                                                                                                                                                                                                                                              |
| Currency        | `string` | <p>The <a href="/pages/-M5-1GpWAZ5Cnf76d3Bq#currency-symbols">currency</a> of the transaction.</p><p></p><p>Webhook does not support <code>BTC</code> Transactions.</p>                                                                                                                                                                                                      |
| Status          | `string` | <p>The status of the transaction.<code>Unconfirmed</code>, <code>Confirmed</code>, or <code>Failed</code>.<br></p><p>Unconfirmed - The transaction was announce to the blockchain, but is not included in any block yet.<br>Confirmed - The transaction was included in the blockchain and received a confirmation. Failed - The transaction has failed for some reason.</p> |
| MerchantOrderID | `string` | Used by the receiver of the receiver of the transaction to identify a payment. Supported by QR code payment feature only.                                                                                                                                                                                                                                                    |
| Note            | `string` | A message attached to the transaction. It is an optional memo you can associate with the transaction.                                                                                                                                                                                                                                                                        |

#### Exchange

| Attribute            | Type     | Description                                                                                                 |
| -------------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| ID                   | `UUID`   | The ID of the order.                                                                                        |
| OrderAmountRemaining | `string` | Amount remaining in the order.                                                                              |
| Conversion           | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols). |
| SendingAddress       | `string` | The address where the source amount was sent from.                                                          |
| ReceivingAddress     | `string` | The address where the exchanged amount was received.                                                        |
| SourceAmount         | `string` | The amount that was sent in source currency.                                                                |
| Price                | `string` | The price used for the exchange. The unit is `<exchanged currency>/<source currency>`.                      |
| ExchangedAmount      | `string` | The amount that was received in exchanged currency.                                                         |


# Creating Signatures

## Signature

A signature helps us to verify that a piece of data was signed by a specific wallet account. There are two types of signatures used in Gluwa API:

1. Address Signature
2. Transaction Signature

## Address Signature

Address signature is used to verify the ownership of a cryptocurrency (e.g., [Bitcoin](https://en.wikipedia.org/wiki/Bitcoin) or [Ethereum](https://en.wikipedia.org/wiki/Ethereum)) wallet. A cryptocurrency wallet is a set of a private key and a public key. To generate a signature, you sign a message (or a piece of data) with your private key, and then anyone with your public key can verify the integrity of your signature. To prevent the same signature used over and over again, our APIs mandates the users to use Unix timestamp as the message. The server will check if the timestamp was created no more than 10 minutes ago, and if it has been over 10 minutes, it will deny the request.

### Generating Address Signature for Gluwacoins (USD-G, KRW-G, NGN-G)

Since Gluwacoins, such as USD-G, KRW-G and NGN-G, are ERC20 tokens, you can sign a message just like you would on any Ethereum based address. There are libraries out there that can help you create signatures. Some examples include:

1. [web3.js](https://github.com/ethereum/web3.js). (JavaScript)
2. [Nethereum](https://github.com/Nethereum/Nethereum/) (C#)

{% tabs %}
{% tab title="JavaScript (web.js)" %}

```javascript
var Web3 = require('web3');

...

// replace with your own message and privakey
var message = "1587674497";
var privateKey = "0x18cffe0cd4eb63809d0e55ed8dd1aa29e3ac660088e82f7a82977c458f334d8b";

var web3 = new Web3(Web3.givenProvider);
var obj = web3.eth.accounts.sign(message , privateKey);

// signature: 0x96322ca1b963c98e33fe1296b504d3c7adfcfd4e8473bf92f6ee24b560497d16390404a4f9f241d9efdd02cf1fea79d0ebf45d4aa2ef47a4c97fa06750e242301c
var signature = obj.signature;


```

{% endtab %}

{% tab title="C# (Nethereum)" %}

```csharp
using Nethereum.Signer;

...

// replace with your own message and privakey
string message = "1587674497";
string privateKey = "0x18cffe0cd4eb63809d0e55ed8dd1aa29e3ac660088e82f7a82977c458f334d8b";

EthereumMessageSigner signer = new EthereumMessageSigner();

// signature: 0x96322ca1b963c98e33fe1296b504d3c7adfcfd4e8473bf92f6ee24b560497d16390404a4f9f241d9efdd02cf1fea79d0ebf45d4aa2ef47a4c97fa06750e242301c
string signature = signer.EncodeUTF8AndSign(message, new EthECKey(privateKey));


```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
In production environment, your private key should never be hard coded like above. Private keys must be kept secret and be handled with utmost care.
{% endhint %}

### Generating Address Signature for Bitcoin

There are unofficial Bitcoin libraries you can use to create the signature. Some examples include:

1. [BitcoinJS](https://github.com/bitcoinjs/bitcoinjs-lib) (JavaScript)
2. [NBitcoin](https://github.com/MetacoSA/NBitcoin) (C#)

{% tabs %}
{% tab title="BitcoinJS (JavaScript)" %}

```javascript
var bitcoin = require('bitcoinjs-lib');
var bitcoinMessage = require('bitcoinjs-message');

...

// replace with your own message and privakey
var network = bitcoin.networks.bitcoin;
var message = "1587674497";
var privateKeyString = "KwJfd6xHiqtEFBawy8tKPyJ9TFKQCqHpMr8DQVJ9LbUBj21jqFjE";

var keyPair = bitcoin.ECPair.fromWIF(privateKeyString, network);
var privateKey = keyPair.privateKey;

// signature: H8Gc4g7/X+JsHZyV/qjQSMg9ivoopMztzx9efeV+a+eAJ7Y45OnEi3qmhVWaL743jofge4gQVapzAVsHFSSpBSk=
var signature = bitcoinMessage
        .sign(message, privateKey, keyPair.compressed)
        .toString('base64');


```

{% endtab %}

{% tab title="NBitcoin (C#)" %}

```csharp
using NBitcoin;

...

// replace with your own message and privakey
string message = "1587674497";
string privateKey = "KwJfd6xHiqtEFBawy8tKPyJ9TFKQCqHpMr8DQVJ9LbUBj21jqFjE";

BitcoinSecret secret = Network.Main.CreateBitcoinSecret(privateKey);

// signature: H1iG0zN+TmigcsHDUw2XQo0Wd0LKXbDVG8yr104I0g64cB1kq6WUPKUiI1oNc9Uo9hCRFlfZ3UcALJZNCSy1ZjY=
string signature = secret.PrivateKey.SignMessage(message);

// OR you don't have to force low R. Both format is accepted
// signature: H8Gc4g7/X+JsHZyV/qjQSMg9ivoopMztzx9efeV+a+eAJ7Y45OnEi3qmhVWaL743jofge4gQVapzAVsHFSSpBSk=
signature = secret.PrivateKey.SignMessage(Encoding.UTF8.GetBytes(message), false);


```

{% endtab %}
{% endtabs %}

## Transaction Signature

To create a transaction, you must create a signature of the transfer information so that Gluwa can submit it to the blockchain as a proof-of-intention. Think of signature as a signed contract. You send the contract to Gluwa to submit it to the blockchain for you. The authority (Gluwacoin smart contract or Bitcoin blockchain in this case) can verify that the information in the contract is genuine with your signature.

### Generating Transaction Signature for Gluwacoins (USD-G, KRW-G, NGN-G)

Gluwacoin is an [ERC-20](https://en.wikipedia.org/wiki/ERC-20) token. Users can transfer Gluwacoin as they would transfer any other ERC-20 token. To move tokens on the blockchain, you would normally have to spend Ether to cover the gas for the transaction. However, Gluwacoin allows you to move the coins by paying gas in Gluwacoin instead of Ether. We call this *ETHless transfer*.

You are going to need the contract addresses to make a transaction signature. Use the following addresses.

{% tabs %}
{% tab title="Production" %}
**ERC20 Contract Addresses**

* USD-G Gluwacoin - [0xfb0aaa0432112779d9ac483d9d5e3961ece18eec](https://etherscan.io/token/0xfb0aaa0432112779d9ac483d9d5e3961ece18eec)
* KRW-G Gluwacoin - [0x4cc8486f2f3dce2d3b5e27057cf565e16906d12d](https://etherscan.io/token/0x4cc8486f2f3dce2d3b5e27057cf565e16906d12d)
* NGN-G Gluwacoin - [0x4AB30B965A8Ef0F512DA064B5e574d9Ad73c0e79](https://etherscan.io/token/0x4AB30B965A8Ef0F512DA064B5e574d9Ad73c0e79)
  {% endtab %}
  {% endtabs %}

To create a Transaction Signature, you can use well known libraries like [web.js](https://github.com/ethereum/web3.js) or [Nethereum](https://github.com/Nethereum/Nethereum/).

{% tabs %}
{% tab title="web3.js (JavaScript)" %}

```javascript
var Web3 = require('web3');

...

// replace the values below with your own values
var contractAddress = "0xfb0aaa0432112779d9ac483d9d5e3961ece18eec"; // USD-G contract
var sourceAddress = "0x3E6d16c11497aD1A2F47a6594d995f1FaaE727d9";
var sourcePrivateKey = "0x18cffe0cd4eb63809d0e55ed8dd1aa29e3ac660088e82f7a82977c458f334d8b";
var targetAddress = "0xc4f7fDf5EB4a1204dCa3BeC609f9E457C4fF9844";
var amount = 100; // sending 100 USD-G
var fee = 0.5; // fee is 0.5 USD-G
var nonce = 1;

var web3 = new Web3(Web3.givenProvider);

var hash = web3.utils.soliditySha3({ t: 'address', v: contractAddress },
    { t: 'address', v: sourceAddress },
    { t: 'address', v: targetAddress },
    { t: 'uint256', v: web3.utils.toWei(amount.toString(), 'ether') },
    { t: 'uint256', v: web3.utils.toWei(fee.toString(), 'ether') },
    { t: 'uint256', v: nonce });
    
var obj = web3.eth.accounts.sign(hash , sourcePrivateKey);

// signature: 0x8fa899ec93a3f20b5294bed40ab33bac0913b0c9670a48795b99ff8f994526b95e6ff5d7e8ef2ab99c4b1edaf70569b549ba3747e7b4e43ade28405035777bfb1b
var signature = obj.signature;



```

{% endtab %}

{% tab title="Nethereum (C#)" %}

```csharp
using Nethereum.ABI;
using Nethereum.Signer;
using Nethereum.Util;
using Nethereum.Web3;
using System.Numerics;

...

// replace the values below with your own values
string contractAddress = "0xfb0aaa0432112779d9ac483d9d5e3961ece18eec"; // USD-G contract
string sourceAddress = "0x3E6d16c11497aD1A2F47a6594d995f1FaaE727d9";
string sourcePrivateKey = "0x18cffe0cd4eb63809d0e55ed8dd1aa29e3ac660088e82f7a82977c458f334d8b";
string targetAddress = "0xc4f7fDf5EB4a1204dCa3BeC609f9E457C4fF9844";
decimal amount = 100m; // sending 100 USD-G
decimal fee = 0.5m; // fee is 0.5 USD-G
BigInteger nonce = new BigInteger(1);


ABIEncode abiEncode = new ABIEncode();

byte[] hash = abiEncode.GetSha3ABIEncodedPacked(
                new ABIValue("address", contractAddress),
                new ABIValue("address", sourceAddress),
                new ABIValue("address", targetAddress),
                new ABIValue("uint256", Web3.Convert.ToWei(amount, UnitConversion.EthUnit.Ether)),
                new ABIValue("uint256", Web3.Convert.ToWei(fee, UnitConversion.EthUnit.Ether)),
                new ABIValue("uint256", nonce)
                );

EthereumMessageSigner messageSigner = new EthereumMessageSigner();

// signature: 0x8fa899ec93a3f20b5294bed40ab33bac0913b0c9670a48795b99ff8f994526b95e6ff5d7e8ef2ab99c4b1edaf70569b549ba3747e7b4e43ade28405035777bfb1b
string signature = messageSigner.Sign(hash, sourcePrivateKey );

```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Note that when you generate the transaction signature, you must multiply the amount and the fee by 10^18 (1,000,000,000,000,000,000). For example, if you want to transfer 10 USD-G, the value for the amount when you create transaction signature must be 10,000,000,000,000,000,000. However, the amount in the transaction request body must be 10.
{% endhint %}

### Generating Transaction Signature for Bitcoin

Create and sign Bitcoin transaction like you normally would. You can use well known libraries like [BitcoinJS](https://github.com/bitcoinjs/bitcoinjs-lib) or [NBitcoin](https://github.com/MetacoSA/NBitcoin).

{% tabs %}
{% tab title="BitcoinJS (JavaScript)" %}

```javascript
var bitcoin = require('bitcoinjs-lib');
var bitcoinMessage = require('bitcoinjs-message');

...


var btcToSatoshi = 100000000;

// replace the values below with your own values
var network = bitcoin.networks.bitcoin;
var sourceAddressString = "12koEsMzrdxuZ71ATU1a5jgZyUYtf3debA";
var sourceAddressPrivateKey = "KwJfd6xHiqtEFBawy8tKPyJ9TFKQCqHpMr8DQVJ9LbUBj21jqFjE";
var targetAddressString = "14NYL22gWLrVPEdjM6W5oJXcWyu496kZCQ";
var amountToSend = 0.001;
var fee = 0.00006;
var previousTxnHash = "e52fd66f35c48e690d8caada1a881ebb11912c479783f51f839a8827a9afcad4";
var unspentOutputAmount = 0.03800757;
var unspentOutputIndex = 1;
    
var keyPair = bitcoin.ECPair.fromWIF(sourceAddressPrivateKey, network);
   
var txnBuilder = new bitcoin.TransactionBuilder(network);
txnBuilder.addInput(previousTxnHash, unspentOutputIndex);
txnBuilder.addOutput(sourceAddressString, (unspentOutputAmount - amountToSend - fee) * btcToSatoshi);
txnBuilder.addOutput(targetAddressString, amountToSend * btcToSatoshi);
txnBuilder.sign(0, keyPair);

var txn = txnBuilder.build();

// signature: 0200000001d4caafa927889a831ff58397472c9111bb1e881adaaa8c0d698ec4356fd62fe5010000006b483045022100f5e8970b5cb154e96d5696f8fa2c36fabb3e86caf2cd681490448b38403ee92b0220797a0f61f869173d4dbf65894b772cb953349defe2b6275872f0a0b3bc01b86a0121034274d104b6d68ebf109ae3cd35cd53e8b8cd359bedf5598a92033292ae7f76a4ffffffff02a5603800000000001976a91413409c509b056480b21e54d0c5d2b87965eff65188aca0860100000000001976a91424fb438587b31ffd7612f4fbf6d67e21f4bb3ec788ac00000000
var signature = txn.toHex();


```

{% endtab %}

{% tab title="NBitcoin (C#)" %}

```csharp
using NBitcoin;

...

// replace the values below with your own values
Network network = Network.Main;
string sourceAddressString = "12koEsMzrdxuZ71ATU1a5jgZyUYtf3debA";
string sourceAddressPrivateKey = "KwJfd6xHiqtEFBawy8tKPyJ9TFKQCqHpMr8DQVJ9LbUBj21jqFjE";
string targetAddressString = "14NYL22gWLrVPEdjM6W5oJXcWyu496kZCQ";
decimal amountToSend = 0.001m;
decimal fee = 0.00006m;
string previousTxnHash = "e52fd66f35c48e690d8caada1a881ebb11912c479783f51f839a8827a9afcad4";
string previousTxnScriptPubKey = "76a914b797bc584c969a2b6b5e613c5ab86b5de57c07ec88ac";
Money unspentOutputAmount = Money.Parse("0.03800757");
uint unspentOutputIndex = 1;

BitcoinAddress sourceAddress = BitcoinAddress.Create(sourceAddressString, network);
BitcoinAddress targetAddress = BitcoinAddress.Create(targetAddressString, network);
BitcoinSecret secret = new BitcoinSecret(sourceAddressPrivateKey, network);

TransactionBuilder builder = network.CreateTransactionBuilder();
Transaction txn = builder
                .AddKeys(secret)
                .AddCoins(
                    new Coin(
                        fromTxHash: new uint256(previousTxnHash),
                        fromOutputIndex: unspentOutputIndex,
                        amount: unspentOutputAmount,
                        scriptPubKey: Script.FromHex(previousTxnScriptPubKey)
                    )
                )
                .Send(targetAddress, amountToSend.ToString())
                .SetChange(sourceAddress)
                .SendFees(fee.ToString())
                .BuildTransaction(true);

// signature: 0100000001d4caafa927889a831ff58397472c9111bb1e881adaaa8c0d698ec4356fd62fe50100000000ffffffff02a0860100000000001976a91424fb438587b31ffd7612f4fbf6d67e21f4bb3ec788aca5603800000000001976a91413409c509b056480b21e54d0c5d2b87965eff65188ac00000000
string signature = txn.ToHex();


```

{% endtab %}
{% endtabs %}

Note that the above is just an example. The number of inputs and outputs may differ for each transaction so you may have to rearrange inputs and outputs accordingly.

## Reserve Signature

When a market consumer and a market provider agree to exchange currencies, they need to lock the amount that they promised to send to each other so that those funds are available when the exchange actually happens. This process is called “Reserving.”

Since we don’t save the private keys of any user in our system, the user has to give us the txn signature for the reserving funds. There are two types of reservation:

Gluwacoin reservation

Bitcoin reservation

## Execute Signature

## Reclaim Signature


# Idempotent Requests

When creating a transaction, the API supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally processing the same operation twice. In case your request is disrupted, and you do not receive a response, you can retry the same request using the same idempotency key to guarantee that you don't create two identical transactions.

To make an idempotent transaction request, provide a value for the `Idem` attribute in the [Transaction](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-M4pEZ8L7EwSLFdquoYR/api/transaction#request-body) request body. The `Idem` value must be `UUID` to guarantee the uniqueness of the transaction. If Gluwa already received a request with the same Idem value and the transaction has begun processing, any subsequent requests that use the same Idem value will be denied with 409 response regardless of whether the first transaction succeeded or failed.


# Sending Address

Use QR code scanner on Gluwa mobile app to get wallet address from your user.

## Update

Add support universal link (03/03/2021)

## About Send Address

In this section, you will learn how to get Gluwacoin address or Bitcoin address from a user to your server.\
There are two ways to send address. If possible, it is recommended to use both methods in parallel.

**The Steps of Send Address (using QR code)**

1. Create a QR code meeting the send address standard.
2. A user scans the QR Code with the camera inside Gluwa mobile app.
3. The app sends the address as a web request to the API URL defined within the QR code.
4. The API may make a respond and tell the user the address was successfully received.

**The Steps of Send Address (using universal link)**

1. Create a universal link url meeting the send address standard.
2. Users click this link on their mobile device to open the Gluwa app.
3. If the user has not installed the app, the user is landed on a page that recommends installing the Gluwa app.

### Send address data parameters

| Key         | Required | Description                                                                                                                                                                          |
| ----------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| QrType      |  `true`  | This value must be `SendAddress` .                                                                                                                                                   |
| Key         |  `true`  | A key to identify the user. You can set any value that fits your requirements.                                                                                                       |
| Message     |  `false` | A message shown in the send address preview screen. If there is any information the user must know, you can put it in this field.                                                    |
| ServiceName |  `true`  | The service name shown in the send address preview screen.                                                                                                                           |
| TargetUrl   |  `true`  | The API URL where you will receive the address. Shown in the send address preview screen.                                                                                            |
| Currency    |  `true`  | Set the currency of the address you want to receive. See [Currency and Conversion Symbols](/api/currency-and-conversion-symbols#currency-symbols) for a list of available currencies |
| Environment |  `true`  | Set the environment of the address you want to receive. `prod` `sandbox`                                                                                                             |

{% hint style="info" %}
Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.
{% endhint %}

### Creating a QR Code for Send Address (using QR code)

In this section, we describe what information you need to include in the QR Code to receive address information from the user.

#### QR Code Example

![QR Code Example](https://chart.googleapis.com/chart?chs=400x400\&cht=qr\&chl=%7B%22Key%22:%22Key%20Example%22,%22Message%22:%22Message%20Example%22,%22ServiceName%22:%22Example%20Service%20Name%22,%22TargetUrl%22:%22https://your-service.com/api-url%22,%22QrType%22:%22SendAddress%22,%22Currency%22:%22USDG%22,%22Environment%22:%22prod%22%7D)

Generate a QR code using send address data parameters. There are QR code generator libraries published on the web. e.g <https://github.com/cozmo/jsQR>

```javascript
// example code when using cozmo/jsQR
import jsQR from "jsqr";

const width = 300;
const height = 300;
const sendAddressData = {
    QrType: 'SendAddress',
    Key: 'Your user\'s unique key',
    Message: 'The message to be exposed to the user',
    ServiceName: 'Your service\'s name',
    TargetUrl: 'Your service\'s api url',
    Currency: 'sUSDCG',
    Environment: 'prod',
};

const code = jsQR(sendAddressData, width, height);
```

### Scanning the Send Address QR Code

#### Universal link Example

```markup
<a href="https://app.gluwa.com/action/scan/%7B%22currency%22%3A%22BTC%22%2C%22Target%22%3A%22TEST%22%7D">
    Connect to Gluwa app
</a>
```

The universal link url can be created as follows.

```javascript
const sendAddressData = {
    QrType: 'SendAddress',
    Key: 'Your user\'s unique key',
    Message: 'The message to be exposed to the user',
    ServiceName: 'Your service\'s name',
    TargetUrl: 'Your service\'s api url',
    Currency: 'sUSDCG',
    Environment: 'prod',
};

const url = `https://app.gluwa.com/action/scan/${encodeURIComponent(JSON.stringify(sendAddressData))}`;
```

### After open Gluwa app

Once the user scans the send address QR code or click universal link, the user will get redirected to a send address preview screen. There, the user can either confirm to send his address by pressing `SEND ADDRESS` button on the bottom or cancel the process by pressing the cancel icon on the upper right corner.

![Send Address Preview Screen](/files/-MCHquyS4oryQIYjTbip)

### Sending the Address

Once the user confirms the information on the send address preview screen and press the `SEND ADDRESS` button, the mobile app makes a `POST` http request with the address information. The app encodes `Key` value and `Address` as JSON and include it in the request body. The request is sent to the target URL as defined in the `TargetUrl`.

#### `POST` Request

```
{
    "Key": "as defined in the Send Address QR Code",
    "Address": "Address of the user"
}
```

### Response

After receiving the Address information, you can send the result as a response message to the user.

| Key     | Required | Description |
| ------- | :------: | ----------: |
| Code    |  `true`  | `200` `201` |
| Message |  `false` |    `String` |


# Gluwa SDK for PHP

If your service is developed in PHP, the features we provide are available through the SDK. The Gluwa SDK for PHP is a library with powerful features that enable PHP developers to easily make requests to the Gluwa APIs.

## Update

v1.0.9 - Add support sUSDCG (01/06/2021)

## Getting started

Download the PHP Package below and upload it to your server. The SDK requires PHP 5.6 or greater.

```bash
$ composer require gluwa/gluwa-php
```

Create and initialize a `Gluwa` object. Then, enter the `APIKey`, `APISecret` and `WebookSecret` generated from the [Gluwa Dashboard](https://dashboard.gluwa.com), and an Ethereum wallet to manage your funds. Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.

```php
<?php
// Specify your vendor path.
require_once('vendor/autoload.php');

// If you want to run test on the sandbox mode, change below to values ​​obtained from Gluwa Dashboard's sandbox mode.
$Configuration_DEV = false; // "true" if you want to use the sandbox mode

$Configuration_APIKey = '{Your API Key}';
$Configuration_APISecret = '{Your API Secret}';
$Configuration_WebhookSecret = '{Your Webhook Secret}';
$Configuration_MasterEthereumPrivateKey = '{Your Ethereum Private Key}';
$Configuration_MasterEthereumAddress = '{Your Ethereum Address}';

$Gluwa = new Gluwa\Gluwa([
    '__DEV__' => $Configuration_DEV,
    'APIKey' => $Configuration_APIKey,
    'APISecret' => $Configuration_APISecret,
    'WebhookSecret' => $Configuration_WebhookSecret,
    'MasterEthereumPrivateKey' => $Configuration_MasterEthereumPrivateKey,
    'MasterEthereumAddress' => $Configuration_MasterEthereumAddress,
]);
```

{% hint style="warning" %}
If you are using PHP 5.6, you need to enable [**php-bcmath**](https://www.php.net/manual/en/book.bc.php) because it is not enabled by default prior PHP 7. If it is not installed yet, just install it. Please visit [here](https://www.php.net/manual/en/book.bc.php) for more information.
{% endhint %}

{% hint style="warning" %}
If you receive the following message, you should install [**gmp extention** ](https://www.php.net/manual/en/book.gmp.php)on your server. Please visit [this site](https://www.php.net/manual/en/book.gmp.php) to find a solution.

> Function gmp\_init is unavailable. Please make sure php\_gmp extension is available
> {% endhint %}

Now you are ready to use the Gluwa API.

## Method Examples

#### [Create a New Transaction](/api/api#create-a-new-transaction)

```php
$PostTransaction_Currency = '{USDG or sUSDCG or KRWG}';
$PostTransaction_Amount = '{Sending Amount}';
$PostTransaction_Target = '{Receiver\'s Address}';
$PostTransaction_MerchantOrderID = '{Merchant\'s Order ID. Optional}';
$PostTransaction_Note = '{Custom Note. Optional}';
$PostTransaction_Expiry = {Expiry of the Transfer Request. Optional};

$Response = $Gluwa->postTransaction([
    'Currency' => $PostTransaction_Currency,
    'Amount' => $PostTransaction_Amount,
    'Target' => $PostTransaction_Target,
    'MerchantOrderID' => $PostTransaction_MerchantOrderID, // optional
    'Note' => $PostTransaction_Note, // optional
    'Expiry' => $PostTransaction_Expiry, // optional
]);
```

#### [Create a Payment QR Code](/api/api#create-a-payment-qr-code)

```php
$Response = $Gluwa->getPaymentQRCode([
    'Currency' => 'USDG', // USDG or sUSDCG or KRWG
    'Amount' => '1',
    'Note' => '', // optional
    'MerchantOrderID' => '', // optional
    'Expiry' => 1800, // optional
]);
```

`getPaymentQRCode` API returns a QR code png image as a Base64 string. You can display the image on your website as below:

```markup
<img src="data:image/png;base64,{BASE64_STRING_YOU_RECEIVED}" alt="Gluwa Payment QR Code">
```

#### [List Transaction History for an Address](/api/api#list-transaction-history-for-an-address)

```php
$Response = $Gluwa->getListTransactionHistory([
    'Currency' => 'USDG', // USDG or sUSDCG or KRWG
    'Limit' => '100', // optional
    'Status' => 'Confirmed', // optional
    'Offset' => '0', // optional
]);
```

#### [Retrieve Transaction Details by Hash](/api/api#retrieve-transaction-details-by-hash)

```php
$Response = $Gluwa->getListTransactionDetail([
    'Currency' => 'USDG', // USDG or sUSDCG or KRWG
    'TxnHash' => '',
]);
```

#### [Retrieve a Balance for an Address](/api/api#retrieve-a-balance-for-an-address)

```php
$Response = $Gluwa->getAddresses([
    'Currency' => 'USDG', // USDG or sUSDCG or KRWG
]);
```

#### [Webhook Validation](/development/webhooks#step-3-verify-your-wallet-address)

When user completes transfer via the QR code, the Gluwa API sends a webhook to your webhook endpoint. Verify that the values ​​actually sent by the Gluwa server are correct.

Payload and Signature of webhook can be obtained as follows:

```php
$Headers = getallheaders();
$Signature = $Headers['X-REQUEST-SIGNATURE'];
$Payload = file_get_contents("php://input");
```

Verify the requested Signature and Payload as follows:

```php
$Response2 = $Gluwa->validateWebhook([
    'Payload' => $Payload,
    'Signature' => $Signature,
]);
```

{% tabs %}
{% tab title="Response" %}

| Type          | Description                                                                                                                                              |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| boolean       | This will return `true` if it is a valid webhook. If it returns `false`, you either set an incorrect secret or the webhook did not originate from Gluwa. |
| {% endtab %}  |                                                                                                                                                          |
| {% endtabs %} |                                                                                                                                                          |


# Gluwa SDK for .NET

If your service is developed in .NET, the features we provide are available through the SDK. The Gluwa SDK for .NET is a library with powerful features that enable .NET developers to easily make requests to the Gluwa APIs.

{% hint style="info" %}
Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.
{% endhint %}

{% hint style="warning" %}
At the moment, our .NET SDK only supports Gluwacoin transfers. For Bitcoin transfers, please use the REST API.
{% endhint %}

## Getting Started

The namespace of Gluwa SDK is [`Gluwa.SDK_dotnet`](https://www.nuget.org/packages/Gluwa.SDK_dotnet/). The SDK requires **.NET Core 2.1** or above.

{% embed url="<https://www.nuget.org/packages/Gluwa.SDK_dotnet/>" %}

Refer to the Microsoft documentation below to learn how to install Nuget packages.

{% embed url="<https://docs.microsoft.com/nuget/install-nuget-client-tools>" %}

## Clients

To use Gluwa API, you need to create a `Client` object and initialize it. There are two types of Clients:

1. `GluwaClient` for managing funds by creating or retrieving transaction
2. `QRCodeClient` for creating QR codes.

{% tabs %}
{% tab title="Input" %}

| **Type**      | **Description**                                                     |
| ------------- | ------------------------------------------------------------------- |
| **bool**      | `false` by default. If you want to use the SandBox mode, set `true` |
| {% endtab %}  |                                                                     |
| {% endtabs %} |                                                                     |

### GluwaClient

```csharp
GluwaClient gluwaClient = new GluwaClient();
// If you want to use the SandBox mode
GluwaClient gluwaClient = new GluwaClient(true);
```

### QRCodeClient

```csharp
QRCodeClient qrCodeClient = new QRCodeClient();
// If you want to use the SandBox mode
QRCodeClient qrCodeClient = new QRCodeClient(true);
```

## Method Examples

### GluwaClient

#### [Create a New Transaction](/api/api#create-a-new-transaction)

```csharp
ECurrency currency = "{USDG or KRWG or NGNG or BTC}";
string address = "{Your Gluwacoin public Address}";
string privateKey = "{Your Gluwacoin Private Key}";
string amount = "{Transaction amount, not including the fee}";
string target = "{The address that the transaction will be sent to}";
string merchantOrderID = "{Identifier for the transaction that was provided by the merchant user}"; // default to null. Optional
string note = "{Additional information about the transaction that a user can provide}"; // default to null. Optional
string nonce = "{Nonce for the transaction. For Gluwacoin currencies only}"; // default to null. Optional
string idem = "{Idempotent key for the transaction to prevent duplicate transactions}"; // default to null. Optional
string paymentID = "{ID for the QR code payment}"; // default to null. Optional
string paymentSig = "{Signature of the QR code payment. Required if PaymentID is not null}"; // default to null. Optional

Result<bool, ErrorResponse> result = await gluwaClient.CreateTransactionAsync(
    currency, 
    address, 
    privateKey, 
    amount, 
    target, 
    merchantOrderID, // optional, default = null
    note, // optional, default = null
    nonce, // optional, default = null
    idem, // optional, default = null
    paymentID, // optional, default = null
    paymentSig // optional, default = null
);

if (result.IsFailure)
{
    switch (result.Error.Code)
    {
        case "ErrorCode1":
            // handle error 1
            break;
        case "ErrorCode2":
            // handle error 2
            break;
        default:
            // handle error
            break;
    }
}
else
{
    // successful response. See result.Data for the response
}

```

Returns `true` if successful and `false` if unsuccessful. Successful response means that the transaction has been accepted by Gluwa and will be included in the blockchain in a couple of minutes.

#### [List Transaction History for an Address](/api/api#list-transaction-history-for-an-address)

```csharp
ECurrency currency = "{USDG or KRWG or NGNG or BTC}";
string address = "{Your Gluwacoin public Address}";
string privateKey = "{Your Gluwacoin Private Key}";
uint limit = "{Number of transactions to include in the result}"; // defaults to 100. Optional
ETransactionStatusFilter status = "{Incomplete or Confirmed}"; // defaults to Confirmed. Optional
uint offset = "{Number of transactions to skip}"; // default to 0. Optional”

Result<List<SuccessResponse>, ErrorResponse> result = await gluwaClient.GetTransactionListAsync(
    currency,
    address,
    privateKey,
    limit, // optional, default = 100
    status, // optional, default = Confirmed,
    offset // optional, default = 0
);

if (result.IsFailure)
{
    switch (result.Error.Code)
    {
        case "ErrorCode1":
            // handle error 1
            break;
        case "ErrorCode2":
            // handle error 2
            break;
        default:
            // handle error
            break;
    }
}
else
{
    // successful response. See result.Data for the response
}

```

#### [Retrieve Transaction Details by Hash](/api/api#retrieve-transaction-details-by-hash)

```csharp
ECurrency currency = "{USDG or KRWG or NGNG or BTC}";
string privateKey = "{Your Gluwacoin Private Key}";
string txnHash = "{Hash of the transaction on the blockchain}";

Result<SuccessResponse, ErrorResponse> result = await gluwaClient.GetTransactionDetailsAsync(
currency,
privateKey,
txnHash
);

if (result.IsFailure)
{
    switch (result.Error.Code)
    {
        case "ErrorCode1":
            // handle error 1
            break;
        case "ErrorCode2":
            // handle error 2
            break;
        default:
            // handle error
            break;
    }
}
else
{
    // successful response. See result.Data for the response
}

```

#### [Retrieve a Balance for an Address](/api/api#retrieve-a-balance-for-an-address)

```csharp
ECurrency currency = "{USDG or KRWG or NGNG or BTC}";
string address = "{Your Gluwacoin public Address}";
bool bUnspentOutputs = false; // (For BTC only) if true, the response includes unspent outputs for the address. Default to false. Optional

Result<SuccessResponse, ErrorResponse> result = await gluwaClient.GetBalanceAsync(
    currency, 
    address,
    bUnspentOutputs
);

if (result.IsFailure)
{
    switch (result.Error.Code)
    {
        case "ErrorCode1":
            // handle error 1
            break;
        case "ErrorCode2":
            // handle error 2
            break;
        default:
            // handle error
            break;
    }
}
else
{
    // successful response. See result.Data for the response
}

```

### QRCodeClient

#### [Create a Payment QR Code](/api/api#create-a-payment-qr-code)

```csharp
string apiKey = "{Your API Key}";
string secret = "{Your API Secret}";
string address = "{Your public address}";
string privateKey = "{Your private Key}"; 
EPaymentCurrency currency = "{USDG or KRWG or NGNG}";
string amount = "{Payment amount}";
string format = "{Desired image format}"; // defaults to null. Returns base64 string. Optional.
                                          // if you want to receive an image file put ‘image/jpeg’ or ‘image/png’ instead.
string note = "{Additional information, used by the merchant user}"; // default to null. Optional
string merchantOrderID = "{Identifier for the payment, used by the merchant user}"; // default to null. Optional
int expiry = "{Time of expiry for the QR code in seconds}"; // default to 1800. Optional”

Result<string, ErrorResponse> result = await qRCodeClient.GetPaymentQRCodeAsync(
    apiKey,
    secret,
    address,
    privateKey,
    currency,
    amount,
    format, //optional, default = null
    note, //optional, default = null
    merchantOrderID, //optional, default = null
    expiry //optional, default = 1800
);

if (result.IsFailure)
{
    switch (result.Error.Code)
    {
        case "ErrorCode1":
            // handle error 1
            break;
        case "ErrorCode2":
            // handle error 2
            break;
        default:
            // handle error
            break;
    }
}
else
{
    // successful response. See result.Data for the response
}

```

### Webhook Validation

A method for validating if the webhook is from Gluwa or not. Gluwa sends a webhook request when a transaction is created or completed. Learn more about webhooks from Gluwa [here](/get-started/dashboard/webhooks).

```csharp
PayLoad payLoad = new PayLoad()
{
    Data = new Data
    {
        MerchantOrderID = "My merchant order ID",
        EventType = EEventType.TransactionConfirmed,
        Type = ENotificationType.Webhook,
        ResourceID = "0xfd820a7e9d9851537e259289269db88826a561a04e1c6982b4d860c797a625ce"
    }
};

string signature = "{The value of X-REQUEST-SIGNATURE header}";
string webhookSecretKey = "{Your Webhook Secret}";

bool bValidated = Webhook.ValidateWebhook(
    payLoad, 
    signature,
    webhookSecretKey); // true if validation was successful
```


# Gluwa SDK for Java

If your service is developed in Java, the features we provide are available through the SDK. The Gluwa SDK for Java is a library with powerful features that enable Java developers to easily make requests to the Gluwa APIs.

## Getting started

```markup
<repositories>
    <repository>
        <id>Gluwa-java-mvn-repo</id>
        <url>https://raw.github.com/gluwa/Gluwa-Java/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.gluwa.sdk</groupId>
        <artifactId>gluwa-sdk-java</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>
```

Our jar is here: <https://github.com/gluwa/Gluwa-Java/tree/mvn-repo/com/gluwa/sdk/gluwa-sdk-java>

Create and initialize a `Configuration` class. Then, enter the `APIKey`, `APISecret` and `WebookSecret` generated from the [Gluwa Dashboard](https://dashboard.gluwa.com), and an Ethereum wallet to manage your funds.

Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.

```java
public class Configuration extends Configuration {
	public ConfigurationForTest() {
		super();
		set__DEV__(true); // sandbox: true, live: false
		setApiKey("{Your API Key}");
		setApiSecret("{Your API Secret}");
		setWebhookSecret("{Your Webhook Secret}");
		setMasterEthereumAddress("{Your Ethereum Address}");
		setMasterEthereumPrivateKey("{Your Ethereum Private Key}");
	}
}
```

{% hint style="warning" %}
Gluwa SDK For Java works with JDK 1.8 or higher.
{% endhint %}

## Method Examples <a href="#method-examples" id="method-examples"></a>

#### ​[Create a New Transaction](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/api/api#create-a-new-transaction)​ <a href="#create-a-new-transaction" id="create-a-new-transaction"></a>

```java
public void postTransaction_test() {
	GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(new ConfigurationForTest());
	GluwaTransaction transaction = new GluwaTransaction();

	transaction.setCurrency("{Currency}"); // Currency.KRWG, Currency.NGNG
	transaction.setAmount("{Amount}");
	transaction.setTargetAddress("{Target's Address}");
	transaction.setNote("{Note}");
	transaction.setMerchantOrderID("{Your OrderID}");

	GluwaResponse result = wrapper.postTransaction(transaction);
}
```

#### ​[Create a Payment QR Code](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/api/api#create-a-payment-qr-code)​ <a href="#create-a-payment-qr-code" id="create-a-payment-qr-code"></a>

```
public void getPaymentQRCode_example() {
	Configuration conf = new ConfigurationForTest();
	GluwaApiSDKImpl sdkImpl = new GluwaApiSDKImpl(conf);

	GluwaTransaction transaction = new GluwaTransaction();
	transaction.setCurrency(Currency.USDCG);
	transaction.setAmount("51");
	transaction.setExpiry(1800);
}
```

`getPaymentQRCode` API returns a QR code png image as a Base64 string. You can display the image on your website as below:

```markup
<img src="data:image/png;base64,{BASE64_STRING_YOU_RECEIVED}" alt="Gluwa Payment QR Code">
```

#### Create a Payment QR Code​ With Payload

```
public void getPaymentQRCodeWithPayload_example() {
  Configuration conf = new ConfigurationForTest();
  GluwaApiSDKImpl sdkImpl = new GluwaApiSDKImpl(conf);

  GluwaTransaction transaction = new GluwaTransaction();
  transaction.setCurrency(Currency.USDCG);
  transaction.setAmount("51");
  transaction.setExpiry(1800);

  // `getPaymentQRCode` API returns QR code png image as a Base64 string and payload.
  GluwaResponse result = sdkImpl.getPaymentQRCodeWithPayload(transaction);
  assertNotNull(result);
}
```

#### ​[List Transaction History for an Address](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/api/api#list-transaction-history-for-an-address)​ <a href="#list-transaction-history-for-an-address" id="list-transaction-history-for-an-address"></a>

```java
public void getListTransactionHistory_test() {
  Configuration conf = new ConfigurationForTest();
  GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(conf);

  GluwaTransaction transaction = new GluwaTransaction();
  transaction.setCurrency("{Currency}");
  transaction.setLimit(100); // optional
  transaction.setStatus("Confirmed"); // optional
  transaction.setOffset(0); // optional

  GluwaResponse result = wrapper.getListTransactionHistory(transaction);
}
```

#### ​[Retrieve Transaction Details by Hash](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/api/api#retrieve-transaction-details-by-hash)​ <a href="#retrieve-transaction-details-by-hash" id="retrieve-transaction-details-by-hash"></a>

```java
public void getListTransactionDetail_test() {
  Configuration conf = new ConfigurationForTest();
  GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(conf);

  GluwaTransaction transaction = new GluwaTransaction();
  transaction.setCurrency("{Currency}");
  transaction.setTxnHash("{Txn Hash}");

  GluwaResponse result = wrapper.getListTransactionDetail(transaction);
}
```

#### ​[Retrieve a Balance for an Address](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/api/api#retrieve-a-balance-for-an-address)​ <a href="#retrieve-a-balance-for-an-address" id="retrieve-a-balance-for-an-address"></a>

```java
public void getAddresses_Test() {
  Configuration conf = new ConfigurationForTest();
  GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(conf);

  GluwaTransaction transaction = new GluwaTransaction();
  transaction.setCurrency("{Currency}");

  GluwaResponse result = wrapper.getAddresses(transaction);
}
```

#### ​[Webhook Validation](https://app.gitbook.com/@gluwa/s/gluwa-documentation/~/drafts/-MEwcvFqT7xZLjp3bwpG/development/webhooks#step-3-verify-your-wallet-address)​ <a href="#webhook-validation" id="webhook-validation"></a>

When the user completes the transfer via the QR code, the Gluwa API sends a webhook to your webhook endpoint. Verify that the values ​​were actually sent from the Gluwa server.‌

Verify the requested Signature and Payload as follows:

```java
public void validateWebhook_test() {
  Configuration conf = new ConfigurationForTest();
  GluwaApiSDKImpl wrapper = new GluwaApiSDKImpl(conf);
  boolean result = wrapper.validateWebhook(
    "{Payload in Request's body}",
    "{Signature in Request's header}");
}
```


# Gluwa SDK for JavaScript (Node.js)

If your service is developed in Node.js, the features we provide are available through the SDK. The Gluwa SDK for Node.js is a library with powerful features that enable Node.js developers to easily make requests to the Gluwa APIs.

## Getting started

Install the npm package on your Node.js server.&#x20;

```bash
$ npm install @gluwa/gluwa-js
```

{% hint style="warning" %}
Never use Gluwa SDK on the client side or make your private key public.
{% endhint %}

Create and initialize a `Gluwa` object. Then, enter the `APIKey`, `APISecret` and `WebookSecret` generated from the [Gluwa Dashboard](https://dashboard.gluwa.com), and an Ethereum wallet to manage your funds. Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.

```javascript
const GluwaJS = require('@gluwa/gluwa-js');

const GluwaConfig = {
    production: {
        APIKey: '{Your production API Key}',
        APISecret: '{Your production API Secret}',
        WebhookSecret: '{Your production Webhhok Secret}',
        MasterEthereumAddress: '{Your Ethereum Address for production}',
        MasterEthereumPrivateKey: '{Your Ethereum Private Key for production}',
        isDev: false,
    },
    sandbox: {
        APIKey: '{Your sandbox API Key}',
        APISecret: '{Your sandbox API Secret}',
        WebhookSecret: '{Your sandbox Webhhok Secret}',
        MasterEthereumAddress: '{Your Ethereum Address for sandbox}',
        MasterEthereumPrivateKey: '{Your Ethereum Private Key for sandbox}',
        isDev: true,
    },
}

const Gluwa = new GluwaJS(GluwaConfig.production);
```

Now you are ready to use the Gluwa API.

## Method Examples

#### [Create a New Transaction](/api/api#create-a-new-transaction)

```javascript
const Currency = '{USDG or sUSDCG or KRWG}'; // e.g USDG
const Amount = '{Send Amount}'; // e.g 1.581
const Target = '{Receiver`s Address}'; // e.g 0xf04349B4A760F5Aed02131e0dAA9bB99a1d1d1e5

const resultPromise = await Gluwa.postTransaction(Currency, Amount, Target);
```

#### [Create a Payment QR Code](/api/api#create-a-payment-qr-code)

```php
const Currency = '{USDG or sUSDCG or KRWG}'; // e.g USDG
const Amount = '{Send Amount}'; // e.g 1.581
const Optionals = {
    Note: '', // optional
    MerchantOrderID: '', // optional
    Expirty: '1800', // optional, it must be a string
};

const resultPromise = await Gluwa.getPaymentQRCode(Currency, Amount, Optionals);
```

`getPaymentQRCode` API returns a QR code png image as a Base64 string. You can display the image on your website as below:

```markup
<img src="data:image/png;base64,{BASE64_STRING_YOU_RECEIVED}" alt="Gluwa Payment QR Code">
```

#### [List Transaction History for an Address](/api/api#list-transaction-history-for-an-address)

```javascript
const Currency = '{USDG or sUSDCG or KRWG}'; // e.g USDG
const Optionals = {
    Limit: '100', // optional, it must be a string
    Offset: '0', // optional, it must be a string
    Status: 'Confirmed', // optional
};

const resultPromise = await Gluwa.getTransactionHistory(Currency, Optionals);
```

#### [Retrieve Transaction Details by Hash](/api/api#retrieve-transaction-details-by-hash)

```php
const Currency = '{USDG or sUSDCG or KRWG}'; // e.g USDG
const Hash = '{Transaction hash}';

const resultPromise = await Gluwa.getTransactionDetail(Currency, Hash);
```

#### [Retrieve a Balance for an Address](/api/api#retrieve-a-balance-for-an-address)

```php
const Currency = '{USDG or sUSDCG or KRWG}'; // e.g USDG

const resultPromise = await Gluwa.getAddresses(Currency);
```

#### [Webhook Validation](/development/webhooks#step-3-verify-your-wallet-address)

When user completes transfer via the QR code, the Gluwa API sends a webhook to your webhook endpoint. Verify that the values ​​actually sent by the Gluwa server are correct.

Verify the requested Signature and Payload as follows:

```php
// Payload example
// {"ID":"9d238b83-e5c7-4a1e-a6b4-5bf7ec1d0218","CreatedDateTime":"2021-01-06T07:46:50.2779406Z","ResourceType":"Transaction","EventName":"TRANSACTION.CREATED","Summary":"A transaction was created.","Resource":{"ID":"62e667cf-1a80-41bf-b064-925999ed5b76","TxHash":"0x89a5d4cb0f1d6b919a4ada42b661ed7b2574ec4dd2d640f5c92642bad532dbe0","Source":"0xf04349B4A760F5Aed02131e0dAA9bB99a1d1d1e5","Target":"0x084Af3876A220F4732e21F7617dc212BB2A1f32E","Amount":"10","Fee":"0.5","Currency":"sUSDCG","Status":"Confirmed"}}

// Signature example
// 7iPzvTRVR81cuZQetKbF1GaGPIk1UkzyvFc6hhgA+VI=

const resultBoolean = Gluwa.validateWebhook(Payload, Signature);
```

## How to resolve promise

All functions except Webhook Validation return `promise`. This can be used by resolving it like this:

```javascript
resultPromise.then((result) => {
    console.log(result);
}).catch((error) => {
    console.warn(error);
});
```


# API Reference

Learn how to use various endpoints of the Gluwa API.

## Introduction

The Gluwa API follows [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) design guideline. The API has predictable resource-oriented URL's and returns [JSON-encoded](http://www.json.org/) responses, and uses standard HTTP response codes, authentication, and verbs.

Please note that the sandbox environment is deprecated and will be replaced with an alternative solution in the future.

{% content-ref url="/pages/-LrWYU96MKF9hrZd8ekR" %}
[Environments](/development/environments)
{% endcontent-ref %}

### Base URL

{% tabs %}
{% tab title="Production" %}

```http
https://api.gluwa.com
```

{% endtab %}
{% endtabs %}

### HTTPS Over HTTP

All API requests must be made over [HTTPS](http://en.wikipedia.org/wiki/HTTP_Secure). Calls made over plain HTTP will fail.&#x20;

### Client SDK's

By default, the Gluwa API Docs demonstrate using curl to interact with the API over HTTP. You could also use one of our official Software Development Kits (SDK) to see interact with our API.

{% content-ref url="/pages/-LrCzWhHMV1wkOU5Xc22" %}
[Gluwa SDK for PHP](/development/gluwa-sdk-for-php)
{% endcontent-ref %}

{% content-ref url="/pages/-LzBAhV6XVIcCvA6zByQ" %}
[Gluwa SDK for .NET](/development/gluwa-sdk-for-.net)
{% endcontent-ref %}

## Authorization

The Gluwa API utilizes various authorization methods for each endpoint. Follow the link below to learn more.

{% content-ref url="/pages/-M-X7GxKubMPWDiPr0KH" %}
[Authorization](/api/authentication)
{% endcontent-ref %}

## Core Resources

{% content-ref url="/pages/-M12IikOxH6UsTweTUv-" %}
[Balance](/api/balance)
{% endcontent-ref %}

{% content-ref url="/pages/-M12KV6tCYBkHIex15Qd" %}
[Fee](/api/fee)
{% endcontent-ref %}

{% content-ref url="/pages/-M12KoRbYEa1jLydnwKg" %}
[Transaction](/api/transaction)
{% endcontent-ref %}

{% content-ref url="/pages/-M12LYz8-0OO9HzMBa91" %}
[Payment QR Code](/api/qr-code)
{% endcontent-ref %}

{% content-ref url="/pages/IaY8zVXTYmil2qF9Ya1z" %}
[Wrap / Unwrap](/api/wrap-unwrap)
{% endcontent-ref %}

{% content-ref url="/pages/-M-cpiUtbZQGGBSIUf8M" %}
[Quote](/exchange-api/quote)
{% endcontent-ref %}

{% content-ref url="/pages/-M12MfXc1XDwfwmO1wMq" %}
[Order](/exchange-api/order)
{% endcontent-ref %}

{% content-ref url="/pages/-M12MrvEl5XB2lNL1oDL" %}
[Order Book](/exchange-api/order-book)
{% endcontent-ref %}


# Authorization

Learn various authorization methods you need to use Gluwa API.

Gluwa has two types of authorizing a request:

1. `X-REQUEST-SIGNATURE` header
2. `Authorization` header

Depending on the request, you may have to use at least one of them or none at all. Look under **Request -> Headers** section under each endpoint to find out if an endpoint requires authorization.

## X-REQUEST-SIGNATURE

`X-REQUEST-SIGNATURE` header is used to verify the ownership of an address, usually, for `GET` requests. The value of the header must be the signature of an address that you own. Follow the guide below to generate an Address Signature.&#x20;

{% content-ref url="/pages/-M5PK0LPPstUZHiW12G6" %}
[Creating Signatures](/development/creating-transaction-signatures)
{% endcontent-ref %}

Then, you can generate the value of the header like below:

```
Base64Encode(<unix timestamp>.<Address Signature>)
```

So for example,

{% tabs %}
{% tab title="Gluwacoin (ex> USDG, KRWG, NGNG)" %}

```
// Given 3 values below
unix timestamp = 1587674497
public address = 0x3E6d16c11497aD1A2F47a6594d995f1FaaE727d9
private key = 18cffe0cd4eb63809d0e55ed8dd1aa29e3ac660088e82f7a82977c458f334d8b


// Address Signature
Address Signature = 0x96322ca1b963c98e33fe1296b504d3c7adfcfd4e8473bf92f6ee24b560497d16390404a4f9f241d9efdd02cf1fea79d0ebf45d4aa2ef47a4c97fa06750e242301c


// Value of X-REQUEST-SIGNATURE header
X-REQUEST-SIGNATURE = Base64Encode("1587674497.0x96322ca1b963c98e33fe1296b504d3c7adfcfd4e8473bf92f6ee24b560497d16390404a4f9f241d9efdd02cf1fea79d0ebf45d4aa2ef47a4c97fa06750e242301c")
                    = MTU4NzY3NDQ5Ny4weDk2MzIyY2ExYjk2M2M5OGUzM2ZlMTI5NmI1MDRkM2M3YWRmY2ZkNGU4NDczYmY5MmY2ZWUyNGI1NjA0OTdkMTYzOTA0MDRhNGY5ZjI0MWQ5ZWZkZDAyY2YxZmVhNzlkMGViZjQ1ZDRhYTJlZjQ3YTRjOTdmYTA2NzUwZTI0MjMwMWM=


```

{% endtab %}

{% tab title="BTC" %}

```
// Given 3 values below
unix timestamp = 1587674497
public address = 12koEsMzrdxuZ71ATU1a5jgZyUYtf3debA
private key = KwJfd6xHiqtEFBawy8tKPyJ9TFKQCqHpMr8DQVJ9LbUBj21jqFjE


// Address Signature
Address Signature = H8Gc4g7/X+JsHZyV/qjQSMg9ivoopMztzx9efeV+a+eAJ7Y45OnEi3qmhVWaL743jofge4gQVapzAVsHFSSpBSk=


// Value of X-REQUEST-SIGNATURE header
X-REQUEST-SIGNATURE = Base64Encode("1587674497.H8Gc4g7/X+JsHZyV/qjQSMg9ivoopMztzx9efeV+a+eAJ7Y45OnEi3qmhVWaL743jofge4gQVapzAVsHFSSpBSk=")
                    = MTU4NzY3NDQ5Ny5IOEdjNGc3L1grSnNIWnlWL3FqUVNNZzlpdm9vcE16dHp4OWVmZVYrYStlQUo3WTQ1T25FaTNxbWhWV2FMNzQzam9mZ2U0Z1FWYXB6QVZzSEZTU3BCU2s9


```

{% endtab %}
{% endtabs %}

There are couple things to note:

1. Make sure that unix timestamp is in seconds, **NOT** milliseconds.
2. The generated `X-REQUEST-SIGNATURE` will be valid for 10 minutes. After that, any request made with the same header value will return 403 response.

## API Keys and Secrets

Some endpoints use API keys and secrets to authorize the request. You can view and manage your API key and secrets in [Gluwa Dashboard](https://dashboard.gluwa.com).

We use [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) scheme.&#x20;

```
Token = Base64Encode("<api key>:<api secret>")
Authorization Header value = "Basic <Token>"
```

For example, you would use call an endpoint like below using curl.

{% code title="Authenticated Request" %}

```bash
$ curl https://api.gluwa.com/my/gluwa/endpoint \
  -H "Authorization: Basic {Token}"
```

{% endcode %}

### Code Examples

{% tabs %}
{% tab title="JavaScript" %}

```javascript
// example key and secret
var key = 'abcd';
var secret = '1234';
var data = key + ':' + secret;

var encodedBytes = Buffer.from(data);

// this is Base64 Encoded API Keys
var encodedString = encodedBytes.toString('base64');

// you should get 'YWJjZDoxMjM0' from the example values
console.log(encodedString)
```

{% endtab %}

{% tab title="Python" %}

```python
import base64

# example key and secret
key = 'abcd'
secret = '1234'

data = '%s:%s' % (key, secret)

encodedBytes = base64.b64encode(data.encode('utf-8'))

 # this is Base64 Encoded API Keys
encodedString = encodedBytes.decode('utf-8')

# you should get 'YWJjZDoxMjM0' from the example values
print(encodedString)
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Text;

...

string apiKey = "abcd";
string apiSecret = "1234";

// token's value is YWJjZDoxMjM0
string token = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{apiKey}:{apiSecret}"));
```

{% endtab %}
{% endtabs %}


# Currency and Conversion Symbols

Learn which currencies Gluwa supports.

## Currency Symbols

Below is the list of currencies Gluwa supports:

| Currency                 | Symbol   |
| ------------------------ | -------- |
| Bitcoin                  | `BTC`    |
| CTC (ERC20 Token)        | `GCRE`   |
| NGN Gluwacoin            | `NGNG`   |
| USDC Gluwacoin           | `USDCG`  |
| Sidechain NGNG           | `sNGNG`  |
| Sidechain USDC Gluwacoin | `sUSDCG` |

## Conversion Symbols

Conversion represents the currency exchange from the source currency to the exchanged currency. For example, `BtcsUsdcg` means that you intend to exchange `BTC` to `sUSDC-G`.

Below is the list of conversions Gluwa supports:

1. `BtcUsdcg`
2. `BtcsUsdcg`
3. `UsdcgBtc`
4. `sUsdcgBtc`


# Errors and Error Codes

Learn how to handle errors.

Upon error, a response will contain details to help resolve the error. The response will contain the following fields:

### Error

| Attribute   | Type                  | Description                                                                                                                           |
| ----------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| Code        | `string`              | Error code.                                                                                                                           |
| Message     | `string`              | A detailed error message. We recommend not to rely on the message to programmatically handle the error. Use Code to do that instead.  |
| ID          | `string`              | **Optional.** For 500 responses only. If you encounter an error and this field is present, you can send us this ID for our reference. |
| ExtraData   | `string`              | ***Optional.*** Extra data that may be helpful to handle the error. This could be a JSON string.                                      |
| InnerErrors | `array of InnerError` | ***Optional.*** For validation errors specifically. See [InnerError](/api/errors-and-error-codes#innererror).                         |

### InnerError

| Attribute | Type     | Description                                                                                                                          |
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Code      | `string` | Error code.                                                                                                                          |
| Path      | `string` | The name of the request object's attribute that has errors.                                                                          |
| Message   | `string` | A detailed error message. We recommend not to rely on the message to programmatically handle the error. Use Code to do that instead. |


# Balance

Retrieve the current balance of an address

## `GET /v1/:currency/Addresses/:address`

Retrieve the current balance of an address.

### Request

#### Path Parameters

| Attribute | Type     | Description                                                                               |
| --------- | -------- | ----------------------------------------------------------------------------------------- |
| currency  | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) unit of the balance |
| address   | `string` | The public address associated with the transactions.                                      |

#### Query Parameters

| Attribute             | Type      | Description                                                                                                                                  |
| --------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| includeUnspentOutputs | `boolean` | ***Optional.*** Unspent transaction outputs of the address. Available only for BTC addresses and if`includeUnspentOutputs` is set to `true`. |

### Response

| HTTP Status | Return Object                   |
| ----------- | ------------------------------- |
| 200         | [Balance](/api/balance#balance) |

#### Balance

| Attribute      | Type                                                     | Description                                                                                                                  |
| -------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Balance        | `string`                                                 | A string representing how much balance in the currency unit (e.g., `"1.23"` for 1.23 USD-G).                                 |
| Currency       | `string`                                                 | The [currency](/api/currency-and-conversion-symbols#currency-symbols) unit of the balance                                    |
| UnspentOutputs | `array of` [`UnspentOutput`](/api/balance#unspentoutput) | Unspent transaction outputs of the address. Available only for BTC addresses and if`includeUnspentOutputs` is set to `true`. |

#### UnspentOutput

| Attribute     | Type     | Description                                       |
| ------------- | -------- | ------------------------------------------------- |
| Amount        | `string` | Bitcoin amount in the output index.               |
| TxHash        | `string` | Hash of the transaction that contains the output. |
| Index         | `int`    | Index of the output.                              |
| Confirmations | `int`    | The number of confirmations for the transaction   |

### Errors

| HTTP Status | Error Code             | Description                                    |
| ----------- | ---------------------- | ---------------------------------------------- |
| 400         | `BadRequest`           | Invalid address format.                        |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                         |
| 500         | `InternalServerError`  | Server error.                                  |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency |


# Fee

Retrieve the minimum fee amount for a transaction.

A blockchain generally charges an optional fee to process a transaction (e.g., [Bitcoin transaction fee](https://en.wikipedia.org/wiki/Bitcoin#Transaction_fees)). This fee is optional, but a transaction with a low fee may not get processed by a blockchain at all. To prevent this, you generally want to pay some amount of fee for the transaction.

For Gluwacoin transactions (eg> USDG, KRWG, NGNG), we charge extra fee on top of the market rate to ensure faster transaction. Any transaction with a fee lower than the minimum fee returned by the fee endpoint will be denied.

For Bitcoin transactions, we return the market rate fee. You may use this fee or use something lower, but please note that your transaction may take a while to be processed by the blockchain.

## `GET /v1/:currency/Fee`

Retrieve the minimum fee amount.

### Request

#### Path Parameters

| Attribute | Type     | Description                                                                             |
| --------- | -------- | --------------------------------------------------------------------------------------- |
| currency  | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) unit for the fee. |

### Response

| HTTP Status | Return Object         |
| ----------- | --------------------- |
| 200         | [Fee](/api/fee#fee-1) |

#### Fee

| Attribute  | Type     | Description                                                                           |
| ---------- | -------- | ------------------------------------------------------------------------------------- |
| Currency   | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) unit of the fee |
| MinimumFee | `string` | The minimum transaction fee for the currency                                          |

### Errors

| HTTP Status | Error Code             | Description                                    |
| ----------- | ---------------------- | ---------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                         |
| 500         | `InternalServerError`  | Server error.                                  |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency |


# Transaction

Create and retrieve transactions.

## `GET /v1/:currency/Addresses/:address/Transactions`

Get transaction history for a given address.

### Request

#### Headers

| Header              | Type     | Description                                                                                                        |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------ |
| X-REQUEST-SIGNATURE | `string` | Address Signature of `address` path parameter. See [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature). |

#### Path Parameters

| Attribute | Type     | Description                                                                                |
| --------- | -------- | ------------------------------------------------------------------------------------------ |
| currency  | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) of the transactions. |
| address   | `string` | The public address associated with the transactions.                                       |

#### Query Parameters

| Attribute | Type     | Description                                                                                                                                                                                                                                                                 |
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status    | `string` | <p><em><strong>Optional.</strong></em> Either <code>Confirmed</code> or <code>Incomplete</code>.<br></p><p>Confirmed (default) - Only includes confirmed transactions on the blockchain.</p><p>Incomplete - Only includes unconfirmed and failed transactions in Gluwa.</p> |
| offset    | `int`    | ***Optional.*** The number of entries to skip.                                                                                                                                                                                                                              |
| limit     | `int`    | ***Optional.*** The number of transactions returned in in the response (max 100).                                                                                                                                                                                           |

### Response

| HTTP Status | Return Object                                         |
| ----------- | ----------------------------------------------------- |
| 200         | array of [Transaction](/api/transaction#transaction). |

#### Transaction

| Attribute        | Type              | Description                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status           | `string`          | <p>The status of the transaction.<code>Unconfirmed</code>, <code>Confirmed</code>, or <code>Failed</code>.<br></p><p>Unconfirmed - The transaction was announce to the blockchain, but is not included in any block yet.<br>Confirmed - The transaction was included in the blockchain and received a confirmation. Failed - The transaction has failed for some reason.</p> |
| Amount           | `string`          | The amount sent or received in this transaction.                                                                                                                                                                                                                                                                                                                             |
| TotalAmount      | `string`          | The sum of the `Amount` and the `Fee`.                                                                                                                                                                                                                                                                                                                                       |
| Currency         | `string`          | The [currency](/api/currency-and-conversion-symbols#currency-symbols) of the transaction                                                                                                                                                                                                                                                                                     |
| Sources          | `array of string` | The sources of the transaction. For BTC, there can be multiple sources.                                                                                                                                                                                                                                                                                                      |
| Targets          | `array of string` | The targets of the transaction. For BTC, there can be multiple targets.                                                                                                                                                                                                                                                                                                      |
| TxnHash          | `string`          | Blockchain transaction hash.                                                                                                                                                                                                                                                                                                                                                 |
| CreatedDateTime  | `datetime`        | Time at which the transaction was created.                                                                                                                                                                                                                                                                                                                                   |
| ModifiedDateTime | `datetime`        | Time at which the transaction was last modified.                                                                                                                                                                                                                                                                                                                             |
| MerchantOrderID  | `string`          | ***Optional.*** Used by the receiver to identify a payment. Supported by QR code payment feature only.                                                                                                                                                                                                                                                                       |
| Note             | `string`          | ***Optional.***  A message attached to the transaction. It is an optional memo you can associate with the transaction.                                                                                                                                                                                                                                                       |
| Fee              | `string`          | ***Optional.*** Transaction fee.                                                                                                                                                                                                                                                                                                                                             |
| ID               | `UUID`            | ***Optional***. Gluwa's internal transaction ID. If the transaction was made outside of Gluwa's system (ex> Transaction was made directly on the blockchain), then this will not be available.                                                                                                                                                                               |

### Errors

| HTTP Status | Error Code             | Description                                    |
| ----------- | ---------------------- | ---------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                         |
| 400         | `BadRequest`           | Invalid address format.                        |
| 403         | `SignatureMissing`     | `X-REQUEST-SIGNATURE` header is missing.       |
| 403         | `SignatureExpired`     | `X-REQUEST-SIGNATURE` has expired.             |
| 403         | `InvalidSignature`     | Invalid `X-REQUEST-SIGNATURE`.                 |
| 500         | `InternalServerError`  | Server error.                                  |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency |

## `GET /v1/:currency/Transactions/:txnhash`

### Request

#### Headers

| Header              | Type     | Description                                                                                                                  |
| ------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| X-REQUEST-SIGNATURE | `string` | Address Signature of an address involved with `txnhash`. See [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature). |

#### Path Parameters

| Attribute | Type     | Description                                                                               |
| --------- | -------- | ----------------------------------------------------------------------------------------- |
| currency  | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) of the transaction. |
| txnhash   | `string` | Blockchain transaction hash.                                                              |

### Response

| HTTP Status | Return Object                                |
| ----------- | -------------------------------------------- |
| 200         | [Transaction](/api/transaction#transaction). |

### Errors

| HTTP Status | Error Code             | Description                                    |
| ----------- | ---------------------- | ---------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                         |
| 400         | `BadRequest`           | Invalid `txnhash` value.                       |
| 403         | `SignatureMissing`     | `X-REQUEST-SIGNATURE` header is missing.       |
| 403         | `SignatureExpired`     | `X-REQUEST-SIGNATURE` has expired.             |
| 403         | `InvalidSignature`     | Invalid `X-REQUEST-SIGNATURE`.                 |
| 404         | `NotFound`             | Transaction not found.                         |
| 500         | `InternalServerError`  | Server error.                                  |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency |

## `POST /v1/Transactions`

### Request

#### Request Body

| Attribute       | Type     | Description                                                                                                                                                                                                                                                                   |
| --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Signature       | `string` | Transaction signed with the sender's private key. See [Creating Transaction Signatures](/development/creating-transaction-signatures#transaction-signature).                                                                                                                  |
| Amount          | `string` | Transaction amount, not including the fee. This is the amount that the receiver receives.                                                                                                                                                                                     |
| Fee             | `string` | Transaction fee amount. Generally, you should use the amount from the [Fee endpoint](/api/fee#get-v-1-currency-fee). Your transaction may not get processed by Gluwa if the fee amount is smaller than the minimum fee amount.                                                |
| Currency        | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) of the transaction.                                                                                                                                                                                     |
| Source          | `string` | Address of the sender.                                                                                                                                                                                                                                                        |
| Target          | `string` | Address of the receiver.                                                                                                                                                                                                                                                      |
| Nonce           | `string` | ***Optional.*** Required if using Gluwacoin as the currency of the transaction. Nonce is an unsigned integer used when creating reserve transaction signature. It must be unique each time you make any new transactions (transfer, exchange, etc). Maximum value is 2^256-1. |
| MerchantOrderID | `string` | ***Optional.*** A string value attached to the transaction which can be used for traceability between Gluwa and your application.                                                                                                                                             |
| Note            | `string` | ***Optional.*** Optional memo attached to the transaction.                                                                                                                                                                                                                    |
| Idem            | `UUID`   | ***Optional.*** Used for idempotent requests. See [Idempotent Requests](/development/idempotent-requests).                                                                                                                                                                    |
| PaymentID       | `UUID`   | ***Optional.*** A unique identifier for a payment used with QR code payment feature. You can get this value by decoding the QR code.                                                                                                                                          |
| PaymentSig      | `string` | ***Optional.*** Required if `PaymentID` is not null. This is provided to you when you use [QR Code](/api/qr-code) endpoint. You can get this value by decoding the QR code.                                                                                                   |

### Response

| HTTP Status | Return Object                                                                                     |
| ----------- | ------------------------------------------------------------------------------------------------- |
| 202         | ***Optional.*** [TransactionHash](/api/transaction#transactionhash). Only for `BTC` transactions. |

#### TransactionHash

| Attribute | Type     | Description                                                                                                                                   |
| --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| TxnHash   | `string` | `BTC` transaction hash. For Gluwacoin transactions, the transaction hash is not immediately available, so it is not included in the response. |

### Errors

| HTTP Status | Error Code                | Description                                    |
| ----------- | ------------------------- | ---------------------------------------------- |
| 400         | `InvalidUrlParameters`    | Invalid URL parameters                         |
| 400         | `MissingBody`             | Request body is missing.                       |
| 400         | `InvalidBody`             | Request validation errors.                     |
| 400         | `ValidationError`         | Request validation errors.                     |
| 403         | `InvalidPaymentSignature` | Invalid payment signature.                     |
| 409         | `Conflict`                | Transfer already exists.                       |
| 500         | `InternalServerError`     | Server error.                                  |
| 503         | `ServiceUnavailable`      | Service unavailable for the specified currency |


# Payment QR Code

Generate QR Code to receive payments.

## `POST /v1/QRCode`

Retrieve QR Code for a payment.

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Query Parameters

| Attribute | Type     | Description                                                                                                         |
| --------- | -------- | ------------------------------------------------------------------------------------------------------------------- |
| format    | `string` | ***Optional.*** Image format, `image/png` or `image/jpeg`. If not specified, the API returns Base64 encoded string. |

#### Request Body

| Attribute       | Type     | Description                                                                                                                                                                                                                                             |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Target          | `string` | The address of the payment receiver.                                                                                                                                                                                                                    |
| Signature       | `string` | Address Signature of the `Target` value, generate in the same way as [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature).                                                                                                                    |
| Currency        | `string` | The [currency](/api/currency-and-conversion-symbols#currency-symbols) of the payment. Not supported for `BTC`.                                                                                                                                          |
| Amount          | `string` | Payment amount.                                                                                                                                                                                                                                         |
| MerchantOrderID | `string` | ***Optional.*** A string value attached to the payment which can be used for traceability between Gluwa and your application. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.*** |
| Note            | `string` | ***Optional.*** Optional memo attached to the transaction. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.***                                                                    |
| Expiry          | `int`    | ***Optional.*** The lifetime of the QR code in seconds. By default, the QR code will expire in 10 minutes. ***Do not set this value to\*\*\*\* ****`blank`**** ****or**** ****`null`****. If you're not using it, just remove it.***                    |

### Response

| HTTP Status | Return Object                                   |
| ----------- | ----------------------------------------------- |
| 200         | Base64 encoded image or `.png` or `.jpeg` file. |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                     |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                          |
| 400         | `MissingBody`          | Request body is missing.                                                                                                        |
| 400         | `InvalidBody`          | Request validation errors.                                                                                                      |
| 400         | `ValidationError`      | Request validation errors.                                                                                                      |
| 400         | `BadRequest`           | Unsupported `format` query parameter value.                                                                                     |
| 403         | `Forbidden`            | Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. |
| 500         | `InternalServerError`  | Server error.                                                                                                                   |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified currency.                                                                                 |


# Wrap / Unwrap

### Wrapping:

### POST /v1/TokenWrapping/Request

Submit a request to wrap a token to receipt token

Note: currently we only support wrapping from USDC to USDC-G

### Request

#### Headers

| Header       | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Attribute           | Type   | Description                                                                                                                                                                                                             |
| ------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SourceToken         | string | The gluwacoin token to be wrapped to TargetToken. Eg: USDC                                                                                                                                                              |
| TargetToken         | string | The gluwacoin token the user will receive after wrapping SourceToken. Eg: USDC-G                                                                                                                                        |
| Amount              | number | The amount of Source tokens to be wrapped with decimal places if any.                                                                                                                                                   |
| ApproveTxnSignature | string | <p>The raw transaction of approve function signed by the user private key to allow the TargetToken contract withdraw the Amount from SourceToken</p><p>Refer: see example Approve Raw Signature </p>                    |
| MintTxnSignature    | string | <p>The raw transaction of mint function of TargetToken contract signed by the user private key to withdraw the Amount from SourceToken and receive the TargetToken</p><p>Refer: see example Ethless Mint Signature </p> |
| Address             | string | The user’s address which has SourceToken and is used to receive TargetToken after wrapping                                                                                                                              |
| IdempotentKey       | string | ***Optional.*** The unique id generated by Gluwa SDK                                                                                                                                                                    |

#### Sample Request

```
{
  "amount": 5,
  "address": "0xf04349b4a760f5aed02131e0daa9bb99a1d1d1e5",
  "ApproveTxnSignature": "0xf8aa81b4843b9aca0083086470944dbcdf9b62e891a7cec5a2568c3f4faf9e8abe2b80b844095ea7b300000000000000000000000071b7e714f87d8b46711a2533c9783d73386b828700000000000000000000000000000000000000000000000000000000004c4b401ca028538b7cb0f280681aabc730b1ee78ddf6279246ef5a8b40e3892c05a644a6f6a00373096b304110857e64cb1e37a83213f2a73a466d72c11bdd98a984d5b523b1",
  "SourceToken": "USDC",
  "TargetToken": "USDCG",
  "MintTxnSignature": "0xf88981b5843b9aca00830864709471b7e714f87d8b46711a2533c9783d73386b828780a4a0712d6800000000000000000000000000000000000000000000000000000000004c4b401ba02cb8352f8692f45ae0fde67f85f6bd4097187a1439aca08e7e0cfc2b1c2a955da061eb5c18a9e7ce00ee2eb96584c1225b3b676507642aa51136493aaf0eda9f74", 
  "IdempotentKey": null
}
```

#### Response

| Response | 202 Accepted |
| -------- | ------------ |

**Example ApproveTxnSignature: Approve Raw Signature**

For a token owner to approve a spender to transfer(spend) an “amount“ of his/her token from a contract on his/her behalf\
Spender can be a contract address or a typical Ethereum address.

Note: the amount must include the fee, which means: approved amount = amount (to transfer) + fee

```
public static string generateApproveRawSignature(string RPC_HTTPS_Endpoint, BigInteger GasLimit, BigInteger GasPrice, string ContractAddress, string ContractABI, string ApproverPrivateKey, string SpenderAddress, BigInteger amount)
        {
            Account approverAccount = new Account(ApproverPrivateKey);
            Web3 web3 = new Web3(RPC_HTTPS_Endpoint);

            Contract contract = web3.Eth.GetContract(ContractABI, ContractAddress);

            Function contractFunction = contract.GetFunction("approve");

            TransactionInput input = contractFunction.CreateTransactionInput(approverAccount.Address,
                new HexBigInteger(GasLimit),
                new HexBigInteger(GasPrice),
                new HexBigInteger(BigInteger.Zero),
                SpenderAddress,
                amount);

            HexBigInteger txCount = web3.Eth.Transactions.GetTransactionCount.SendRequestAsync(approverAccount.Address).Result;

            string signedTxn = Web3.OfflineTransactionSigner.SignTransaction(
                ApproverPrivateKey,
                input.To,
                input.Value,
                txCount.Value,
                input.GasPrice,
                input.Gas,
                input.Data);

            Debug.Assert(Web3.OfflineTransactionSigner.VerifyTransaction(signedTxn));

            return signedTxn.EnsureHexPrefix();
        }
```

**Example MintTxnSignature: Ethless Mint Signature**

* MinterAddress: the address which will receive the minted token

Note 1: only used for wrapping USCD -> USDC-G\
Note 2: for Mint, after minting "amount" successful, the Minter need to pay "fee" from the "amount" to the Wrapper\
Note 3: the prerequisite for Mint function is that the Minter need to approve USDC-G contract to spend "amount" of USDC token on behalf of him/her

```
public static string GenerateMintSignature(string USDCG_ContractAddress, int ChainId, string MinterAddress,
            string MinterPrivateKey, BigInteger amount,
            BigInteger fee, BigInteger nonce)
        {
            ABIEncode abiEncode = new ABIEncode();
            byte[] messageHash = abiEncode.GetSha3ABIEncodedPacked(
                new ABIValue("uint8", 2),
                new ABIValue("uint256", ChainId),
                new ABIValue("address", USDCG_ContractAddress),
                new ABIValue("address", MinterAddress),
                new ABIValue("uint256", amount),
                new ABIValue("uint256", fee),
                new ABIValue("uint256", nonce)
            );
            EthereumMessageSigner signer = new EthereumMessageSigner();
            string signature = signer.Sign(messageHash, MinterPrivateKey);
            return signature;
        }
```

### Unwrapping:

### POST /v1/TokenUnwrapping/Request

Submit a request to unwrap a token to receive another token

Note: currently we only support unwrapping from USDC-G to USDC

### Request

#### Headers

| Header       | Type   | Description      |
| ------------ | ------ | ---------------- |
| Content-Type | string | application/json |

#### Request Body

| Attribute     | Type   | Description                                                                                                                                                    |
| ------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SourceToken   | string | The gluwacoin token to be unwrapped to TargetToken. Eg: USDC-G                                                                                                 |
| TargetToken   | string | The gluwacoin token the user will receive after unwrapping SourceToken. Eg: USDC                                                                               |
| Amount        | number | <p>The amount of Source tokens to be unwrapped with decimal places if any.</p><p>Note: Amount is a component to create BurnSignature</p>                       |
| BurnSignature | string | <p>The Burn signature signed by a user’s private key to authorize burning USDC-G to get USDC</p><p>Refer: see example Ethless Burn Signature</p>               |
| Nonce         | number | <p>A unique random number generated by Gluwa client</p><p>Note: Nonce is a component to create BurnSignature</p>                                               |
| Fee           | number | <p>Fee of burning retrieved from Fee API</p><p>/v1/{Currency}/fee?function=Burn</p><p>Note: Fee is a component to create BurnSignature</p>                     |
| Address       | string | <p>The user’s address which has SourceToken and is used to receive TargetToken after unwrapping</p><p>Note: Address is a component to create BurnSignature</p> |
| IdempotentKey | string | ***Optional.*** The unique id generated by Gluwa SDK                                                                                                           |

#### Sample Request

```
{
  "amount": 5,
  "address": "0xd9d097435E7CF8e663CcB26daB9C31A7F2B64ab4",
  "SourceToken": "USDCG",
  "TargetToken": "USDC",
  "BurnSignature": "0x332ebd2c7bc690984fac572d1c562beb3f86da947f0f73c59521666fe619b9d73d794897cbd7cf5abe7ebec4d68cb62b59cf8466a47fe39ec7a8c32a83090a351c",
  "Nonce": 124,
  "Fee": 1,
  "IdempotentKey": null
}
```

#### Response

| Response | 202 Accepted |
| -------- | ------------ |

**Example BurnSignature: Ethless Burn Signature**

* BurnerAddress: the address which will withdraw USDC-G token -> USDC token

Note 1: only used for unwrapping USCD-G -> USDC

Note 2: for Burn, after burning "amount" successful, the Burner need to pay "fee" from the "amount" to the Wrapper

Note 3: the prerequisite for Burn function is that the Burner need to approve USDC-G contract to spend "amount" of USDC token on behalf of him/her

```
public static string GenerateBurnSignature(string USDCG_ContractAddress, int ChainId, string BurnerAddress,
            string BurnerPrivateKey, BigInteger amount,
            BigInteger fee, BigInteger nonce)
        {
            ABIEncode abiEncode = new ABIEncode();
            byte[] messageHash = abiEncode.GetSha3ABIEncodedPacked(
                new ABIValue("uint8", 1),
                new ABIValue("uint256", ChainId),
                new ABIValue("address", USDCG_ContractAddress),
                new ABIValue("address", BurnerAddress),
                new ABIValue("uint256", amount),
                new ABIValue("uint256", fee),
                new ABIValue("uint256", nonce)
            );
            EthereumMessageSigner signer = new EthereumMessageSigner();
            string signature = signer.Sign(messageHash, BurnerPrivateKey);
            return signature;
        }
```


# Exchange Webhook

The Exchange Request Webhook is a special webhook that allows you to receive an exchange request on the order you've created. This is a different webhook from the webhook you use to receive on various events like transaction confirmed, transaction created and transaction failed. As a market provider, you must register one Exchange Request Webhook URL to create order and accept any exchange request.

## Create an **Exchange Request Webhook URL**&#x20;

Go to the dashboard and register a webhook URL to receive exchange request through this URL. Once you register a webhook URL, there will be a checkbox beside the URL. Check this box to mark the URL as the exchange request webhook URL.

![](/files/-M8Hl5Ys-9yk0utRq14K)

{% hint style="warning" %}
If you unset this checkbox, this will immediately suspend any exchange request webhooks, which means that you will not be able to accept any exchange requests until you recheck this box.
{% endhint %}

## **The Exchange Request**

When an exchange is requested using your order, Gluwa will make a POST request to the exchange webhook URL for the permission to proceed with the exchange. The following request body is sent with the request.

| Attribute                 | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ID                        | `UUID`   | ID of the exchange request                                                                                                                                                                                                                                                                                                                                                                                                 |
| EventType                 | `string` | Always "ExchangeRequest"                                                                                                                                                                                                                                                                                                                                                                                                   |
| Type                      | `string` | Always "Webhook"                                                                                                                                                                                                                                                                                                                                                                                                           |
| ResourceID                | `string` | Order ID                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Conversion                | `string` | The [conversion](/api/currency-and-conversion-symbols#conversion-symbols) of the exchange.                                                                                                                                                                                                                                                                                                                                 |
| DestinationAddress        | `string` | The address where the source amount must be sent to.                                                                                                                                                                                                                                                                                                                                                                       |
| SourceAmount              | `string` | The amount in source currency that this order will exchange.                                                                                                                                                                                                                                                                                                                                                               |
| Fee                       | `string` | The fee amount that must be used to create `ReserveTxnSignature`, `ExecuteTxnSignature` and `ReclaimTxnSignature`                                                                                                                                                                                                                                                                                                          |
| Executor                  | `string` | ***Optional.*** Required if the source currency is Gluwacoin currency (ex> `USD-G`, `KRW-G`). The address that will execute the exchange on your behalf. You need this to sign the reserve transaction signature.                                                                                                                                                                                                          |
| ExpiryBlockNumber         | `string` | <p><em><strong>Optional.</strong></em> Required if the source currency is Gluwacoin currency (ex> <code>USD-G</code>, <code>KRW-G</code>). The block number where your reserved funds will expire. You need this to create the reserve transaction signature.</p><p></p><p>After this block number, the exchange will not execute, and you may call reclaim function on the blockchain to release your reserved funds.</p> |
| ReservedFundsAddress      | `string` | ***Optional.*** Required if the source currency is `BTC`. The address where the source amount must be sent to to reserve your funds for the exchange.                                                                                                                                                                                                                                                                      |
| ReservedFundsRedeemScript | `string` | ***Optional.*** Required if the source currency is `BTC`.                                                                                                                                                                                                                                                                                                                                                                  |

{% hint style="info" %}
If you want to verify that the request was actually sent from Gluwa, you can check the veracity of the webhook as shown [here](/development/webhooks#checking-the-veracity-of-a-request-using-x-request-signature).
{% endhint %}

After the you receive the webhook receive, you must do the following to accept the exchange request:

1. Return 200 status code as a response to the webhook request. If you return any other response, Gluwa will try to send the same webhook for the maximum of 5 times, before treating the exchange request as declined.

2. Use [PATCH /V1/ExchangeRequest/{ID}](/exchange-api/exchange-request#patch-v-1-exchangerequests-id) endpoint to accept the exchange request. If you fail to successfully accept the exchange request within 10 minutes, the exchange request is automatically declined.

If you decline the exchange request for an order 5 times, that order will be canceled automatically.

## **Receiving Exchange Success and Failed Webhooks**

Gluwa will send a webhook when an exchange succeeds or fails. This will be sent to the same webhook URL as the one you use to receive transaction confirmed, transaction created and transaction failed webhooks, **NOT** to the exchange equest webhook URL.

### **ExchangeSuccess Event**

| Attribute            | Type     | Description                                                                                                                                                                                                                                                |
| -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EventType            | `string` | Always "ExchangeSuccess"                                                                                                                                                                                                                                   |
| Type                 | `string` | Always "Webhook"                                                                                                                                                                                                                                           |
| ResourceID           | `string` | Order ID                                                                                                                                                                                                                                                   |
| OrderAmountRemaining | `string` | The amount remaining in the order.                                                                                                                                                                                                                         |
| Conversion           | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).                                                                                                                                                |
| SendingAddress       | `string` | The address that will fund the source amount.                                                                                                                                                                                                              |
| ReceivingAddress     | `string` | <p>The address that the exchanged currency will be received.</p><p></p><p>For example, if the conversion is <code>BtcUsdg</code>, your receiving address must be a <code>USD-G</code> address since your exchanged funds will be sent to that address.</p> |
| SourceAmount         | `string` | The amount in source currency that this order will exchange.                                                                                                                                                                                               |
| Price                | `string` | The price the order will use for the exchange. The unit is `<exchanged currency>/<source currency>`.                                                                                                                                                       |
| ExchangedAmount      | `string` | The exchanged amount in exchanged currency.                                                                                                                                                                                                                |

### **ExchangeFailed Event**

| Attribute            | Type     | Description                                                                                                                                                                                                                                                |
| -------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| EventType            | `string` | Always "ExchangeFailed"                                                                                                                                                                                                                                    |
| Type                 | `string` | Always "Webhook"                                                                                                                                                                                                                                           |
| ResourceID           | `string` | Order ID                                                                                                                                                                                                                                                   |
| OrderAmountRemaining | `string` | The amount remaining in the order.                                                                                                                                                                                                                         |
| Conversion           | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).                                                                                                                                                |
| SendingAddress       | `string` | The address that will fund the source amount.                                                                                                                                                                                                              |
| ReceivingAddress     | `string` | <p>The address that the exchanged currency will be received.</p><p></p><p>For example, if the conversion is <code>BtcUsdg</code>, your receiving address must be a <code>USD-G</code> address since your exchanged funds will be sent to that address.</p> |
| SourceAmount         | `string` | The amount in source currency that this order will exchange.                                                                                                                                                                                               |
| Price                | `string` | The price the order will use for the exchange. The unit is `<exchanged currency>/<source currency>`.                                                                                                                                                       |
| ExchangedAmount      | `string` | The exchanged amount in exchanged currency.                                                                                                                                                                                                                |


# Quote

Learn about the Quote objects and its endpoints.

You can retrieve a `Quote` object before committing for an exchange transaction. The object tells what price you can expect if you exchange your digital asset for another.

You can create, accept, and retrieve exchange quotes with Gluwa API.

## `POST /v1/Quote`

Get Quote for currency exchange

### Request

#### Request Body

| Attribute                 | Type     | Description                                                                                                                                                                                                                                                |
| ------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Amount                    | `string` | The amount in source currency you want to exchange.                                                                                                                                                                                                        |
| Conversion                | `string` | Conversion symbol for the exchange. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).                                                                                                                                             |
| SendingAddress            | `string` | The address that will fund the source amount.                                                                                                                                                                                                              |
| SendingAddressSignature   | `string` | The signature of the sending address. Generated the same way as [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature).                                                                                                                            |
| ReceivingAddress          | `string` | <p>The address that the exchanged currency will be received.</p><p></p><p>For example, if the conversion is <code>BtcUsdg</code>, your receiving address must be a <code>USD-G</code> address since your exchanged funds will be sent to that address.</p> |
| ReceivingAddressSignature | `string` | The signature of the receiving address. Generated the same way as [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature).                                                                                                                          |
| BtcPublicKey              | `string` | ***Optional.*** Required if the source currency is `BTC`. This is BTC public key of the sending address that will be used to reserve your funds.                                                                                                           |

### Response

| HTTP Status | Return Object                       |
| ----------- | ----------------------------------- |
| 200         | [Quote](/exchange-api/quote#quote). |

#### Quote

| Attribute                     | Type                                                          | Description                                                                                                        |
| ----------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Conversion                    | `string`                                                      | The [conversion](/api/currency-and-conversion-symbols#conversion-symbols) of the exchange.                         |
| TotalSourceAmount             | `string`                                                      | The total amount in source currency that will be exchanged.                                                        |
| TotalFee                      | `string`                                                      | The exchange fee.                                                                                                  |
| TotalEstimatedExchangedAmount | `string`                                                      | The total estimated exchanged amount in exchanged currency.                                                        |
| AveragePrice                  | `string`                                                      | The average of all the prices in the list of matched orders. The unit is `<exchanged currency>/<source currency>`. |
| BestPrice                     | `string`                                                      | The best price available in the list of matched orders. The unit is `<exchanged currency>/<source currency>`.      |
| WorstPrice                    | `string`                                                      | The best price available in the list of matched orders. The unit is `<exchanged currency>/<source currency>`.      |
| MatchedOrders                 | `array of` [`MatchedOrder`](/exchange-api/quote#matchedorder) | The list of matched orders available to fulfill the requested source amount.                                       |
| CreatedDateTime               | `DateTime`                                                    | The time when the quote is created.                                                                                |
| TimeToLive                    | `int`                                                         | The duration in seconds that the quote is valid.                                                                   |
| Checksum                      | `string`                                                      | Checksum. Used when you accept the quote.                                                                          |

#### MatchedOrder

| Attribute                 | Type     | Description                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OrderID                   | `UUID`   | Order ID                                                                                                                                                                                                                                                                                                                                                                                                                   |
| DestinationAddress        | `string` | The address where the source amount must be sent to.                                                                                                                                                                                                                                                                                                                                                                       |
| SourceAmount              | `string` | The amount in source currency that this order will exchange.                                                                                                                                                                                                                                                                                                                                                               |
| Fee                       | `string` | The fee amount that must be used to create `ReserveTxnSignature`, `ExecuteTxnSignature` and `ReclaimTxnSignature`                                                                                                                                                                                                                                                                                                          |
| ExchangedAmount           | `string` | The amount in exchanged currency that this order will fulfill.                                                                                                                                                                                                                                                                                                                                                             |
| Price                     | `string` | The price this order is offering for the exchange. The unit is `<exchanged currency>/<source currency>`.                                                                                                                                                                                                                                                                                                                   |
| ExpiryBlockNumber         | `string` | <p><em><strong>Optional.</strong></em> Required if the source currency is Gluwacoin currency (ex> <code>USD-G</code>, <code>KRW-G</code>). The block number where your reserved funds will expire. You need this to create the reserve transaction signature.</p><p></p><p>After this block number, the exchange will not execute, and you may call reclaim function on the blockchain to release your reserved funds.</p> |
| Executor                  | `string` | ***Optional.*** Required if the source currency is Gluwacoin currency (ex> `USD-G`, `KRW-G`). The address that will execute the exchange on your behalf. You need this to sign the reserve transaction signature.                                                                                                                                                                                                          |
| ReservedFundsAddress      | `string` | ***Optional.*** Required if the source currency is `BTC`. The address where the source amount must be sent to to reserve your funds for the exchange.                                                                                                                                                                                                                                                                      |
| ReservedFundsRedeemScript | `string` | ***Optional.*** Required if the source currency is `BTC`.                                                                                                                                                                                                                                                                                                                                                                  |

### Errors

| HTTP Status | Error Code             | Description                                 |
| ----------- | ---------------------- | ------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                      |
| 400         | `MissingBody`          | Request body is missing.                    |
| 400         | `InvalidBody`          | Request validation errors. See InnerErrors. |
| 400         | `ValidationError`      | Request validation errors. See InnerErrors. |
| 404         | `NotFound`             | No orders are matched.                      |
| 500         | `InternalServerError`  | Server error.                               |

## `PUT /v1/Quote`

Accept quote received from `POST /v1/Quote` endpoint.

### Request

#### Request Body

| Attribute     | Type                                                        | Description                                        |
| ------------- | ----------------------------------------------------------- | -------------------------------------------------- |
| MatchedOrders | array of [MatchedOrder](/exchange-api/quote#matchedorder-1) | All orders that will fulfill this quote.           |
| Checksum      | `string`                                                    | Checksum that was received when quote was created. |

#### MatchedOrder

| Attribute           | Type     | Description                                                                                                                                                                                                                                             |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OrderID             | `UUID`   | ID of the order that was matched                                                                                                                                                                                                                        |
| ReserveTxnSignature | `string` | Reserve transaction signature used to reserve funds for the exchange.                                                                                                                                                                                   |
| Nonce               | `string` | ***Optional***. Required if the source currency is Gluwacoin currency (ex> `USD-G`, `KRW-G`). Nonce is an integer used when creating reserve transaction signature. It must increase each time you make any new transactions (transfer, exchange, etc). |
| ExecuteTxnSignature | `string` | ***Optional.*** Required if the source currency `BTC`. Execute transaction signature used to execute the exchange when your funds are available in the reserve address.                                                                                 |
| ReclaimTxnSignature | `string` | ***Optional.*** Required if the source currency `BTC`. Reclaim transaction signature used to return the funds in the reserve address when the exchange fails or expires.                                                                                |

### Response

| HTTP Status | Return Object                                           |
| ----------- | ------------------------------------------------------- |
| 202         | [AcceptedQuoteID](/exchange-api/quote#acceptedquoteid). |

#### AcceptedQuoteID

| Attribute | Type   | Description                   |
| --------- | ------ | ----------------------------- |
| ID        | `UUID` | The ID of the accepted quote. |

### Errors

| HTTP Status | Error Code             | Description                                         |
| ----------- | ---------------------- | --------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                              |
| 400         | `MissingBody`          | Request body is missing.                            |
| 400         | `InvalidBody`          | Request validation errors. See InnerErrors.         |
| 400         | `ValidationError`      | Request validation errors. See InnerErrors.         |
| 403         | `Forbidden`            | Invalid checksum. Checksum may be wrong or expired. |
| 404         | `NotFound`             | One of the matched orders are no longer available.  |
| 500         | `InternalServerError`  | Server error.                                       |

## `GET /v1/:currency/Addresses/:address/Quotes`

Get a list of accepted quotes.

### Request

#### Headers

| Header              | Type     | Description                                                                                                   |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
| X-REQUEST-SIGNATURE | `string` | Address Signature of the sending address. See [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature). |

#### Path Parameters

| Attribute | Type     | Description                                                                                  |
| --------- | -------- | -------------------------------------------------------------------------------------------- |
| currency  | `string` | The source [currency](/api/currency-and-conversion-symbols#conversion-symbols) of the quote. |
| address   | `string` | The sending address of the quote.                                                            |

#### Query Parameters

| Attribute     | Type       | Description                                                                                                  |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------------ |
| startDateTime | `datetime` | ISO 8601 format datetime. If defined, only quotes created after this datetime are included in the response.  |
| endDateTime   | `datetime` | ISO 8601 format datetime. If defined, only quotes created before this datetime are included in the response. |
| status        | `string`   | `Pending` or `Processed`.                                                                                    |
| offset        | `int`      | Number of quotes to skip the beginning of list. Defaults to 0.                                               |
| limit         | `int`      | Number of quotes to include in the result. Defaults to 25, maximum of 100.                                   |

### Response

| HTTP Status | Return Object                                   |
| ----------- | ----------------------------------------------- |
| 200         | array of [Quotes](/exchange-api/quote#quote-1). |

#### Quote

| Attribute                | Type     | Description                                                                                                         |
| ------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------- |
| ID                       | `UUID`   | Accepted quote ID.                                                                                                  |
| SendingAddress           | `string` | The address that funded the source amount.                                                                          |
| SourceAmount             | `string` | The total amount                                                                                                    |
| Fee                      | `string` | The total fee of the exchange                                                                                       |
| EstimatedExchangedAmount | `string` | The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. |
| AveragePrice             | `string` | The average of all the prices in the list of matched orders. The unit is `<exchanged currency>/<source currency>`.  |
| BestPrice                | `string` | The best price available in the list of matched orders. The unit is `<exchanged currency>/<source currency>`.       |
| WorstPrice               | `string` | The best price available in the list of matched orders. The unit is `<exchanged currency>/<source currency>`.       |
| ReceivingAddress         | `string` | The address that the exchanged currency is received.                                                                |
| Status                   | `string` | `Pending` or `Processed`.                                                                                           |
| Conversion               | `string` | The conversion of the quote. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).             |

### Errors

| HTTP Status | Error Code             | Description                              |
| ----------- | ---------------------- | ---------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                   |
| 403         | `SignatureMissing`     | `X-REQUEST-SIGNATURE` header is missing. |
| 403         | `SignatureExpired`     | `X-REQUEST-SIGNATURE` has expired.       |
| 403         | `InvalidSignature`     | Invalid `X-REQUEST-SIGNATURE`.           |
| 500         | `InternalServerError`  | Server error.                            |

## `GET /V1/Quotes/:ID`

Get an accepted quote with ID.

### Request

#### Headers

| Header              | Type     | Description                                                                                                                 |
| ------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| X-REQUEST-SIGNATURE | `string` | Address Signature of the sending address of this quote. See [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature). |

#### Path Parameters

| Attribute | Type   | Description               |
| --------- | ------ | ------------------------- |
| ID        | `UUID` | ID of the accepted quote. |

### Response

| HTTP Status | Return Object                         |
| ----------- | ------------------------------------- |
| 200         | [Quote](/exchange-api/quote#quote-1). |

#### Quote

| Attribute                | Type                                                             | Description                                                                                                         |
| ------------------------ | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| ID                       | `UUID`                                                           | Accepted quote ID.                                                                                                  |
| SendingAddress           | `string`                                                         | The address that funded the source amount.                                                                          |
| SourceAmount             | `string`                                                         | The total source amount.                                                                                            |
| Fee                      | `string`                                                         | The total fee of the exchange.                                                                                      |
| EstimatedExchangedAmount | `string`                                                         | The estimated exchange amount. Sometimes, if someone takes the order before you, the exchange will not be executed. |
| ReceivingAddress         | `string`                                                         | The address that the exchanged currency is received.                                                                |
| Status                   | `string`                                                         | `Pending` or `Processed`.                                                                                           |
| Conversion               | `string`                                                         | The conversion of the quote. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).             |
| MatchedOrders            | `array of` [`MatchedOrders`](/exchange-api/quote#matchedorder-2) | The list of matched orders that fulfilled the source amount.                                                        |

#### MatchedOrder

| Attribute    | Type     | Description                                                                                              |
| ------------ | -------- | -------------------------------------------------------------------------------------------------------- |
| SourceAmount | `string` | The amount in source currency that this order will exchange.                                             |
| Fee          | `string` | The fee amount used to create `ReserveTxnSignature`, `ExecuteTxnSignature` and `ReclaimTxnSignature`     |
| Status       | `string` | `Pending`, `Success` or `Failed`.                                                                        |
| Price        | `string` | The price this order is offering for the exchange. The unit is `<exchanged currency>/<source currency>`. |

### Errors

| HTTP Status | Error Code             | Description                              |
| ----------- | ---------------------- | ---------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                   |
| 403         | `SignatureMissing`     | `X-REQUEST-SIGNATURE` header is missing. |
| 403         | `SignatureExpired`     | `X-REQUEST-SIGNATURE` has expired.       |
| 403         | `InvalidSignature`     | Invalid `X-REQUEST-SIGNATURE`.           |
| 404         | `NotFound`             | Quote not found.                         |
| 500         | `InternalServerError`  | Server error.                            |


# Order

## `GET v1/Orders`

Retrieve all orders.

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Query Parameters

| Attribute     | Type       | Description                                                                                                               |
| ------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------- |
| startDateTime | `datetime` | ISO 8601 format datetime. If defined, only orders created after this datetime are included in the response.               |
| endDateTime   | `datetime` | ISO 8601 format datetime. If defined, only orders created before this datetime are included in the response.              |
| status        | `string`   | `Active`, `Complete` or `Canceled`. If specified, only orders with the specified status will be included in the response. |
| offset        | `int`      | Number of orders to skip the beginning of list. Defaults to 0.                                                            |
| limit         | `int`      | Number of orders to include in the result. Defaults to 25, maximum of 100.                                                |

### Response

| HTTP Status | Return Object                                 |
| ----------- | --------------------------------------------- |
| 200         | array of [Orders](/exchange-api/order#order). |

#### Order

| Attribute        | Type     | Description                                                                                                 |
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------- |
| ID               | `string` | The order ID.                                                                                               |
| Conversion       | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols). |
| SendingAddress   | `string` | The address where the source amount is sent from.                                                           |
| SourceAmount     | `string` | The amount available for exchange in source currency.                                                       |
| Price            | `string` | The price the order will use for the exchange. The unit is `<exchanged currency>/<source currency>`.        |
| ReceivingAddress | `string` | The address where the exchanged amount is received.                                                         |
| Status           | `string` | `Active`, `Complete` or `Canceled`.                                                                         |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                     |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                          |
| 403         | `Forbidden`            | Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. |
| 500         | `InternalServerError`  | Server error.                                                                                                                   |

## `GET v1/Orders/:ID`

Retrieve an order with specified ID.

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Path Parameters

| Attribute | Type   | Description |
| --------- | ------ | ----------- |
| ID        | `UUID` | Order ID.   |

### Response

| HTTP Status | Return Object                         |
| ----------- | ------------------------------------- |
| 200         | [Order](/exchange-api/order#order-1). |

#### Order

| Attribute        | Type                                                   | Description                                                                                                 |
| ---------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| ID               | `string`                                               | The order ID.                                                                                               |
| Conversion       | `string`                                               | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols). |
| SendingAddress   | `string`                                               | The address where the source amount is sent from.                                                           |
| SourceAmount     | `string`                                               | The amount available for exchange in source currency.                                                       |
| Price            | `string`                                               | The price the order will use for the exchange. The unit is `<exchanged currency>/<source currency>`.        |
| ReceivingAddress | `string`                                               | The address where the exchanged amount is received.                                                         |
| Status           | `string`                                               | `Active`, `Complete` or `Canceled`.                                                                         |
| Exchanges        | `array of` [`Exchanges`](/exchange-api/order#exchange) | The list of the past and pending exchanges this order is fulfilling.                                        |

#### Exchange

| Attribute        | Type     | Description                                                                             |
| ---------------- | -------- | --------------------------------------------------------------------------------------- |
| SendingAddress   | `string` | The address where the source amount is sent from.                                       |
| ReceivingAddress | `string` | The address where the exchanged amount is received.                                     |
| SourceAmount     | `string` | The amount in source currency to be exchanged.                                          |
| Fee              | `string` | The total fee paid for the exchange.                                                    |
| ExchangedAmount  | `string` | The amount in exchanged currency you received.                                          |
| Price            | `string` | The price used for this exchange. The unit is `<exchanged currency>/<source currency>`. |
| Status           | `string` | `Pending`, `Success` or `Failed`.                                                       |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                   |
| ----------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                        |
| 403         | `Forbidden`            | Access is denied for this resource. Make sure your authorization header is correct and you are using valid API key and secret |
| 404         | `NotFound`             | Order not found.                                                                                                              |
| 500         | `InternalServerError`  | Server error.                                                                                                                 |

## `POST v1/Orders`

Create a new order.

{% hint style="info" %}
You **MUST** create [Exchange Request Webhook URL](/exchange-api/exchange-webhook#create-an-exchange-request-webhook-url) in the dashboard before you use this endpoint.
{% endhint %}

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Request Body

| Attribute                 | Type     | Description                                                                                                                                             |
| ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Conversion                | `string` | Conversion symbol for the order. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols).                                             |
| SendingAddress            | `string` | The address that funds the source amount.                                                                                                               |
| SendingAddressSignature   | `string` | Address Signature of the `SendingAddress` , generate in the same way as [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature).                 |
| ReceivingAddress          | `string` | The address that the exchanged amount will be received.                                                                                                 |
| ReceivingAddressSignature | `string` | Address Signature of the `ReceivingAddress` , generate in the same way as [X-REQUEST-SIGNATURE](/api/authentication#x-request-signature).               |
| SourceAmount              | `string` | The amount in source currency to be exchanged.                                                                                                          |
| Price                     | `string` | The price you want to use. Any exchange that this order will fulfill will use this price. The unit is `<exchanged currency>/<source currency>`.         |
| BtcPublicKey              | `string` | ***Optional.*** Required if the source currency is `BTC`.  The public key for the sending address. Note that this is different from the public address. |

### Response

| HTTP Status | Return Object                                     |
| ----------- | ------------------------------------------------- |
| 201         | [CreatedOrder](/exchange-api/order#createdorder). |

#### CreatedOrder

| Attribute | Type   | Description   |
| --------- | ------ | ------------- |
| ID        | `UUID` | The order ID. |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                     |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                          |
| 400         | `MissingBody`          | Request body is missing.                                                                                                        |
| 400         | `InvalidBody`          | Request validation errors. See InnerErrors.                                                                                     |
| 400         | `ValidationError`      | Request validation errors. See InnerErrors.                                                                                     |
| 403         | `Forbidden`            | Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. |
| 403         | `WebhookNotFound`      | Webhook URL to send exchange request is unavailable.                                                                            |
| 500         | `InternalServerError`  | Server error.                                                                                                                   |
| 503         | `ServiceUnavailable`   | Service unavailable for the specified conversion.                                                                               |

## `PATCH v1/Orders/:ID`

Cancel an order.

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Path Parameters

| Attribute | Type   | Description |
| --------- | ------ | ----------- |
| ID        | `UUID` | Order ID.   |

#### Request Body

| Attribute | Type     | Description   |
| --------- | -------- | ------------- |
| Action    | `string` | Use `Cancel`. |

### Response

| HTTP Status | Return Object                                                                  |
| ----------- | ------------------------------------------------------------------------------ |
| 200         | none. If the order is already canceled, it will have no effect and return 200. |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                   |
| ----------- | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                        |
| 400         | `MissingBody`          | Request body is missing.                                                                                                      |
| 400         | `InvalidBody`          | Request validation errors. See InnerErrors.                                                                                   |
| 400         | `ValidationError`      | Request validation errors. See InnerErrors.                                                                                   |
| 403         | `Forbidden`            | Access is denied for this resource. Make sure your authorization header is correct and you are using valid API key and secret |
| 404         | `NotFound`             | Order is not found.                                                                                                           |
| 409         | `Conflict`             | Cannot be canceled. Usually because the order is already completed.                                                           |
| 500         | `InternalServerError`  | Server error.                                                                                                                 |


# Exchange Request

## `PATCH /V1/ExchangeRequests/{ID}`

Accept an exchange request.

### Request

#### Headers

| Header        | Type     | Description                                                                                            |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------ |
| Authorization | `string` | Auth token using `Basic` scheme. See [API Keys and Secrets](/api/authentication#api-keys-and-secrets). |

#### Request Body

| Attribute           | Type     | Description                                                                                                                                                                                                                                             |
| ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SendingAddress      | `string` | The address that funds the source amount. Must be the same value as the `SendingAddress` you used when creating a new order.                                                                                                                            |
| ReserveTxnSignature | `string` | Reserve transaction signature used to reserve funds for the exchange.                                                                                                                                                                                   |
| Nonce               | `int`    | ***Optional***. Required if the source currency is Gluwacoin currency (ex> `USD-G`, `KRW-G`). Nonce is an integer used when creating reserve transaction signature. It must increase each time you make any new transactions (transfer, exchange, etc). |
| ExecuteTxnSignature | `string` | ***Optional.*** Required if the source currency `BTC`. Execute transaction signature used to execute the exchange when your funds are available in the reserve address.                                                                                 |
| ReclaimTxnSignature | `string` | ***Optional.*** Required if the source currency `BTC`. Reclaim transaction signature used to return the funds in the reserve address when the exchange fails or expires.                                                                                |

### Response

| HTTP Status |
| ----------- |
| 202         |

### Errors

| HTTP Status | Error Code             | Description                                                                                                                     |
| ----------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters                                                                                                          |
| 400         | `MissingBody`          | Request body is missing.                                                                                                        |
| 400         | `InvalidBody`          | Request validation errors. See InnerErrors.                                                                                     |
| 403         | `Forbidden`            | Not authorized to use this endpoint. Make sure your authorization header is correct and you are using valid API key and secret. |
| 404         | `NotFound`             | Exchange Request not found.                                                                                                     |
| 409         | `Conflict`             | Exchange Request cannot be accepted because it already has been accepted or failed.                                             |
| 500         | `InternalServerError`  | Server error.                                                                                                                   |


# Order Book

## `GET v1/OrderBook/:conversion`

Get current order book.

### Request

#### Path Parameters

| Attribute  | Type     | Description                                                                                   |
| ---------- | -------- | --------------------------------------------------------------------------------------------- |
| conversion | `string` | Conversion symbol. See [conversion](/api/currency-and-conversion-symbols#conversion-symbols). |

### Response

| HTTP Status | Return Object                                      |
| ----------- | -------------------------------------------------- |
| 200         | array of [Orders](/exchange-api/order-book#order). |

#### Order

| Attribute | Type     | Description                                                  |
| --------- | -------- | ------------------------------------------------------------ |
| Amount    | `string` | Amount of available in the order.                            |
| Price     | `string` | Price. The unit is `<exchanged currency>/<source currency>`. |

### Errors

| HTTP Status | Error Code             | Description            |
| ----------- | ---------------------- | ---------------------- |
| 400         | `InvalidUrlParameters` | Invalid URL parameters |


# What is Gluwacoin

Gluwacoin is an interoperable stablecoin standard that can serve as a viable medium of exchange and unit of account for decentralized applications.

Welcome to Gluwacoin documentation! Our goal is to create a stablecoin standard with usability, expandability, and, of course, stability.

The Gluwacoin standard is a cryptographic token standard. Gluwacoin is issued by a Delaware trust company,  strictly pegged 1:1 to a target fiat currency, and built on the [Ethereum network](https://ethereum.org/) according to the ERC20 standard for tokens. The issuer can create a different type of Gluwacoin by pegging it to a different fiat currency. For example, the Gluwacoin pegged to the U.S. dollar is called USD Gluwacoin.

The Gluwacoin standard supports its users to transfer the token on the Ethereum network without paying the transfer fee in Ether but paying the transfer fee in Gluwacoin. Gluwacoin is a stablecoin that combines the creditworthiness and price stability of fiat currency with the technological advantages of a cryptocurrency. Gluwacoins are minted at the time of deposit into the Gluwa platform and burnt at the time of withdrawal from the Gluwa platform.

Gluwacoin create inter-blockchain network by supporting functions for non-custodial exchange use cases. Instead of trusting a 3rd party to hold Gluwacoins for an exchange, a user can request the 3rd party to lock Gluwacoins at the user’s account instead. The locked Gluwacoins are called a reserve and can only be released to the pre-designated receiver or unlocked back to the sender. Note that the exchange can happen not only between Gluwacoins but also with other cryptocurrencies. To do so, the other cryptocurrency will have to support functions equivalent to the Gluwacoin non-custodial exchange functions. For instance, Bitcoin is compatible with Gluwacoin non-custodial exchange when utilizing a 2-to-3 multi-sig wallet.

Read our [white paper](http://gluwacoin.com/white-paper) to learn more about Gluwacoin.


# Gluwacoin Token Standard

Learn how Gluwacoin extends the ERC20 token standard

### Simple Summary

A standard interface for interoperable stablecoin tokens.

### Abstract

The following standard allows for the implementation of a standard API for interoperable stablecoin tokens compliant with the ERC20 token standard. This standard provides every standard ERC20 token method and, additionally, six custom methods for circulation control, Etherless transfer, and non-custodial exchange.

### Motivation <a href="#motivation" id="motivation"></a>

A standard interface that allows stablecoins to enhance usability and interoperability by enabling Etherless transfer and non-custodial exchanges.

## Specifications

### Token <a href="#token" id="token"></a>

{% content-ref url="/pages/-M1UFcvQBaRiPuWx-8uE" %}
[Methods](/gluwacoin/gluwacoin-token-standard/methods)
{% endcontent-ref %}

{% content-ref url="/pages/-M1XiredX1wHvsoOvuLM" %}
[Events](/gluwacoin/gluwacoin-token-standard/events)
{% endcontent-ref %}

## Implementation

Example implementations are available at

* [Gluwa implementation](https://github.com/gluwa/Gluwacoin)


# Methods

Learn custom methods of the Gluwacoin standard

Gluwacoin provides every standard ERC20 token function and, additionally, eight custom functions for circulation control, Etherless transfer, and non-custodial exchange.

## Circulation Control Functions

The contract owner of Gluwacoin can control the supply creating or destroying Gluwacoins.

### mint

*Reserved for the contract owner.* Creates new Gluwacoins and transfers them to a designated address.

```javascript
function mint(address _to, uint256 _value) public onlyOwner returns (bool success)
```

### burn

*Reserved for the contract owner.* Removes Gluwacoins the owner holds from the circulation.

```javascript
function burn(uint256 _value) public onlyOwner returns (bool success)
```

## Etherless Transfer Functions

Gluwacoin standard supports Etherless transfer for Gluwacoin users. Instead of paying gas to transfer Gluwacoin, a user pays a transfer fee in Gluwacoin to the contract owner.

### transfer

A standard ERC20 function but with `_fee`,`_nonce`, and `_sig`as extra parameters. `_fee`is a transfer fee amount in Gluwacoin, which the sender will pay for the transaction. `_sig` is a signature created by signing the transfer information with the sender’s private key. Anyone can initiate the transfer for the sender by calling the Etherless Transfer function with the transfer information and the signature. The caller will have to pay the gas for calling the function.

```javascript
function transfer(address _from, address _to, uint256 _value, uint256 _fee, uint256 _nonce, bytes memory _sig) public returns (bool success)
```

## Non-custodial Exchange Functions

Gluwacoin supports functions for non-custodial exchange use cases. Instead of trusting a 3rd party to hold Gluwacoins for an exchange, a user can request the 3rd party to lock Gluwacoins at the user’s account instead. The locked Gluwacoins are called a reserve and can only be released to the pre-designated receiver or unlocked back to the sender.

Note that the exchange can happen not only between Gluwacoins but also with other cryptocurrencies. If a cryptocurrency supports features equivalent to the Gluwacoin non-custodial exchange functions, it is compatible. For instance, Bitcoin is compatible with Gluwacoin non-custodial exchange when utilizing a 2-to-3 multi-sig wallet.

### reserve

Creates a reserve in `_from` address. The amount of the reserve is `_amount` and each reserve has `_nonce`  which is unique together with `_from` . Assigns receiver's address `_to` and the validator's address `_executor`.`_expiryBlockNum` specifies when the `_from` address can reclaim the reserve in case the reserve is unused. `_sig` is a signature created by signing the transfer information with the `_from` address' private key.

```javascript
function reserve(address _from, address _to, address _executor, uint256 _amount, uint256 _fee, uint256 _nonce, uint256 _expiryBlockNum, bytes memory _sig) public returns (bool success)
```

### execute

Releases a fund reserved in `_sender` address. The reserve is specified by `_nonce`*.* The released fund is transferred to `_to` addres&#x73;*.* Reserved for the `_executor`. Note that `_to` and `_executor` are pre-determined when the reserve was created.

```javascript
function execute(address _sender, uint256 _nonce) public returns (bool success)
```

### reclaim

Returns a fund reserved in `_sender` address. The reserve is specified by `_nonce`*.* The fund is transferred to `_from` address. Reserved for the `_from`  and `_executor`. While `_executor` can call the function any time, `_from` can only call after `_expiryBlockNum`. Note that `_from`, `_executor`, and `_expiryBlockNum`  are pre-determined when the reserve was created.

```javascript
function reclaim(address _sender, uint256 _nonce) public returns (bool success)
```


# Events

Learn custom events of the Gluwacoin standard

### Mint

MUST trigger on any successful call to `mint(address _to, uint256 _value)`.

```javascript
event Mint(address indexed _mintTo, uint256 _value)
```

### Burnt

MUST trigger on any successful call to `burn(address _to, uint256 _value)`.

```javascript
event Burnt(uint256 _value)
```


# Terms of Use

Welcome to Gluwacoin! Please read these Terms of Use and our [Privacy Policy](/gluwacoin/legal/privacy-policy) (collectively the “Terms”) carefully, as you agree that you consent to these Terms by your use of this website and Gluwacoin’s services, as described further below.

## **Acceptance of the Terms of Use**

These terms of use are entered into by and between you and Gluwacoin LLC (“**Company**,” “**Gluwacoin**,” “**we**,” “**our**,” or “**us**”), and they govern your access to and use of our online software platform (the “**Platform**”), including any content, functionality, and services offered on or through the Platform, whether as a guest or a registered user.  &#x20;

Please read the Terms carefully before you use the Platform. By using the Platform, or by clicking to accept or agree to the Terms of Use when this option is made available to you, you accept and agree to be bound and abide by these Terms of Use and our Privacy Policy, incorporated herein by reference. **If you do not agree to these Terms of Use or the Privacy Policy, do not access or use the Platform or any Gluwacoin services.**

## **Eligibility**

The Platform is only intended for adults eighteen (18) years of age and older. You are not allowed to use the Platform or provide information on it if you are under eighteen (18) years of age. The Platform is limited to users who meet the Anti-Money Laundering and Counter Terrorism Financing customer due diligence requirements outlined below.

## **Changes to the Terms of Use and Platform**

We will likely change and update these Terms from time to time, and these changes are effective as soon as we post them on the Platform. If you continue to use the Platform following the posting of any revised Terms, you are accepting and agreeing to the changes.&#x20;

We may also update the content on the Platform as we see fit, but do not guarantee that any content is necessarily complete or up-to-date.

## **Gluwacoin Services**

The Platform is an online environment to purchase USD Gluwacoin, KRW Gluwacoin, and other stable cryptocurrency tokens (each a “**Gluwacoin**”  and collectively “**Gluwacoins**”) for US Dollars, Korean Won, and other fiat currencies, respectively. You may also redeem Gluwacoin tokens for the respective fiat currency on the Platform. Gluwacoins are not money, legal tender, and are not monetary instruments. They are also not stored value or currency. Once you have Gluwacoin tokens, you can trade them, keep them, or use them to pay persons that will accept your Gluwacoin tokens, or redeem them for the respective fiat currency backing the tokens on the Platform.&#x20;

Gluwacoin tokens are fully backed by the currency used to purchase them at issuance, cash equivalents, or short-term government securities denominated in the same underlying currency. Gluwacoin holders can purchase or redeem tokens for their respective fiat currencies held in escrow accounts managed by our independent fiduciary network through the Platform. The Platform is only intended to facilitate such purchases and redemptions. The Company utilizes Gluwacoin’s asset tokenization smart contracts and escrow accounts managed by banks, depository institutions, or trust companies (each a “Banking Partner” and together our “Banking Partners”)  in order to maintain 1 to 1 parity between Gluwacoin tokens and the fiat currencies, cash equivalents, or short-term government securities held in escrow accounts for the benefit of our users. The Company itself does not guarantee any right of redemption or exchange of Gluwacoin tokens for fiat currency.&#x20;

The Company reserves the right to refuse to issue or redeem Gluwacoin tokens, without limiting the generality of the foregoing, if any act, conduct, transaction, omission, or misrepresentation, or the party requesting the issuance or redemption, violates, attempts to violate, causes, aids, or abets the violation of any applicable laws, statutes, ordinances, or regulations; is suspected or believed to be blocked property, frozen assets, or economic resources, or the proceeds of any crime, terrorist financing, or corruption related to any person or government official under any applicable laws; or exposes the Company to sanctions, restrictions, or penalties.

## **No Class Proceedings**

You and we agree that any party hereto may bring claims against the other on an individual basis only and not as a plaintiff or class member in any purported class or representative action or proceeding. Unless the parties agree otherwise, any adjudicator of any claim—whether judicial or otherwise—may not consolidate or join more than one party’s claims and may not otherwise preside over any form of a consolidated, representative, or class proceeding. Any adjudicator of any claim may award relief, including monetary, injunctive, and declaratory relief, only in favor of the party seeking relief, and only to the extent necessary to provide relief necessitated by that party’s claim(s). Any relief awarded cannot affect other users of the Platform or of any Services.

## **Anti-Money Laundering and Counter-Terrorist Financing**

We are committed to providing you with safe, compliant, and reputable services through the Platform. Accordingly, we insist on a comprehensive and thorough customer due diligence process and implementation and ongoing analysis and reporting. This includes monitoring of and for suspicious transactions and mandatory reporting to international regulators.

We reserve the right to refuse registration to, or to bar transactions from or to, anyone from or in jurisdictions that do not meet international AML–CTF standards as set out by the FATF; to anyone that is a Politically Exposed Person within the meaning of the FATF’s 40 Recommendations; or, that fails to meet any of our customer due diligence standards, requests, or requirements. In lieu of refusing registration, we may perform enhanced customer due diligence procedures. At all times, you may be subject to enhanced customer due diligence procedures in your use of the Platform and any related service. The Company will validate and verify your identity based on the information provided. As part of our Know Your Customer (KYC) policy and ongoing monitoring of account activity, we may request additional information and documentation from you in the future. If we are unable to contact you and verify your identity in the future, we may need to close your account.

The Company will cooperate with applicable law enforcement and regulatory authorities where it is required to do so and will share information if there are reasonable grounds to believe that a Gluwacoin is being used for illegal purposes.

We reserve the right to prohibit specific cryptocurrency exchanges from accessing the Platform, receiving Gluwacoin tokens, or transferring Gluwacoin tokens if the exchange has not been preapproved by the Company or the Company is properly directed to do so by law enforcement or a court of competent jurisdiction. We reserve the right to restrict or prohibit the listing or trading of a Gluwacoin on any exchange in our sole and absolute discretion. Any exchange that lists a Gluwacoin token represents and warrants to the Company that by doing so it is duly organized, registered, licensed, and shall comply with all applicable laws and rules in every jurisdiction in which it operates. Furthermore, any exchange listing a Gluwacoin token represents and warrants to the Company that by doing so it has Anti-Money Laundering (“**AML**”) and Counter Terrorist Financing controls meeting the requirements in every jurisdiction in which it operates. The Company will make reasonable efforts to notify and inform exchanges in advance of any such restriction or prohibition, unless the Company is prohibited from doing so by law enforcement or under an order from a court of competent jurisdiction.

## **Accessing the Platform**

We reserve the right to amend the Platform, and any service or material we provide on the Platform, in our sole discretion without notice. This includes, but is not limited to, replacing the existing Gluwacoin smart contracts with new smart contracts or moving any Gluwacoin token to a new blockchain. In the event that a Gluwacoin smart contract is replaced or moved to a new blockchain, balances will be transferred and the old Gluwacoin tokens will not be valid for any purpose and shall be frozen.&#x20;

Should a blockchain on which a Gluwacoin token is on forks, we reserve the right to select the new fork based on factors that include, but are not limited to, community adoption and long-term viability. In the event of a fork, all Gluwacoin tokens on the non-chosen fork will not be valid for any purpose and shall be frozen. The Company defines a blockchain fork as a protocol upgrade that breaks backward compatibility. The Company shall have sole and absolute discretion in defining a blockchain fork.&#x20;

In order to cause Gluwacoin tokens to be issued or redeemed by the Company, you must be a verified customer of the Company. You must create an account on the Platform and pass any bank verifications and KYC/AML validation requirements that we or our independent fiduciary partners require. It is a condition of your use of the Platform that information you enter into the Platform your account is correct, current, and complete. All information you enter into the Platform is governed by our Privacy Policy.&#x20;

We reserve the right to deny access to the Platform to anyone or cancel an account for any or no reason, including but not limited to violations of these Terms, applicable laws and regulations, or engaging in any Prohibited Uses as outlined below, and at any time, at our sole discretion. If we terminate your account for any reason, we’ll provide you with notice of our actions and make any unrestricted Gluwacoin tokens available for redemption.

We reserve the right to prohibit wire submissions of fiat currency or redemption requests of Gluwacoins if the total amount submitted or requested is less than $10,000 USD, ₩10,000 KRW, or the equivalent amount of the respective fiat currency used to purchase a Gluwacoin.

## **Account Security**

You are solely responsible for maintaining the confidentiality of your account information, as well as any and all activities that occur under your account. You must immediately notify us of any unauthorized use of your account and any other such security breach. We will not be liable for any loss that may occur as a result of someone else using your account or password, with or without your knowledge. You should use particular caution when accessing your account from a public or shared computer so that others are not able to view or record your password or other personal information.

We have the right to disable any account at any time in our sole discretion if, in our opinion, you have violated any provision of these Terms of Use.

## **Fees**

The Company does not take any responsibility for any bank transfer, wire, or any other fees or costs (“**Fees**”) associated with the purchase or redemption of any Gluwacoin product. Any Fees incurred by you during the purchase or redemption of a Gluwacoin product shall be deducted from the amount being purchased or redeemed before the balance is transferred to you. For example, if you wire $10,000 to purchase USD Gluwacoin and there is a wire fee of $25.00, you will then receive 9,975 USD-G in your ERC-20 wallet.

You are responsible for all on-chain transaction costs associated with on-chain transfers of any Gluwacoin product. The Company does not charge any Fees for purchasing or redeeming any Gluwacoin and does not charge any on-chain transaction fees in addition to the blockchain-specific transaction fees associated with such transfers.

## **Taxes**

You are solely liable for all the taxes, fees, and commissions resulting from the use of the Platform. These Terms of Use alone do not create a joint venture, partnership, or principal-agent relationship between you and the Company, or any other users, and nothing in these Terms of Use may be used to imply such a relationship. You agree to indemnify the Company from any liability for, or assessment of, any claims or penalties with respect to such taxes, labor, or employment requirements, including any liability for, or assessment of taxes imposed on the Company by the relevant taxing authorities with respect to any fees paid to you as the result of using the Platform.

## **Assumption of Risk; No Advice**

Cryptocurrency markets are volatile and shift quickly in terms of liquidity, market depth, and trading dynamics. You are solely responsible and liable for your account on the Platform and knowing the true status of your Gluwacoin tokens even if the information on the Platform is displayed incorrectly.&#x20;

The Company does not provide investment advice. The information contained within the Platform is for informational purposes only, and the Company is not soliciting any action based upon such materials. The material is not to be construed as investment advice. We do not provide any consultation on the advisability of purchasing any Gluwacoin, the timing of a purchase or redemption, or any other matters regarding the purchase or redemption of any Gluwacoin, such as trading techniques, models, algorithms, or any other schemes. Additionally, the material accessible through the Platform does not constitute a representation that the purchase of any Gluwacoin tokens are suitable or appropriate for you.

## **Risks**

Please note the following risks in purchasing and using Gluwacoin:

**Not a Bank Account**

Your account with us (and any available assets held in such account) is not a bank account or a deposit account. Gluwacoin tokens are not financial instruments and the Company may not be regulated as a financial institution in your jurisdiction. No interest will be paid on any funds or other assets held in your account and all assets directly held by the Company are not insured by the Company or, except as set forth below, any third party or any government agency. The Company may collect interest on the fiat deposits held in the Gluwacoin escrow accounts.&#x20;

**FDIC Coverage and Sweeps**

The Company works with independent third-party financial institutions to provide cash management for the fiat deposits backing Gluwacoin tokens so that each Gluwacoin token is backed by an equivalent amount of fiat deposits, cash equivalents, or short-term government treasuries.  To achieve this, a portion of the fiat deposits backing USD Gluwacoin are held in one or more depository accounts at our Banking Partners whose deposits may be insured by the Federal Deposit Insurance Corporation (“**FDIC**”). US Dollar depository accounts are generally protected by FDIC insurance up to $250,000 in each insured bank for each account ownership category.  However, since the depository accounts are large volume transaction accounts with balances exceeding this deposit insurance limit, the Company has taken additional steps to provide protection for the funds.&#x20;

To provide additional protection, the independent third-party financial institution bank or trust company may either: (1) deposit US Dollar funds in multiple FDIC-insured US banks to provide full insurance coverage, (2) utilize sweep accounts that can protect the deposits through overnight investments in US Government Treasuries, or (3) invest US Dollar funds in cash equivalents or short-term government treasuries. Due to the large amount of fiat deposits backing the USD Gluwacoin tokens, a portion of these deposits may be deposited in non-FDIC insured US bank accounts or depository accounts at non-US banks subject to the local laws or invested in cash equivalents or short-term government treasuries. Therefore, there may be a risk of loss to these funds associated with the solvency of the US bank or non-US banks holding such funds or other factors.

FDIC insurance is not applicable to the fiat deposits backing non-USD Gluwacoins. Non-USD Gluwacoins are held at one or more depository accounts at our Banking Partners. To provide protection, the independent third-party financial institution bank or trust company may utilize sweep accounts that can protect the deposits through overnight investments in government-backed securities. For example, South Korea Government Treasuries may be utilized for KRW deposits.

**Theft and Loss**

Any depository account maintained by an independent third-party financial institution for the benefit of Gluwacoin token holders may not be sufficient to cover all losses due to theft or fraud incurred by our Gluwacoin holders. Transactions in Gluwacoins may be irreversible, and, accordingly, losses due to fraudulent or accidental transactions may not be recoverable.&#x20;

**Market Value**

The market value of Gluwacoin tokens may be derived from the continued willingness of market participants to exchange fiat currency or digital assets for Gluwacoin tokens, which may result in the potential for permanent and total loss of value of Gluwacoins in the market.&#x20;

**Redemption of Gluwacoins**

All Gluwacoin tokens will be rounded down to the nearest amount of the lowest circulating denomination of the underlying representative fiat currency (e.g., US cent or Korean won) respectively, upon redemption.

## **Feedback**

In the event that you provide us any ideas, thoughts, criticisms, suggested improvements, or other feedback related to Platform (collectively “**Feedback**”), you agree that we may use the Feedback in any way we deem appropriate to: (a) improve our Platform and (b) promote the Platform, and that you will not be due any compensation for your Feedback that is used in these ways.

## **Intellectual Property Rights**

The Platform and its entire contents, features, and functionality (including but not limited to all information, software, text, displays, images, video and audio, and the design, selection, and arrangement thereof), are owned by the Company, its licensors, or other providers of such material and are protected by United States and international copyright, trademark, patent, trade secret, and other intellectual property or proprietary rights laws.

These Terms of Use permit you to use the Platform for your use only, subject to the following restrictions:&#x20;

* You must not reproduce, distribute, modify, create derivative works of, publicly display, publicly perform, republish, download, store, or transmit any of the material on the Platform, except as it is created and owned by you.&#x20;
* You must not delete or alter any copyright, trademark, or other proprietary rights notices from copies of materials from this site.
* No right, title, or interest in or to the Platform or any content on the Platform is transferred to you, and all rights not expressly granted are reserved by the Company.

## **Prohibited Uses**

You may use the Platform only for lawful purposes and in accordance with these Terms of Use. You agree not to use the Platform:

* In any way that violates any applicable federal, state, local, or international law or regulation (including, without limitation, any laws regarding the export of data or software to and from the US or other countries).
* For the purpose of exploiting, harming, or attempting to exploit or harm minors in any way by exposing them to inappropriate content, asking for personally identifiable information, or otherwise.
* To transmit, or procure the sending of, any advertising or promotional material, including any “junk mail”, “chain letter,” “spam,” or any other similar solicitation.
* To impersonate or attempt to impersonate the Company, a Company employee, another user, or any other person or entity.&#x20;
* In any way that infringes upon the rights of others, or in any way is illegal, threatening, fraudulent, or harmful, or in connection with any unlawful, illegal, fraudulent, or harmful purpose or activity.
* To engage in any other conduct that restricts or inhibits anyone’s use or enjoyment of the Platform, or which, as determined by us, may harm or offend the Company or users of the Platform or expose them to liability.
* By means of any robot, bot spider, or other automatic device or process, or by any manual process, intended to monitor or copy any of material on the Website or for any other unauthorized purpose.
* In order to disguise the proceeds of, or to further, any breach of applicable laws or regulations, or to deal in any contraband USD Gluwacoins, other digital tokens, funds, or proceeds.
* To use any funds or other value on the Platform, or use any Services, with anything other than funds, keys, Gluwacoins, or other digital tokens that have been legally obtained by you and that belong to you.
* To interfere with or subvert our rights or obligations or the rights or obligations of any other Platform customer or any other third party;
* To engage in conduct that is detrimental to us or to any other Platform customer or any other third party;
* To falsify any account registration details provided to us;
* To falsify or materially omit any information or provide misleading information requested by us in the course of, directly or indirectly relating to, or arising from your activities on the Platform or the use of any Services, including at registration;
* To reverse-engineer, decompile, or disassemble any software running on the Platform; or, attempt to harm us through your access to the Platform or any Services, except that nothing in this subparagraph shall be construed as limiting your free speech rights under applicable law.

## **Reliance on Information Posted**

We do not warrant the accuracy, completeness, or usefulness of any information on the Platform. Any reliance you place on such information is strictly at your own risk. We disclaim all liability and responsibility arising from any reliance placed on such materials by you or any other visitor to the Platform, or by anyone who may be informed of any of its contents.

The Platform includes content provided by third parties, including materials provided by other users, attorneys, third-party licensors, syndicators, aggregators, and/or reporting services. All statements and/or opinions expressed in these materials, other than the content provided by the Company, are solely the opinions and the responsibility of the person or entity providing those materials. We are not responsible, or liable to you or any third party, for the content or accuracy of any materials provided by any third parties.

## **Links from the Platform**

Links to any third-party websites on the Platform are provided for your convenience only. We have no control over the contents of those sites or resources. If you decide to access any of the third-party websites linked to the Platform, you do so entirely at your own risk and subject to the terms and conditions of use for such websites.

## **Users Outside the U.S.**

The Platform is controlled and operated from the United States and is subject to its laws. If you choose to access the Platform outside of the United States, you do so at your own risk and are responsible for complying with all applicable laws, rules, and regulations.

## **Disclaimer of Warranties**

YOUR USE OF THE PLATFORM, ITS CONTENT, GLUWACOIN TOKENS AND ANY SERVICES OR ITEMS OBTAINED THROUGH THE PLATFORM IS AT YOUR OWN RISK. THE PLATFORM, ITS CONTENT, GLUWACOIN TOKENS, AND ANY SERVICES OR ITEMS OBTAINED THROUGH THE PLATFORM ARE PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS, WITHOUT ANY WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED.&#x20;

NEITHER THE COMPANY NOR ANY PERSON ASSOCIATED WITH THE COMPANY MAKES ANY WARRANTY OR REPRESENTATION WITH RESPECT TO THE COMPLETENESS, SECURITY, RELIABILITY, QUALITY, ACCURACY, OR AVAILABILITY OF THE PLATFORM OR GLUWACOIN TOKENS. WITHOUT LIMITING THE FOREGOING, NEITHER THE COMPANY NOR ANYONE ASSOCIATED WITH THE COMPANY REPRESENTS OR WARRANTS THAT THE PLATFORM, ITS CONTENT, GLUWACOIN TOKENS, OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE PLATFORM WILL BE ACCURATE, RELIABLE, ERROR-FREE, OR UNINTERRUPTED, THAT DEFECTS WILL BE CORRECTED, THAT THE PLATFORM OR THE SERVER THAT MAKES IT AVAILABLE ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS, OR THAT THE PLATFORM, GLUWACOIN TOKENS, OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE PLATFORM WILL OTHERWISE MEET YOUR NEEDS OR EXPECTATIONS.

THE COMPANY HEREBY DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS OR IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, AND FITNESS FOR PARTICULAR PURPOSE.

THE FOREGOING DOES NOT AFFECT ANY WARRANTIES WHICH CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW.

## **Limitation on Liability**

IN NO EVENT WILL THE COMPANY, ITS AFFILIATES, OR THEIR LICENSORS, SERVICE PROVIDERS, EMPLOYEES, AGENTS, OFFICERS, OR DIRECTORS BE LIABLE FOR DAMAGES OF ANY KIND, UNDER ANY LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH YOUR USE, OR INABILITY TO USE, THE PLATFORM, ANY WEBSITES LINKED TO IT, ANY CONTENT ON THE PLATFORM, GLUWACOIN TOKENS, OR ANY SERVICES OR ITEMS OBTAINED THROUGH THE PLATFORM, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO, PERSONAL INJURY, PAIN AND SUFFERING, EMOTIONAL DISTRESS, LOSS OF REVENUE, LOSS OF PROFITS, LOSS OF BUSINESS, OR ANTICIPATED SAVINGS, LOSS OF USE, LOSS OF GOODWILL, LOSS OF DATA, AND WHETHER CAUSED BY TORT (INCLUDING NEGLIGENCE), BREACH OF CONTRACT, OR OTHERWISE, EVEN IF FORESEEABLE.

IN NO EVENT WILL THE COLLECTIVE LIABILITY OF THE COMPANY AND ITS SUBSIDIARIES AND AFFILIATES, AND THEIR LICENSORS, SERVICE PROVIDERS, EMPLOYEES, AGENTS, OFFICERS, AND DIRECTORS, TO ANY PARTY (REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT OR OTHERWISE) EXCEED THE AMOUNT YOU HAVE PAID TO THE COMPANY FOR THE APPLICABLE SERVICES IN THE LAST 12 MONTHS OUT OF WHICH LIABILITY AROSE.

THE FOREGOING DOES NOT AFFECT ANY LIABILITY WHICH CANNOT BE EXCLUDED OR LIMITED UNDER APPLICABLE LAW.

## **Indemnification**

You agree to defend, indemnify, and hold harmless the Company, its affiliates, licensors, and service providers, and its and their respective officers, directors, employees, contractors, agents, licensors, suppliers, successors, and assigns from and against any claims, liabilities, damages, judgments, awards, losses, costs, expenses, or fees (including reasonable attorneys’ fees) (collectively “Claims”) arising out of or relating to: (i) your violation of these Terms of Use; or (ii) your use of the Platform, or (iii) your purchase or redemption of any Gluwacoin.

## **Governing Law**

All matters relating to the Platform and these Terms and any dispute or claim arising therefrom or related thereto shall be governed by the internal laws of the State of California without giving effect to any choice or conflict of law provisions or rules.

## **Arbitration**

At the Company’s sole discretion, it may require you to submit any disputes arising from the use of these Terms of Use or the Platform, including disputes arising from or concerning their interpretation, violation, invalidity, non-performance, or termination, to final and binding arbitration under the Rules of Arbitration of the American Arbitration Association applying California law.

## **Waiver and Severability**

No waiver by the Company of any term or condition set forth in these Terms shall be deemed a further or continuing waiver of such term or condition, and any failure of the Company to assert a right or provision under these Terms shall not constitute a waiver of such right or provision.

If any provision of these Terms is held by a court or other tribunal of competent jurisdiction to be invalid, illegal or unenforceable for any reason, such provision shall be eliminated or limited to the minimum extent such that the remaining provisions of the Terms will continue in full force and effect.

## **Entire Agreement**

The Terms of Use and our Privacy Policy constitute the sole and entire agreement between you and the Company. with respect to the Platform and supersedes all prior and contemporaneous understandings, agreements, representations and warranties, both written and oral, with respect to the Platform.

## **Your Comments and Concerns**

All feedback, comments, requests for technical support and other communications relating to the Platform should be directed to: [legal@Gluwacoin.com](mailto:legal@truecoin.com).


# Privacy Policy

## **Introduction**

Gluwacoin LLC ("Company," "our," "we") understands the importance of privacy, especially when it comes to your personal information. Data privacy and your trust are our top priorities, and in this Privacy Policy we explain what information we collect from you when you use our online asset tokenization platform (the "Platform"), how we will use this information, and the very limited ways that we may share your information. Please read this policy carefully to understand our policies and practices regarding your information, as you agree to this Privacy Policy by using the Platform. **If you do not agree with our policies and practices, do not use the Platform.** This Privacy Policy is part of our [Terms of Use](/gluwacoin/legal/terms-of-use).

## **Users Under Age 18**

The Platform is only intended for adults eighteen (18) years of age and older. You are not allowed to use the Platform or provide information on it if you are under eighteen (18) years of age. If we learn we have received personal information from or about a child under 13 without verification of parental consent, we will delete that information immediately. If you believe we might have any information from or about a child under thirteen (13) without parental consent, please contact us immediately at <legal@gluwacoin.com>.

## **What Data Do We Collect?**

We collect several types of information from and about users of the Platform depending on how they are using the Platform, including:

* Personal identification information about you, such as your name, address, phone number, and email address;
* Information about your financial information, such as bank accounts and cryptocurrency wallet addresses;
* Information that is needed to complete a Know Your Customer (KYC) & Anti-money Laundering (AML) check; and
* Any other information you voluntarily provide on the Platform in the ordinary course of the continuation of the relationship; and
* Information about your internet connection, the equipment you use to access the Platform, and Platform usage details.

## **How Do We Collect Your Data?**

You directly provide us with most of the data we collect. We collect data and process data when you:

* Register online for an account or enter information into the Platform when prompted or permitted.
* Voluntarily complete a customer survey or provide feedback on any of our message boards or via email.
* Use or view our website via your browser’s cookies.
* Navigate through the Platform. We collect generic information about your usage and equipment automatically, such as usage details, IP addresses, web browser preferences, and information collected through cookies and other tracking technologies. Although we do not correlate tracking information to individuals, some information collected, such as IP addresses, will be unique.

## **Do Not Track Settings**

We do not track, plant cookies, or use advertising when a Do Not Track (DNT) browser mechanism is in place.

## **How Will We Use Your Data?**

From time to time, it is necessary for customers to supply us with data in connection with the opening or continuation of accounts, the establishment or continuation of facilities or provision of services, or in compliance with any laws or guidelines issued by regulatory or other authorities. We use the information that we collect about you or that you provide to us, including personal information:

* To process your purchases and redemptions of any product and manage your account.
* To email you with special offers on other products and services we think you might like.
* To continue the daily operation of the services and facilities provided to customers.
* To meet the requirements to make disclosures under the requirements of any law binding on the Platform under and for the purposes of any guidelines issued by regulatory or other authorities with which the Platform is expected to comply.
* To provide you with information, products, or services that you request from us.
* To verify the information that you provide to use and validate you through the KYC/AML process required by our fiduciary partners.
* To provide you with notices about your account and payments.
* To carry out our obligations and enforce our rights arising from any contracts entered into between you and us, including for billing and collection.
* To notify you about changes to the Platform or any products or services we offer or provide though it.
* In any other way we may describe when you provide the information

## **Disclosure of Your Information**

If you agree, we will share your data with our affiliate companies so that they may offer you their products and services. These affiliate companies include Gluwa, Inc. We only collect personal information that we believe to be relevant and required to conduct our business. We may share your personal information with our business partners and service providers, but only to the extent that they each need to know specific information to continue to provide the Platform or services to you. This includes:

* Our contractors, employees, service providers, and other third parties that we use to support our business and improve the Platform;
* To our fiduciary and other financial partners to provide the Platform services to you;
* To a buyer or other successor in the event of a merger or reorganization if the personal information of our users is part of the assets transferred;
* To fulfill the purpose for which you provide it;
* To comply with any court order, law, or legal process, including to respond to any government or regulatory request;
* To third party contractors in order to analyze Platform performance and user behavior and/or to improve the Platform;
* If we believe disclosure is necessary or appropriate to protect the rights, property, or safety of the Platform, our users, or others; or
* For any other purpose disclosed by us when you provide the information. We may disclose aggregated information about our users, which means information that does not identify any individual, without restriction. As an example, we may include in our marketing materials that a certain percentage of our users are female, but we won’t share a list of all female users in these materials.

## **How Do We Store Your Data?**

To provide you with the Services described in our Terms of Use, we may securely store, process and transmit information in the United States and locations around the world - including those outside your country. In order to comply with local laws and regulations, we will keep your personal identifying information for seven (7) years from the date you terminate your account. Once this time period has expired, we will delete your data by deleting it from our Postgres relational database and scrubbing it from all third-party systems.

## **Data Security**

We have implemented measures designed to secure your personal information from accidental loss and from unauthorized access. For example, access by a user to his or her personal information is available through a unique customer ID and password selected by the user that should be regularly updated. This information is encrypted through the Platform with Secure Socket Layer technology (SSL) and is also encrypted when it is stored by us to prevent unauthorized parties from viewing such information. Also, we perform regular malware monitoring of the Platform and all servers and computers used by us to support the Platform. All Company employees are required to adhere to our security and confidentiality procedures and undergo training related to maintaining the security of user personal information. The safety and security of your information also depends on you. Where you have chosen a password for access to certain parts of the Platform, you are responsible for keeping this password confidential. We ask you not to share your password with anyone and be careful about giving out information to other users on the Platform if requested. Unfortunately, the transmission of information via the internet is not completely secure. Although we do our best to protect your personal information, we cannot guarantee the security of your personal information transmitted to the Platform. Any transmission of personal information is at your own risk. We are not responsible for circumvention of any privacy settings or security measures contained on the Platform.

## **Marketing**

We would like to send you information about our products and services of ours that we think you may like, as well as those of our partner companies, including Gluwa and Creditcoin. If you have agreed to receive marketing, you may always opt out at a later date. You have the right at any time to stop us from contacting you for marketing purposes or giving your data to other members of our affiliate group. If you no longer wish to be contacted for marketing purposes, please unsubscribe from the marketing emails via the ‘unsubscribe’ link provided in the footer of the most recent marketing email or email <support@gluwa.com> and request to be removed from all marketing emails.

## **What Are Your Data Protection Rights?**

Our Company would like to make sure you are fully aware of all of your data protection rights. Every user is entitled to the following: **The right to access** - You have the right to request us for copies of your personal data. We may charge you a small fee for this service. **The right to rectification** - You have the right to request that we correct any information you believe is inaccurate. You also have the right to request us to complete the information you believe is incomplete. **The right to erasure** - You have the right to request that we erase your personal data, under certain conditions, and in compliance with applicable laws and regulations. **The right to restrict processing** - You have the right to request that we restrict the processing of your personal data, under certain conditions, and in compliance with applicable laws and regulations. **The right to object to processing** - You have the right to object to our processing of your personal data, under certain conditions, and in compliance with applicable laws and regulations. **The right to data portability** - You have the right to request that we transfer the data that we have collected to another organization, or directly to you, under certain conditions, and in compliance with applicable laws and regulations. If you make a request, we have one month to respond to you. If you would like to exercise any of these rights, please contact us at: [legal@](mailto:legal@gluwacoin.com)[g](mailto:legal@gluwacoin.com)[luwacoin.com](mailto:legal@gluwacoin.com).

## **Accessing and Correcting Your Information**

You can review and change your personal information by logging into the Platform and visiting your account page. You may also send us an email at [customerservice@](mailto:customerservice@gluwacoin.com)[g](mailto:customerservice@gluwacoin.com)[luwacoin.com](mailto:customerservice@gluwacoin.com) to request access to, correct, or delete any personal information that you have provided to us. We may not accommodate a request to change information if we believe the change would violate any law or legal requirement or cause the information to be incorrect.

## **What Are Cookies?**

Cookies are text files placed on your computer to collect standard Internet log information and visitor behavior information. When you visit our websites, we may collect information from you automatically through cookies or similar technology. For further information, visit [allaboutcookies.org](https://allaboutcookies.org/).

## **How Do We Use Cookies?**

We use cookies in a range of ways to improve your experience on our website, including:

* Keeping you signed in
* Understanding how you use our website

## **What Types of Cookies Do We Use?**

There are a number of different types of cookies, however, our website uses:

* **Functionality** - Our Company uses these cookies so that we recognize you on our website and remember your previously selected preferences. These could include what language you prefer and location you are in. A mix of first-party and third-party cookies are used.
* **Advertising** - Our Company uses these cookies to collect information about your visit to our website, the content you viewed, the links you followed and information about your browser, device, and your IP address. Our Company sometimes shares some limited aspects of this data with third parties for advertising purposes. We may also share online data collected through cookies with our advertising partners. This means that when you visit another website, you may be shown advertising based on your browsing patterns on our website.

## **How To Manage Your Cookies**

You can set your browser not to accept cookies, and the above website tells you how to remove cookies from your browser. However, in a few cases, some of our website features may not function as a result.

## **Third Party Links**

The Platform may contain links that lead to other websites, and the Company is not responsible for the privacy practices, content, and/or activities of these linked websites. Nonetheless, we seek to protect the integrity of the Platform and welcome any feedback about these external websites.

## **Privacy Policies from Other Websites**

Our websites contain links to other websites. Our privacy policy applies only to our websites, so if you click on a link to another website, you should read their privacy policy.

## **Changes to Our Privacy Policy**

We will post any changes we make to our privacy policy on this page and you will be notified of any material changes on the Platform home page and in an email to the most recent email address that you provided to us, if any.

## **Contact Information**

To ask questions, comment about this Privacy Policy and our privacy practices, or you would like to exercise one of your data protection rights, please do not hesitate to contact us. contact us at [legal@](mailto:legal@gluwacoin.com)[g](mailto:legal@gluwacoin.com)[luwacoin.com](mailto:legal@gluwacoin.com).

## **How To Contact The Appropriate Authorities**

Should you wish to report a complaint or if you feel that we have not addressed your concern in a satisfactory manner, you may contact the Information Commissioner’s Office: <https://ico.org.uk/global/contact-us/>


