---
title: "Checkout with D-Sports Cash"
method: POST
path: "/api/checkout/dsports-cash"
tags: ["Checkout", "Commerce and purchases"]
---

# Checkout with D-Sports Cash

`POST /api/checkout/dsports-cash`

## Request

- Base URL: `https://app.d-sports.org`
- URL: `https://app.d-sports.org/api/checkout/dsports-cash`
- Auth: HTTP bearer

Charges the caller's D-Sports Cash balance and, in the same transaction, removes or reduces the purchased ShopCartItem lines. Each purchased unit is applied once: the Product id the client sent is cleared first, then another mirror of that pack. A single-item buy of an item that is also in the cart reduces that line. A rejected charge leaves the cart. Optional Idempotency-Key header or idempotencyKey body field (max 128). The same key and the same cart replay the first 200 and do not charge again. The same key with a different cart is 409 IDEMPOTENCY_KEY_CONFLICT. Omitting the key charges every request. Keys are not expired. An omitted pack wallet resolves to the fan's primary wallet (oldest custodial, else oldest of any type), or null when the fan has no wallet (#938).

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `itemId` string
  - `itemType` string
  - `quantity` integer
  - `cartItems` unknown[]
    - unknown
  - `idempotencyKey` string: Optional. Ignored when the Idempotency-Key header is set to the same value. A mismatch with the header is 400.

## Response `200`

{ success, data: { paymentId, remainingBalance, chargedAmount, currency } }. A replay returns the first paymentId, remainingBalance, and chargedAmount stored at charge time, not a live wallet read; legacy receipts omit chargedAmount.

## Other responses

- `400`: PRODUCT_UNAVAILABLE for a missing or unavailable product/pack; otherwise VALIDATION_ERROR or INSUFFICIENT_BALANCE. The cart is unchanged.
- `403`: WALLET_NOT_LINKED — buying wallet no longer linked to the fan (switch wallets and retry). Message stays 'Wallet not linked to this fan'; status stays 403. Native keeps the old code+message match as fallback.
- `409`: IDEMPOTENCY_KEY_CONFLICT — this key was already used for a different cart.
- `429`: FREE_PACK_DAILY_LIMIT_REACHED. The cart is unchanged.

## Changes

- **2026-11-18** `6de639c52609`: 6 info
  - added the new optional `header` request parameter `Idempotency-Key`
  - added the new optional request property `idempotencyKey`
  - added the non-success response with the status `400`
  - added the non-success response with the status `403`
  - …2 more
- **2026-03-12** `099fcb1a1540`: 1 info
  - api tag `Commerce and purchases` added
- **2026-03-08** `120afc4ee72c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/changes/api/checkout/dsports-cash/post.md)

---

[API](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api.md) - [All operations](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/llms.txt) - [OpenAPI document](https://skmtc.dev/d-sports-ecosystem/apis/d-sports-api/revisions/63735cf90a04?raw)
