Skip to main content
The CheckoutRequest class contains information about the buyer, the items inside the cart, transaction amount, status of payment and other details.

Properties

totalAmount
TotalAmount
required
Transaction amount details including value, currency, and optional fee breakdown.
buyer
Buyer
Details of the buyer including name, contact information, and addresses.
items
List<Item>
required
List of items in the checkout cart.
requestReferenceNumber
String
required
Reference number assigned by the merchant to identify a transaction.
redirectUrl
RedirectUrl
required
Set of redirect URLs upon process completion (success, failure, cancel).
metadata
JSONObject
Additional data about the specific checkout. This can be supplied during the checkout creation.
authorizationType
AuthorizationType
The type of authorization for the payment. Can be NORMAL, FINAL, or PREAUTHORIZATION.

TotalAmount

Contains information about transaction amount.
value
BigDecimal
required
Payment amount to be charged.
currency
String
required
Currency code (e.g., “PHP”, “USD”).
details
AmountDetails
Breakdown of fees.

AmountDetails

Optional breakdown of fees. If provided, it will reflect on the Checkout Page and will be viewed by the buyer for review.
discount
BigDecimal
Discount amount.
serviceCharge
BigDecimal
Service charge amount.
shippingFee
BigDecimal
Shipping fee amount.
tax
BigDecimal
Tax amount.
subtotal
BigDecimal
Subtotal amount.

Item

Represents an entity that can be purchased from a merchant’s shop.
name
String
required
Item’s product name.
quantity
Int
Item’s quantity.
code
String
Item’s SKU code.
description
String
Item’s description.
amount
ItemAmount
Item’s unit price.
totalAmount
TotalAmount
required
Item’s total price.

ItemAmount

Details about each item’s amount.
value
BigDecimal
required
Payment amount to be charged to the card.
details
AmountDetails
Breakdown of fees.

Buyer

Represents the entity that bought items from the merchant’s shop. When provided, must have at least one populated field.
firstName
String
First name of buyer.
middleName
String
Middle name of buyer.
lastName
String
Last name of buyer.
contact
Contact
Contact details of buyer.
shippingAddress
Address
Shipping address of buyer.
billingAddress
Address
Billing address of buyer.

Contact

Buyer’s contact details. If the email field is provided, a payment receipt will be sent to the email address.
phone
String
Phone number of the buyer.
email
String
Valid email address of the buyer.

Address

Address of the buyer.
line1
String
Address line 1.
line2
String
Address line 2.
city
String
City.
state
String
State/Province.
zipCode
String
Zip code.
countryCode
String
ISO 3166-2 country code.

RedirectUrl

Redirect URL model defining URLs used to redirect to specific pages once the payment process is done.
success
String
required
Success URL.
failure
String
required
Failure URL.
cancel
String
required
Cancel URL.

Example

val checkoutRequest = CheckoutRequest(
    totalAmount = TotalAmount(
        value = BigDecimal("100.00"),
        currency = "PHP",
        details = AmountDetails(
            subtotal = BigDecimal("100.00")
        )
    ),
    buyer = Buyer(
        firstName = "Juan",
        lastName = "Dela Cruz",
        contact = Contact(
            phone = "+639181234567",
            email = "juan.delacruz@example.com"
        )
    ),
    items = listOf(
        Item(
            name = "Sample Item",
            quantity = 1,
            totalAmount = TotalAmount(
                value = BigDecimal("100.00"),
                currency = "PHP"
            )
        )
    ),
    requestReferenceNumber = "REF-123456",
    redirectUrl = RedirectUrl(
        success = "https://example.com/success",
        failure = "https://example.com/failure",
        cancel = "https://example.com/cancel"
    )
)

Build docs developers (and LLMs) love