Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. Inventory Quantity

1) Purpose

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

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

...

2. API spec

1) Request

Endpoint

product environment: 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}

...

Name

Required

Type

Description

product_code

O

StringUUID

Product ID(UUID)

3) Query Parameter

...

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

주문 갯수

...

Expand
titleStatus Code : 200 정상 처리 시
Code Block
languagejson
{
  "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,
        "depth_combination_id": 15"
      },
      {
        "inventory_code": "374bf54a-d7c1-4ad3-a95a-32aa3e7212ae",
        "date": "2023-03-08",
        "max_quantity": 25, 
        "remain_quantity": 5, 
        "ordered_quantity": 20,
        "depth_combination_id":
15       },
      {
        "inventory_code": "5e77bcf2-9026-4263-847b-a8a4a84b5613",
        "date": "2023-03-15",
        "max_quantity": 25, 
        "remain_quantity": 11, 
        "ordered_quantity": 14,
        "depth_combination_id": 15
      }
    ]
  }
}

5) Error Spec

Expand
titleStatus Code : 404 Cause: 유효하지 않은 요청 값
Code Block
{'message': '찾을 수 없습니다.'}

...

Code Block
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,
        "depth_combination_id":
15"       },
      {
        "inventory_code": "374bf54a-d7c1-4ad3-a95a-32aa3e7212ae",
        "date": "2023-03-08",
        "max_quantity": 25, 
        "remain_quantity": 5, 
        "ordered_quantity": 20,
 
      "depth_combination_id": 15
      },
      {
        "inventory_code": "5e77bcf2-9026-4263-847b-a8a4a84b5613",
        "date": "2023-03-15",
        "max_quantity": 25, 
        "remain_quantity": 11, 
        "ordered_quantity": 14,
        "depth_combination_id": 15
      }
    ]
  }
}'

...