> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User Store ID 키 갱신

> 백엔드가 계속 호출을 인증할 수 있도록 30일 수명이 만료되기 전에 Microsoft Store 서비스에서 User Store ID 키를 갱신합니다.

이 문서에서는 User Store ID 키를 갱신하는 방법을 설명합니다.

[User Store ID 키를 생성](/publishing/xstore-commerce/xstore-requesting-userstoreid#step-4-create-a-user-store-id-key)하면 30일의 수명을 가집니다. 그 기간 동안 키는 Microsoft Store 서비스에 대한 호출을 인증할 수 있습니다. 만료 전에 갱신하여 동일한 Microsoft Entra 앱 클라이언트 ID와 사용자 identity에 대한 새 키를 생성할 수 있습니다.

## 사전 요구 사항

User Store ID 키를 갱신하려면 다음 키/토큰이 필요합니다.

* 대상(audience) URI 값이 `https://onestore.microsoft.com`인 Microsoft Entra ID 액세스 토큰
* [앱의 클라이언트 측 코드에서 생성된](/publishing/xstore-commerce/xstore-requesting-userstoreid#step-4-create-a-user-store-id-key) 만료된 Microsoft Store ID 키

자세한 내용은 [서비스 간 인증을 위한 User Store ID 요청](/publishing/xstore-commerce/xstore-requesting-userstoreid)을 참고하세요.

## 요청

### 요청 구문

| 키 유형          | 메서드    | 요청 URI                                                     |
| ------------- | ------ | ---------------------------------------------------------- |
| `Collections` | `POST` | `https://collections.mp.microsoft.com/v6.0/b2b/keys/renew` |
| `Purchase`    | `POST` | `https://purchase.mp.microsoft.com/v6.0/b2b/keys/renew`    |

### 요청 헤더

| 헤더               | 유형       | 설명                                                                          |
| ---------------- | -------- | --------------------------------------------------------------------------- |
| `Host`           | `string` | `collections.mp.microsoft.com` 또는 `purchase.mp.microsoft.com` 값으로 설정해야 합니다. |
| `Content-Length` | `number` | 요청 본문의 길이입니다.                                                               |
| `Content-Type`   | `string` | 요청 및 응답 유형을 지정합니다. 현재 지원되는 유일한 값은 `application/json`입니다.                    |

### 요청 본문

| 매개변수            | 유형       | 설명                                | 필수 |
| --------------- | -------- | --------------------------------- | -- |
| `serviceTicket` | `string` | Microsoft Entra ID 서비스 액세스 토큰입니다. | 예  |
| `key`           | `string` | 만료된 Microsoft Store ID 키입니다.      | 예  |

### 요청 예

```syntax theme={null}
POST https://collections.mp.microsoft.com/v6.0/b2b/keys/renew HTTP/1.1
Content-Length: 2774
Content-Type: application/json
Host: collections.mp.microsoft.com

{
    "serviceTicket": "eyJ0eXAiOiJKV1QiLCJhb...",
    "Key": "eyJ0eXAiOiJKV1QiLCJhbG..."
}
```

## 응답

### 응답 본문

| 매개변수  | 유형       | 설명                                                                                          |
| ----- | -------- | ------------------------------------------------------------------------------------------- |
| `key` | `string` | Microsoft Store collections API 또는 purchase API에 대한 향후 호출에 사용할 수 있는 갱신된 User Store ID 키입니다. |

### 응답 예

```syntax theme={null}
HTTP/1.1 200 OK
Content-Length: 1646
Content-Type: application/json
MS-CorrelationId: bfebe80c-ff89-4c4b-8897-67b45b916e47
MS-RequestId: 1b5fa630-d672-4971-b2c0-3713f4ea6c85
MS-CV: xu2HW6SrSkyHyFh.0.0
MS-ServerId: 030011428
Date: Tue, 13 Sep 2019 07:31:12 GMT

{
    "key":"eyJ0eXAi..."
}
```

## 오류 코드

| 코드  | 오류           | 내부 오류 코드                     | 설명                                                                                                       |
| --- | ------------ | ---------------------------- | -------------------------------------------------------------------------------------------------------- |
| 401 | Unauthorized | `AuthenticationTokenInvalid` | Microsoft Entra ID 액세스 토큰이 유효하지 않습니다. 경우에 따라 `ServiceError`에 토큰 만료 또는 누락된 `appid` 클레임과 같은 자세한 정보가 포함됩니다. |
| 401 | Unauthorized | `InconsistentClientId`       | User Store ID 키의 `clientId` 클레임과 Microsoft Entra ID 액세스 토큰의 `appid` 클레임이 일치하지 않습니다.                      |

## 참조 API 문서

* [XStore (API 내용)](/reference/system/xstore/xstore_members)

## 참고

[커머스(개요)](/publishing/xstore-commerce/xstore-commerce-overview)

[서비스에서 제품 관리](/publishing/xstore-commerce/xstore-authenticating-service)

[서비스 간 인증을 위한 User Store ID 요청](/publishing/xstore-commerce/xstore-requesting-userstoreid)

[X-token 또는 OAuth 2.0으로 서비스에서 User Store ID 요청](/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth)

[Microsoft Store API로 서비스 인증](/publishing/xstore-commerce/xstore-authenticating-service)

[Microsoft.StoreServices library (GitHub)](https://github.com/microsoft/Microsoft-Store-Services)

[Microsoft.StoreServices sample (GitHub)](https://github.com/microsoft/Microsoft-Store-Services-Sample)

[XStore (API 참조)](/reference/system/xstore/xstore_members)


## Related topics

- [서비스 간 인증을 위한 User Store ID 요청](/ko/publishing/xstore-commerce/xstore-requesting-userstoreid.md)
- [Microsoft Store API로 서비스 인증하기](/ko/publishing/xstore-commerce/xstore-authenticating-service.md)
- [X-token 또는 OAuth 2.0으로 User Store ID 요청](/ko/publishing/xstore-commerce/xstore-requesting-userstoreid-oauth.md)
- [XStoreGetUserCollectionsIdResult](/ko/reference/system/xstore/functions/xstoregetusercollectionsidresult.md)
- [XStoreGetUserPurchaseIdAsync](/ko/reference/system/xstore/functions/xstoregetuserpurchaseidasync.md)
