Hosted checkout

Tạo phiên thanh toán và link thu tiền

Tạo VietQR động và trả checkout_url. Nếu chưa có hồ sơ trả 422 detail=payment_profile_missing.

post/api/v1/checkouts

Request

  • Base URL: https://api.monapay.vn
  • URL: https://api.monapay.vn/api/v1/checkouts
  • Auth: HTTP bearer and API key in header X-Client-Secret

Headers

Idempotency-Keystring required

TTL 24 giờ; cùng key khác body trả 409.

Request body

amountinteger required

Số tiền VND.

order_codestring required
descriptionstring
return_urlstring uri required
cancel_urlstring uri
payer_emailstring email
payer_namestring
expires_ininteger
metadataobject

JSON tối đa 2 KB sau khi encode.

virtual_account_idstring uuid
sandboxboolean

true để dùng VA sandbox SBX và không chuyển tiền thật.

Example request

{
  "amount": 250000,
  "order_code": "DH10234",
  "description": "Thanh toan DH10234",
  "return_url": "https://shop.vn/payment/return",
  "cancel_url": "https://shop.vn/checkout",
  "expires_in": 900
}

Response

Envelope với data là Checkout.

successboolean required
messagestring required

Example response

{
  "data": {
    "checkout_url": "https://pay.monapay.vn/c/VlGJtN2dJH_lZ5pU7eKqX8cR3wA9mB4n",
    "bank": {
      "code": "ACB",
      "name": "Ngân hàng ACB"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.