Skip to content

Back End Group Project - Kelompok 20 ASEAN Youth Organization

Notifications You must be signed in to change notification settings

rahmaninsani/ternakhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Spec

Base URL

https://ternakhub.rahmaninsani.my.id

Authentication

Request :

  • Header :
    • Bearer ACCESS_TOKEN

Get Flashsale Products

Request :

  • Method : GET
  • Endpoint : /products/flashsale
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "discountPercent": "decimal",
      "priceAfterDiscount": "long",
      "weight": "integer",
      "unit": "string",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "priceWithDiscount": "long",
      "weight": "integer",
      "unit": "string",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Latest Products

Request :

  • Method : GET
  • Endpoint : /products/latest
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Best Seller Products

Request :

  • Method : GET
  • Endpoint : /products/best-seller
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Search Products

Request :

  • Method : GET
  • Endpoint : /products
  • Header :
    • Accept: application/json
  • Query Param :
    • keyword : string

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "image": "string",
      "price": "long",
      "weight": "integer",
      "unit": "string",
      "amountSold": "integer",
      "rating": "decimal",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Product Detail

Request :

  • Method : GET
  • Endpoint : /products/{productId}
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "name": "string",
    "image": "string",
    "description": "string",
    "price": "long",
    "weight": "integer",
    "unit": "string",
    "amountSold": "integer",
    "rating": "decimal",
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Get Product Reviews

Request :

  • Method : GET
  • Endpoint : /products/{productId}/reviews
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "user": {
        "id": "integer, unique",
        "name": "string"
      },
      "rating": "decimal",
      "content": "string",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "user": {
        "id": "integer, unique",
        "name": "string"
      },
      "rating": "decimal",
      "content": "string",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Cart Items

Request :

  • Method : GET
  • Endpoint : /carts
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "products": [
      {
        "id": "integer, unique",
        "name": "string",
        "price": "long",
        "weight": "integer",
        "unit": "string",
        "quantity": "integer",
        "createdAt": "date",
        "updatedAt": "date"
      },
      {
        "id": "integer, unique",
        "name": "string",
        "price": "long",
        "weight": "integer",
        "unit": "string",
        "quantity": "integer",
        "createdAt": "date",
        "updatedAt": "date"
      }
    ]
  }
}

Add Cart Item

Request :

  • Method : POST
  • Endpoint : /carts
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "productId": "integer"
}

Response :

{
  "code": "integer",
  "status": "string"
}

Update Cart Item

Request :

  • Method : PUT
  • Endpoint : /carts/{productId}
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "quantity": "integer"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "products": [
      {
        "id": "integer, unique",
        "name": "string",
        "price": "long",
        "weight": "integer",
        "unit": "string",
        "quantity": "integer",
        "createdAt": "date",
        "updatedAt": "date"
      }
    ]
  }
}

Delete Cart Item

Request :

  • Method : DELETE
  • Endpoint : /carts/{productId}
  • Header :
    • Accept: application/json

Response :

{
  "code": "integer",
  "status": "string"
}

Get Addresses

Request :

  • Method : GET
  • Endpoint : /addresses
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "label": "string",
      "ownerName": "string",
      "phone": "long",
      "address": "string",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "label": "string",
      "ownerName": "string",
      "phone": "string",
      "address": "string",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Create Address

Request :

  • Method : POST
  • Endpoint : /addresses
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "label": "string",
  "owner_name": "string",
  "phone": "string",
  "address": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "label": "string",
    "ownerName": "string",
    "phone": "long",
    "address": "string",
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Update Address

Request :

  • Method : PUT
  • Endpoint : /addresses/{addressId}
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "label": "string",
  "owner_name": "string",
  "phone": "string",
  "address": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "label": "string",
    "ownerName": "string",
    "phone": "long",
    "address": "string",
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Delete Address

Request :

  • Method : DELETE
  • Endpoint : /addresses/{addressId}
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string"
}

Shipping Method

Get Shipping Method

Request :

  • Method : GET
  • Endpoint : /shipping-methods
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "cost": "long",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "cost": "long",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Payment Method

Request :

  • Method : GET
  • Endpoint : /payment-methods
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "name": "string",
      "code": "string",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "name": "string",
      "code": "string",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Order

Request :

  • Method : GET
  • Endpoint : /orders
  • Header :
    • Accept: application/json
  • Query Param :
    • status : string

Response :

{
  "code": "number",
  "status": "string",
  "data": [
    {
      "id": "integer, unique",
      "orderNumber": "string",
      "orderDate": "date",
      "status": "string",
      "total": "long",
      "createdAt": "date",
      "updatedAt": "date"
    },
    {
      "id": "integer, unique",
      "orderNumber": "string",
      "orderDate": "date",
      "status": "string",
      "total": "long",
      "createdAt": "date",
      "updatedAt": "date"
    }
  ]
}

Get Order Detail

Request :

  • Method : GET
  • Endpoint : /orders/{ordersId}
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "orderNumber": "string",
    "orderDate": "date",
    "shippingMethod": {
      "name": "string",
      "cost": "long"
    },
    "shippingAddress": {
      "name": "string",
      "phone": "long",
      "address": "string"
    },
    "paymentMethod": {
      "name": "string",
      "bankCode": "string"
    },
    "total": "long",
    "status": "string",
    "products": [
      {
        "id": "integer, unique",
        "name": "string",
        "image": "string",
        "quantity": "integer",
        "price": "long",
        "weight": "integer",
        "unit": "string",
        "reviews": {
          "id": "integer, unique",
          "name": "string",
          "rating": "decimal",
          "content": "string"
        }
      },
      {
        "id": "integer, unique",
        "name": "string",
        "image": "string",
        "quantity": "integer",
        "price": "long",
        "weight": "integer",
        "unit": "string",
        "reviews": {
          "id": "integer, unique",
          "name": "string",
          "rating": "decimal",
          "content": "string"
        }
      }
    ],
    "virtualAccount": "string",
    "receivedDate": "date",
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Get Profile

Request :

  • Method : GET
  • Endpoint : /users
  • Header :
    • Accept: application/json

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "name": "string",
    "dateOfBirth": "date",
    "gender": "string",
    "contact": {
      "email": "string",
      "phone": "string"
    },
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Create User (Register)

Request :

  • Method : POST
  • Endpoint : /users/register
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "name": "string",
  "dateOfBirth": "date",
  "gender": "string",
  "contact": {
    "email": "string",
    "phone": "string"
  },
  "password": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "name": "string",
    "dateOfBirth": "date",
    "gender": "string",
    "contact": {
      "email": "string",
      "phone": "string"
    },
    "createdAt": "date",
    "updatedAt": "date"
  }
}

Login User

Request :

  • Method : POST
  • Endpoint : /users/login
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "email": "string",
  "password": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "accessToken": "string"
  }
}

Update Profile

Request :

  • Method : PUT
  • Endpoint : /users/{userId}
  • Header :
    • Content-Type: application/json
    • Accept: application/json

Body :

{
  "name": "string",
  "dateOfBirth": "date",
  "gender": "string",
  "contact": {
    "email": "string",
    "phone": "string"
  },
  "password": "string"
}

Response :

{
  "code": "number",
  "status": "string",
  "data": {
    "id": "integer, unique",
    "name": "string",
    "dateOfBirth": "date",
    "gender": "string",
    "contact": {
      "email": "string",
      "phone": "string"
    },
    "createdAt": "date",
    "updatedAt": "date"
  }
}

About

Back End Group Project - Kelompok 20 ASEAN Youth Organization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published