On this page, find out how to:
Before you begin
Make sure you've registered to begin using Hosted Payments Page. Contact your Solution Engineer or [email protected] . During integration, you can specify your payment capture and 3D Secure settings. Create your secret and public API keys in the Dashboard. Set up webhooks to be notified when the payment is approved, so you can continue the sales fulfillment flow. Create a Hosted Payments Page
Step 1: Create a new Hosted Payments Page
When a customer purchases something from you, you can create a Hosted Payments Page session by using the
post
/hosted-payments
endpoint and providing us with details of the purchase.
To get a detailed view of all required and optional fields, see the API reference .
Checkout.com does not support Hosted Payments Pages embedded within an iframe.
If you've enabled Remember Me to let customers save and reuse their details for faster checkout:
To display Remember Me on the checkout screen, you must provide the display_name
and customer.email
fields in the request To help with profile creation and retrieval, request a phone number from the customer and provide it in the customer.phone
field Endpoints
http://localhost/ can only be used for the URL fields during testing and does not work in production.
post
https://api.checkout.com/hosted-payments
post
https://api.sandbox.checkout.com/hosted-payments
Payment method field requirements
Some payment methods may require you to provide additional fields or specific values when you perform a payment request. Refer to the API reference for more details.
Payment method Field requirements Card payments
No additional requirements.
Apple Pay
Apple Pay is processed as a card transaction. currency
and billing.address.country
must be supported by Apple Pay .Google Pay
Google Pay is processed as a card transaction. currency
and billing.address.country
must be supported by Google Pay .Alipay CN
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be CN
, for Chinacurrency
value must be one of:Alipay HK
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be HK
, for Hong Kongcurrency
value must be one of:Alma
billing.address.country
value must be FR
, for Francecurrency
value must be EUR
Bancontact
customer.name
must be providedbilling.address.country
value must be BE
, for Belgiumcurrency
value must be EUR
Benefit Payment Gateway
billing.address.country
value must be BH
, for Bahraincurrency
value must be BHD
reference
must be providedDana
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be ID
, for Indonesiacurrency
value must be one of:EPS
billing.address.country
value must be AT
, for Austriacurrency
value must be EUR
GCash
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be PH
, for the Philippinescurrency
value must be one of:iDEAL
billing.address.country
value must be NL
, for Netherlandscurrency
value must be EUR
Kakao Pay
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be KR
, for South Koreacurrency
value must be one of:Klarna
products[]
must be providedcustomer.name
must be providedbilling.address.country
value must be one of:AT
for AustriaAU
for AustraliaBE
for BelgiumCH
for SwitzerlandCZ
for Czech RepublicDE
for GermanyDK
for DenmarkES
for SpainFR
for FranceFI
for FinlandGB
for United KingdomGR
for GreeceIE
for IrelandIT
for ItalyNL
for NetherlandsNO
for NorwayPL
for PolandPT
for PortugalSE
for Swedencurrency
value must be one of:KNET
billing.address.country
value must be KW
, for Kuwaitcurrency
value must be KWD
locale
value must be ar
– if no value is provided, the en-GB
locale is used by defaultMB WAY
billing.address.country
value must be PT
, for Portugalcurrency
value must be EUR
reference
must be providedMultibanco
customer.name
must be providedbilling.address.country
value must be PT
, for Portugalcurrency
value must be EUR
PayPal
Przelewy24
customer.name
must be providedcustomer.email
must be providedbilling.address.country
value must be PL
, for Polandcurrency
value must be EUR
or PLN
QPay
billing.address.country
value must be QA
, for Qatarcurrency
value must be QAR
description
must be providedSEPA Direct Debit
billing.address.address_line1
must be providedbilling.address.city
must be providedbilling.address.country
value must be set to a country in the Single Euro Payments Area (SEPA) billing.address.zip
must be providedcurrency
value must be EUR
stc pay
billing.address.country
must be set to SA
currency
value must be SAR
reference
must be providedTabby
billing.address.country
value must be one of:AE
for United Arab EmiratesSA
for Saudi ArabiaKW
for Kuwaitcurrency
value must be one of:reference
must be providedThe following shipping information must be provided:shipping.address_line1
shipping.city
shipping.zip
items[]
must be providedFor each item
in items[]
, the following must be provided: Tamara
reference
must be provided.items[]
must be provided.billing.address.address_line1
and billing.address.city
must be provided.For each item
in items[]
, the following must be provided: billing.address.country
must be one of:SA
for Saudi ArabiaAE
for United Arab EmiratesTouch 'n Go
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be MY
, for Malaysiacurrency
value must be one of:TrueMoney
customer.email
or customer.id
must be providedpayment_type
must be set to Regular
or Recurring
products[]
must be providedFor each product
in products[]
, the following must be provided:name
quantity
reference
unit_price
billing.address.country
value must be TH
, for Thailandcurrency
value must be one of:Venmo
billing.address.country
must be US
, for the United Statescurrency
value must be USD
Request example
4
"reference" : "ORD-123A" , 14
"success_url" : "https://example.com/payments/success" , 15
"failure_url" : "https://example.com/payments/failure" , 16
"cancel_url" : "https://example.com/payments/cancel"
Response example
The response includes the redirect
link to which you redirect your customer to finalize the payment.
2
"id" : "hpp_xGQBg0AXl3cM" , 3
"reference" : "ORD-123A" , 6
"href" : "https://api.checkout.com/hosted-payments/hpp_xGQBg0AXl3cM" 9
"href" : "https://pay.checkout.com/page/hpp_xGQBg0AXl3cM"
Step 2: Redirect your customer
Redirect the customer to the _links.redirect
URL you received in the Create Hosted Payments Page response, using either a server-side or client-side call.
1
res . redirect ( hostedPaymentsResponse . _links . redirect . href ) ;
1
window . location . href ( hostedPaymentsResponse . _links . redirect . href ) ;
Step 3: Confirm the payment status
When your customer completes the payment, they're redirected to the success URL. The session ID (cko-session-id
) or payment ID (cko-payment-id
) is provided in the query parameter included in the redirect URL. For example:
https://example.com/success?cko-session-id=sid_ubj2q76miwundwlk72vxt2i7
https://example.com/success?cko-payment-id=pay_mbabizu24mvu3mela5njyhpit4
You can set up webhooks to be notified when the payment has been approved, so you can continue the sales fulfillment flow.
Check the status of a Hosted Payments Page
To keep track of the payments you request as a Hosted Payments Page, you can check the status using the id
returned when you created the session. For example, hpp_xGQBg0AXl3cM
.
There are three statuses:
Payment Pending
– The Hosted Payments Page can accept a payment from the customer. A payment may have been attempted by the customer but not completed successfully.Payment Received
– A payment has been received successfully using this Hosted Payments Page.Expired
– The Hosted Payments Page has expired and can no longer be accessed.Endpoints
For a full explanation of the fields, see the API reference .
get
https://api.checkout.com/hosted-payments/{id}
get
https://api.sandbox.checkout.com/hosted-payments/{id}
Response examples
2
"id" : "hpp_xGQBg0AXl3cM" , 3
"status" : "Payment Pending" , 4
"payment_id" : "undefined" , 7
"reference" : "ORD-123A" , 8
"description" : "Payment for Gold Necklace" , 9
"expires_on" : "2021-08-20T20:25:28+08:00" , 16
"address_line1" : "123 High St." , 17
"address_line2" : "Flat 456" , 23
"country_code" : "+44" , 24
"number" : "1234567890" 29
"name" : "Gold Necklace" , 36
"href" : "https://api.sandbox.checkout.com/hosted-payments/hpp_xGQBg0AXl3cM" 39
"href" : "https://pay.sandbox.checkout.com/page/hpp_xGQBg0AXl3cM"
2
"id" : "hpp_xGQBg0AXl3cM" , 3
"status" : "Payment Received" , 4
"payment_id" : "pay_mbabizu24mvu3mela5njyhpit4" , 7
"reference" : "ORD-123A" , 8
"description" : "Payment for Gold Necklace" , 9
"expires_on" : "2021-08-20T20:25:28+08:00" , 16
"address_line1" : "123 High St." , 17
"address_line2" : "Flat 456" , 23
"country_code" : "+44" , 24
"number" : "1234567890" 29
"name" : "Gold Necklace" , 36
"href" : "https://api.sandbox.checkout.com/hosted-payments/hpp_xGQBg0AXl3cM" 39
"href" : "https://pay.sandbox.checkout.com/page/hpp_xGQBg0AXl3cM" 42
"href" : "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4" 45
"href" : "https://api.sandbox.checkout.com/payments/pay_mbabizu24mvu3mela5njyhpit4/actions"
2
"id" : "hpp_xGQBg0AXl3cM" , 4
"payment_id" : "undefined" , 7
"reference" : "ORD-123A" , 8
"description" : "Payment for Gold Necklace" , 9
"expires_on" : "2021-08-20T20:25:28+08:00" , 16
"address_line1" : "123 High St." , 17
"address_line2" : "Flat 456" , 23
"country_code" : "+44" , 24
"number" : "1234567890" 29
"name" : "Gold Necklace" , 36
"href" : "https://api.sandbox.checkout.com/hosted-payments/hpp_xGQBg0AXl3cM" 39
"href" : "https://pay.sandbox.checkout.com/page/hpp_xGQBg0AXl3cM"
Next steps