POST/api/v4/connected-accounts/create-location-from-listing

연결된 계정의 등록 정보로 사업장 생성

연결된 계정에 있는 기존 Google Business Profile 또는 Facebook 등록 정보로 새 Listings API 사업장을 생성합니다.

API 키가 필요합니다. 헤더 형식과 키 교체는 인증을 참고하세요.

매개변수

본문

이름유형필수설명
inputobject필수Wrapper object. The entire request body must be nested under `input`.
input.connectedAccountIdstring필수ID of the connected account (Google or Facebook) that owns the listing. Taken from `GET /connected-accounts`.
input.connectedAccountListingIdstring필수ID of the listing to import into a new location. Taken from the `id` of a record returned by `POST /connected-accounts/connected-account-listings`.

요청 예시

바로 붙여 넣을 수 있는 본문입니다. 예시 ID와 값을 실제 값으로 바꾸세요.

Request body
{  "input": {    "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5",    "connectedAccountListingId": "R21iQnVsa0RhdGFMYWtlOjU3NzU5MzRiLTUwOTgtNGQwYS04YjQ0LTNjY2ZlZmZkZmUzNw=="  }}

응답

200Request accepted. `success` is `true` and `locationId` holds the new location's database ID; on failure `success` is `false`, `locationId` is `null`, and `errors` carries a structured, coded reason.
Response
{  "data": {    "createLocationFromConnectedAccountListing": {      "success": true,      "locationId": 88277,      "errors": null    }  }}
400Bad request, the body was not wrapped in `input`, or a required field was omitted. The field is `connectedAccountListingId`, not `listingId` (the latter is rejected by the schema).
401Unauthenticated, missing or invalid API key.

연결된 Google Business Profile 또는 Facebook 계정의 기존 등록 정보에서 비즈니스 데이터를 가져와 새 Listings API 사업장을 생성합니다. 등록 정보는 계정에 이미 존재해야 하며(POST /connected-accounts/connected-account-listings을 통해 조회), 다른 Listings API 사업장에 연결되어 있지 않아야 합니다.

요청 구조. 본문은 필수 필드 2개인 connectedAccountId(등록 정보를 소유한 계정)과 connectedAccountListingId(가져올 특정 등록 정보)를 포함하는 input 객체로 감싸야 합니다. listingId 필드는 없으며, 포함하면 스키마에서 거부됩니다.

Google 등록 정보의 경우 API는 이름, 주소, 좌표, 전화번호, 웹사이트, 설명, 정규 및 특별 영업시간, 기본 및 추가 카테고리, 개업일, 매장 코드, 시간대를 가져옵니다. 결제 수단과 소셜 프로필 링크는 등록 정보의 Google 속성에서 가져옵니다. 결제 수단과 소셜 링크 외의 Google 속성은 읽지만 저장하지 않습니다. Facebook의 경우 이름, 사업장, 영업시간, 카테고리, 설명, 연락처 정보를 가져옵니다.

새 사업장은 데이터를 가져온 원본 연결 계정에 자동으로 연결됩니다. Google에서 가져온 데이터는 Google에 다시 제출되지 않습니다. 데이터를 가져온 원본 프로필은 그대로 유지되며, 첫 번째 POST /api/v4/locations/update이 해당 등록 정보에 게시할 때까지 등록 정보의 상태는 syncStatus: IN_PROGRESS으로 표시됩니다. 다른 모든 게시 플랫폼은 일반적인 방식으로 처리됩니다. 주문 항목이 생성되고, 계정에서 활성화된 나머지 각 사이트에 사업장이 제출됩니다.

이 엔드포인트는 사이트 범위 지정이나 제출 비활성화 옵션을 허용하지 않으므로, 사업장은 항상 계정의 전체 게시 플랫폼을 대상으로 생성됩니다. 게시 플랫폼을 하나로 제한하려면 생성 직후 POST /api/v4/locations/update을 통해 새 사업장의 enabledSiteIds을 설정합니다. 사업장이 생성되는 즉시 이 업데이트를 전송해야 합니다. 다른 게시 플랫폼의 주문 항목은 생성 직후에 만들어지며, 이미 만들어진 주문 항목은 이 업데이트로 취소되지 않습니다.

사용 사례: 온보딩 중 사업장 일괄 생성. 대행사가 Listings API에 아직 등록하지 않은 매장 40개를 관리하는 고객의 Google 계정을 연결합니다. 각 사업장을 수동으로 생성하는 대신, 계정의 등록 정보 목록을 조회하고 connectedAccountListingId마다 이 엔드포인트를 한 번씩 호출하여 Google 데이터가 미리 채워진 Listings API 사업장 40개를 모두 생성한 다음, 일반적인 방식으로 요금을 청구하고 관리합니다.

success: true은 사업장이 생성되었음을 의미하며, locationId은 해당 사업장의 데이터베이스 ID입니다. 실패 시 success은 false이고, locationId는 null이며, errors에는 코드가 포함된 구조화된 실패 사유가 담깁니다. 예를 들어 connectedAccountListingId에 해당하는 대상을 찾을 수 없으면 { "code": "SY81067", "message": "Invalid connected account listing ID" }이 포함됩니다. 그 밖의 일반적인 실패 사례로는 등록 정보가 이미 다른 사업장에 연결되어 있거나, 계정의 자격 증명이 만료되어 connect-google 또는 connect-facebook 엔드포인트를 통해 다시 연결해야 하는 경우가 있습니다. 새 사업장을 생성하는 대신 기존 사업장에 등록 정보를 연결하려면 connect-listing 엔드포인트를 사용합니다.

Request
curl -X POST 'https://listingsapi.com/api/v4/connected-accounts/create-location-from-listing' \  -H "Authorization: API $LISTINGSAPI_KEY" \  -H 'Content-Type: application/json' \  -d '{    "input": {      "connectedAccountId": "4f712c17-4f95-42dd-90f4-97171a2e67b5",      "connectedAccountListingId": "R21iQnVsa0RhdGFMYWtlOjU3NzU5MzRiLTUwOTgtNGQwYS04YjQ0LTNjY2ZlZmZkZmUzNw=="    }  }'