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

# XStoreReportConsumableFulfillmentAsync

> XStoreReportConsumableFulfillmentAsync

# XStoreReportConsumableFulfillmentAsync

지정된 수량의 소비 항목을 사용합니다. 소비 제품의 구현 및 사용에 대한 자세한 내용은 [소비 항목 기반 에코시스템](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-consumable-based-ecosystems)을 참조하세요.

## 구문

```cpp theme={null}
HRESULT XStoreReportConsumableFulfillmentAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char* storeProductId,  
         uint32_t quantity,  
         GUID trackingId,  
         XAsyncBlock* async  
)  
```

### 매개 변수

*storeContextHandle*   \_In\_\
형식: XStoreContextHandle

[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext)에서 반환된 사용자의 스토어 컨텍스트 핸들입니다.

*storeProductId*   \_In\_z\_\
형식: char\*

소비되었음을 보고할 소비 추가 기능의 스토어 ID입니다.

*quantity*   \_In\_\
형식: uint32\_t

소비되었음을 보고할 소비 추가 기능의 단위 수입니다. 스토어 관리 소비 항목(즉, Microsoft가 잔량을 추적하는 소비 항목)의 경우 소비된 단위 수를 지정합니다. 게임 관리 소비 항목(즉, 개발자가 잔량을 추적하는 소비 항목)의 경우 1을 지정합니다.

*trackingId*   \_In\_\
형식: GUID

추적 목적으로 소비 작업이 연결된 특정 트랜잭션을 식별하는 개발자가 제공한 GUID입니다.

*async*   \_Inout\_\
형식: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

수행 중인 비동기 작업을 정의하는 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)입니다. [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)을 사용하여 호출 상태를 폴링하고 호출 결과를 검색할 수 있습니다. 자세한 내용은 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)을 참조하세요.

### 반환 값

형식: HRESULT

HRESULT 성공 또는 오류 코드입니다.

## 설명

이 함수의 결과를 검색하려면 이 함수를 호출한 후 [XStoreReportConsumableFulfillmentResult](/reference/system/xstore/functions/xstorereportconsumablefulfillmentresult)를 호출합니다.

다음 코드 조각은 소비 항목의 수량을 사용하는 예를 보여줍니다.

```cpp theme={null}
void CALLBACK ReportConsumableFulfillmentCallback(XAsyncBlock* asyncBlock)
{
    XStoreConsumableResult result{};
    HRESULT hr = XStoreReportConsumableFulfillmentResult(
        asyncBlock,
        &result);

    if (FAILED(hr))
    {
        printf("Failed retrieve the consumable balance remaining: 0x%x\r\n", hr);
        return;
    }

    printf("quantity: %d\r\n", result.quantity);
}

void ReportConsumableFulfillment(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle, const char* storeId, uint32_t quantity, GUID trackingId)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = ReportConsumableFulfillmentCallback;

    HRESULT hr = XStoreReportConsumableFulfillmentAsync(
        storeContextHandle,
        storeId,
        quantity,
        trackingId,
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to report consumable fulfillment: 0x%x\r\n", hr);
        return;
    }
}
```

## 요구 사항

**헤더:** XStore.h (XGameRuntime.h에 포함됨)

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 개념 설명서

* [소비 항목 기반 에코시스템](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-consumable-based-ecosystems)

## 참고 항목

[XStore](/reference/system/xstore/xstore_members)\
[소비 항목 기반 에코시스템](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-consumable-based-ecosystems)
[XStoreReportConsumableFulfillmentResult](/reference/system/xstore/functions/xstorereportconsumablefulfillmentresult)


## Related topics

- [XStoreReportConsumableFulfillmentResult](/ko/reference/system/xstore/functions/xstorereportconsumablefulfillmentresult.md)
- [XStoreConsumableResult](/ko/reference/system/xstore/structs/xstoreconsumableresult.md)
- [소모품 기반 생태계](/ko/publishing/xstore-commerce/xstore-consumables.md)
- [선택 서비스](/ko/build/gdk-and-engines/optional-services.md)
- [XStore](/ko/reference/system/xstore/xstore_members.md)
