Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 24 Current »


1. Inventory Quantity

1) Purpose

  • 특정 Product의 인벤토리의 가용성을 확인하기 위하여 사용하는 API입니다.

  • 가용성을 확인하면 해당 인벤토리를 구매 가능 여부를 판단할 수 있습니다.

2) Detail

  • 인벤토리는 Depth Combination(Option) 와 연결되어 있습니다.

  • Path Parameter로 입력한 <product_id> 와 일치하는 Product의 Inventory List 를 보여줍니다.

  • 유효한 API Key를 Request Header에 토큰으로 입력해야만 호출 가능합니다.

2. API spec

1) Request

Endpoint

product 환경: https://prod.ax-cloud.com/v1/channel/inventory/day-ticket/{product_code}

Method

GET

Description

특정 Product의 Inventory를 조회합니다.

Content-Type

application/json

Headers > Authorization

Token {api_key}

Headers > Channel

Code {channel_code}

2) Path Parameter

Name

Required

Type

Description

product_code

O

UUID

Product ID(UUID)

3) Query Parameter

Name

Required

Type

Description

page

X

Integer

Page number(default : 1)

page_size

X

Integer

Size per page(default : 25)

3) Response

Name

Type

Description

status_code

Integer

정상 처리 시 200

option_codes

Object

{option_code}

List[Object]

상품의 옵션 식별자

inventory_code

String

상품의 인벤토리 식별자

date

Date

날짜

max_quantity

Integer

최초 생성 재고

remain_quantity

Integer

남은 재고

ordered_quantity

Integer

주문 갯수

4) Response Example

 Status Code : 200 정상 처리 시
{
  "status_code": 200,
  "option_codes": {
    "1e0bd91f-989a-45e7-8e1c-4fe2d4231ae5": [
      {
        "inventory_code": "d50a6594-3457-4e87-afe1-435ca13b8cdd",
        "date": "2023-03-01",
        "max_quantity": 25, 
        "remain_quantity": 15, 
        "ordered_quantity": 10
      },
      {
        "inventory_code": "374bf54a-d7c1-4ad3-a95a-32aa3e7212ae",
        "date": "2023-03-08",
        "max_quantity": 25, 
        "remain_quantity": 5, 
        "ordered_quantity": 20
      },
      {
        "inventory_code": "5e77bcf2-9026-4263-847b-a8a4a84b5613",
        "date": "2023-03-15",
        "max_quantity": 25, 
        "remain_quantity": 11, 
        "ordered_quantity": 14
      }
    ]
  }
}

5) Error Spec

 Status Code : 404 Cause: 유효하지 않은 요청 값
{'message': '찾을 수 없습니다.'}
 Status Code : 403 Cause: 유효하지 않은 API Key 혹은 Channel Code
{'detail': ErrorDetail(string='이 작업을 수행할 권한(permission)이 없습니다.', code='permission_denied')}

3. Request Example

1) CURL

curl -X 'POST' \
  'https://prod.ax-cloud.com/v1/channel/inventory/day-ticket/6ecf4685-ca60-4a7d-843c-479329ca8789' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token api_key_secret' \
  -H 'Channel: Code code_secret'
  -d '{
  "status_code": 200,
  "option_codes": {
    "1e0bd91f-989a-45e7-8e1c-4fe2d4231ae5": [
      {
        "inventory_code": "d50a6594-3457-4e87-afe1-435ca13b8cdd",
        "date": "2023-03-01",
        "max_quantity": 25, 
        "remain_quantity": 15, 
        "ordered_quantity": 10
      },
      {
        "inventory_code": "374bf54a-d7c1-4ad3-a95a-32aa3e7212ae",
        "date": "2023-03-08",
        "max_quantity": 25, 
        "remain_quantity": 5, 
        "ordered_quantity": 20
      },
      {
        "inventory_code": "5e77bcf2-9026-4263-847b-a8a4a84b5613",
        "date": "2023-03-15",
        "max_quantity": 25, 
        "remain_quantity": 11, 
        "ordered_quantity": 14
      }
    ]
  }
}'


  • No labels