twenty-six API DOCS (v1)

Download OpenAPI specification:Download

Please contact twenty-six backend if there are any issues with API

carts

retrieveCart_success

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"[ {\n \"brandId\" : 1,\n \"brandName\" : \"돌봄\",\n \"freeDeliveryInfimum\" : 10000,\n \"deliveryFee\" : 2500,\n \"items\" : [ {\n \"productId\" : \"1234\",\n \"name\" : \"터그 장난감\",\n \"quantity\" : 1,\n \"price\" : 10000,\n \"discount\" : 0,\n \"discountedPrice\" : 10000,\n \"totalPrice\" : 10000\n } ]\n} ]"

changeCartItemQuantity_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Request Body schema: application/json
object (orders-orderId-cancel486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"id\" : \" \",\n \"quantity\" : 1001\n}"

Response samples

Content type
application/json
Example
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"quantity\" : \"수량은 1000개 이하입니다.\",\n \"id\" : \"아이디는 비어있을 수 없습니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:07:24.576435022\"\n}"

addCartItem_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Request Body schema: application/json
object (orders-orderId-cancel486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"id\" : \"1234\",\n \"quantity\" : 5\n}"

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"quantity\" : \"수량은 1개 이상입니다.\",\n \"id\" : \"아이디는 비어있을 수 없습니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:07:24.822186573\"\n}"

deleteCartItem_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Request Body schema: application/json
object (orders-orderId-cancel486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"productIds\" : [ \"1234\" ]\n}"

Response samples

Content type
application/json
Example
"{\n \"code\" : \"ITEM_DOES_NOT_EXIST\",\n \"message\" : \"해당 아이템이 없습니다.\",\n \"timestamp\" : \"2024-09-03T09:07:24.940498628\"\n}"

orders

receiveOrder_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Request Body schema: application/json
object (orders-orderId-cancel486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"products\" : [ {\n \"id\" : \"123456\",\n \"quantity\" : 1\n } ],\n \"shouldSaveNewAddress\" : true,\n \"shouldDeleteCartItem\" : true,\n \"receiver\" : {\n \"isDefault\" : false,\n \"name\" : \"송송이\",\n \"address\" : \"서울특별시 성북구 보문로\",\n \"zipCode\" : \"11112\",\n \"phone\" : \"010-2222-2222\"\n },\n \"productIds\" : [ \"123456\" ]\n}"

Response samples

Content type
application/json
Example
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"receiver.address\" : \"주소는 비어있을 수 없습니다.\",\n \"receiver.zipCode\" : \"우편번호 형식이 아닙니다.\",\n \"receiver.name\" : \"이름의 형식이 아닙니다.\",\n \"products[0].quantity\" : \"수량은 1개 이상입니다.\",\n \"receiver.phone\" : \"전화 번호 형식이 아닙니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:07:26.207403807\"\n}"

retrieveMyOrder_success

query Parameters
page
string

number of index

size
string

number of items per page

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"content\" : [ {\n \"id\" : 1,\n \"orderNumber\" : \"202332231313-1212313\",\n \"orderingAt\" : \"2024-09-03T09:07:25.658657122\",\n \"status\" : \"CANCEL\",\n \"brands\" : [ {\n \"brandId\" : 1,\n \"deliveryFee\" : 0,\n \"products\" : [ {\n \"productId\" : \"1234\",\n \"name\" : \"터그 장난감\",\n \"thumbnail\" : \"/12121221.jpg\",\n \"quantity\" : 10,\n \"amount\" : 20000,\n \"brandId\" : 1,\n \"brandName\" : \"돌봄\",\n \"deliveryFee\" : 0\n } ]\n } ]\n } ],\n \"pageable\" : \"INSTANCE\",\n \"first\" : true,\n \"last\" : true,\n \"size\" : 1,\n \"number\" : 0,\n \"sort\" : {\n \"empty\" : true,\n \"unsorted\" : true,\n \"sorted\" : false\n },\n \"numberOfElements\" : 1,\n \"empty\" : false\n}"

cancelOrder_

path Parameters
orderId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"NOT_USERS_ORDER\",\n \"message\" : \"유저의 주문이 아닙니다.\",\n \"timestamp\" : \"2024-09-03T09:07:26.261378083\"\n}"

returnOrder_

path Parameters
orderId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"NOT_USERS_ORDER\",\n \"message\" : \"유저의 주문이 아닙니다.\",\n \"timestamp\" : \"2024-09-03T09:07:26.174058822\"\n}"

brands

createBrand_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
Example
"{\n \"code\" : \"BRAND_LIMIT_OVER\",\n \"message\" : \"허용 가능한 브랜드 개수를 초과했습니다.\",\n \"timestamp\" : \"2024-09-03T09:07:45.199056951\"\n}"

updateBrand_

path Parameters
brandId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"freeDeliveryInfimum\" : \"무료 배송 하한은 1000만원 이하입니다.\",\n \"legalName\" : \"상호명은 50글자 이내, 1글자 이상입니다.\",\n \"deliveryFee\" : \"기본 배송비는 0원 이상입니다.\",\n \"name\" : \"이름은 50글자 이내, 1글자 이상입니다.\",\n \"introduction\" : \"상호명은 255글자 이내입니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:07:45.108149744\"\n}"

products

retrieveProductList_success

query Parameters
page
string

number of index

size
string

number of items per page

header Parameters
Authorization
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"[ {\n \"id\" : \"abcdefkghaskfldlm123\",\n \"thumbnailPath\" : \"/22222.jpg\",\n \"price\" : 20000,\n \"discount\" : 0,\n \"name\" : null,\n \"isFreeDelivery\" : true,\n \"countOfLikes\" : 1,\n \"isUserLike\" : true,\n \"brandName\" : \"돌봄\",\n \"brandId\" : 1,\n \"isOpen\" : true\n}, {\n \"id\" : \"qewreqrtuoyiyopeqwoo\",\n \"thumbnailPath\" : \"/33333.jpg\",\n \"price\" : 30000,\n \"discount\" : 10,\n \"name\" : null,\n \"isFreeDelivery\" : true,\n \"countOfLikes\" : 2,\n \"isUserLike\" : false,\n \"brandName\" : \"디어\",\n \"brandId\" : 2,\n \"isOpen\" : true\n} ]"

createProduct_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"quantity\" : \"재고는 0개 이상입니다.\",\n \"deliveryFee\" : \"기본 배송비는 10000원 이하입니다.\",\n \"price\" : \"가격은 0원 이상입니다.\",\n \"contact\" : \"A/S 책임자와 전화번호는 50글자 이내, 1글자 이상입니다.\",\n \"brandId\" : \"브랜드 id는 비어 있을 수 없습니다.\",\n \"countryOfManufacture\" : \"제조국은 50글자 이내, 1글자 이상입니다.\",\n \"name\" : \"이름은 50글자 이내, 1글자 이상입니다.\",\n \"orderingOpensAt\" : \"과거이거나 datetime 형식이 아닙니다.\",\n \"discount\" : \"할인율은 100 퍼센트 이하입니다.\",\n \"categoryId\" : \"카테고리 id는 비어 있을 수 없습니다.\",\n \"manufacturer\" : \"제조자는 50글자 이내, 1글자 이상입니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:08:03.903300679\"\n}"

retrieveProduct_

path Parameters
productId
required
string
header Parameters
Authorization
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"id\" : \"abcdefkghaskfldlm123\",\n \"thumbnailPath\" : \"/22222.jpg\",\n \"descriptionImagePath\" : \"/33333.jpg\",\n \"discountedPrice\" : 20000,\n \"price\" : 20000,\n \"discount\" : 0,\n \"deliveryFee\" : null,\n \"name\" : \"강아지 하네스\",\n \"isFreeDelivery\" : true,\n \"isUserLike\" : true,\n \"info\" : {\n \"manufacturer\" : \"돌봄\",\n \"countryOfManufacture\" : \"중국\",\n \"contact\" : \"010-1111-1111\"\n },\n \"brand\" : {\n \"brandId\" : 1,\n \"name\" : \"돌봄\",\n \"legalName\" : \"(주)돌봄\",\n \"thumbnail\" : \"/12356.jpg\",\n \"introduction\" : \"강아지가 행복한 세상을 만듭니다.\",\n \"registrationNumber\" : \"111-12-12323\",\n \"freeDeliveryInfimum\" : 10000\n },\n \"categories\" : [ \"반려용품\", \"강아지\", \"산책\" ],\n \"isOpen\" : true,\n \"orderingOpensAt\" : \"2024-07-07T07:07:07.000000007\"\n}"

updateProduct_

path Parameters
productId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"deliveryFee\" : \"기본 배송비는 10000원 이하입니다.\",\n \"quantity\" : \"재고는 0개 이상입니다.\",\n \"price\" : \"가격은 0원 이상입니다.\",\n \"countryOfManufacture\" : \"제조국은 50글자 이내, 1글자 이상입니다.\",\n \"contact\" : \"A/S 책임자와 전화번호는 50글자 이내, 1글자 이상입니다.\",\n \"name\" : \"이름은 50글자 이내, 1글자 이상입니다.\",\n \"discount\" : \"할인율은 100 퍼센트 이하입니다.\",\n \"orderingOpensAt\" : \"과거이거나 datetime 형식이 아닙니다.\",\n \"categoryId\" : \"카테고리 id는 비어 있을 수 없습니다.\",\n \"manufacturer\" : \"제조자는 50글자 이내, 1글자 이상입니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:08:03.363211783\"\n}"

deleteProduct_

path Parameters
productId
required
string
header Parameters
Authorization
required
string
Example: Bearer token

Bearer token for authorization

Responses

Response samples

Content type
application/json
Example
"{\n \"code\" : \"ALREADY_DELETED_PRODUCT\",\n \"message\" : \"이미 삭제된 상품입니다.\",\n \"timestamp\" : \"2024-09-03T09:08:03.314280705\"\n}"

retrieveProductStock_

path Parameters
productId
required
string
header Parameters
Authorization
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"PRODUCT_NOT_FOUND\",\n \"message\" : \"일치하는 상품이 없습니다.\",\n \"timestamp\" : \"2024-09-03T09:08:04.488412892\"\n}"

checkout

fail_success

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
text/html;charset=UTF-8
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8" />
</head>

<body>
<h2> 결제 실패 </h2>
<p id="code"></p>
<p id="message"></p>
</body>
</html>

<script>
    const urlParams = new URLSearchParams(window.location.search);

    const codeElement = document.getElementById("code");
    const messageElement = document.getElementById("message");

    codeElement.textContent = "에러코드: " + urlParams.get("code");
    messageElement.textContent = "실패 사유: " + urlParams.get("message");
</script>

success_success

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
text/html;charset=UTF-8
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8"/>
</head>
<body>
<h2>결제 성공</h2>
<p id="paymentKey"></p>
<p id="orderId"></p>
<p id="amount"></p>

<script>
    // 쿼리 파라미터 값이 결제 요청할 때 보낸 데이터와 동일한지 반드시 확인하세요.
    // 클라이언트에서 결제 금액을 조작하는 행위를 방지할 수 있습니다.
    const urlParams = new URLSearchParams(window.location.search);
    const paymentKey = urlParams.get("paymentKey");
    const orderId = urlParams.get("orderId");
    const amount = urlParams.get("amount");

    async function confirm() {
        const requestData = {
            paymentKey: paymentKey,
            orderId: orderId,
            amount: amount,
        };

        const response = await fetch("/payments", {
            method: "POST",
            headers: {
                "Content-Type": "application/json",
            },
            body: JSON.stringify(requestData),
        });

        const json = await response.json();

        if (!response.ok) {
            // 결제 실패 비즈니스 로직을 구현하세요.
            console.log(json);
            window.location.href = `/checkout/fail?message=${json.message}&code=${json.code}`;
        }

        // 결제 성공 비즈니스 로직을 구현하세요.
        console.log(json);
    }

    confirm();

    const paymentKeyElement = document.getElementById("paymentKey");
    const orderIdElement = document.getElementById("orderId");
    const amountElement = document.getElementById("amount");

    orderIdElement.textContent = "주문번호: " + orderId;
    amountElement.textContent = "결제 금액: " + amount;
    paymentKeyElement.textContent = "paymentKey: " + paymentKey;
</script>
</body>
</html>

checkout_success

path Parameters
orderId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
text/html;charset=UTF-8
<!DOCTYPE html>
<html lang="ko">
<head>
    <meta charset="utf-8" />
    <script src="https://js.tosspayments.com/v1/payment"></script>
    <style>
        .form-group {
            margin-bottom: 15px;
        }
        .form-group label {
            display: block;
            margin-bottom: 5px;
        }
    </style>
</head>
<body>
<!-- 사용자 입력 폼 -->
<div class="form-group">
    <label for="customerEmail">이메일:</label>
    <input type="email" id="customerEmail" placeholder="결제 정보를 받을 이메일을 입력하세요" required>
</div>
<div class="form-group">
    <label for="customerMobilePhone">전화번호:</label>
    <input type="tel" id="customerMobilePhone" placeholder="결제 정보를 받을 전화번호를 입력하세요" required>
</div>
<!-- 결제 UI -->
<div id="payment-method"></div>
<!-- 이용약관 UI -->
<div id="agreement"></div>
<!-- 결제하기 버튼 -->
<button class="button" id="payment-button" style="margin-top: 30px">결제하기</button>

<script>
    main();

    async function main() {
        const isBlocked = false;

        if(isBlocked)
            window.location.href = `/checkout/fail?message=Order failed due to insufficient stock&code=STOCK_SHORTAGE`;

        const button = document.getElementById("payment-button");
        // ------  결제위젯 초기화 ------
        const clientKey = "test_ck_ma60RZblrqB01KyaP0mb8wzYWBn1";
        const tossPayments = TossPayments(clientKey);


        // ------ '결제하기' 버튼 누르면 결제창 띄우기 ------
        button.addEventListener("click", async function () {
            const email = document.getElementById("customerEmail").value;
            const phone = document.getElementById("customerMobilePhone").value;

            if (!email || !phone) {
                alert("이메일과 전화번호를 모두 입력해주세요.");
                return;
            }

            await tossPayments.requestPayment({
                orderId: "abcdefkghaskfldlm123",
                orderName: "귀여운 데님 외 1건",
                successUrl: window.location.origin + "/checkout/success",
                failUrl: window.location.origin + "/checkout/fail",
                customerEmail: email,
                customerName: "1",
                customerMobilePhone: phone,
                amount: "1000",

            });
        });
    }
</script>
</body>
</html>

payments

confirm_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Request Body schema: application/json
object (payments486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"orderId\" : \"1234\",\n \"amount\" : \"10000\",\n \"paymentKey\" : \"12341341\"\n}"

Response samples

Content type
application/json
Example
"{\n \"code\" : \"NOT_FOUND_PAYMENT\",\n \"message\" : \"해당하는 결제 건이 없습니다.\",\n \"timestamp\" : \"2024-09-03T09:08:22.779616481\"\n}"

users

retrieveAllAddress_success

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"[ {\n \"id\" : 1,\n \"isDefault\" : true,\n \"receiverName\" : \"송송이\",\n \"address\" : \"서울시 성북구 보문로 23\",\n \"zipCode\" : \"11111\",\n \"phone\" : \"010-1223-2222\"\n}, {\n \"id\" : 2,\n \"isDefault\" : false,\n \"receiverName\" : \"안은영\",\n \"address\" : \"경북 안동\",\n \"zipCode\" : \"22222\",\n \"phone\" : \"010-2222-3333\"\n} ]"

sendAuthEmail_

Request Body schema: application/json
object (users-logout486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"email\" : \"abcde@naver.com\"\n}"

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"email\" : \"이메일 형식이 아닙니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:08:36.988007155\"\n}"

login_

Request Body schema: application/json
object (users-logout486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"email\" : \"abcde@gmail.com\",\n \"password\" : \"Qwerty!@1\"\n}"

Response samples

Content type
application/json
"{\n \"accessToken\" : \"any\"\n}"

logout_

query Parameters
type
string

logout type is ALL or SINGLE

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : \"logout.logoutType: 허용하지 않는 타입입니다.\",\n \"timestamp\" : \"2024-09-03T09:08:38.049210315\"\n}"

signUp_

Request Body schema: application/json
object (users-logout486549215)

Responses

Request samples

Content type
application/json
Example
"{\n \"email\" : \"abcde@gmail.com\",\n \"password\" : \"Qwerty!@1\",\n \"phone\" : \"010-1111-1111\",\n \"name\" : \"송송\",\n \"address\" : \"서울 특별시 성북구 보문로 23\",\n \"zipCode\" : \"11111\",\n \"userType\" : \"SELLER\"\n}"

Response samples

Content type
application/json
"{\n \"code\" : \"REQUEST_ARGUMENT_NOT_VALID\",\n \"message\" : {\n \"zipCode\" : \"우편번호 형식이 아닙니다.\",\n \"password\" : \"비밀번호는 8자리 이상의 소문자, 대문자, 숫자, 특수문자를 포함해야 합니다.\",\n \"address\" : \"주소의 형식이 아닙니다.\",\n \"phone\" : \"전화 번호 형식이 아닙니다.\",\n \"name\" : \"이름의 형식이 아닙니다.\",\n \"userType\" : \"회원가입 타입은 CUSTOMER 이거나 SELLER 입니다.\",\n \"email\" : \"이메일 형식이 아닙니다.\"\n },\n \"timestamp\" : \"2024-09-03T09:08:38.411695986\"\n}"

retrieveDefaultAddress_

header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"id\" : 1,\n \"isDefault\" : true,\n \"receiverName\" : \"송송이\",\n \"address\" : \"서울시 성북구 보문로 23\",\n \"zipCode\" : \"11111\",\n \"phone\" : \"010-1223-2222\"\n}"

changeDefaultAddress_

path Parameters
addressId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

deleteAddress_

path Parameters
addressId
required
string
header Parameters
Authorization
required
string
Example: Bearer eyJhbGciOiJIUzI1NiJ9.

Bearer token for authorization

Responses

Response samples

Content type
application/json
"{\n \"code\" : \"ONLY_ADDRESS\",\n \"message\" : \"유일한 배송지는 삭제할 수 없습니다.\",\n \"timestamp\" : \"2024-09-03T09:08:35.953703806\"\n}"

verifyEmail_

query Parameters
email
required
string

verification email

code
required
string

verification code

Responses

Response samples

Content type
application/json
Example
"{\n \"code\" : \"NOT_VALID_EMAIL\",\n \"message\" : \"인증을 요청하지 않거나 요청이 만료된 이메일입니다.\",\n \"timestamp\" : \"2024-09-03T09:08:36.670215222\"\n}"