This repository is about my simple project using Spring Boot. So Delivery API is a simple API for order a delivery service.
This project is using Spring, H2, JWT.
now this repos is on https://delivapi.herokuapp.com/
response :
{
"ok": Boolean,
"statusCode": String,
"statusMessage": String,
"payload": ...
}
At first we have to sign in as user before using the provided endpoints
POST /api/auth/loginbody eg :
{
"email":"nansamgr@gmail.com",
"password":"thisissecret"
}
you will get a token and you have to add that token on header request with key "Authorization" and value "Bearer your_token" when you try access any other endpoints.
but if dont have any account yet, you can create new one in signup endpoint
POST /api/auth/signupbody eg :
{
"fullName":"I Putu Nanda Amanta",
"email":"nansamgr@gmail.com",
"password":"thisissecret",
"phoneNumber":"089999999999"
}
To get all provinces data.
GET /api/data/provincesTo get 1 province data
GET /api/data/provinces/{id}| Parameter | Type | Description |
|---|---|---|
id |
string |
Required. Id of item to fetch |
To get all Cities data.
GET /api/data/citiesTo check delivery cost andcheck courier availbility.
GET /api/pricing| Parameter | Type | Description |
|---|---|---|
originCityId |
string |
Required. Id of origin city |
destinationCityId |
string |
Required. Id of destination city |
courier |
string |
Required. courier : pos, tiki, jne |
packageWeight |
string |
Required. your package weight |
To get all orders logged user.
GET /api/orderTo create new order.
POST /api/orderbody eg :
{
"packageWeight": 12,
"courier": "jne",
"recipientName": "dodo",
"recipientNumber": "0899990009",
"destinationCityId": "1",
"originCityId" : "2"
}
| field | Type | Description |
|---|---|---|
destinationCityId |
string |
Required. city_id, you can get it from /api/data/cities |
originCityId |
string |
Required. city_id, you can get it from /api/data/cities |