Train Ticket

📘

Notes:

For this part, we also provide the user journey. You can check the API documentation after user journey section.

User Journey

256

Select Tiket Kereta menu

Users can choose Tiket Kereta on the menu

641

Searching Train Schedule

In this step, the user will fill in their schedule data for the ticket they buy. The data that they need to fill in are:

  • Origin station
  • Destination station
  • Departing date
  • Numbers of passengers that will book the ticket (Adults & Children (under 3 y.o))
643

Choose Available Train on The Schedule List

After filling in the schedule, the system will show the available train that can be chosen by the user. In this step, the user could choose which train and depart time that they want to choose. The user will be shown the price also.

643

Customer and Passenger Data

In this step, the user should fill in the customer and passenger's data. The customer data will be:

  • Order data
  • Customer's full name based on ID Card
  • Phone number
  • Email
    You can refer to the result below after the customer filled out the data:
644

Customer and Passenger Data

All the fields and details are shown in the picture. Customer data means a person who booked this ticket, KAI will use this information to send email confirmation regarding the ticket booking. Passenger data will be the data for every passenger that will travel.

585

Booking Review

In this section, the user can see the booking details. User will be shown:

  • Customer details (Including Customer name, Phone number, and email),
  • Passenger details (Including Passenger name, ID number, and seat details),
  • The total amount that the user should pay.
    The user also could change the seat of the passenger by selecting the name of the passenger. The user will be shown the seat map.

Users can choose the seat and wagon number on this step by seeing the available seat. After the user finishes this step, the user will proceed to another page as shown below:

API Documentation

  • Enrollment API
📘

Endpoint

https://dev.openapi.ayopop.id/api/v2/enrollment/register

{
  "partnerId" : "partner-id",
  "account_number" : "081215474224",
  "product_code" : "product-code",
  "ref_number" : "567894039"
}
{
    "responseCode": 200,
    "success": true,
    "message": {
        "id": "Success.",
        "en": "Success."
    },
    "data": {
        "ayoconnect_ref_number": "19954",
        "accountNumber": "081215474224",
        "productName": "product-name",
        "productCode": "product-code",
        "category": "Tiket Kereta",
        "url": "{base-url}?ID=167584936197511"
    }
}
  • Callback API
{
    "responseCode": 200,
    "success": true,
    "message": {
        "ID": "success",
        "EN": "success"
    },
    "data": {
        "ayoconnectRefNumber": "475",
        "enrollmentId": "212607493988102",
        "refNumber": "4544578",
        "extraDetails": []
    }
}
  • Inquiry
{
  "partnerId": "partner-id",
  "accountNumber": "212607493988102",
  "productCode": "product-code"
}
{
    "responseCode": 300,
    "success": true,
    "message": {
        "ID": "Inkuiri berhasil",
        "EN": "Inquiry is successful"
    },
    "data": {
        "inquiryId": 5388773,
        "accountNumber": "212607493988102",
        "customerName": "TEST",
        "productName": "Tproduct-name",
        "productCode": "product-code",
        "category": "Tiket Kereta",
        "amount": 17500,
        "totalAdmin": 7500,
        "processingFee": 0,
        "denom": "",
        "validity": "",
        "customerDetails": [
            {
                "key": "Kode Pembayaran",
                "value": "212601111118102"
            },
            {
                "key": "Nama Pelanggan",
                "value": "TEST"
            },
            {
                "key": "Nomor HP",
                "value": "8111111111"
            },
            {
                "key": "Tanggal & Waktu Pembayaran",
                "value": "08 Feb 2023 | 17:44"
            },
            {
                "key": "Email",
                "value": "[email protected]"
            }
        ],
        "billDetails": [
            {
                "billId": "1",
                "billInfo": [],
                "isMandatory": true,
                "key": "Jumlah Tagihan",
                "value": 10000
            },
            {
                "billId": "0",
                "billInfo": [],
                "isMandatory": true,
                "key": "Biaya Administrasi",
                "value": 7500
            }
        ],
        "productDetails": [
            {
                "key": "Waktu Berangkat",
                "value": "2219"
            },
            {
                "key": "Waktu Sampai",
                "value": "2358"
            },
            {
                "key": "Tanggal Berangkat",
                "value": "2023-02-09"
            },
            {
                "key": "Tanggal Sampai",
                "value": "2023-02-09"
            },
            {
                "key": "Kode Kelas Gerbong",
                "value": "EKO"
            },
            {
                "key": "Id Kelas Gerbong",
                "value": "4"
            },
            {
                "key": "Sub Kelas",
                "value": "C"
            },
            {
                "key": "Id Trip",
                "value": "2496592"
            },
            {
                "key": "Kode Booking",
                "value": "RP86AY2"
            },
            {
                "key": "Stasiun Asal",
                "value": "GAMBIR"
            },
            {
                "key": "Stasiun Tujuan",
                "value": "BANDUNG"
            },
            {
                "key": "Nomor KA",
                "value": "0L0"
            },
            {
                "key": "Nama Kereta",
                "value": "PSO KA PSO"
            },
            {
                "key": "Kadaluarsa",
                "value": "2023-02-08 20:41:08"
            },
            {
                "key": "Kode Stasiun Asal",
                "value": "GMR"
            },
            {
                "key": "Kode Stasiun Tujuan",
                "value": "BD"
            }
        ],
        "extraFields": [
            {
                "key": "passengerDetails",
                "value": [
                    {
                        "key": "Penumpang1",
                        "value": [
                            {
                                "key": "Nomor ID",
                                "value": "99111119647289009"
                            },
                            {
                                "key": "NAMA",
                                "value": "Excel A"
                            },
                            {
                                "key": "Tipe Penumpang",
                                "value": "A"
                            },
                            {
                                "key": "Kursi",
                                "value": "EKO-1,19-D"
                            },
                            {
                                "key": "Harga",
                                "value": "10000"
                            },
                            {
                                "key": "Nomor Tiket",
                                "value": "039RP86AY21"
                            },
                            {
                                "key": "Kode Gerbong",
                                "value": "EKO-1"
                            },
                            {
                                "key": "Baris",
                                "value": "19"
                            },
                            {
                                "key": "Kolom",
                                "value": "D"
                            },
                            {
                                "key": "Kode Kelas Gerbong",
                                "value": "EKO"
                            },
                            {
                                "key": "Id Gerbong",
                                "value": "1834"
                            },
                            {
                                "key": "Status refund",
                                "value": "false"
                            },
                            {
                                "key": "Vaksin status",
                                "value": "false"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
  • Payment
{
  "partnerId": "jNfryats0BeN",
  "productCode": "TTRTKA",
  "accountNumber": "212607493988102",
  "inquiryId": 5388773,
  "amount": 17500,
  "refNumber": "AYE9999999"
}
{
    "responseCode": 0,
    "success": true,
    "message": {
        "ID": "Transaksi Anda Telah Berhasil",
        "EN": "Your transaction was successful"
    },
    "data": {
        "refNumber": "AYE9999999",
        "transactionId": 255363,
        "accountNumber": "212607493988102",
        "amount": 17500,
        "totalAdmin": 7500,
        "processingFee": 0,
        "denom": "",
        "productCode": "TTRTKA",
        "productName": "Tiket Kereta Api",
        "category": "Tiket Kereta",
        "token": "RP86AY2",
        "customerName": "Excel A",
        "validity": "",
        "customerDetails": [
            {
                "key": "Kode Pembayaran",
                "value": "212607493988102"
            },
            {
                "key": "Nama Pelanggan",
                "value": "Excel A"
            },
            {
                "key": "Nomor HP",
                "value": "81215474224"
            },
            {
                "key": "Tanggal & Waktu Pembayaran",
                "value": "08 Feb 2023 | 17:46"
            },
            {
                "key": "Email",
                "value": "[email protected]"
            }
        ],
        "billDetails": [
            {
                "billId": "1",
                "billInfo": [],
                "key": "Jumlah Tagihan",
                "value": 10000
            },
            {
                "billId": "0",
                "billInfo": [],
                "key": "Biaya Administrasi",
                "value": 7500
            }
        ],
        "productDetails": [
            {
                "key": "Nomor Referensi",
                "value": "RP86AY2"
            },
            {
                "key": "Waktu Berangkat",
                "value": "2219"
            },
            {
                "key": "Waktu Sampai",
                "value": "2358"
            },
            {
                "key": "Tanggal Berangkat",
                "value": "2023-02-09"
            },
            {
                "key": "Tanggal Sampai",
                "value": "2023-02-09"
            },
            {
                "key": "Kode Kelas Gerbong",
                "value": "EKO"
            },
            {
                "key": "Id Kelas Gerbong",
                "value": "4"
            },
            {
                "key": "Sub Kelas",
                "value": "C"
            },
            {
                "key": "Id Trip",
                "value": "2496592"
            },
            {
                "key": "Kode Booking",
                "value": "RP86AY2"
            },
            {
                "key": "Stasiun Asal",
                "value": "GAMBIR"
            },
            {
                "key": "Stasiun Tujuan",
                "value": "BANDUNG"
            },
            {
                "key": "Nomor KA",
                "value": "0L0"
            },
            {
                "key": "Nama Kereta",
                "value": "PSO KA PSO"
            },
            {
                "key": "Etiket",
                "value": "https://storage.googleapis.com/kai-train-ticket-stage/16758530839692369.pdf?Expires=1683629183&GoogleAccessId=control-room-pub-sub%40control-room-277910.iam.gserviceaccount.com&Signature=i9uROJW7WXzo%2F8BwaPj9xFuE8D2FxhGVlhbOr0E7pho373Ffu7dJTrGvrMPgPgzzR0sRxgSrQ3OnHTeKTYmLz3yUlDBi9FngAtozzruDCE0Jyrb9mj5XpzHYpDBAElInI%2B837sJg9EQZ14cvrq10bk3JIeW3Yqy9%2Fu3WpCwVNban0EM7u8aShQQZLfPLOLvXWoJiJCbXYi4jg%2BM9WVoxkiwh4l%2BS1po9hehm%2FXmbN5PprCNSCxiMdeCpH1tkPRnGe8YoyfaO1bCIEuvk8hdcpNl4poqz0dMtR5fiQ3CXQ1WwtTWDW%2BiJsIZdXoH2TeDtCDG9SwLtP29BnqHLE17vsQ%3D%3D"
            },
            {
                "key": "Kode Stasiun Asal",
                "value": "GMR"
            },
            {
                "key": "Kode Stasiun Tujuan",
                "value": "BD"
            }
        ],
        "extraFields": [
            {
                "key": "passengerDetails",
                "value": [
                    {
                        "key": "Penumpang1",
                        "value": [
                            {
                                "key": "Nomor ID",
                                "value": "3174189647289009"
                            },
                            {
                                "key": "NAMA",
                                "value": "Excel A"
                            },
                            {
                                "key": "Tipe Penumpang",
                                "value": "A"
                            },
                            {
                                "key": "Kursi",
                                "value": "EKO-1,19-D"
                            },
                            {
                                "key": "Harga",
                                "value": "10000"
                            },
                            {
                                "key": "Nomor Tiket",
                                "value": "CONNEC6039RP86AY21"
                            },
                            {
                                "key": "Kode Gerbong",
                                "value": "EKO-1"
                            },
                            {
                                "key": "Baris",
                                "value": "19"
                            },
                            {
                                "key": "Kolom",
                                "value": "D"
                            },
                            {
                                "key": "Kode Kelas Gerbong",
                                "value": "EKO"
                            },
                            {
                                "key": "Id Gerbong",
                                "value": "1834"
                            },
                            {
                                "key": "Status refund",
                                "value": "false"
                            },
                            {
                                "key": "Vaksin status",
                                "value": "false"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
  • Cancelation
📘

  • Ayoconnect provide cancel API, so user can do cancelation when they do wrong booking
  • Cancel API can be hit after user completed their enrollment or after inquiry call
  • accountNumber is enrollmentid
{
    "accountNumber": "212607493988102",
    "partnerId": "ayopop"
}
{
    "responseCode": 600,
    "success": true,
    "message": {
        "ID": "Pembatalan Sukses",
        "EN": "Cancellation Successful"
    },
    "data": {
        "refNumber": "2074134",
        "transactionId": 0,
        "accountNumber": "212607493988102",
        "amount": 1000,
        "totalAdmin": 0,
        "processingFee": 0,
        "denom": "",
        "productCode": "TTRTTGKA",
        "productName": "Rp. 1.000",
        "category": "",
        "token": "",
        "customerDetails": [],
        "billDetails": [],
        "productDetails": [],
        "extraFields": []
    }
}