Hosted Payments Page

Create a Hosted Payments Page session

Create a Hosted Payments Page session and pass through all the payment information, like the amount, currency, country and reference.

To get started with our Hosted Payments Page, contact your solutions engineer or <a href="https://dashboard.checkout.com/support/new?topic=case_account_management_and_access&amp;issue=issue_account_changes" target="_blank">request support</a>.

post/hosted-payments

Request

Request body

amountinteger

The payment amount. The exact format <a href="https://www.checkout.com/docs/resources/calculating-the-amount" target="_blank">depends on the currency</a>

currencystring required

The three-letter <a href="https://www.checkout.com/docs/resources/codes/currency-codes" target="blank">ISO currency code</a> of the payment

payment_type'Regular' | 'Recurring'

This must be specified for card payments where the cardholder is not present (i.e., recurring or mail order / telephone order)

authorization_type'Final' | 'Estimated'

The authorization type.

payment_ipstring ipv4
referencestring

A reference you can use to identify the payment. For example, an order number.

  • For Amex payments, this must be at most 30 characters.
  • For Benefit payments, the reference must be a unique alphanumeric value.
  • For iDEAL payments, the reference is required and must be an alphanumeric value with a 35-character limit.
descriptionstring

A description of the payment

display_namestring

The merchant name to display to customers on the checkout page.

processing_channel_idstring

The processing channel to be used for the payment

allow_payment_methods'alipay_cn' | 'alipay_hk' | 'alma' | 'applepay' | 'bancontact' | 'benefit' | 'bizum' | 'card' | 'dana' | 'eps' | 'gcash' | 'googlepay' | 'ideal' | 'kakaopay' | 'klarna' | 'knet' | 'mbway' | 'mobilepay' | 'multibanco' | 'octopus' | 'p24' | 'paynow' | 'paypal' | 'plaid' | 'qpay' | 'sepa' | 'stcpay' | 'stored_card' | 'tabby' | 'tamara' | 'tng' | 'truemoney' | 'twint' | 'vipps' | 'wechatpay'
disabled_payment_methodsPaymentInterfacesPaymentMethodEnum[]
senderPaymentInterfacesSender

The sender type. If set to instrument, the sender information (name and address) will be retrieved from the payment instrument.

success_urlstring uri required

For redirect payment methods, this overrides the default success redirect URL configured on your account

cancel_urlstring uri required

The URL to which the customer should be directed if they cancel the payment

failure_urlstring uri required

For redirect payment methods, this overrides the default failure redirect URL configured on your account

metadataobject

Allows you to store additional information about the transaction. This object only allows one level of depth, so cannot accept non-primitive data types such as objects or arrays.

locale'ar' | 'da-DK' | 'de-DE' | 'el' | 'en-GB' | 'es-ES' | 'fi-FI' | 'fil-PH' | 'fr-FR' | 'hi-IN' | 'id-ID' | 'it-IT' | 'ja-JP' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'pt-PT' | 'sv-SE' | 'th-TH' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW'

Creates a translated version of the page in the specified language

captureboolean

Whether to capture the payment (if applicable).

capture_onstring date-time

ISO 8601 timestamp

Example request

{
  "amount": 1000,
  "currency": "GBP",
  "authorization_type": "Estimated",
  "payment_plan": {
    "amount_variability": "Variable",
    "days_between_payments": 28,
    "total_number_of_payments": 5,
    "current_payment_number": 3,
    "expiry": "20251031",
    "name": "Subscription 1234",
    "start_date": "20260507",
    "amount": 1234
  },
  "payment_ip": "90.197.169.245",
  "reference": "ORD-123A",
  "description": "Payment for Gold Necklace",
  "display_name": "The Jewelry Shop",
  "processing_channel_id": "pc_q4dbxom5jbgudnjzjpz7j2z6uq",
  "amount_allocations": [
    {
      "id": "ent_w4jelhppmfiufdnatam37wrfc4",
      "amount": 1000,
      "reference": "ORD-5023-4E89",
      "commission": {
        "amount": 1000,
        "percentage": 1.125
      }
    }
  ],
  "customer": {
    "email": "ali.farid@example.com",
    "name": "Ali Farid",
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    },
    "summary": {
      "registration_date": "2023-05-01T00:00:00.0000000",
      "first_transaction_date": "2023-07-01T00:00:00.0000000",
      "last_payment_date": "2023-08-01T00:00:00.0000000",
      "total_order_count": 15,
      "last_payment_amount": 500,
      "is_premium_customer": true,
      "is_returning_customer": true,
      "lifetime_value": 500
    }
  },
  "shipping": {
    "address": {
      "address_line1": "123 High St.",
      "address_line2": "Flat 456",
      "city": "London",
      "zip": "SW1A 1AA",
      "country": "GB"
    },
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    }
  },
  "billing": {
    "address": {
      "address_line1": "123 High St.",
      "address_line2": "Flat 456",
      "city": "London",
      "zip": "SW1A 1AA",
      "country": "GB"
    },
    "phone": {
      "country_code": "+1",
      "number": "415 555 2671"
    }
  },
  "recipient": {
    "dob": "1985-05-15T00:00:00.0000000",
    "account_number": "5555554444",
    "address": {
      "address_line1": "123 High St.",
      "address_line2": "Flat 456",
      "city": "London",
      "zip": "SW1A 1AA",
      "country": "GB"
    },
    "first_name": "Jia",
    "last_name": "Tsang"
  },
  "processing": {
    "shipping_amount": 300,
    "tax_amount": 3000,
    "locale": "en-US",
    "airline_data": [
      {
        "ticket": {
          "number": "045-21351455613",
          "issue_date": "2023-05-20T00:00:00.0000000",
          "issuing_carrier_code": "AI",
          "travel_package_indicator": "B",
          "travel_agency_name": "World Tours",
          "travel_agency_code": "01"
        },
        "passenger": [
          {
            "first_name": "John",
            "last_name": "White",
            "date_of_birth": "1990-05-26T00:00:00.0000000",
            "address": {
              "country": "US"
            }
          }
        ],
        "flight_leg_details": [
          {
            "flight_number": "101",
            "carrier_code": "BA",
            "class_of_travelling": "J",
            "departure_airport": "LHR",
            "departure_date": "2023-06-19T00:00:00.0000000",
            "departure_time": "15:30",
            "arrival_airport": "LAX",
            "stop_over_code": "x",
            "fare_basis_code": "SPRSVR"
          }
        ]
      }
    ],
    "accommodation_data": [
      {
        "name": "The Sea View Hotel",
        "booking_reference": "HOTEL123",
        "check_in_date": "2023-06-20T00:00:00.0000000",
        "check_out_date": "2023-06-23T00:00:00.0000000",
        "address": {
          "address_line1": "123 Beach Road",
          "zip": "10001"
        },
        "state": "FL",
        "country": "USA",
        "city": "Los Angeles",
        "number_of_rooms": 2,
        "guests": [
          {
            "first_name": "Jane",
            "last_name": "Doe",
            "date_of_birth": "1985-07-14T00:00:00.0000000"
          }
        ],
        "room": [
          {
            "rate": "70",
            "number_of_nights_at_room_rate": "3"
          }
        ]
      }
    ],
    "order_id": "123456789",
    "surcharge_amount": 200,
    "shipping_tax_amount": 100,
    "affiliate_url": "www.mycrypto.com",
    "original_order_amount": 10,
    "receipt_id": "10",
    "line_of_business": "Flights",
    "provision_network_token": true,
    "reconciliation_id": "4123495123",
    "aggregator": {
      "sub_merchant_id": "9cf70789ba90123",
      "aggregator_id_visa": "10012345",
      "aggregator_id_mc": "00000123456"
    }
  },
  "products": [
    {
      "url": "https://example.com/products/gold-necklace",
      "name": "Gold Necklace",
      "quantity": 1,
      "price": 1000
    }
  ],
  "customer_retry": {
    "max_attempts": 2
  },
  "success_url": "https://example.com/payments/success",
  "cancel_url": "https://example.com/payments/cancel",
  "failure_url": "https://example.com/payments/failure",
  "capture": true,
  "payment_method_configuration": {
    "applepay": {
      "account_holder": {
        "type": "individual",
        "first_name": "Toby",
        "last_name": "Arden"
      }
    },
    "card": {
      "account_holder": {
        "type": "individual",
        "first_name": "Toby",
        "last_name": "Arden"
      }
    },
    "googlepay": {
      "account_holder": {
        "type": "individual",
        "first_name": "Toby",
        "last_name": "Arden"
      }
    }
  }
}

Response

Created Hosted Payments Page

idstring required

The unique identifier for a Hosted Payments Page.

referencestring

A reference you can later use to identify this payment, such as an order number.

Example response

{
  "id": "hpp_xGQBg0AXl3cM",
  "reference": "ORD-123A",
  "_links": {
    "self": {
      "href": "https://{prefix}.api.sandbox.checkout.com/hosted-payments/hpp_xGQBg0AXl3cM"
    },
    "redirect": {
      "href": "https://pay.sandbox.checkout.com/page/hpp_xGQBg0AXl3cM"
    }
  }
}

Changes

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