API URL

POST /api/v2/checkout

Request

Request Parameters

NameTypeRequiredDescription
pidinteger(int64)YUnique identifier of the acquiring project in Cregis
noncestringYA 6-character random string
timestampinteger(int64)Y13-digit unix timestamp format
signstringYThe digital signature of the request to prevent illegal tampering. Refer to the Signature section for the signing rules.
order_idstringYMerchant’s internal order ID. Must be equal or less than 128 characters
order_amountstringYOrder amount (based on the order currency)
Order amount (fiat amount if order_currency is fiat currency / crypto amount if order_currency is crypto currency)
order_currencystringYPlease refer to the Order Currency under Order currency List
- If the order currency is a cryptocurrency, examples are USDT, ETH, etc.
- If the order currency is a fiat currency, please enter the ISO 4217 3-character currency code. Examples are HKD, USD, etc
order_detailsJSONStringNThe breakdown of the order items including price, quantity and product description that will be displayed on the Cregis checkout page under the 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, If accept_partial_payment / accept_over_payment is false, then Yes
tokensArrayStringNThis field enables you to limit the tokens that you allow your customers to pay with. Leaving this field empty means you allow all Cregis-supported tokens for payment.
For this parameter format, please refer to the Payment Currency and Payment Network from the Pay currency List Parameters page; for example, USDT-BEP20, USDT-TRC20, etc.
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.

This lower tolerance threshold is used to calculate the minimum amount you would accept the order. Unit is according to the parameter of order_currency
- “paid” order status: order_amount - underpaid_tolerance <= Actual Paid Amount <= order_amount + overpaid_tolerance
- “partial_paid” order status: Actual Paid Amount < order_amount - underpaid_tolerance
- “overpaid” order status: order_amount + overpaid_tolerance < Actual Paid Amount

Example: order_currency is HKD and underpaid_tolerance is 3.50. Order status will be
- “paid” if the order is underpaid by HKD 3.50 or less
- “partial_paid” if the order is underpaid by HKD 3.50 and more
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.

This upper tolerance threshold is used to calculate the maximum amount you would accept the order. Unit is according to the parameter of order_currency
- “paid” order status: order_amount - underpaid_tolerance <= Actual Paid Amount <= order_amount + overpaid_tolerance
- “partial_paid” order status: Actual Paid Amount < order_amount - underpaid_tolerance
- “overpaid” order status: order_amount + overpaid_tolerance < Actual Paid Amount

Example: order_currency is HKD and overpaid_tolerance is 3.50. Order status will be
- “paid” if the order is overpaid by HKD 3.50 or less
- “overpaid” if the order is overpaid by HKD 3.50 and more
accept_partial_paymentstringNDefault value: “true”
- “false”: If the order does NOT accept the partial payment and the actual payment amount is less than the order_amount, the payer must make an additional payment or proceed a refund
- “true”: If the order accepts the partial payment, the payer is not required to make an additional payment or proceed a refund
accept_over_paymentstringNDefault value: “true”
- “false”: If the order does NOT accept the overpayment and the actual payment amount is more than the order_amount, the payer must proceed a refund for the extra amount
- “true”: If the order accepts the overpayment, the payer is not required to proceed a refund for the extra amount
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_timeintegerYUnit: Minutes (Integer value from 10 to 60)
The valid time for this order. If the valid time is expired, the payment will not be accepted.
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_urlstringYRedirect to this url if the payer does not pay or click on the “Cancel” button. Be sure to include “http://” or “https://” in this url
order_details object
NameTypeRequiredDescription
shopping_costdecimalNShipping cost
tax_costdecimalNTax
itemsJSONArrayStringNProduct List
items object
NameTypeRequiredDescription
item_idstringNThe unique identifier of the item
item_namestringNItem name
item_pricedecimalNItem price
price_currencystringNPlease refer to Order Currency under Order currency List
item_quantityinteger(int64)NQuantity of an item ordered
sub_merchant object
NameTypeRequiredDescription
sub_merchant_idstringNSub merchant’s ID
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
dataObjectReturn data

data 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_amountstringOrder amount.
order_currencystringOrder currency
created_timeinteger(int64)Order creation time in 13-digit unix timestamp format
e.g. 1720508269092 (2024-07-09 14:57:49 092)
expire_timeinteger(int64)Order expiration time in 13-digit unix timestamp format
e.g. 1720508269092 i.e. 2024-07-09 14:57:49 092
payment_infoArrayObjectPayment detail information

payment_info object

NameTypeDescription
payment_addressstringWallet address that receives payment
token_symbolstringAvailable cryptocurrency for payment. Can refer to the parameter of tokens in order creation
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]"
            },
        ]
    }
}