Checkout
Commerce and purchases

Checkout with D-Sports Cash

Changed on

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

post/api/checkout/dsports-cash

Request

  • Base URL
    https://app.d-sports.org
  • Auth
    HTTP bearer

Headers

Idempotency-Keystring

Request body

itemIdstring
itemTypestring
quantityinteger
idempotencyKeystring

Optional. Ignored when the Idempotency-Key header is set to the same value. A mismatch with the header is 400.

Response

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

Changes

    • info

      added the new optional header request parameter Idempotency-Key

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    3 more changes in this revision