# 상품 카탈로그

## 사전 작업 <a href="#pre-work" id="pre-work"></a>

서버에서 이벤트를 전송하기 전, 먼저 프로젝트에 유효한 토큰을 발급받아 주세요.

{% content-ref url="authentication" %}
[authentication](https://docs.marketap.io/t3ZS4WXNMj0HK27EtIMV/developer/open-api/authentication)
{% endcontent-ref %}

## 1. 개요

카탈로그 데이터를 전송할 수 있도록 제공하는 Open API입니다. 상품 속성에 대한 자세한 설명은 [카탈로그 속성](https://app.gitbook.com/s/yROeODSgPulCgZ9LFAYn/settings/catalog/property)에서 확인하세요.

## 2. 인증

API를 사용하려면 서버에서 발급받은 API 키를 Authorization 헤더에 포함해야 합니다.

```
Authorization: Bearer {your_api_key}
```

또한, 모든 요청에는 프로젝트 ID가 필요합니다.

이를 쿼리 파라미터에 포함하여 전송합니다.

```
?project_id=your_project_id
```

## 3. Open API 명세서

* timestamp 값으로 속성을 명시하는 경우, [ISO 8601 ](https://ko.wikipedia.org/wiki/ISO_8601)표준에 맞게 전달해주세요.
  * 예) "2025-01-17T05:39:22Z", "2025-01-17T05:39:22+09:00"

{% hint style="danger" %}
Timestamp를 명시적으로 적는 경우, Timezone값에 유의하세요.
{% endhint %}

* bulk 요청 시, 한 번의 호출당 items에 1,000개 미만으로 요청해주세요.
* 연동 가능한 속성에 대한 자세한 설명은 [카탈로그 속성](https://app.gitbook.com/s/yROeODSgPulCgZ9LFAYn/settings/catalog/property)에서 확인하세요.

## Create or update product catalogs in bulk

> Creates or updates multiple product catalog items.

```json
{"openapi":"3.0.0","info":{"title":"Marketap Catalog API - Bulk Upsert","version":"1.0.0"},"servers":[{"url":"https://event.marketap.io","description":"Production Server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"CreateBulkCatalogReq":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CreateCatalogReq"}}}},"CreateCatalogReq":{"type":"object","required":["product_id"],"properties":{"product_id":{"type":"string"},"properties":{"type":"object","nullable":true,"additionalProperties":true}}},"CatalogResponse":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/v1/api/catalogs":{"post":{"summary":"Create or update product catalogs in bulk","description":"Creates or updates multiple product catalog items.","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string"},"description":"Project ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBulkCatalogReq"}}}},"responses":{"200":{"description":"Catalogs processed successfully."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}}}}}}}
```

## Request catalog item deletion

> Triggers asynchronous deletion of a catalog product.

```json
{"openapi":"3.0.0","info":{"title":"Marketap Catalog API - Deletion Job","version":"1.0.0"},"servers":[{"url":"https://event.marketap.io","description":"Production Server"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"DeleteCatalogReq":{"type":"object","required":["productId"],"properties":{"productId":{"type":"string"}}},"CatalogResponse":{"type":"object","properties":{"code":{"type":"integer"},"message":{"type":"string"}}}}},"paths":{"/v1/api/catalogs/deletion-job":{"post":{"summary":"Request catalog item deletion","description":"Triggers asynchronous deletion of a catalog product.","parameters":[{"name":"project_id","in":"query","required":true,"schema":{"type":"string"},"description":"Project ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteCatalogReq"}}}},"responses":{"200":{"description":"Catalog deletion job accepted."},"400":{"description":"Invalid request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}},"401":{"description":"Unauthorized request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogResponse"}}}}}}}}}
```
