@sayren/store-sdk 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +608 -5
- package/dist/index.mjs +636 -32
- package/package.json +1 -1
- package/src/client.ts +19 -0
- package/src/http.ts +16 -1
- package/src/index.ts +1 -0
- package/src/schemas/api-log.ts +12 -1
- package/src/schemas/claim.ts +24 -0
- package/src/schemas/misc.ts +134 -1
- package/src/schemas/order.ts +72 -4
- package/src/schemas/payment.ts +64 -0
- package/src/schemas/product.ts +42 -3
- package/src/schemas/shipping-policy.ts +375 -0
- package/src/schemas/store.ts +10 -0
package/dist/index.d.mts
CHANGED
|
@@ -8,9 +8,13 @@ export declare class ApiError extends Error {
|
|
|
8
8
|
readonly body?: unknown | undefined;
|
|
9
9
|
/** 엔벨로프 `$.error.details` — 에러 코드별 보조 데이터. 없으면 undefined */
|
|
10
10
|
readonly details?: Record<string, unknown> | undefined;
|
|
11
|
+
/** 엔벨로프 `$.error.docs` — 이 에러 코드를 설명하는 문서 URL. 매핑이 없으면 undefined */
|
|
12
|
+
readonly docs?: string | undefined;
|
|
11
13
|
constructor(status: number, code: string, message: string, traceId?: string | undefined, body?: unknown | undefined,
|
|
12
14
|
/** 엔벨로프 `$.error.details` — 에러 코드별 보조 데이터. 없으면 undefined */
|
|
13
|
-
details?: Record<string, unknown> | undefined
|
|
15
|
+
details?: Record<string, unknown> | undefined,
|
|
16
|
+
/** 엔벨로프 `$.error.docs` — 이 에러 코드를 설명하는 문서 URL. 매핑이 없으면 undefined */
|
|
17
|
+
docs?: string | undefined);
|
|
14
18
|
}
|
|
15
19
|
type TokenSource = string | null | undefined | (() => string | null | undefined);
|
|
16
20
|
type Query = Record<string, string | number | boolean | undefined>;
|
|
@@ -619,6 +623,7 @@ export declare const apiLogListQuerySchema: z.ZodObject<{
|
|
|
619
623
|
"5xx": "5xx";
|
|
620
624
|
}>>;
|
|
621
625
|
q: z.ZodOptional<z.ZodString>;
|
|
626
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
622
627
|
cursor: z.ZodOptional<z.ZodString>;
|
|
623
628
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
624
629
|
}, z.core.$strip>;
|
|
@@ -1082,6 +1087,22 @@ export declare const claimReasonSchema: z.ZodEnum<{
|
|
|
1082
1087
|
DELAY: "DELAY";
|
|
1083
1088
|
}>;
|
|
1084
1089
|
export type ClaimReason = z.infer<typeof claimReasonSchema>;
|
|
1090
|
+
/**
|
|
1091
|
+
* 반품지 (이슈 #30) — 반품·교환 수거가 안내하는 주소다. 스토어 주소록의 기본 반품지이거나,
|
|
1092
|
+
* 상품이 반품지를 따로 지정했으면 그 주소다.
|
|
1093
|
+
*
|
|
1094
|
+
* 취소 클레임은 보낼 물건이 없어 null이고, 반품지를 등록하지 않은 스토어도 null이다.
|
|
1095
|
+
* 구매자가 직접 보내는 수거(`BUYER_SEND`)에 이 주소가 필요하다.
|
|
1096
|
+
*/
|
|
1097
|
+
export declare const claimReturnAddressSchema: z.ZodObject<{
|
|
1098
|
+
name: z.ZodString;
|
|
1099
|
+
contactName: z.ZodString;
|
|
1100
|
+
phone: z.ZodString;
|
|
1101
|
+
zipCode: z.ZodString;
|
|
1102
|
+
address1: z.ZodString;
|
|
1103
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
1104
|
+
}, z.core.$strip>;
|
|
1105
|
+
export type ClaimReturnAddress = z.infer<typeof claimReturnAddressSchema>;
|
|
1085
1106
|
export declare const claimSchema: z.ZodObject<{
|
|
1086
1107
|
claimId: z.ZodString;
|
|
1087
1108
|
type: z.ZodEnum<{
|
|
@@ -1136,6 +1157,14 @@ export declare const claimSchema: z.ZodObject<{
|
|
|
1136
1157
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
1137
1158
|
holdExpiresAt: z.ZodNullable<z.ZodString>;
|
|
1138
1159
|
holdUsed: z.ZodBoolean;
|
|
1160
|
+
returnAddress: z.ZodNullable<z.ZodObject<{
|
|
1161
|
+
name: z.ZodString;
|
|
1162
|
+
contactName: z.ZodString;
|
|
1163
|
+
phone: z.ZodString;
|
|
1164
|
+
zipCode: z.ZodString;
|
|
1165
|
+
address1: z.ZodString;
|
|
1166
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
1167
|
+
}, z.core.$strip>>;
|
|
1139
1168
|
}, z.core.$strip>;
|
|
1140
1169
|
export type Claim = z.infer<typeof claimSchema>;
|
|
1141
1170
|
export interface ClaimListParams extends PageParams {
|
|
@@ -1215,6 +1244,14 @@ export declare const claimDetailSchema: z.ZodObject<{
|
|
|
1215
1244
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
1216
1245
|
holdExpiresAt: z.ZodNullable<z.ZodString>;
|
|
1217
1246
|
holdUsed: z.ZodBoolean;
|
|
1247
|
+
returnAddress: z.ZodNullable<z.ZodObject<{
|
|
1248
|
+
name: z.ZodString;
|
|
1249
|
+
contactName: z.ZodString;
|
|
1250
|
+
phone: z.ZodString;
|
|
1251
|
+
zipCode: z.ZodString;
|
|
1252
|
+
address1: z.ZodString;
|
|
1253
|
+
address2: z.ZodNullable<z.ZodString>;
|
|
1254
|
+
}, z.core.$strip>>;
|
|
1218
1255
|
histories: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1219
1256
|
status: z.ZodEnum<{
|
|
1220
1257
|
REQUESTED: "REQUESTED";
|
|
@@ -1924,6 +1961,34 @@ export declare const webhookDeliveryErrorCodeSchema: z.ZodEnum<{
|
|
|
1924
1961
|
WEBHOOK_SUSPENDED: "WEBHOOK_SUSPENDED";
|
|
1925
1962
|
}>;
|
|
1926
1963
|
export type WebhookDeliveryErrorCode = z.infer<typeof webhookDeliveryErrorCodeSchema>;
|
|
1964
|
+
/**
|
|
1965
|
+
* 실패 원인 분류의 **현재** 값. 응답 스키마(`webhookFailureReasonSchema`)는 문자열로 열려 있다 —
|
|
1966
|
+
* 서버가 값을 더해도 이전 SDK가 목록 파싱에 실패하지 않게 한다(택배 추적 `stage`와 같은 이유).
|
|
1967
|
+
* 모르는 값은 `errorCode`로 판단한다.
|
|
1968
|
+
*/
|
|
1969
|
+
export declare const WEBHOOK_FAILURE_REASONS: readonly ["DNS", "TLS", "TIMEOUT", "CONNECTION", "HTTP_4XX", "HTTP_5XX", "HTTP_OTHER", "SSRF_BLOCKED", "SUSPENDED"];
|
|
1970
|
+
/** 알려진 실패 원인. 응답에는 이 밖의 문자열이 올 수 있다 */
|
|
1971
|
+
export type WebhookFailureReason = (typeof WEBHOOK_FAILURE_REASONS)[number];
|
|
1972
|
+
export declare const webhookFailureReasonSchema: z.ZodString;
|
|
1973
|
+
/**
|
|
1974
|
+
* 대상 리소스 종류의 **현재** 값. 응답 스키마는 문자열로 열려 있다(새 이벤트가 새 리소스를 가리킬 수 있다).
|
|
1975
|
+
*/
|
|
1976
|
+
export declare const WEBHOOK_RESOURCE_TYPES: readonly ["ORDER", "CLAIM", "PRODUCT", "REVIEW", "INQUIRY"];
|
|
1977
|
+
/** 알려진 리소스 종류. 응답에는 이 밖의 문자열이 올 수 있다 */
|
|
1978
|
+
export type WebhookResourceType = (typeof WEBHOOK_RESOURCE_TYPES)[number];
|
|
1979
|
+
export declare const webhookResourceTypeSchema: z.ZodString;
|
|
1980
|
+
/** 이벤트가 가리키는 대상 리소스 — 전송 기록을 주문·상품과 잇는 키 */
|
|
1981
|
+
export declare const webhookDeliveryResourceSchema: z.ZodObject<{
|
|
1982
|
+
type: z.ZodString;
|
|
1983
|
+
id: z.ZodString;
|
|
1984
|
+
}, z.core.$strip>;
|
|
1985
|
+
export type WebhookDeliveryResource = z.infer<typeof webhookDeliveryResourceSchema>;
|
|
1986
|
+
/** 발송 요청 헤더 한 줄 (값 마스킹) */
|
|
1987
|
+
export declare const webhookRequestHeaderSchema: z.ZodObject<{
|
|
1988
|
+
name: z.ZodString;
|
|
1989
|
+
value: z.ZodNullable<z.ZodString>;
|
|
1990
|
+
}, z.core.$strip>;
|
|
1991
|
+
export type WebhookRequestHeader = z.infer<typeof webhookRequestHeaderSchema>;
|
|
1927
1992
|
/** 웹훅 전송 기록 한 건 (전송 기록 조회 항목) */
|
|
1928
1993
|
export declare const webhookDeliverySchema: z.ZodObject<{
|
|
1929
1994
|
deliveryId: z.ZodString;
|
|
@@ -1960,6 +2025,11 @@ export declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
1960
2025
|
NON_2XX: "NON_2XX";
|
|
1961
2026
|
WEBHOOK_SUSPENDED: "WEBHOOK_SUSPENDED";
|
|
1962
2027
|
}>>;
|
|
2028
|
+
failureReason: z.ZodNullable<z.ZodString>;
|
|
2029
|
+
resource: z.ZodNullable<z.ZodObject<{
|
|
2030
|
+
type: z.ZodString;
|
|
2031
|
+
id: z.ZodString;
|
|
2032
|
+
}, z.core.$strip>>;
|
|
1963
2033
|
attemptCount: z.ZodNumber;
|
|
1964
2034
|
createdAt: z.ZodString;
|
|
1965
2035
|
attemptedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -1968,6 +2038,64 @@ export declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
1968
2038
|
redeliveredAs: z.ZodNullable<z.ZodString>;
|
|
1969
2039
|
}, z.core.$strip>;
|
|
1970
2040
|
export type WebhookDelivery = z.infer<typeof webhookDeliverySchema>;
|
|
2041
|
+
/** 발송 본문 최대 노출 길이(바이트). 넘으면 잘라 주고 `payloadTruncated`가 true다 */
|
|
2042
|
+
export declare const WEBHOOK_PAYLOAD_EXCERPT_MAX_BYTES: number;
|
|
2043
|
+
/** 웹훅 전송 기록 상세 — `GET /webhooks/{id}/deliveries/{deliveryId}`. 목록 항목 + 요청 본문·헤더 */
|
|
2044
|
+
export declare const webhookDeliveryDetailSchema: z.ZodObject<{
|
|
2045
|
+
deliveryId: z.ZodString;
|
|
2046
|
+
eventId: z.ZodString;
|
|
2047
|
+
eventType: z.ZodEnum<{
|
|
2048
|
+
"ORDER.PAID": "ORDER.PAID";
|
|
2049
|
+
"ORDER.CONFIRMED": "ORDER.CONFIRMED";
|
|
2050
|
+
"ORDER.DISPATCHED": "ORDER.DISPATCHED";
|
|
2051
|
+
"ORDER.DELIVERED": "ORDER.DELIVERED";
|
|
2052
|
+
"ORDER.PURCHASE_DECIDED": "ORDER.PURCHASE_DECIDED";
|
|
2053
|
+
"ORDER.ADDRESS_CHANGE_REQUESTED": "ORDER.ADDRESS_CHANGE_REQUESTED";
|
|
2054
|
+
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2055
|
+
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2056
|
+
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2057
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2058
|
+
"INQUIRY.CREATED": "INQUIRY.CREATED";
|
|
2059
|
+
"REVIEW.CREATED": "REVIEW.CREATED";
|
|
2060
|
+
"PRODUCT.OUT_OF_STOCK": "PRODUCT.OUT_OF_STOCK";
|
|
2061
|
+
}>;
|
|
2062
|
+
url: z.ZodString;
|
|
2063
|
+
status: z.ZodEnum<{
|
|
2064
|
+
PENDING: "PENDING";
|
|
2065
|
+
PENDING_RETRY: "PENDING_RETRY";
|
|
2066
|
+
SUCCESS: "SUCCESS";
|
|
2067
|
+
FAILED: "FAILED";
|
|
2068
|
+
}>;
|
|
2069
|
+
responseStatusCode: z.ZodNullable<z.ZodNumber>;
|
|
2070
|
+
responseTimeMs: z.ZodNullable<z.ZodNumber>;
|
|
2071
|
+
responseBodyExcerpt: z.ZodNullable<z.ZodString>;
|
|
2072
|
+
errorCode: z.ZodNullable<z.ZodEnum<{
|
|
2073
|
+
TIMEOUT: "TIMEOUT";
|
|
2074
|
+
CONNECTION_FAILED: "CONNECTION_FAILED";
|
|
2075
|
+
BLOCKED_ADDRESS: "BLOCKED_ADDRESS";
|
|
2076
|
+
NON_2XX: "NON_2XX";
|
|
2077
|
+
WEBHOOK_SUSPENDED: "WEBHOOK_SUSPENDED";
|
|
2078
|
+
}>>;
|
|
2079
|
+
failureReason: z.ZodNullable<z.ZodString>;
|
|
2080
|
+
resource: z.ZodNullable<z.ZodObject<{
|
|
2081
|
+
type: z.ZodString;
|
|
2082
|
+
id: z.ZodString;
|
|
2083
|
+
}, z.core.$strip>>;
|
|
2084
|
+
attemptCount: z.ZodNumber;
|
|
2085
|
+
createdAt: z.ZodString;
|
|
2086
|
+
attemptedAt: z.ZodNullable<z.ZodString>;
|
|
2087
|
+
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
2088
|
+
redeliveryOf: z.ZodNullable<z.ZodString>;
|
|
2089
|
+
redeliveredAs: z.ZodNullable<z.ZodString>;
|
|
2090
|
+
payload: z.ZodString;
|
|
2091
|
+
payloadTruncated: z.ZodBoolean;
|
|
2092
|
+
payloadMasked: z.ZodBoolean;
|
|
2093
|
+
requestHeaders: z.ZodArray<z.ZodObject<{
|
|
2094
|
+
name: z.ZodString;
|
|
2095
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2096
|
+
}, z.core.$strip>>;
|
|
2097
|
+
}, z.core.$strip>;
|
|
2098
|
+
export type WebhookDeliveryDetail = z.infer<typeof webhookDeliveryDetailSchema>;
|
|
1971
2099
|
/** 전송 기록 조회 쿼리 — `GET /webhooks/{id}/deliveries` */
|
|
1972
2100
|
export declare const webhookDeliveryListQuerySchema: z.ZodObject<{
|
|
1973
2101
|
status: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1976,6 +2104,22 @@ export declare const webhookDeliveryListQuerySchema: z.ZodObject<{
|
|
|
1976
2104
|
SUCCESS: "SUCCESS";
|
|
1977
2105
|
FAILED: "FAILED";
|
|
1978
2106
|
}>>;
|
|
2107
|
+
eventType: z.ZodOptional<z.ZodEnum<{
|
|
2108
|
+
"ORDER.PAID": "ORDER.PAID";
|
|
2109
|
+
"ORDER.CONFIRMED": "ORDER.CONFIRMED";
|
|
2110
|
+
"ORDER.DISPATCHED": "ORDER.DISPATCHED";
|
|
2111
|
+
"ORDER.DELIVERED": "ORDER.DELIVERED";
|
|
2112
|
+
"ORDER.PURCHASE_DECIDED": "ORDER.PURCHASE_DECIDED";
|
|
2113
|
+
"ORDER.ADDRESS_CHANGE_REQUESTED": "ORDER.ADDRESS_CHANGE_REQUESTED";
|
|
2114
|
+
"CLAIM.CANCEL_REQUESTED": "CLAIM.CANCEL_REQUESTED";
|
|
2115
|
+
"CLAIM.RETURN_REQUESTED": "CLAIM.RETURN_REQUESTED";
|
|
2116
|
+
"CLAIM.EXCHANGE_REQUESTED": "CLAIM.EXCHANGE_REQUESTED";
|
|
2117
|
+
"CLAIM.COMPLETED": "CLAIM.COMPLETED";
|
|
2118
|
+
"INQUIRY.CREATED": "INQUIRY.CREATED";
|
|
2119
|
+
"REVIEW.CREATED": "REVIEW.CREATED";
|
|
2120
|
+
"PRODUCT.OUT_OF_STOCK": "PRODUCT.OUT_OF_STOCK";
|
|
2121
|
+
}>>;
|
|
2122
|
+
resourceId: z.ZodOptional<z.ZodString>;
|
|
1979
2123
|
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
1980
2124
|
}, z.core.$strip>;
|
|
1981
2125
|
export type WebhookDeliveryListParams = z.infer<typeof webhookDeliveryListQuerySchema>;
|
|
@@ -2013,6 +2157,13 @@ export declare const webhookTestResultSchema: z.ZodObject<{
|
|
|
2013
2157
|
NON_2XX: "NON_2XX";
|
|
2014
2158
|
WEBHOOK_SUSPENDED: "WEBHOOK_SUSPENDED";
|
|
2015
2159
|
}>>;
|
|
2160
|
+
failureReason: z.ZodNullable<z.ZodString>;
|
|
2161
|
+
responseBodyExcerpt: z.ZodNullable<z.ZodString>;
|
|
2162
|
+
requestHeaders: z.ZodArray<z.ZodObject<{
|
|
2163
|
+
name: z.ZodString;
|
|
2164
|
+
value: z.ZodNullable<z.ZodString>;
|
|
2165
|
+
}, z.core.$strip>>;
|
|
2166
|
+
payload: z.ZodString;
|
|
2016
2167
|
}, z.core.$strip>;
|
|
2017
2168
|
export type WebhookTestResult = z.infer<typeof webhookTestResultSchema>;
|
|
2018
2169
|
export declare const webhookRequestSchema: z.ZodObject<{
|
|
@@ -2218,6 +2369,28 @@ export declare const orderSchema: z.ZodObject<{
|
|
|
2218
2369
|
discountAmount: z.ZodNumber;
|
|
2219
2370
|
totalAmount: z.ZodNumber;
|
|
2220
2371
|
paidAt: z.ZodNullable<z.ZodString>;
|
|
2372
|
+
cashReceipt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2373
|
+
cashReceiptId: z.ZodString;
|
|
2374
|
+
status: z.ZodString;
|
|
2375
|
+
type: z.ZodString;
|
|
2376
|
+
identityType: z.ZodString;
|
|
2377
|
+
identityNumberMasked: z.ZodString;
|
|
2378
|
+
amount: z.ZodNumber;
|
|
2379
|
+
issuedAmount: z.ZodNumber;
|
|
2380
|
+
provider: z.ZodNullable<z.ZodEnum<{
|
|
2381
|
+
tosspayments: "tosspayments";
|
|
2382
|
+
portone: "portone";
|
|
2383
|
+
}>>;
|
|
2384
|
+
issueNumber: z.ZodNullable<z.ZodString>;
|
|
2385
|
+
receiptUrl: z.ZodNullable<z.ZodString>;
|
|
2386
|
+
issuedAt: z.ZodNullable<z.ZodString>;
|
|
2387
|
+
canceledAt: z.ZodNullable<z.ZodString>;
|
|
2388
|
+
failCode: z.ZodNullable<z.ZodString>;
|
|
2389
|
+
failMessage: z.ZodNullable<z.ZodString>;
|
|
2390
|
+
reissuable: z.ZodBoolean;
|
|
2391
|
+
requestedAt: z.ZodString;
|
|
2392
|
+
updatedAt: z.ZodString;
|
|
2393
|
+
}, z.core.$strip>>>>;
|
|
2221
2394
|
}, z.core.$strip>;
|
|
2222
2395
|
testPayment: z.ZodBoolean;
|
|
2223
2396
|
items: z.ZodArray<z.ZodObject<{
|
|
@@ -2441,7 +2614,7 @@ export declare const dispatchRequestSchema: z.ZodObject<{
|
|
|
2441
2614
|
}>;
|
|
2442
2615
|
carrierCode: z.ZodOptional<z.ZodString>;
|
|
2443
2616
|
trackingNumber: z.ZodOptional<z.ZodString>;
|
|
2444
|
-
dispatchedAt: z.ZodOptional<z.
|
|
2617
|
+
dispatchedAt: z.ZodOptional<z.ZodISODateTime>;
|
|
2445
2618
|
}, z.core.$strip>;
|
|
2446
2619
|
export type DispatchRequest = z.infer<typeof dispatchRequestSchema>;
|
|
2447
2620
|
export declare const deliveryInfoSchema: z.ZodObject<{
|
|
@@ -2465,6 +2638,11 @@ export declare const deliveryInfoSchema: z.ZodObject<{
|
|
|
2465
2638
|
deliveredAt: z.ZodNullable<z.ZodString>;
|
|
2466
2639
|
}, z.core.$strip>;
|
|
2467
2640
|
export type DeliveryInfo = z.infer<typeof deliveryInfoSchema>;
|
|
2641
|
+
/**
|
|
2642
|
+
* 택배 추적 단계. 응답에서는 문자열로 받는다(값이 추가될 수 있다) — 현재 값은 `ACCEPTED`(접수)·`IN_TRANSIT`(이동 중)·
|
|
2643
|
+
* `OUT_FOR_DELIVERY`(배송 출발)·`DELIVERED`(배송완료)다.
|
|
2644
|
+
*/
|
|
2645
|
+
export declare const trackingStageResponseSchema: z.ZodString;
|
|
2468
2646
|
/** `GET /v1/order-items/{orderItemId}/delivery` 응답 — 배송 정보 + 배송 추적 이벤트 */
|
|
2469
2647
|
export declare const deliveryStatusSchema: z.ZodObject<{
|
|
2470
2648
|
orderItemId: z.ZodString;
|
|
@@ -2489,7 +2667,14 @@ export declare const deliveryStatusSchema: z.ZodObject<{
|
|
|
2489
2667
|
status: z.ZodString;
|
|
2490
2668
|
location: z.ZodString;
|
|
2491
2669
|
occurredAt: z.ZodString;
|
|
2670
|
+
stage: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
2492
2671
|
}, z.core.$strip>>>;
|
|
2672
|
+
tracking: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
2673
|
+
result: z.ZodNullable<z.ZodString>;
|
|
2674
|
+
stage: z.ZodNullable<z.ZodString>;
|
|
2675
|
+
checkedAt: z.ZodNullable<z.ZodString>;
|
|
2676
|
+
carrierDeliveredAt: z.ZodNullable<z.ZodString>;
|
|
2677
|
+
}, z.core.$strip>>>>;
|
|
2493
2678
|
}, z.core.$strip>;
|
|
2494
2679
|
export type DeliveryStatus = z.infer<typeof deliveryStatusSchema>;
|
|
2495
2680
|
/** `PUT /v1/order-items/{orderItemId}/dispatch/tracking` 응답 — 바뀐 송장 */
|
|
@@ -3268,6 +3453,40 @@ export declare const paymentRecordStatusSchema: z.ZodEnum<{
|
|
|
3268
3453
|
}>;
|
|
3269
3454
|
export type PaymentRecordStatus = z.infer<typeof paymentRecordStatusSchema>;
|
|
3270
3455
|
export declare const paymentAttemptStatusSchema: z.ZodString;
|
|
3456
|
+
/**
|
|
3457
|
+
* 현금영수증 상태 — 값이 추가될 수 있어 응답은 문자열로 받는다. 화면 분기는 이 목록으로 하고 모르는 값은 처리 중으로 다룬다.
|
|
3458
|
+
* - `REQUESTED`: 구매자가 신청했고 결제 승인 전이다
|
|
3459
|
+
* - `PENDING`: 발급·취소를 기다린다(승인 직후, 또는 일시 오류로 자동 재시도 대기)
|
|
3460
|
+
* - `ISSUED`: 발급됐다. 부분 환불이 있었으면 그만큼 취소(또는 재발급)된 금액이다
|
|
3461
|
+
* - `CANCELED`: 전액 환불로 취소됐다
|
|
3462
|
+
* - `FAILED`: 발급·취소가 실패했고 자동 재시도가 끝났다. `failCode`·`failMessage`를 보고 재발급한다
|
|
3463
|
+
* - `SKIPPED`: 발급 대상이 아니다(승인된 결제수단이 계좌이체·가상계좌가 아님)
|
|
3464
|
+
*/
|
|
3465
|
+
export declare const CASH_RECEIPT_STATUS_VALUES: readonly ["REQUESTED", "PENDING", "ISSUED", "CANCELED", "FAILED", "SKIPPED"];
|
|
3466
|
+
export type KnownCashReceiptStatus = (typeof CASH_RECEIPT_STATUS_VALUES)[number];
|
|
3467
|
+
export declare const cashReceiptSchema: z.ZodObject<{
|
|
3468
|
+
cashReceiptId: z.ZodString;
|
|
3469
|
+
status: z.ZodString;
|
|
3470
|
+
type: z.ZodString;
|
|
3471
|
+
identityType: z.ZodString;
|
|
3472
|
+
identityNumberMasked: z.ZodString;
|
|
3473
|
+
amount: z.ZodNumber;
|
|
3474
|
+
issuedAmount: z.ZodNumber;
|
|
3475
|
+
provider: z.ZodNullable<z.ZodEnum<{
|
|
3476
|
+
tosspayments: "tosspayments";
|
|
3477
|
+
portone: "portone";
|
|
3478
|
+
}>>;
|
|
3479
|
+
issueNumber: z.ZodNullable<z.ZodString>;
|
|
3480
|
+
receiptUrl: z.ZodNullable<z.ZodString>;
|
|
3481
|
+
issuedAt: z.ZodNullable<z.ZodString>;
|
|
3482
|
+
canceledAt: z.ZodNullable<z.ZodString>;
|
|
3483
|
+
failCode: z.ZodNullable<z.ZodString>;
|
|
3484
|
+
failMessage: z.ZodNullable<z.ZodString>;
|
|
3485
|
+
reissuable: z.ZodBoolean;
|
|
3486
|
+
requestedAt: z.ZodString;
|
|
3487
|
+
updatedAt: z.ZodString;
|
|
3488
|
+
}, z.core.$strip>;
|
|
3489
|
+
export type CashReceipt = z.infer<typeof cashReceiptSchema>;
|
|
3271
3490
|
export declare const paymentRecordSchema: z.ZodObject<{
|
|
3272
3491
|
paymentId: z.ZodString;
|
|
3273
3492
|
orderId: z.ZodNullable<z.ZodString>;
|
|
@@ -3306,6 +3525,7 @@ export declare const paymentRecordSchema: z.ZodObject<{
|
|
|
3306
3525
|
failMessage: z.ZodNullable<z.ZodString>;
|
|
3307
3526
|
paidAt: z.ZodNullable<z.ZodString>;
|
|
3308
3527
|
createdAt: z.ZodString;
|
|
3528
|
+
cashReceiptStatus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3309
3529
|
}, z.core.$strip>;
|
|
3310
3530
|
export type PaymentRecord = z.infer<typeof paymentRecordSchema>;
|
|
3311
3531
|
export declare const paymentRecordPageSchema: z.ZodObject<{
|
|
@@ -3351,6 +3571,7 @@ export declare const paymentRecordPageSchema: z.ZodObject<{
|
|
|
3351
3571
|
failMessage: z.ZodNullable<z.ZodString>;
|
|
3352
3572
|
paidAt: z.ZodNullable<z.ZodString>;
|
|
3353
3573
|
createdAt: z.ZodString;
|
|
3574
|
+
cashReceiptStatus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3354
3575
|
}, z.core.$strip>>;
|
|
3355
3576
|
}, z.core.$strip>;
|
|
3356
3577
|
export type PaymentRecordPage = z.infer<typeof paymentRecordPageSchema>;
|
|
@@ -3439,6 +3660,7 @@ export declare const paymentRecordDetailSchema: z.ZodObject<{
|
|
|
3439
3660
|
failMessage: z.ZodNullable<z.ZodString>;
|
|
3440
3661
|
paidAt: z.ZodNullable<z.ZodString>;
|
|
3441
3662
|
createdAt: z.ZodString;
|
|
3663
|
+
cashReceiptStatus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3442
3664
|
refundableAmount: z.ZodNumber;
|
|
3443
3665
|
merchantId: z.ZodNullable<z.ZodString>;
|
|
3444
3666
|
attempts: z.ZodArray<z.ZodObject<{
|
|
@@ -3486,6 +3708,28 @@ export declare const paymentRecordDetailSchema: z.ZodObject<{
|
|
|
3486
3708
|
requestedAt: z.ZodString;
|
|
3487
3709
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
3488
3710
|
}, z.core.$strip>>;
|
|
3711
|
+
cashReceipt: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
3712
|
+
cashReceiptId: z.ZodString;
|
|
3713
|
+
status: z.ZodString;
|
|
3714
|
+
type: z.ZodString;
|
|
3715
|
+
identityType: z.ZodString;
|
|
3716
|
+
identityNumberMasked: z.ZodString;
|
|
3717
|
+
amount: z.ZodNumber;
|
|
3718
|
+
issuedAmount: z.ZodNumber;
|
|
3719
|
+
provider: z.ZodNullable<z.ZodEnum<{
|
|
3720
|
+
tosspayments: "tosspayments";
|
|
3721
|
+
portone: "portone";
|
|
3722
|
+
}>>;
|
|
3723
|
+
issueNumber: z.ZodNullable<z.ZodString>;
|
|
3724
|
+
receiptUrl: z.ZodNullable<z.ZodString>;
|
|
3725
|
+
issuedAt: z.ZodNullable<z.ZodString>;
|
|
3726
|
+
canceledAt: z.ZodNullable<z.ZodString>;
|
|
3727
|
+
failCode: z.ZodNullable<z.ZodString>;
|
|
3728
|
+
failMessage: z.ZodNullable<z.ZodString>;
|
|
3729
|
+
reissuable: z.ZodBoolean;
|
|
3730
|
+
requestedAt: z.ZodString;
|
|
3731
|
+
updatedAt: z.ZodString;
|
|
3732
|
+
}, z.core.$strip>>>>;
|
|
3489
3733
|
}, z.core.$strip>;
|
|
3490
3734
|
export type PaymentRecordDetail = z.infer<typeof paymentRecordDetailSchema>;
|
|
3491
3735
|
/** `GET /v1/payments` 쿼리 — OpenAPI 문서용 형태(값은 쿼리 문자열) */
|
|
@@ -3795,7 +4039,7 @@ export declare const productCreateRequestSchema: z.ZodObject<{
|
|
|
3795
4039
|
PAID: "PAID";
|
|
3796
4040
|
CONDITIONAL_FREE: "CONDITIONAL_FREE";
|
|
3797
4041
|
}>>;
|
|
3798
|
-
deliveryFee: z.
|
|
4042
|
+
deliveryFee: z.ZodOptional<z.ZodNumber>;
|
|
3799
4043
|
conditionalFreeAmount: z.ZodOptional<z.ZodNumber>;
|
|
3800
4044
|
returnFee: z.ZodDefault<z.ZodNumber>;
|
|
3801
4045
|
exchangeFee: z.ZodDefault<z.ZodNumber>;
|
|
@@ -3806,8 +4050,8 @@ export declare const productCreateRequestSchema: z.ZodObject<{
|
|
|
3806
4050
|
sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
|
|
3807
4051
|
conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
|
|
3808
4052
|
}, z.core.$strict>>>;
|
|
3809
|
-
shippingAddressId: z.ZodOptional<z.ZodString
|
|
3810
|
-
returnAddressId: z.ZodOptional<z.ZodString
|
|
4053
|
+
shippingAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4054
|
+
returnAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3811
4055
|
optionGroups: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
3812
4056
|
groupId: z.ZodOptional<z.ZodString>;
|
|
3813
4057
|
name: z.ZodString;
|
|
@@ -3840,6 +4084,8 @@ export declare const productPatchRequestSchema: z.ZodObject<{
|
|
|
3840
4084
|
CLOSED: "CLOSED";
|
|
3841
4085
|
}>>;
|
|
3842
4086
|
deliveryFee: z.ZodOptional<z.ZodNumber>;
|
|
4087
|
+
shippingAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
4088
|
+
returnAddressId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3843
4089
|
}, z.core.$strip>;
|
|
3844
4090
|
export type ProductPatchRequest = z.infer<typeof productPatchRequestSchema>;
|
|
3845
4091
|
export declare const productSortSchema: z.ZodEnum<{
|
|
@@ -3950,6 +4196,12 @@ export declare const updateStoreRequestSchema: z.ZodObject<{
|
|
|
3950
4196
|
sellerFaultFreeShipping: z.ZodOptional<z.ZodBoolean>;
|
|
3951
4197
|
conditionalFreeShortfallCharge: z.ZodOptional<z.ZodBoolean>;
|
|
3952
4198
|
}, z.core.$strict>>;
|
|
4199
|
+
shippingPolicy: z.ZodOptional<z.ZodObject<{
|
|
4200
|
+
baseDeliveryFee: z.ZodOptional<z.ZodNumber>;
|
|
4201
|
+
freeThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
4202
|
+
jejuSurcharge: z.ZodOptional<z.ZodNumber>;
|
|
4203
|
+
isolatedSurcharge: z.ZodOptional<z.ZodNumber>;
|
|
4204
|
+
}, z.core.$strict>>;
|
|
3953
4205
|
termsVersion: z.ZodOptional<z.ZodString>;
|
|
3954
4206
|
privacyVersion: z.ZodOptional<z.ZodString>;
|
|
3955
4207
|
termsUrl: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
@@ -3981,6 +4233,12 @@ export declare const storeSchema: z.ZodObject<{
|
|
|
3981
4233
|
sellerFaultFreeShipping: z.ZodBoolean;
|
|
3982
4234
|
conditionalFreeShortfallCharge: z.ZodBoolean;
|
|
3983
4235
|
}, z.core.$strip>;
|
|
4236
|
+
shippingPolicy: z.ZodObject<{
|
|
4237
|
+
baseDeliveryFee: z.ZodNumber;
|
|
4238
|
+
freeThreshold: z.ZodNullable<z.ZodNumber>;
|
|
4239
|
+
jejuSurcharge: z.ZodNumber;
|
|
4240
|
+
isolatedSurcharge: z.ZodNumber;
|
|
4241
|
+
}, z.core.$strip>;
|
|
3984
4242
|
termsVersion: z.ZodString;
|
|
3985
4243
|
privacyVersion: z.ZodString;
|
|
3986
4244
|
termsVersionUpdatedAt: z.ZodNullable<z.ZodString>;
|
|
@@ -4911,6 +5169,25 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4911
5169
|
discountAmount: number;
|
|
4912
5170
|
totalAmount: number;
|
|
4913
5171
|
paidAt: string | null;
|
|
5172
|
+
cashReceipt: {
|
|
5173
|
+
cashReceiptId: string;
|
|
5174
|
+
status: string;
|
|
5175
|
+
type: string;
|
|
5176
|
+
identityType: string;
|
|
5177
|
+
identityNumberMasked: string;
|
|
5178
|
+
amount: number;
|
|
5179
|
+
issuedAmount: number;
|
|
5180
|
+
provider: "tosspayments" | "portone" | null;
|
|
5181
|
+
issueNumber: string | null;
|
|
5182
|
+
receiptUrl: string | null;
|
|
5183
|
+
issuedAt: string | null;
|
|
5184
|
+
canceledAt: string | null;
|
|
5185
|
+
failCode: string | null;
|
|
5186
|
+
failMessage: string | null;
|
|
5187
|
+
reissuable: boolean;
|
|
5188
|
+
requestedAt: string;
|
|
5189
|
+
updatedAt: string;
|
|
5190
|
+
} | null;
|
|
4914
5191
|
};
|
|
4915
5192
|
testPayment: boolean;
|
|
4916
5193
|
items: {
|
|
@@ -4941,6 +5218,29 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
4941
5218
|
testPayment: boolean;
|
|
4942
5219
|
}[];
|
|
4943
5220
|
}>;
|
|
5221
|
+
/**
|
|
5222
|
+
* `POST /v1/orders/{orderId}/cash-receipt/reissue` — 실패했거나 재시도 대기 중인 현금영수증을 지금 다시 발급·취소한다.
|
|
5223
|
+
* 콘솔 OWNER·ADMIN 전용(PAT·M2M 403 `INSUFFICIENT_ROLE`). 404 `CASH_RECEIPT_NOT_FOUND`, 409 `CASH_RECEIPT_NOT_REISSUABLE`
|
|
5224
|
+
*/
|
|
5225
|
+
reissueCashReceipt: (orderId: string) => Promise<{
|
|
5226
|
+
cashReceiptId: string;
|
|
5227
|
+
status: string;
|
|
5228
|
+
type: string;
|
|
5229
|
+
identityType: string;
|
|
5230
|
+
identityNumberMasked: string;
|
|
5231
|
+
amount: number;
|
|
5232
|
+
issuedAmount: number;
|
|
5233
|
+
provider: "tosspayments" | "portone" | null;
|
|
5234
|
+
issueNumber: string | null;
|
|
5235
|
+
receiptUrl: string | null;
|
|
5236
|
+
issuedAt: string | null;
|
|
5237
|
+
canceledAt: string | null;
|
|
5238
|
+
failCode: string | null;
|
|
5239
|
+
failMessage: string | null;
|
|
5240
|
+
reissuable: boolean;
|
|
5241
|
+
requestedAt: string;
|
|
5242
|
+
updatedAt: string;
|
|
5243
|
+
}>;
|
|
4944
5244
|
};
|
|
4945
5245
|
orderItems: {
|
|
4946
5246
|
/** `GET /v1/order-items`. `testPayment` 필터는 `orders.list`와 같다 */
|
|
@@ -5082,10 +5382,17 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5082
5382
|
status: "DISPATCHED" | "DELIVERING" | "DELIVERED";
|
|
5083
5383
|
dispatchedAt: string;
|
|
5084
5384
|
deliveredAt: string | null;
|
|
5385
|
+
tracking: {
|
|
5386
|
+
result: string | null;
|
|
5387
|
+
stage: string | null;
|
|
5388
|
+
checkedAt: string | null;
|
|
5389
|
+
carrierDeliveredAt: string | null;
|
|
5390
|
+
} | null;
|
|
5085
5391
|
trackingEvents?: {
|
|
5086
5392
|
status: string;
|
|
5087
5393
|
location: string;
|
|
5088
5394
|
occurredAt: string;
|
|
5395
|
+
stage: string | null;
|
|
5089
5396
|
}[] | undefined;
|
|
5090
5397
|
}>;
|
|
5091
5398
|
};
|
|
@@ -5129,6 +5436,14 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5129
5436
|
completedAt: string | null;
|
|
5130
5437
|
holdExpiresAt: string | null;
|
|
5131
5438
|
holdUsed: boolean;
|
|
5439
|
+
returnAddress: {
|
|
5440
|
+
name: string;
|
|
5441
|
+
contactName: string;
|
|
5442
|
+
phone: string;
|
|
5443
|
+
zipCode: string;
|
|
5444
|
+
address1: string;
|
|
5445
|
+
address2: string | null;
|
|
5446
|
+
} | null;
|
|
5132
5447
|
}[];
|
|
5133
5448
|
}>;
|
|
5134
5449
|
get: (claimId: string) => Promise<{
|
|
@@ -5158,6 +5473,14 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5158
5473
|
completedAt: string | null;
|
|
5159
5474
|
holdExpiresAt: string | null;
|
|
5160
5475
|
holdUsed: boolean;
|
|
5476
|
+
returnAddress: {
|
|
5477
|
+
name: string;
|
|
5478
|
+
contactName: string;
|
|
5479
|
+
phone: string;
|
|
5480
|
+
zipCode: string;
|
|
5481
|
+
address1: string;
|
|
5482
|
+
address2: string | null;
|
|
5483
|
+
} | null;
|
|
5161
5484
|
histories?: {
|
|
5162
5485
|
status: "REQUESTED" | "HELD" | "COLLECTING" | "COLLECTED" | "REDELIVERING" | "APPROVED" | "REJECTED" | "COMPLETED" | "WITHDRAWN";
|
|
5163
5486
|
actor: "BUYER" | "SELLER" | "SYSTEM";
|
|
@@ -5213,6 +5536,14 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5213
5536
|
completedAt: string | null;
|
|
5214
5537
|
holdExpiresAt: string | null;
|
|
5215
5538
|
holdUsed: boolean;
|
|
5539
|
+
returnAddress: {
|
|
5540
|
+
name: string;
|
|
5541
|
+
contactName: string;
|
|
5542
|
+
phone: string;
|
|
5543
|
+
zipCode: string;
|
|
5544
|
+
address1: string;
|
|
5545
|
+
address2: string | null;
|
|
5546
|
+
} | null;
|
|
5216
5547
|
}>;
|
|
5217
5548
|
};
|
|
5218
5549
|
inquiries: {
|
|
@@ -5846,6 +6177,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5846
6177
|
failMessage: string | null;
|
|
5847
6178
|
paidAt: string | null;
|
|
5848
6179
|
createdAt: string;
|
|
6180
|
+
cashReceiptStatus: string | null;
|
|
5849
6181
|
}[];
|
|
5850
6182
|
}>;
|
|
5851
6183
|
/** `GET /v1/payments/{paymentId}` — 시도·환불 이력 포함. 404 `PAYMENT_NOT_FOUND` */
|
|
@@ -5869,6 +6201,7 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5869
6201
|
failMessage: string | null;
|
|
5870
6202
|
paidAt: string | null;
|
|
5871
6203
|
createdAt: string;
|
|
6204
|
+
cashReceiptStatus: string | null;
|
|
5872
6205
|
refundableAmount: number;
|
|
5873
6206
|
merchantId: string | null;
|
|
5874
6207
|
attempts: {
|
|
@@ -5898,6 +6231,25 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
5898
6231
|
requestedAt: string;
|
|
5899
6232
|
completedAt: string | null;
|
|
5900
6233
|
}[];
|
|
6234
|
+
cashReceipt: {
|
|
6235
|
+
cashReceiptId: string;
|
|
6236
|
+
status: string;
|
|
6237
|
+
type: string;
|
|
6238
|
+
identityType: string;
|
|
6239
|
+
identityNumberMasked: string;
|
|
6240
|
+
amount: number;
|
|
6241
|
+
issuedAmount: number;
|
|
6242
|
+
provider: "tosspayments" | "portone" | null;
|
|
6243
|
+
issueNumber: string | null;
|
|
6244
|
+
receiptUrl: string | null;
|
|
6245
|
+
issuedAt: string | null;
|
|
6246
|
+
canceledAt: string | null;
|
|
6247
|
+
failCode: string | null;
|
|
6248
|
+
failMessage: string | null;
|
|
6249
|
+
reissuable: boolean;
|
|
6250
|
+
requestedAt: string;
|
|
6251
|
+
updatedAt: string;
|
|
6252
|
+
} | null;
|
|
5901
6253
|
}>;
|
|
5902
6254
|
};
|
|
5903
6255
|
/**
|
|
@@ -6691,6 +7043,11 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6691
7043
|
responseTimeMs: number | null;
|
|
6692
7044
|
responseBodyExcerpt: string | null;
|
|
6693
7045
|
errorCode: "TIMEOUT" | "CONNECTION_FAILED" | "BLOCKED_ADDRESS" | "NON_2XX" | "WEBHOOK_SUSPENDED" | null;
|
|
7046
|
+
failureReason: string | null;
|
|
7047
|
+
resource: {
|
|
7048
|
+
type: string;
|
|
7049
|
+
id: string;
|
|
7050
|
+
} | null;
|
|
6694
7051
|
attemptCount: number;
|
|
6695
7052
|
createdAt: string;
|
|
6696
7053
|
attemptedAt: string | null;
|
|
@@ -6698,6 +7055,40 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6698
7055
|
redeliveryOf: string | null;
|
|
6699
7056
|
redeliveredAs: string | null;
|
|
6700
7057
|
}[]>;
|
|
7058
|
+
/**
|
|
7059
|
+
* 전송 기록 한 건의 상세. 목록 항목에 보낸 요청 본문(최대 16KB)과 요청 헤더가 더해진다.
|
|
7060
|
+
* 실패 원인 분류(`failureReason`)·응답 본문(`responseBodyExcerpt`)으로 원인을 찾고,
|
|
7061
|
+
* `resource.id`를 API 로그 조회의 `q`로 넘겨 같은 리소스의 API 요청과 맞춰 본다.
|
|
7062
|
+
*/
|
|
7063
|
+
getDelivery: (webhookId: string, deliveryId: string) => Promise<{
|
|
7064
|
+
deliveryId: string;
|
|
7065
|
+
eventId: string;
|
|
7066
|
+
eventType: "ORDER.PAID" | "ORDER.CONFIRMED" | "ORDER.DISPATCHED" | "ORDER.DELIVERED" | "ORDER.PURCHASE_DECIDED" | "ORDER.ADDRESS_CHANGE_REQUESTED" | "CLAIM.CANCEL_REQUESTED" | "CLAIM.RETURN_REQUESTED" | "CLAIM.EXCHANGE_REQUESTED" | "CLAIM.COMPLETED" | "INQUIRY.CREATED" | "REVIEW.CREATED" | "PRODUCT.OUT_OF_STOCK";
|
|
7067
|
+
url: string;
|
|
7068
|
+
status: "PENDING" | "PENDING_RETRY" | "SUCCESS" | "FAILED";
|
|
7069
|
+
responseStatusCode: number | null;
|
|
7070
|
+
responseTimeMs: number | null;
|
|
7071
|
+
responseBodyExcerpt: string | null;
|
|
7072
|
+
errorCode: "TIMEOUT" | "CONNECTION_FAILED" | "BLOCKED_ADDRESS" | "NON_2XX" | "WEBHOOK_SUSPENDED" | null;
|
|
7073
|
+
failureReason: string | null;
|
|
7074
|
+
resource: {
|
|
7075
|
+
type: string;
|
|
7076
|
+
id: string;
|
|
7077
|
+
} | null;
|
|
7078
|
+
attemptCount: number;
|
|
7079
|
+
createdAt: string;
|
|
7080
|
+
attemptedAt: string | null;
|
|
7081
|
+
nextAttemptAt: string | null;
|
|
7082
|
+
redeliveryOf: string | null;
|
|
7083
|
+
redeliveredAs: string | null;
|
|
7084
|
+
payload: string;
|
|
7085
|
+
payloadTruncated: boolean;
|
|
7086
|
+
payloadMasked: boolean;
|
|
7087
|
+
requestHeaders: {
|
|
7088
|
+
name: string;
|
|
7089
|
+
value: string | null;
|
|
7090
|
+
}[];
|
|
7091
|
+
}>;
|
|
6701
7092
|
/**
|
|
6702
7093
|
* FAILED 전송 기록 한 건을 같은 eventId로 다시 보낸다(202). 새로 적재된 기록을 돌려주며
|
|
6703
7094
|
* `redeliveryOf`가 원본 deliveryId다. 원본이 FAILED가 아니면 409 `DELIVERY_NOT_FAILED`,
|
|
@@ -6714,6 +7105,11 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6714
7105
|
responseTimeMs: number | null;
|
|
6715
7106
|
responseBodyExcerpt: string | null;
|
|
6716
7107
|
errorCode: "TIMEOUT" | "CONNECTION_FAILED" | "BLOCKED_ADDRESS" | "NON_2XX" | "WEBHOOK_SUSPENDED" | null;
|
|
7108
|
+
failureReason: string | null;
|
|
7109
|
+
resource: {
|
|
7110
|
+
type: string;
|
|
7111
|
+
id: string;
|
|
7112
|
+
} | null;
|
|
6717
7113
|
attemptCount: number;
|
|
6718
7114
|
createdAt: string;
|
|
6719
7115
|
attemptedAt: string | null;
|
|
@@ -6736,6 +7132,13 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6736
7132
|
responseStatusCode: number | null;
|
|
6737
7133
|
responseTimeMs: number | null;
|
|
6738
7134
|
errorCode: "TIMEOUT" | "CONNECTION_FAILED" | "BLOCKED_ADDRESS" | "NON_2XX" | "WEBHOOK_SUSPENDED" | null;
|
|
7135
|
+
failureReason: string | null;
|
|
7136
|
+
responseBodyExcerpt: string | null;
|
|
7137
|
+
requestHeaders: {
|
|
7138
|
+
name: string;
|
|
7139
|
+
value: string | null;
|
|
7140
|
+
}[];
|
|
7141
|
+
payload: string;
|
|
6739
7142
|
}>;
|
|
6740
7143
|
};
|
|
6741
7144
|
/** API 로그 (보관 7일, 콘솔 OWNER/ADMIN) */
|
|
@@ -6857,6 +7260,12 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6857
7260
|
sellerFaultFreeShipping: boolean;
|
|
6858
7261
|
conditionalFreeShortfallCharge: boolean;
|
|
6859
7262
|
};
|
|
7263
|
+
shippingPolicy: {
|
|
7264
|
+
baseDeliveryFee: number;
|
|
7265
|
+
freeThreshold: number | null;
|
|
7266
|
+
jejuSurcharge: number;
|
|
7267
|
+
isolatedSurcharge: number;
|
|
7268
|
+
};
|
|
6860
7269
|
termsVersion: string;
|
|
6861
7270
|
privacyVersion: string;
|
|
6862
7271
|
termsVersionUpdatedAt: string | null;
|
|
@@ -6891,6 +7300,12 @@ export declare function createStoreClient(options: StoreClientOptions): {
|
|
|
6891
7300
|
sellerFaultFreeShipping: boolean;
|
|
6892
7301
|
conditionalFreeShortfallCharge: boolean;
|
|
6893
7302
|
};
|
|
7303
|
+
shippingPolicy: {
|
|
7304
|
+
baseDeliveryFee: number;
|
|
7305
|
+
freeThreshold: number | null;
|
|
7306
|
+
jejuSurcharge: number;
|
|
7307
|
+
isolatedSurcharge: number;
|
|
7308
|
+
};
|
|
6894
7309
|
termsVersion: string;
|
|
6895
7310
|
privacyVersion: string;
|
|
6896
7311
|
termsVersionUpdatedAt: string | null;
|
|
@@ -7107,6 +7522,194 @@ export declare const STORE_ROLE_SCOPES: {
|
|
|
7107
7522
|
readonly STAFF: readonly ["product:rw", "category:rw", "order:rw", "claim:rw", "inquiry:rw", "review:rw", "customer:r"];
|
|
7108
7523
|
};
|
|
7109
7524
|
//#endregion
|
|
7525
|
+
//#region src/schemas/shipping-policy.d.ts
|
|
7526
|
+
/** 유효 배송비 정책 — 스토어가 정하지 않은 항목은 `SHIPPING_POLICY_DEFAULTS`로 채운 값이다 */
|
|
7527
|
+
export declare const shippingPolicySchema: z.ZodObject<{
|
|
7528
|
+
baseDeliveryFee: z.ZodNumber;
|
|
7529
|
+
freeThreshold: z.ZodNullable<z.ZodNumber>;
|
|
7530
|
+
jejuSurcharge: z.ZodNumber;
|
|
7531
|
+
isolatedSurcharge: z.ZodNumber;
|
|
7532
|
+
}, z.core.$strip>;
|
|
7533
|
+
export type ShippingPolicy = z.infer<typeof shippingPolicySchema>;
|
|
7534
|
+
/**
|
|
7535
|
+
* 스토어가 정하지 않았을 때 서버가 쓰는 값.
|
|
7536
|
+
*
|
|
7537
|
+
* `as const`가 아니라 `ShippingPolicy`로 좁힌다 — 리터럴 타입이면 `Partial<typeof …>`로 일부만 바꿀 때
|
|
7538
|
+
* `null` 자리에 숫자를 넣을 수 없다(`REFUND_POLICY_DEFAULTS`와 같은 이유).
|
|
7539
|
+
*/
|
|
7540
|
+
export declare const SHIPPING_POLICY_DEFAULTS: ShippingPolicy;
|
|
7541
|
+
/**
|
|
7542
|
+
* 부분 정책 — `PATCH /v1/store`의 `shippingPolicy`가 쓴다. 준 항목만 바뀐다.
|
|
7543
|
+
*
|
|
7544
|
+
* `strictObject`라 모르는 키는 400이다. 오타를 조용히 무시하면 셀러는 저장됐다고 믿는데
|
|
7545
|
+
* 정책은 기본값으로 남는다(`refundPolicyPatchSchema`와 같은 이유).
|
|
7546
|
+
*/
|
|
7547
|
+
export declare const shippingPolicyPatchSchema: z.ZodObject<{
|
|
7548
|
+
baseDeliveryFee: z.ZodOptional<z.ZodNumber>;
|
|
7549
|
+
freeThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
7550
|
+
jejuSurcharge: z.ZodOptional<z.ZodNumber>;
|
|
7551
|
+
isolatedSurcharge: z.ZodOptional<z.ZodNumber>;
|
|
7552
|
+
}, z.core.$strict>;
|
|
7553
|
+
export type ShippingPolicyPatch = z.infer<typeof shippingPolicyPatchSchema>;
|
|
7554
|
+
/** 유효 정책 해석 — 스토어가 정한 항목 + `SHIPPING_POLICY_DEFAULTS` */
|
|
7555
|
+
export declare function resolveShippingPolicy(patch?: ShippingPolicyPatch | null): ShippingPolicy;
|
|
7556
|
+
/** 지역 구분 — 우편번호로 판정한다 */
|
|
7557
|
+
export declare const remoteAreaSchema: z.ZodEnum<{
|
|
7558
|
+
NONE: "NONE";
|
|
7559
|
+
JEJU: "JEJU";
|
|
7560
|
+
ISOLATED: "ISOLATED";
|
|
7561
|
+
}>;
|
|
7562
|
+
export type RemoteArea = z.infer<typeof remoteAreaSchema>;
|
|
7563
|
+
/**
|
|
7564
|
+
* 제주·도서산간 우편번호 범위 — **코드 상수다.** 금액은 스토어가 정하고 범위는 플랫폼이 고정한다.
|
|
7565
|
+
*
|
|
7566
|
+
* 국내 택배사가 공표하는 제주·도서산간 할증 구간을 5자리 우편번호 범위로 옮긴 표다. 셀러마다
|
|
7567
|
+
* 범위가 다르면 같은 주소에 다른 금액이 나가고 CS가 셀러 수만큼 갈라진다. 스토어별 범위 편집은
|
|
7568
|
+
* 후속 과제이고, 지금은 이 표가 유일한 원천이다.
|
|
7569
|
+
*
|
|
7570
|
+
* ## 근거
|
|
7571
|
+
*
|
|
7572
|
+
* 원천은 **CJ대한통운이 공표한 「제주 및 도서산간 지역 추가 운송비」 표**(구간 시작·끝 우편번호와
|
|
7573
|
+
* 지역명이 붙은 그 표)다. 같은 표가 한진택배 공지와 쇼핑몰 솔루션 안내에도 같은 값으로 실린다.
|
|
7574
|
+
* 서로 다른 게시자의 전재본 네 곳이 인천·전남·경남 구간까지 글자 그대로 일치하는 것을 확인했다.
|
|
7575
|
+
*
|
|
7576
|
+
* - CJ대한통운 표 전재 (구간별 금액 포함): https://ichibanhouse.com/article/공지뉴스/1/16/
|
|
7577
|
+
* - 같은 표의 다른 전재본: https://peppytail.com/article/공지사항/1/4046/
|
|
7578
|
+
* - 시행 시점(2020-02-01)과 구간별 행정구역명을 함께 적은 전재본:
|
|
7579
|
+
* https://tosstoss.co.kr/bbs/content.php?co_id=pilotage
|
|
7580
|
+
* - 솔루션 안내 「제주도 및 도서산간 지역 기준표」:
|
|
7581
|
+
* https://help.campaignus.me/ko/articles/제주도-및-도서산간-지역-기준표-342d2e5e
|
|
7582
|
+
*
|
|
7583
|
+
* 라벨의 행정구역명은 우편번호 배정을 따로 확인해 고쳤다. 택배사 표의 지역명은 축약·오기가 있다.
|
|
7584
|
+
* 확인한 것만 남기고, 확인하지 못한 구간은 이 표에서 뺀다 — 판정하지 못하면 받지 않는 쪽이
|
|
7585
|
+
* `remoteAreaOf`의 규칙과 같다.
|
|
7586
|
+
*
|
|
7587
|
+
* ## 표에서 뺀 구간
|
|
7588
|
+
*
|
|
7589
|
+
* - **54000**: 택배사 표는 「경남 통영 섬지역3」으로 적었지만 이 번호는 **전북 군산시 옥도면**이다.
|
|
7590
|
+
* 게다가 공정거래위원회가 2025-10-07 발표에서 연륙교로 이어진 신시도·야미도·선유도와 비연륙
|
|
7591
|
+
* 도서(방축도·관리도)가 같은 우편번호를 쓰는 대표 사례로 이 지역을 들었다. 라벨도 부과 근거도
|
|
7592
|
+
* 확정하지 못해 뺀다.
|
|
7593
|
+
* - **강화군 본섬(23000~23003, 23011~23099)**: 택배사 표의 강화 할증 구간은 23004~23010
|
|
7594
|
+
* (교동면·삼산면·서도면)뿐이다. 강화대교·초지대교로 이어진 본섬은 도선료가 없어 어느 택배사도
|
|
7595
|
+
* 할증하지 않는다. 「누락」이 아니라 대상이 아니다.
|
|
7596
|
+
*
|
|
7597
|
+
* ## 한계
|
|
7598
|
+
*
|
|
7599
|
+
* 우편번호 단위 판정은 한 번호 안에 연륙도서와 비연륙도서가 섞인 구간에서 과대 부과가 된다.
|
|
7600
|
+
* 공정위가 2025-10-07에 온라인몰 13곳의 이 방식을 시정하게 한 지적이 그것이다
|
|
7601
|
+
* (https://eiec.kdi.re.kr/policy/materialView.do?num=272070). 아래 구간 중 33411(보령 오천면,
|
|
7602
|
+
* 원산도가 해저터널로 연결), 46768~46771(강서구 가덕도, 거가대교로 연결)이 그런 혼재 구간이다.
|
|
7603
|
+
* 도로명주소·건물관리번호 단위 판정은 후속 과제다.
|
|
7604
|
+
*
|
|
7605
|
+
* 범위는 **닫힌 구간**(`from` ≤ zip ≤ `to`)이고 겹치지 않는다. 앞에서부터 처음 맞는 항목을 쓴다.
|
|
7606
|
+
* 순서는 콘솔 「추가 배송비 지역」 표의 행 순서이기도 하다(`remoteAreaGroups`). 제주를 먼저 두고
|
|
7607
|
+
* 도서산간은 우편번호 오름차순으로 둔다.
|
|
7608
|
+
*/
|
|
7609
|
+
export declare const REMOTE_AREA_ZIP_RANGES: ReadonlyArray<{
|
|
7610
|
+
readonly area: Exclude<RemoteArea, "NONE">;
|
|
7611
|
+
readonly from: number;
|
|
7612
|
+
readonly to: number;
|
|
7613
|
+
readonly label: string;
|
|
7614
|
+
}>;
|
|
7615
|
+
/**
|
|
7616
|
+
* 우편번호 → 지역 구분. 5자리 숫자가 아니면 `NONE`이다.
|
|
7617
|
+
*
|
|
7618
|
+
* 형식 검증은 배송지 스키마(`/^[0-9]{5}$/`)가 하고, 여기서는 **판정하지 못하면 추가 배송비를 받지 않는다**.
|
|
7619
|
+
* 반대로 두면 우편번호를 잘못 넣은 주문에 근거 없는 금액이 붙는다.
|
|
7620
|
+
*/
|
|
7621
|
+
export declare function remoteAreaOf(zipCode: string | null | undefined): RemoteArea;
|
|
7622
|
+
/** 지역 구분의 안내 이름 — 판정된 범위의 `label`이다. 판정되지 않으면 null */
|
|
7623
|
+
export declare function remoteAreaLabelOf(zipCode: string | null | undefined): string | null;
|
|
7624
|
+
/** 묶음 하나에 붙는 지역 추가 배송비 */
|
|
7625
|
+
export declare function remoteSurchargeOf(policy: ShippingPolicy, area: RemoteArea): number;
|
|
7626
|
+
/** 묶음 판정에 쓰는 상품 값 — 출고지와 배송 정책이다 */
|
|
7627
|
+
export interface DeliveryBundleProduct {
|
|
7628
|
+
deliveryType: DeliveryType;
|
|
7629
|
+
deliveryFee: number;
|
|
7630
|
+
conditionalFreeAmount: number | null;
|
|
7631
|
+
/** 출고지 주소 id(`seller_addresses`). null이면 스토어 기본 출고지를 쓰는 상품끼리 한 묶음이다 */
|
|
7632
|
+
shippingAddressId?: string | null;
|
|
7633
|
+
}
|
|
7634
|
+
/**
|
|
7635
|
+
* 배송 묶음 키 — **같은 출고지 + 같은 배송 정책이면 같은 키다.**
|
|
7636
|
+
*
|
|
7637
|
+
* 키는 주문 시점에 주문상품 행에 스냅샷된다(`order_items.delivery_bundle_key`). 셀러가 주문 뒤
|
|
7638
|
+
* 출고지나 배송비를 바꿔도 그 주문의 묶음은 움직이지 않는다 — 움직이면 이미 환불한 묶음의 키가
|
|
7639
|
+
* 달라져 `orders.delivery_fee_settlements`의 이중 환불 방지 표시가 무력해진다.
|
|
7640
|
+
*
|
|
7641
|
+
* `-`는 「값 없음」이다. 사람이 읽을 수 있게 남기고, 값 자체에 `:`가 들어갈 수 없는 형식만 쓴다
|
|
7642
|
+
* (주소 id는 `adr_…`, 나머지는 열거형·정수).
|
|
7643
|
+
*/
|
|
7644
|
+
export declare function deliveryBundleKeyOf(product: DeliveryBundleProduct): string;
|
|
7645
|
+
/** 계산에 넣는 한 줄 — 주문상품·장바구니 항목·주문서 항목이 이 형태로 들어온다 */
|
|
7646
|
+
export interface DeliveryFeeLine {
|
|
7647
|
+
productId: string;
|
|
7648
|
+
/** 상품 금액 (할인 반영 단가 × 수량) */
|
|
7649
|
+
amount: number;
|
|
7650
|
+
}
|
|
7651
|
+
/**
|
|
7652
|
+
* 기본 배송비를 면제한 근거 — 면제하지 않았으면 null이다.
|
|
7653
|
+
*
|
|
7654
|
+
* 환불 정산이 근거를 구분해야 한다. 조건부 무료 기준 미달 차감은 **상품별 조건부 무료(`CONDITIONAL`)로
|
|
7655
|
+
* 면제된 묶음만** 대상이다. 스토어 전체 무료 기준(`STORE_THRESHOLD`)이나 무료배송 상품(`FREE`)은 셀러가
|
|
7656
|
+
* 배송비를 받지 않기로 한 것이므로, 일부 취소로 기준이 깨져도 구매자에게 배송비를 물리지 않는다.
|
|
7657
|
+
*
|
|
7658
|
+
* 세 값이 겹치면 `FREE` → `STORE_THRESHOLD` → `CONDITIONAL` 순으로 센 근거를 남긴다.
|
|
7659
|
+
*/
|
|
7660
|
+
export declare const deliveryFeeWaiverSchema: z.ZodEnum<{
|
|
7661
|
+
FREE: "FREE";
|
|
7662
|
+
STORE_THRESHOLD: "STORE_THRESHOLD";
|
|
7663
|
+
CONDITIONAL: "CONDITIONAL";
|
|
7664
|
+
}>;
|
|
7665
|
+
export type DeliveryFeeWaiver = z.infer<typeof deliveryFeeWaiverSchema>;
|
|
7666
|
+
/** 묶음 하나의 견적 */
|
|
7667
|
+
export interface DeliveryBundleQuote {
|
|
7668
|
+
bundleKey: string;
|
|
7669
|
+
/** 이 묶음에 든 상품 id — 스냅샷 검증과 콘솔 안내에 쓴다 */
|
|
7670
|
+
productIds: string[];
|
|
7671
|
+
/** 실제 청구한 기본 배송비 — 무료배송·무료 기준 충족이면 0 */
|
|
7672
|
+
fee: number;
|
|
7673
|
+
/** 기본 배송비를 면제한 근거. 청구했으면 null */
|
|
7674
|
+
waivedBy: DeliveryFeeWaiver | null;
|
|
7675
|
+
/** 배송비 정가 — 조건부 무료 미달 차감액의 상한이다 */
|
|
7676
|
+
listFee: number;
|
|
7677
|
+
/** 묶음 조건부 무료 기준액. 조건부 무료가 아니면 null */
|
|
7678
|
+
freeThreshold: number | null;
|
|
7679
|
+
/** 이 묶음에 붙은 지역 추가 배송비 */
|
|
7680
|
+
remoteSurcharge: number;
|
|
7681
|
+
}
|
|
7682
|
+
/** 배송비 견적 — 합계와 묶음 내역 */
|
|
7683
|
+
export interface DeliveryQuote {
|
|
7684
|
+
bundles: DeliveryBundleQuote[];
|
|
7685
|
+
/** 기본 배송비 합계 (지역 추가 제외) */
|
|
7686
|
+
baseFee: number;
|
|
7687
|
+
/** 지역 추가 배송비 합계 */
|
|
7688
|
+
remoteSurcharge: number;
|
|
7689
|
+
/** 청구할 배송비 총액 = `baseFee` + `remoteSurcharge` */
|
|
7690
|
+
deliveryFee: number;
|
|
7691
|
+
remoteArea: RemoteArea;
|
|
7692
|
+
/** 스토어 전체 무료 기준(`freeThreshold`) 충족으로 기본 배송비를 면제했는가 */
|
|
7693
|
+
freeByThreshold: boolean;
|
|
7694
|
+
}
|
|
7695
|
+
export interface DeliveryQuoteInput {
|
|
7696
|
+
lines: DeliveryFeeLine[];
|
|
7697
|
+
/** 상품 배송 정책 조회 — 못 읽은 상품은 계산에서 빠진다(배송비를 만들어 붙이지 않는다) */
|
|
7698
|
+
productOf: (productId: string) => DeliveryBundleProduct | undefined;
|
|
7699
|
+
policy: ShippingPolicy;
|
|
7700
|
+
/** 배송지 우편번호. 아직 모르면 생략한다 — 지역 추가 배송비 0으로 계산한다 */
|
|
7701
|
+
zipCode?: string | null;
|
|
7702
|
+
}
|
|
7703
|
+
/**
|
|
7704
|
+
* 배송비 계산 — **순수 함수다.** 장바구니 요약, 주문서 금액, 결제 시작의 최종 확정,
|
|
7705
|
+
* 주문 배송비 스냅샷이 모두 이 한 곳을 쓴다.
|
|
7706
|
+
*
|
|
7707
|
+
* 순서가 규칙이다. 묶음별 조건부 무료를 먼저 보고, 그다음 스토어 전체 무료 기준으로 기본 배송비를
|
|
7708
|
+
* 한꺼번에 0으로 만들고, 마지막에 지역 추가 배송비를 묶음마다 더한다. 추가 배송비는 무료 기준에
|
|
7709
|
+
* 걸리지 않는다.
|
|
7710
|
+
*/
|
|
7711
|
+
export declare function quoteDelivery(input: DeliveryQuoteInput): DeliveryQuote;
|
|
7712
|
+
//#endregion
|
|
7110
7713
|
//#region src/schemas/webhook-event.d.ts
|
|
7111
7714
|
export declare const orderWebhookEventDataSchema: z.ZodObject<{
|
|
7112
7715
|
orderId: z.ZodString;
|