Applies to both merchants in Indonesia and Philippines
To simulate payment with PayLater in Live Mode, please also check the Paylater payment flow (for further reference can go to this docs):
Here are the steps on how to create PayLater charge and simulate payment in live mode:
1. Create secret API Key on your dashboard in live mode
Reference can be found in this doc.
Things to remember below:
2. Set your callback URL in Dashboard > Settings > Callbacks in PayLater payment status and make sure upon "test and save" it returns 2XX
3. Create PayLater customer using endpoint:
POST https://api.xendit.co/customers
4. Input you secret API key in Authorization (live/production mode)
5. In Body Request you can input the parameters which are required or optional based on each PayLater partners:
{
"given_names": "Yoselin",
"surname":"Gunawan",
"email": "yoselin@xendit.co",
"mobile_number": "+6281388089105",
"reference_id": "yoselinpaylater123",
"addresses": [{
"street_line1": "Jalan Makan",
"city": "Jakarta Pusat",
"province": "Daerah Khusus Ibukota Jakarta",
"postal_code": "12160",
"country": "ID"
}]
}
6. You will get this response afterwards:
{
"id": "6fe639e6-144d-4ff4-be10-2a7cf787369b",
"reference_id": "yoselinpaylater123",
"given_names": "Yoselin",
"email": "yoselin@xendit.co",
"mobile_number": "+6281388089105",
"description": null,
"middle_name": null,
"surname": "Gunawan",
"phone_number": null,
"hashed_phone_number": null,
"nationality": null,
"date_of_birth": null,
"metadata": null,
"employment": null,
"addresses": [
{
"category": null,
"country": "ID",
"state": null,
"province": "Daerah Khusus Ibukota Jakarta",
"city": "Jakarta Pusat",
"postal_code": "12160",
"street_line1": "Jalan Makan",
"street_line2": null,
"is_preferred": false
}
]
}
7. Initiate PayLater plants using endpoint:
POST https://api.xendit.co/paylater/plans
8. Input you secret API key in Authorization (live/production mode)
9. In Body Request you can input the parameters which are required or optional based on each PayLater partners, do not forget to get the ID from the response you got from create paylater customer:
{
"customer_id": "6fe639e6-144d-4ff4-be10-2a7cf787369b",
"channel_code": "ID_KREDIVO",
"currency": "IDR",
"amount": 1000,
"order_items": [{
"type": "PHYSICAL_PRODUCT",
"reference_id": "SKU_backtoschool-promotion123",
"name": "Nymbus twothousand",
"net_unit_amount": 1000,
"quantity": 1,
"url": "https://www.zngmyhome.com/nymbus",
"category": "Sports",
"subcategory": "Equipment",
"description": "Sports equipment for quidditch"
}]
}
{
"id": "plp_a4866b2a-08b4-4c6c-a432-7c8bf3f7d2af",
"customer_id": "6fe639e6-144d-4ff4-be10-2a7cf787369b",
"channel_code": "ID_KREDIVO",
"currency": "IDR",
"amount": 1000,
"order_items": [
{
"type": "PHYSICAL_PRODUCT",
"reference_id": "SKU_backtoschool-promotion123",
"name": "Nymbus twothousand",
"net_unit_amount": 1000,
"quantity": 1,
"url": "https://www.zngmyhome.com/nymbus",
"category": "Sports",
"subcategory": "Equipment",
"description": "Sports equipment for quidditch",
"metadata": null
}
],
"options": [
{
"total_amount": 2000,
"installment_amount": 2000,
"interval": "MONTH",
"interval_count": 1,
"total_recurrence": 1,
"interest_rate": 0,
"description": "Bayar dalam 30 hari"
}
],
"created": "2023-04-04T04:29:05.014Z"
}
12. Input you secret API key in Authorization (live/production mode)
13. In Body Request you can input the parameters which are required or optional based on each PayLater partners, do not forget to get the ID from the response you got from creating paylater plans (this example is for Billease):
{
"plan_id": "plp_a4866b2a-08b4-4c6c-a432-7c8bf3f7d2af",
"reference_id": "order_id_test1234",
"checkout_method": "ONE_TIME_PAYMENT",
"success_redirect_url": "https://google.com",
"failure_redirect_url": "https://twitter.com"
}
{
"id": "plc_b907ce2b-6817-483a-86e3-fdc8c9c01b21",
"business_id": "603f1c4172bbe840979fd408",
"reference_id": "order_id_test1234",
"customer_id": "6fe639e6-144d-4ff4-be10-2a7cf787369b",
"plan_id": "plp_a4866b2a-08b4-4c6c-a432-7c8bf3f7d2af",
"currency": "IDR",
"amount": 1000,
"channel_code": "ID_KREDIVO",
"checkout_method": "ONE_TIME_PAYMENT",
"status": "PENDING",
"actions": {
"desktop_web_checkout_url": "https://pay.kredivo.com/signIn?tk=06e528b0-565e-414e-a9b1-9561f7209c10",
"mobile_web_checkout_url": "https://pay.kredivo.com/signIn?tk=06e528b0-565e-414e-a9b1-9561f7209c10"
},
"expires_at": "2023-04-05T04:33:35.299Z",
"success_redirect_url": "https://google.com",
"failure_redirect_url": "https://twitter.com",
"callback_url": "https://8b6d6f2961b98dc36e327335023ece5d.m.pipedream.net/hook",
"created": "2023-04-04T04:33:35.303Z",
"updated": "2023-04-04T04:33:35.470Z",
"order_items": [
{
"type": "PHYSICAL_PRODUCT",
"reference_id": "SKU_backtoschool-promotion123",
"name": "Nymbus twothousand",
"net_unit_amount": 1000,
"quantity": 1,
"url": "https://www.zngmyhome.com/nymbus",
"category": "Sports",
"subcategory": "Equipment",
"description": "Sports equipment for quidditch",
"metadata": null
}
],
"voided_at": null,
"payment_method_id": null,
"metadata": null
}