Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

...

1.

...

Create Question

1) Purpose

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

  • 1개의 Inventory 는 Depth Combination(Option) 와 연결되어 채널에서 발생한 여행자 문의 사항을 AX Cloud 에 생성합니다.

  • 특정 상품에 생성된 문의는 답변을 받아서 채널에서 정보를 조회할 수 있습니다.

2) Detail

  • Path Parameter로 입력한 <product_id> 와 일치하는 Product의 Inventory List 를 보여줍니다상품 별로 문의를 등록하고 답변을 조회할 수 있습니다.

  • 답변 생성 여부도 조회하여 확인할 수 있습니다.

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

2. API spec

1) Request

Endpoint

product environment: https://prod.ax-cloud.com/v1/channel/question/tour/<product_code>

test environment: https://test.ax-cloud.com/v1/channel/inventoryquestion/tour/<product_code>

Method

GETPOST

Description

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

Content-Type

application/json

Headers > Authorization

Token {api_key}

Headers > Channel

Code {channel_code}

2)

...

Body Parameter

...

remain_quantity

...

Integer

...

남은 재고

...

ordered_quantity

...

Integer

...

주문 갯수

...

depth_combination_id

...

String

...

인벤토리 연관된 옵션 아이디

4) Response Example

...

titleStatus Code : 200 정상 처리 시
Code Block
languagejson
{
  "status_code": 200,
  "data": [
    {
      "id": 1,
      "date": "2023-03-01",
      "start_time": "14:00", 
      "day_of_the_week": "Sunday", 
      "is_order": true, 
      "max_quantity": 25, 
      "min_quantity": 5, 
      "remain_quantity": 10,
      "ordered_quantity": 15
    },
    {
      "id": 2,
      "date": "2023-03-08",
      "start_time": "14:00", 
      "day_of_the_week": "Sunday", 
      "is_order": true, 
      "max_quantity": 25, 
      "min_quantity": 5, 
      "remain_quantity": 20,
      "ordered_quantity": 5
    },
    {
      "id": 3,
      "date": "2023-03-15",
      "start_time": "14:00", 
      "day_of_the_week": "Sunday", 
      "is_order": true, 
      "max_quantity": 25, 
      "min_quantity": 5, 
      "remain_quantity": 11,
      "ordered_quantity": 14
    }
  ]
}

...

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

...

data

...

List[Object]

...

인벤토리 리스트

...

id

...

Integer

...

인벤토리 아이디

...

date

...

Date

...

날짜

...

start_time

...

Time

...

투어 시작 시간

...

day_of_the_week

...

String

...

요일

...

is_order

...

Boolean

...

판매 유무

...

max_quantity

...

Integer

...

최초 생성 재고

...

min_quantity

...

Integer

...

최소 출발 인원으로 ordered_quantity가 이 값 보다 높아야 Tour가 진행된다.

question_code

O

String

답변을 식별할 수 있도록 채널에서 생성한 질문의 식별자

  • UUID4 형식의 코드 권장

option_code

X

UUID

질문이 옵션 관련 질문인 경우 상품 옵션 코드가 필요함

title

O

String

문의 제목

body

X

String

문의 본문.

is_public

O

Bool

공개질문/비공개질문(판매자, 문의자만 조회) 여부

quested_at

O

Datetime

YYYY-MM-DD hh:mm:ss

  • 문의 작성시간 (채널 기준)

3) Response

Name

Type

Description

question_code

string

  • 답변을 식별할 수 있도록 채널에서 생성한 질문의 식별자

Expand
titleStatus Code : 201 Response: AX Cloud 에 생성된 문의
Code Block
{
  "question_code": "6ecf4685-ca60-4a7d-843c-479329ca8789"
}

4) Error Spec

Expand
titleStatus Code : 400 Cause: 유효하지 않은 요청 값
Code Block
{'

...

body': 

...

'이 필드는 null일 수 없습니다.'

...

}
Expand
titleStatus Code : 403 Cause: 유효하지 않은 API Key 혹은 Channel Code
Code Block
{'

...

message': 

...

'이 작업을 수행할 권한(permission)이 없습니다.'

...

}

3. Request Example

1) CURL

  • Code Block
    curl -X 'POST' \
      'https://prod.ax-cloud.com/v1/channel/

...

  • question/tour

...

  • ' \
      -H 'accept: application/json' \
      -H 'Content-Type: application/json' \
      -H 

...

  • "Authorization: Token api_key_secret" \
      -

...

  • d '

...

  • {
          "question_code": "6ecf4685-ca60-4a7d-843c-479329ca8789",
          "option_code": "5a8b34ec-1a32-4b70-a5ba-8f2c81ec4c09",
          "title": "투어상품 관련문의",
          "body": "준비물은 없나요?",
          "is_public": true,
          "quested_at": "2022-01-21 10:00:00",
    }'

...