A CheckoutSession
represents a one-time use checkout to receive payments. To learn how to use the Checkout Resource, you can check the Checkout API Implementation document.
A CheckoutSession Resource
"data":{
"id":"cs_CbFCTDfxvMFNjwjVi26Uzhtj",
"type":"checkout_session",
"attributes":{
"billing":{
"address":{
"city":"Taguig",
"country":"PH",
"line1":"address line 1",
"line2":"address line 2",
"postal_code":"1234",
"state":"PH-MNL"
},
"email":"[email protected]",
"name":"John doe",
"phone":null
},
"checkout_url":"https://checkout.paymongo.com/cs_CbFCTasdvMFNjwjVi26Uzhtj#fneklwafoifdlsa123f5v1=",
"client_key":"cs_CbFCTDfxvMFNjwjVi26Uzhtj_client_YyXPYEejtNMmeZfcg5AAzXQ8",
"description":"The beanie products.",
"line_items":[
{
"amount":550,
"currency":"PHP",
"description":"A fresh bag of coffee beanines.",
"images":[
"https://images.unsplash.com/photo-1612346903007-b5ac8bb135bb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80"
],
"name":"Beanines",
"quantity":100
},
{
"amount":125000,
"currency":"PHP",
"description":"A locally grown Jasmine Rice.",
"images":[
"https://images.unsplash.com/photo-1612346903007-b5ac8bb135bb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80"
],
"name":"Jasmine Rice 25KG",
"quantity":1
}
],
"livemode":true,
"merchant":"Paymongo Test Account",
"payments":[
{
"id":"pay_gPSJ6SB24SVEa5hH8LrXBtd4",
"type":"payment",
"attributes":{
"access_url":null,
"amount":180000,
"balance_transaction_id":"bal_txn_ck7GWJfM19q5YFQKFqo17vbu",
"billing":{
"address":{
"city":"Taguig",
"country":"PH",
"line1":"Address 1",
"line2":"",
"postal_code":"1234",
"state":"Metro Manila"
},
"email":"[email protected]",
"name":"Customer Name",
"phone":""
},
"currency":"PHP",
"description":"The beanie products.",
"disputed":false,
"external_reference_number":null,
"fee":9000,
"foreign_fee":1800,
"livemode":true,
"net_amount":169393,
"origin":"api",
"payment_intent_id":"pi_aJsHfCD2AmR9V5KBvtkW8XY2",
"payout":null,
"source":{
"id":"card_7EAQrE19W7ESJZkQdoQiy6gj",
"type":"card",
"brand":"mastercard",
"country":"BJ",
"last4":"2346"
},
"statement_descriptor":"Paymongo Test Account",
"status":"paid",
"tax_amount":193,
"metadata":{
"customer_number":"42jn1i53",
"remarks":"Customer cannot receive items during weekends or evening",
"notes":"Additional packaging. Include free samples"
},
"refunds":[
],
"taxes":[
{
"amount":193,
"currency":"PHP",
"inclusive":true,
"name":"Withholding Tax",
"type":"withholding_tax",
"value":"200_bps"
},
{
"amount":1157,
"currency":"PHP",
"inclusive":true,
"name":"VAT",
"type":"vat",
"value":"1200_bps"
}
],
"available_at":1671526800,
"created_at":1671438226,
"credited_at":1671613200,
"paid_at":1671438228,
"updated_at":1671438228
}
}
],
"payment_intent":{
"id":"pi_aJsHfCD2AmR9V5KBvtkW8XY2",
"type":"payment_intent",
"attributes":{
"amount":180000,
"capture_type":"automatic",
"client_key":"pi_aJsHfCD2AmR9V5KBvtkW8XY2_client_HBSX2uMBbpapxbPVhsy6zdJz",
"currency":"PHP",
"description":"The beanie products.",
"livemode":true,
"statement_descriptor":"Paymongo Test Account",
"status":"succeeded",
"last_payment_error":null,
"payment_method_allowed":[
"card",
"gcash"
],
"payments":[
{
"id":"pay_gPSJ6SB24SVEa5hH8LrXBtd4",
"type":"payment",
"attributes":{
"access_url":null,
"amount":180000,
"balance_transaction_id":"bal_txn_ck7GWJfM19q5YFQKFqo17vbu",
"billing":{
"address":{
"city":"Taguig",
"country":"PH",
"line1":"Address 1",
"line2":"",
"postal_code":"1234",
"state":"Metro Manila"
},
"email":"[email protected]",
"name":"Customer Name",
"phone":""
},
"currency":"PHP",
"description":"The beanie products.",
"disputed":false,
"external_reference_number":null,
"fee":9000,
"foreign_fee":1800,
"livemode":true,
"net_amount":169393,
"origin":"api",
"payment_intent_id":"pi_aJsHfCD2AmR9V5KBvtkW8XY2",
"payout":null,
"source":{
"id":"card_7EAQrE19W7ESJZkQdoQiy6gj",
"type":"card",
"brand":"mastercard",
"country":"BJ",
"last4":"2346"
},
"statement_descriptor":"Paymongo Test Account",
"status":"paid",
"tax_amount":193,
"metadata":{
"customer_number":"42jn1i53",
"remarks":"Customer cannot receive items during weekends or evening",
"notes":"Additional packaging. Include free samples"
},
"refunds":[
],
"taxes":[
{
"amount":193,
"currency":"PHP",
"inclusive":true,
"name":"Withholding Tax",
"type":"withholding_tax",
"value":"200_bps"
},
{
"amount":1157,
"currency":"PHP",
"inclusive":true,
"name":"VAT",
"type":"vat",
"value":"1200_bps"
}
],
"available_at":1671526800,
"created_at":1671438226,
"credited_at":1671613200,
"paid_at":1671438228,
"updated_at":1671438228
}
}
],
"next_action":null,
"payment_method_options":{
"card":{
"request_three_d_secure":"any",
"installments":{
"enabled":true
}
}
},
"metadata":{
"remarks":"Customer cannot receive items during weekends or evening",
"customer_number":"42jn1i53",
"notes":"Additional packaging. Include free samples"
},
"setup_future_usage":null,
"created_at":1671437933,
"updated_at":1671438228
}
},
"payment_method_types":[
"card",
"gcash",
"atome"
],
"reference_number":"m2m39sj43h5lfFSA1sd",
"send_email_receipt":true,
"show_description":true,
"show_line_items":true,
"status":"active",
"success_url":"https://google.com",
"created_at":1671437933,
"updated_at":1671437933,
"metadata":{
"notes":"Additional packaging. Include free samples",
"customer_number":"42jn1i53",
"remarks":"Customer cannot receive items during weekends or evening"
}
}
}
id string
The unique identifier of PayMongo Checkout Session. Prefix is cs_. This is the reference ID when doing some actions for a Checkout Session resource such as retrieval or expiration.
billing dictionary
Billing information that will be used to pre-fill the billing information fields on the checkout page.
Attribute | Description |
---|---|
address.city string | City of the billing address information. |
address.country string | Country of the billing address information. Possible values are ISO 3166-1 alpha-2 codes or two-letter country codes. |
address.line1 string | Line1 of the billing address information. |
address.line2 string | Line2 of the billing address information. |
address.postal_code string | Postal Code of the billing address information. |
address.state string | State of the billing address information. |
email string | E-mail address of the billing information. |
name string | Name of the billing information. |
phone string | Phone number of the billing information. |
cancel_url string
A URL link used to go back to the merchant's page. No actual canceling of records is done.
checkout_url string
A URL link to the checkout page.
Format: https://checkout.paymongo.com/{{client_key}}#{{public_key in base64 format}}
client_key string
The client key of the Checkout Session. A unique identifier used by PayMongo's checkout page to retrieve the Checkout Session resource.
description string
A merchant defined string that describes the purpose of the checkout. The value here comes from the merchant during the Checkout Session creation.
line_items array of dictionary
A list of items included in the checkout that the customer is paying for. Maximum no. of line items is 999.
Attribute | Description |
---|---|
amount integer | The amount of the item. If you want to create a link with an amount of 1.00, the value that you should pass is 100. If you want to create a link with an amount of 1500.50, the value that you should pass is 150050. |
currency string | Three-letter ISO currency code, in uppercase. PHP is the only supported currency as of the moment. |
description string | A string that describes the item. |
images array of strings | A list of URLs directing to an image that will be used to display product images in the Checkout page. Pass only one (1) URL since only a single image display per item is supported as of the moment. |
name string | Name of the item. |
quantity integer | The quantity of item. |
livemode boolean
The value is true if the resource exists in live mode or the value is false if the resource exists in test mode.
payments array of dictionary
Payments that were created for the Checkout Session. The payments attribute can only be queried using secret key. Retrieving the Checkout Session resource using public key will not return this attribute for security purposes.
See our Payment Resource docs for more information.
payment_intent dictionary
A Payment Intent resource that is related to the Checkout Session.
See our PaymentIntent Resource docs for more information.
payment_method_types array of strings
The list of payment method types that the checkout is configured.
reference_number string
A merchant defined string that contains the external reference number. This is mainly used to track the Checkout Session resource by the merchant.
send_email_receipt boolean
Flag configuration to control if a payment confirmation will be sent to the customer via email as a form of receipt.
show_description boolean
Flag configuration to control the display of the checkout description on the checkout page.
show_line_items string
Flag configuration to control the display of the items on the checkout page.
status string
Status of the Checkout Session. Possible values are active
and expired
.
split_payment dictionary
This attribute configures the payment for splitting with associated merchant accounts. Note that configuration is required before using this feature. See the Payment splitting documentation for more information.
Attribute | Description |
---|---|
transfer_to string | The transfer_to field specifies the recipient of the remaining net amount after the payment has been split. The merchant assigned to this field will also be responsible for any associated fees. If no recipient is provided, the entire net amount will be transferred to the specified merchant. If the transfer_to field is left blank but a recipient is defined, the system defaults to transferring the net amount to the merchant who created the resource. |
recipients[].merchant_id string | The identifier for the associated recipient merchant. |
recipients[].split_type string | Determines the method of payment splitting. Possible values for now are fixed and percentage_net . If left blank, this would automatically be set to fixed . |
recipients[].value integer | Defines the values of the split payment. For fixed split type, this field expects an integer in cents (e.g., 100 equals 1.00 in the respective currency). For percentage_net , this field expects an integer representing a percentage in basis points (bps) (e.g., 100 equals 1%).. |
success_url string
A URL link used to redirect the customer after a successful payment.
created_at timestamp
The date when the Checkout Session has been created.
updated_at timestamp
The date when the Checkout Session has been updated.
metadata dictionary
A set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the object in a structured format. Only string values are accepted.