- Getting Started
- Version
- Auth
- User
- Kereta
- Pelanggan
- Gerbong
- Kursi
- Jadwal
- Pembelian Tiket
Create Kereta
Developing
POST
/kereta
Maintainer:Muhammad Fadhil Kholaf
Request
Cookie Params
token
string
required
Body Params application/json
namaKereta
string
required
deskripsi
string
required
kelas
enum<string>
required
Allowed values:
ekonomibisniseksekutifluxury
Example
{
"namaKereta": "string",
"deskripsi": "string",
"kelas": "ekonomi"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://kereta.api.fadhilkholaf.my.id/kereta' \
--header 'Cookie: token=' \
--header 'Content-Type: application/json' \
--data-raw ''
Responses
🟢201Created
application/json
Body
message
string
required
data
object (Kereta)
required
id
string
required
namaKereta
string
required
deskripsi
string
required
kelas
enum<string>
required
Allowed values:
ekonomibisniseksekutifluxury
createdAt
string
required
updatedAt
string
required
Example
{
"message": "string",
"data": {
"id": "string",
"namaKereta": "string",
"deskripsi": "string",
"kelas": "ekonomi",
"createdAt": "string",
"updatedAt": "string"
}
}
🔴500Server Error
🟠401Unauthorized
🟠400Bad Request
Modified at 2025-03-17 00:49:46