Overview

With SMARTy Pay you as a payment service provider (or Partner) can accept cryptocurrency payments on behalf of your merchants, manage their accounts, and perform other payments related tasks. SMARTy Pay handles all interactions related to transferring payments from the buyer to the merchant's wallet.

You only need to add your merchants to SMARTy Pay through the Partner UI, configure basic parameters, and integrate with SMARTy Pay via API.

Payment process

To process a payment, the Partner must create the payment via the SMARTy Pay API on behalf of the Merchant and redirect the payer to the payment page (or embed this page in their application).

For interacting with the payment page, the buyer will need a digital wallet. However, if the buyer does not have one, SMARTy Pay will allow them to create a wallet on the fly in the browser using special technology (this will require a standard email or a Google account).

Next, the buyer interacts with the decentralized payment protocol through their web3 wallet and confirms the payment. After that, the buyer is redirected back to the Merchant's URL.

Let's explore the whole process in more detail step by step.

Step 1. Prepare the Merchant

Ensure that the Merchant for whom you are processing the payment is properly set up:

  1. Has a confirmed Merchant address.
  2. The Gas Wallet for the network where you plan to make the payment is created and has a positive balance of native tokens.

Step 2. Create a Payment

Create a payment through the appropriate endpoints in the SMARTy Pay API and receive a unique payment identifier.

Request

POST
/v1/payments
curl https://partner-api.smartypay.io/v1/payments \
    -u API_KEY:SECRET \
    -H "Content-Type: application/json" \
    -d '{
        "amount": {
            "value": "3",
            "currency": "btUSDTv2"
        },
        "merchantId": [your-merchant-id]
    }'

Response

{
    "id": "wv7xbaSP4ljdITbrFI995v",
    // ... other attributes
}

Step 3. Make the Payment

To make the payment, go to the payment form and provide the payment identifier (the identifier is wv7xbaSP4ljdITbrFI995v in this example):

Payment URL

https://checkout.smartypay.io/wv7xbaSP4ljdITbrFI995v

For interacting with the payment form, we recommend using MetaMask. Fund your address with some btUSDTv2 tokens, as well as native BNB tokens on the BSC Test Network.

To confirm the payment, go to the payment form, connect MetaMask, and follow the instructions.

Step 4. Check the Balance

After a successful payment, ensure that the Merchant's balance in the system has increased by the necessary amount. To do this in the Partner UI, go to the Merchant » Merchant's card » Balances tab or use the balances API.

You'll need a merchant id to make a request (the identifier is FdDQBuaqXoReYAxf9VtEBq in this example).

Request

GET
/v1/merchants/{merchantId}/balance
curl https://partner-api.smartypay.io/v1/merchants/FdDQBuaqXoReYAxf9VtEBq/balance \
     -u API_KEY:SECRET

Response

{
    "balances": [
        {
            "value": "3",
            "currency": "btUSDTv2"
        }
    ]
}

Payment states

Below is a diagram depicting the possible states for a payment. Use it to understand the overall processing flow as well as to grasp the potential transitions between states.

[State model here]