API URL

POST /api/v2/checkout

Request

Request Parameters

NameTypeRequiredDescription
pidinteger(int64)YProject id
noncestringY6 random string
timestampinteger(int64)YTimestamp
signstringYSignature
order_idstringYCan be used by the merchant to assign their own internal order ID to a payment. No more than 128 characters
order_amountstringYThe total payment amount, in the order currency
order_currencystringYISO 4217 3-character currency code. This is the currency associated with the order amount field

eg: USD、HKD
Get support currency from Get support fiat currency
order_detailsJSONStringNThe breakdown details of an order, each item will be displayed on the Cregis checkout page, under order details section
sub_merchantJSONStringNIf the merchant has a sub merchant assigned under this acquiring project, it can be used by the merchant to assign their own internal sub merchant ID to associate with a payment.
Field:
sub_merchant_id
sub_merchant_name
payer_idstringYCan be used by the merchant to assign their own internal user ID to associate with a payment
payer_namestringNPayer’s name
payer_emailstringNPayer’s email
tokensArrayStringNBy inputing corresponding token_name to this field to control the tokens you allow your customers to pay in. If this field is left blank, that means you accept all tokens supported by Cregis as the payin tokens by customers.

eg: [“USDT-TRC20”,“USDT-BEP20”]
Get support currency from Get support crypto currency
stablecoin_realtime_ratestringNDefault value:false
false:means using a fixed 1:1 exchange rate of USDT/USDC to USD
true:means using the real-time exchange rate of USDT/USDC to USD obtained on CoinMarketCap
underpaid_tolerancefloatNThe lower tolerance threshold for payment amount deviations of this order, underpaid_tolerance is calculated based on order_currency, and the default value is 0.
- The order status will be ‘paid’: When order actual pay-in amount falls within the upper and lower tolerance range
- The order status will be ‘partial_paid’: When order actual pay-in amount is lower than order receivable amount minus underpaid_tolerance value
- The order status will be ‘overpaid’: When order actual pay-in amount is higher than order receivable amount plus overpaid_tolerance value
For example:
The original order_currency is HKD, and the value for underpaid_tolerance is: 2.25, which means that the order is still considered paid exact if the underpayment is within 2.25 HKD, and the ‘paid’ order status will be returned. If the underpayment exceeds 2.25 HKD, it will return partial paid
overpaid_tolerancefloatNThe upper tolerance threshold for payment amount deviations of this order, overpaid_tolerance is calculated based on order_currency, and the default value is 0.
- The order status will be ‘paid’: When order actual pay-in amount falls within the upper and lower tolerance range
- The order status will be ‘partial_paid’: When order actual pay-in amount is lower than order receivable amount minus underpaid_tolerance value
- The order status will be ‘overpaid’: When order actual pay-in amount is higher than order receivable amount plus overpaid_tolerance value
For example:
The original order_currency is HKD, and the overpaid_tolerance is 3.50, which means that the order is still considered paid exact if an overpayment is HKD 3.50 or lower. If the overpayment exceeds HKD 3.50, the status will be returned as overpaid
accept_partial_paymentstringNDefault value: true
- false: If the merchant does NOT accept partial payment and needs user to pay remaining amount for partial paid orders
- true: If the merchant accepts partial payment and does NOT need user to pay remaining amount for partial paid orders
accept_over_paymentstringNDefault value: true
- false: If the merchant does NOT accept overpayment and needs to refund the overpaid value to user
- true: If the merchant accepts overpayment and does NOT needs to refund the overpaid value to user
languagestringNDefault value:en
Used to specify the default language for the Cregis checkout page or emails. The optional are:
en - English
tc - Traditional Chinese
sc - Simplified Chinese
callback_urlstringNURL to which Cregis sends webhook notifications on payment status update to the merchant, details for Payment notify
remarkstringNFor the merchant to make remarks about a payment
valid_timeintegerYValidation time in minute (within 10 to 60 minutes) for a payment, a payment will be expired after this assigned validation timeframe
success_urlstringYThe payer will be redirected to this URL when clicking on the Return to Store button after a successful payment. Be sure to include “http://” or “https://” in the url
cancel_urlstringYURL to redirect if the payer does not pay and click on the Cancel button instead. Be sure to include “http://” or “https://” in the url

order_details object

NameTypeRequiredDescription
shopping_costdecimalNShipping cost of the order
tax_costdecimalNTax amount of the order
itemsJSONArrayStringNThe breakdown details of each item in the order

items object

NameTypeRequiredDescription
item_idstringNThe unique identifier of a payment in the merchant’s system
item_namestringNName of an item purchase
item_pricedecimalNUnit price of an item
price_currencystringNISO 4217 3-character currency code. This is the currency associated with the order amount field
item_quantityinteger(int64)NQuantity of an item ordered

sub_merchant object

NameTypeRequiredDescription
sub_merchant_idstringNID of sub merchant
sub_merchant_namestringNName of sub merchant
Request Example
{
    "timestamp": 1734327655,
    "nonce": "dositl",
    "sign": "f5be13fdd8c6f63951ca4427359457cb",
    "order_id": "merchant_order_id_12334567",
    "order_amount": "5",
    "order_currency": "USD",
    "callback_url": "https://callback.com",
    "remark": "VIP order",
    "payer_id": "payer001",
    "payer_name": "payer",
    "payer_email": "[email protected]",
    "valid_time": 60,
    "pid": 1419287201923072,
    "cancel_url": "https://cancel.merchant.com",
    "success_url": "https://success.merchant.com",
    "tokens": "[\"USDT-TRC20\",\"USDT-BEP20\"]",
    "order_details": "{\"items\": [{\"item_id\": \"10001\", \"item_name\": \"Product1\",\"item_price\": 123.00,\"item_quantity\": 1,\"price_currency\": \"USD\"},{\"item_id\": \"10002\", \"item_name\": \"Product2\",\"item_price\": 100.00,\"item_quantity\": 2,\"price_currency\": \"USD\"}],\"shopping_cost\": 10.88,\"tax_cost\": 10.00}"
    "sub_merchant": "{\"sub_merchant_id\": \"submerchant10001\",\"sub_merchant_name\": \"Merchant1\"}"
}

Response

Response Result

NameTypeDescription
codestringReturn code
msgstringReturn message
dataArrayReturn data

Response data Array Object

NameTypeDescription
cregis_idstringUnique identifier of a payment generated by Cregis
checkout_urlstringCheckout page url
merchant_namestringMerchant name to be displayed on Cregis checkout page
merchant_logo_urlstringMerchant logo to be displayed on Cregis checkout page
order_amountstringThe total payment amount, in the order currency
order_currencystringISO 4217 3-character currency code. This is the currency associated with the order amount field
created_timeinteger(int64)Order creation time in 13-digit
e.g. 1720508269092
expire_timeinteger(int64)Order expiration time in 13-digit
e.g. 1720508269092
payment_infoarrayPayment detail information

payment_info object

NameTypeDescription
payment_addressstringWallet address that receives payment
token_symbolstringcrypto asset symbol
blockchainstringBlockchain network
token_namestringcrypto token name
logo_urlstringcrypto token logo
token_decimalsintegercrypto token decimal places
receive_amountstringThe amount of the order after exchange rate conversion
receive_currencystringThe order currency code after exchange rate conversion
exchange_ratestringCurrency exchange rate
asset_logostringcrypto asset logo
Response Example
{
    "code": "00000",
    "msg": "ok",
    "data": {
        "cregis_id": "po1420761885130752",
        "checkout_url": "http://192.168.2.60:9099?cid=b2fb433c953a43bd9bdfc3f611567887",
        "merchant_name": null,
        "merchant_logo_url": null,
        "order_amount": "5",
        "order_currency": "HKD",
        "created_time": 1734328473070,
        "expire_time": 1734332073070,
        "payment_info": [
            {
                "payment_address": "TX8GZJfLYPtmzRgd3FoiXuCHbptiQ37NSM",
                "token_symbol": "USDT",
                "blockchain": "TRON",
                "token_name": "USDT-TRC20",
                "logo_url": "https://static.cregis.io/pic/coin/[email protected]",
                "token_decimals": 6,
                "receive_amount": "0.642951",
                "receive_currency": "USDT",
                "exchange_rate": "0.1285902181",
                "asset_logo": "https://static.cregis.io/pic/coin/tether%[email protected]"
            },
            {
                "payment_address": "0xf9d70ab23195cfc9c0c14b384a1fd3a3f12cd4f8",
                "token_symbol": "USDT",
                "blockchain": "BNB-BSC",
                "token_name": "USDT-BEP20",
                "logo_url": "https://static.cregis.io/pic/coin/USDT-BNB%[email protected]",
                "token_decimals": 18,
                "receive_amount": "0.642951",
                "receive_currency": "USDT",
                "exchange_rate": "0.1285902181",
                "asset_logo": "https://static.cregis.io/pic/coin/tether%[email protected]"
            },
        ]
    }
}