# Checkout Redirect Payment

# Request Base URL

  Test Environment : https://gateway-sandbox.luxpag.com
  Prod Environment : https://gateway.luxpag.com

# EndPoints

  /trade/create

# Request Header

Parameter Required Description
Content-Type recommend application/json
Authorization yes Basic Base64(app_id:secret_key)

# Request Body (JSON format)

Parameter Type Required Max Length(or Default Value) Description
app_id string yes 32 created app's id at dashboard
timestamp string yes 19 yyyy-MM-dd HH:mm:ss
out_trade_no string yes 64 ID given by the merchant in their system
method string no 32 Payment Methods
channel string no 32 sub channel(only use at method 'Wallet')
order_currency string yes 3 BRL for brazil
order_amount decimal yes 0.01 ~ 99999999999999.99 request payment amount
subject string yes 128 payment reason or item title
content string no 255 payment reason detail or item detail,Khipu fill in truthfully
trade_type string yes WEB response content type, WEB will return a checkout URL
notify_url string yes 255 IPN URL to merchant
return_url string no 255 return to merchant URL at checkout page,some channels only support HTTPS (Peru Wallet)
buyer_id string yes 128 merchant user's id
timeout_express string no 90m m(minutes), h(hours), d(days), c(always end in currency day UTC)
cancellation_express string no Luxpag active cancel time:m(minutes), h(hours), d(days).The value must be an integar. Ex: 90m The value must be larger than timeout_express,max 3 days
regions List no region code,Valid when app is Global, for example [ "MEX", "BRA" ]

# Request Sample

curl --location --request POST 'https://gateway.gemini-tiger.cn/trade/create' \
--header 'Authorization: Basic Base64(appid:secret_key)' \
--header 'Content-Type: application/json' \
--data-raw '{
    "app_id": "app_id",
    "content": "content",
    "method": "Boleto",
    "notify_url": "notify_url",
    "order_amount": 10,
    "order_currency": "BRL",
    "out_trade_no": "{{$randomUUID}}",
    "subject": "subject",
    "timeout_express": "1h",
    "timestamp": "{{datetime}}",
    "trade_type": "WEB",
    "version": "2.0"
}'

# Http Response (JSON format)

Parameter Type Description
code string return code
msg string return msg
sub_code string return sub code(only error)
sub_msg string return sub msg(only error)
out_trade_no string request out_trade_no
trade_no string Luxpag trade NO.
web_url string checkout URL

# Return Sample (Success)

{
    "code": "10000",
    "msg": "Success",
    "out_trade_no": "{out_trade_no}",
    "trade_no": "{trade_no}",
    "web_url": "http://checkout.luxpag.com?trade_no={$trade_no}"
}

# Return Sample (Fail)

{
    "code": "40002",
    "msg": "Business Failed",
    "sub_code": "invalid-signature",
    "sub_msg": "invalid signature"
}

# Result Code

Return status when creating an order.

# !!!Attention!!!

return_url is now in the request parameters, but if needed, you can overwrite it with append the return_url after the web_url when redirect and will only takes effect during the WEB payment process :

http://checkout.luxpag.com?trade_no={$trade_no}

↓↓↓

http://checkout.luxpag.com?trade_no={$trade_no}&return_url=encodeURIComponent({$return_url})

If App WebView loads the checkout page, it is recommended to support localStorage to avoid refilling user information every time you pay, for example:webSettings.setDomStorageEnabled(true)