Skip to main content

Online Payment

Integrating MixPay into Online Payment takes only three steps.

Introduction

Before you get started, all you need to know is that it takes only three steps to integrate MixPay into the Online Payment. They are as follows.

  1. Create the payment link.
  2. Place the payment link on a button.
  3. Users scan the QR code to pay, and the Online Payment look queries the payment results.

More about MixPay, you can check this for reference.

API Integration

Before you start, you need to know that through the API of MixPay, the crypto paid by the user is settled directly to your Mixin bot, MixPay user or Mixin Wallet.

Mixin bot and MixPay user (ID of MixPay user is equal to Mixin ID) both have the same parameter, called UUID. This UUID is very important and determines the destination of the money received. The assets in your Mixin bot are programmable, and the assets in MixPay you can withdraw and manage easily.

Next, we start with a detailed guide.

  1. There is no need to register MixPay to use MixPay API. You can just use MixPay API with your preferred languages. MixPay API click here.
  2. Also, you can use this bot(7000101422) to get the Mixin UUID; just send the Mixin ID in the chat window to the bot. It's simple, and no programming is required. Also, you can get this UUID via this API, and you can click here for the tutorial.
  3. The ID of cryptocurrency you need to acquire. The type of assets is used for settlement and quote. Also, you can click here for detail about supported assets.
  1. You can use this API to integrate with MixPay. The specific parameters are as below. And you can place the payment link on a button, and the customers scan the QR code to pay.

And the traceId you can generate randomly. If you use Golang, the sample code is like below.

package main

import (
"fmt"
"github.com/google/uuid"
)

func main() {
id := uuid.New()
fmt.Println(id.String())
}

Assuming the traceId is dd9c3e04-a5d2-11ec-b909-0242ac120002 generated by the sample code, the full sample request and parameters are below.

Example request - Accepting Payments

You can copy the link and open it in a browser:

https://mixpay.me/pay?payeeId=a0d7791408776b47eb1dd3f94ed15d6a&settlementAssetId=c6d0c728-2624-429b-8e0d-d9d19b6592fa&quoteAssetId=usd&traceId=dd9c3e04-a5d2-11ec-b909-0242ac120002&remark=xxxxxx

Parameters

ParamOptionalTypeDescription
payeeId*requiredStringAccount ID for receiving crypto, pls see Five types of account and How to get payeeId.
settlementAssetIdoptionalStringassetId of settlement cryptocurrency. Settlement assets you prefer. If left blank, the payee will receive the cryptocurrency the user pays for. For more options, see here.
quoteAssetIdoptionalStringassetId of quote cryptocurrency. For more options, see here.
quoteAmountoptionalNumericAmount of cryptocurrency received, if left blank, the user can enter manually.
remarkoptionalStringPayment remark viewable by the payee.
traceIdoptionalStringUUID, used to prevent double payment.

When you've generated the payment link, you can place the payment link on a button on your website. Maybe you can use <button> HTML tag or create responsive buttons using JavaScript.

Step 3 - Look query the payment results

Then you can use this API to loop query payment results. The parameter is the traceId you generated. And the response is the status of payment. The status has three parameters, unpaid, failed and success.

JS Plugin

You can also integrate MixPay using the JS Plugin we provide. It helps you have a more user-friendly experience on mobile, such as automatically pulling up a wallet, and the user can select a certain wallet to pay. When the user doesn't have a wallet on their phone, they will be alerted to make a manual transfer.

Q & A

You can contact Robin(Mixin ID: 26930) directly if you have any further questions.