Closed
Conversation
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add support for refunds implementation in SDKs
Add refund support via entitlement IDs
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the
/game/refund/v1refund endpoint, allowing players to refund previously purchased items by their entitlement IDs.New types (
PurchaseRequest.cs)LootLockerRefundByEntitlementIdsRequest– request payloadLootLockerRefundByEntitlementIdsResponse– full response with inventory events, currency credited/clawed back, and per-entitlement warningsLootLockerRefundInventoryEvent,LootLockerRefundCurrencyEntry,LootLockerRefundWarning,LootLockerRefundWarningDetail,LootLockerRefundNonReversibleRewardNew endpoint (
LootLockerEndPoints.cs)New SDK method (
LootLockerSDKManager.cs)A non-empty
warningsarray does not indicate failure — it signals partial reversal (e.g. non-reversible progression rewards, insufficient funds for clawback). The method validates thatentitlementIdsis non-null and non-empty before making the API call.Original prompt
This section details on the original issue you should resolve
<issue_title>Add support for refunds</issue_title>
<issue_description>### Purpose
Reflect the backend implementation of the refunds feature
Acceptance Criteria
APIDog collaboration link
https://app.apidog.com/link/project/446496/apis/api-28123628
Public API docs link
https://ref.lootlocker.com/game/refund-items-by-entitlement-ids-api-28123628
An in issue OpenAPI spec of the relevant API surface
{ "openapi": "3.1.0", "info": { "title": "Default module", "description": "Async virtual-currency purchasing endpoints for game clients. Purchases are initiated with a 202 response and polled for completion via the status endpoint. Failed purchases can be retried.\n", "version": "1.0.0" }, "tags": [], "paths": { "/game/refund/v1": { "post": { "summary": "Refund items by Entitlement IDs", "deprecated": false, "description": "", "tags": [], "parameters": [ { "name": "Content-Type", "in": "header", "description": "", "required": true, "example": "application/json", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "entitlement_ids": { "type": "array", "items": { "$ref": "#/components/schemas/ULID" } } }, "required": [ "entitlement_ids" ] }, "examples": {} } }, "required": true }, "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "player_inventory_events": { "type": "array", "description": "Assets that were added or removed from the player's inventory as part of the refund", "items": { "type": "object", "properties": { "asset_id": { "type": "integer", "description": "The legacy numeric ID of the asset", "format": "uint64" }, "name": { "type": "string", "description": "Display name of the asset" }, "action": { "type": "string", "enum": [ "removed", "skipped" ], "description": "`removed` if the asset was successfully taken back from the player's inventory. `skipped` if it could not be removed (e.g. already consumed or transferred)." } }, "required": [ "asset_id", "name", "action" ] } }, "currency_refunded": { "type": "array", "description": "Currency amounts credited back to the player's wallet (i.e. the purchase price being returned)", "items": { "$ref": "#/components/schemas/Currency%20Entry" } }, "currency_clawback": { "type": "array", "description": "Currency amounts debited from the player's wallet (i.e. currency rewards from the entitlement being reclaimed)", "items": { "$ref": "#/components/schemas/Currency%20Entry" } }, "warnings": { "type": "array", "description": "Warnings encountered during refund processing, grouped by entitlement. A non-empty warnings array does not mean the refund failed — it means some aspects could not be fully reversed.", "items": { "type": "object", "properties": { "entitlement_id": { ... </details> <!-- START COPILOT CODING AGENT SUFFIX --> - Fixes lootlocker/index#1395 <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.