> ## 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.

# purchase.mp.microsoft.com/v8.0/b2b/clawback/sastoken

> Microsoft Store v8 Clawback SAS 令牌终结点，用于生成 Azure 存储 SAS 令牌，以读取游戏服务的 Clawback 事件消息队列。

此终结点会生成一个 [SAS 令牌](https://learn.microsoft.com/azure/storage/common/storage-sas-overview)，用于进行身份验证并访问你的 Clawback 事件消息队列。
有关 Clawback 事件消息队列的详细信息，请参阅[从服务管理退款和退单](/zh-CN/publishing/xstore-commerce/xstore-managing-refunds.md)。

## 先决条件

请查看[服务到服务 API 的先决条件](/zh-CN/publishing/xstore-commerce/xstore-authenticating-service.md)。

若要使用此 API，你必须在开发者合作伙伴经理或 Microsoft 联系人的协助下完成加入流程。
有关加入流程的详细信息，请参阅[所需设置/加入请求](/zh-CN/publishing/xstore-commerce/xstore-managing-refunds.md#required-setup--onboarding-request)。

## 请求

### 请求语法

| 方法 | 请求 URI |
| - | - |
| `GET` | `purchase.mp.microsoft.com/v8.0/b2b/clawback/sastoken` |

### 请求标头

| 标头 | 类型 | 说明 |
| - | - | - |
| `Authorization` | `string` | 必需。你的 Microsoft Entra ID 服务访问令牌，格式为 `Bearer` \<*token*>。请参阅[创建 Microsoft Entra ID 访问令牌](/zh-CN/publishing/xstore-commerce/xstore-requesting-userstoreid.md#step-3-creating-microsoft-entra-id-access-tokens)。 |
| `Host` | `string` | 必须设置为值 `purchase.mp.microsoft.com`。 |

### 请求示例

```html theme={null}
GET https://purchase.mp.microsoft.com/v8.0/b2b/clawback/sastoken HTTP/1.1
Host: purchase.mp.microsoft.com
Authorization: Bearer [Microsoft Entra ID bearer token]
```

## 响应

### 响应正文

响应正文为包含以下值的 JSON。

| 参数 | 类型 | 说明 | 必需 |
| - | - | - | - |
| `expiresOn` | `DateTime` | SAS 令牌过期的 UTC 日期和时间 | 是 |
| `uri` | `string` | 用于访问 Clawback 消息队列的组合存储资源 URI 和 [SAS 令牌](https://learn.microsoft.com/azure/storage/common/storage-sas-overview)。 | 是 |

### 响应示例

```json theme={null}

HTTP/1.1 200 OK
Date: Thu, 08 Dec 2022 20:13:46 GMT
Content-Length: 243
Content-Type: application/json; charset=utf-8
ms-correlationid: 70e6f659-ceee-4050-bdf3-56ea3beefe23
ms-requestid: 8c80d7ff-73e2-4a5c-9aca-79059fbc1beb
ms-cv: tRscYtHLJHps.0
x-content-type-options: nosniff

{
    "expiresOn":"2022-12-09T02:13Z",
    "uri":"https://uluufeofsxh2k.queue.core.windows.net:443/gxhxcvb32lnk4?sv=2021-10-04&spr=https&st=2022-12-08T20%3A13%3A46Z&se=2022-12-09T02%3A13%3A46Z&sp=rp&sig=OneHfX99E820avICZvXJUF14IyDuv2BrvY0kj%2Ftxc70%3D"
}

```

## 使用 SAS 令牌访问 Clawback 事件消息队列

获得 `uri` 参数后，即可访问队列消息。
有关详细信息，请参阅[处理队列中的 Clawback 消息](/zh-CN/publishing/xstore-commerce/xstore-managing-refunds.md#processing-clawback-messages-from-the-queue)。

## 相关文章

[从服务管理退款和退单](/zh-CN/publishing/xstore-commerce/xstore-managing-refunds.md)

[从服务管理消耗型产品](/zh-CN/publishing/xstore-commerce/xstore-managing-consumables.md)

[从服务管理产品](/zh-CN/publishing/xstore-commerce/xstore-authenticating-service.md)

[使用 Microsoft Store API 对服务进行身份验证](/zh-CN/publishing/xstore-commerce/xstore-authenticating-service.md)

[Azure 队列存储 REST API](https://learn.microsoft.com/rest/api/storageservices/queue-service-rest-api)

[通过 .NET 使用 Azure 队列存储](https://learn.microsoft.com/azure/storage/queues/storage-dotnet-how-to-use-queues?tabs=dotnet)


## Related topics

- [Microsoft Store 服务 API（内容）](/zh-CN/reference/microsoft-store-apis/xstore-nav.md)
- [从你的服务管理消耗品产品](/zh-CN/publishing/xstore-commerce/xstore-managing-consumables.md)
- [purchase.mp.microsoft.com/v8.0/b2b/orders/query](/zh-CN/reference/microsoft-store-apis/xstore-v8-clawbackv1.md)
- [purchase.mp.microsoft.com/v8.0/b2b/recurrences/query](/zh-CN/reference/microsoft-store-apis/xstore-v8-recurrence-query.md)
- [purchase.mp.microsoft.com/v8.0/b2b/recurrences/{recurrenceId}/change](/zh-CN/reference/microsoft-store-apis/xstore-v8-recurrence-change.md)
