Liking cljdoc? Tell your friends :D
Clojure only.

game.protocols.market


blocking-refund-statusesclj


blocking-return-statusesclj


capability-statusesclj


cart-statusesclj


category-statusesclj


chargeback-statusesclj


checkout-batch-statusesclj


checkout-group-statusesclj


checkout-providersclj

Payment rails that can own one leg of a mixed-cart checkout. The historical marketplace providers remain valid so existing games keep their one-provider behavior; IoTravel adds hosted WeTravel and connected-account direct Stripe.

Payment rails that can own one leg of a mixed-cart checkout. The historical
marketplace providers remain valid so existing games keep their one-provider
behavior; IoTravel adds hosted WeTravel and connected-account direct Stripe.
raw docstring

checkout-statusesclj


committed-refund-statusesclj


fulfillment-statusesclj


handle-abort-refund-card-fundingclj

(handle-abort-refund-card-funding payload)

handle-accept-cart-offersclj

(handle-accept-cart-offers payload)

handle-acknowledge-refund-funding-reconciliationclj

(handle-acknowledge-refund-funding-reconciliation payload)

handle-add-to-cartclj

(handle-add-to-cart payload)

Buyer fast-path: add a directly-buyable capability to a cart at the listed price. Synthesizes a proposed offer for quantity units (default 1) tagged :auto-generated, and considers it in the cart.

Buyer fast-path: add a directly-buyable capability to a cart at the
listed price. Synthesizes a proposed offer for `quantity` units (default 1)
tagged :auto-generated, and considers it in the cart.
raw docstring

handle-approve-returnclj

(handle-approve-return payload)

Seller approves a requested return, optionally attaching an RMA number, shipping instructions, and the amount they are willing to refund (defaults to the requested amount, or the order's remaining refundable total).

Seller approves a requested return, optionally attaching an RMA number,
shipping instructions, and the amount they are willing to refund (defaults
to the requested amount, or the order's remaining refundable total).
raw docstring

handle-archive-cartclj

(handle-archive-cart payload)

handle-block-card-funded-buyer-refund-attemptclj

(handle-block-card-funded-buyer-refund-attempt payload)

handle-cancel-payment-legclj

(handle-cancel-payment-leg payload)

handle-cancel-returnclj

(handle-cancel-return payload)

Buyer withdraws their own return request.

Buyer withdraws their own return request.
raw docstring

handle-cancel-subscriptionclj

(handle-cancel-subscription payload)

Stop future cycles. The buyer or the seller may cancel; the GM may too, since the provider can report a cancellation that happened out of band.

Stop future cycles. The buyer or the seller may cancel; the GM may too, since
the provider can report a cancellation that happened out of band.
raw docstring

handle-confirm-receiptclj

(handle-confirm-receipt payload)

Buyer confirms they received the order and are satisfied. This is the fast path for coseller payout release: confirming makes the order immediately eligible for coseller/settle-checkout, instead of waiting for the policy's :payout-hold-days window to elapse since payment. Idempotent — confirming an already-confirmed order is a no-op, not an error.

Buyer confirms they received the order and are satisfied. This is the fast
path for coseller payout release: confirming makes the order immediately
eligible for `coseller/settle-checkout`, instead of waiting for the
policy's :payout-hold-days window to elapse since payment. Idempotent —
confirming an already-confirmed order is a no-op, not an error.
raw docstring

handle-consider-offerclj

(handle-consider-offer payload)

handle-create-cartclj

(handle-create-cart payload)

handle-declare-capabilityclj

(handle-declare-capability payload)

handle-deny-returnclj

(handle-deny-return payload)

Seller denies a requested return. A denied return stops holding the order's coseller payout.

Seller denies a requested return. A denied return stops holding the order's
coseller payout.
raw docstring

handle-expire-refund-card-fundingclj

(handle-expire-refund-card-funding payload)

handle-expire-returnsclj

(handle-expire-returns payload)

Game Master sweep: a return the seller has left :requested for longer than the policy's :return-response-days auto-approves, so silence cannot strand a buyer. Auto-approval keeps the settlement freeze — the order stays held until a refund is issued — so this sweep is about visibility and refund eligibility, not about releasing money.

Game Master sweep: a return the seller has left :requested for longer than
the policy's :return-response-days auto-approves, so silence cannot strand a
buyer. Auto-approval keeps the settlement freeze — the order stays held
until a refund is issued — so this sweep is about visibility and refund
eligibility, not about releasing money.
raw docstring

handle-express-intentclj

(handle-express-intent payload)

handle-fee-adjustment-ledger-failedclj

(handle-fee-adjustment-ledger-failed payload)

handle-fee-adjustment-ledger-succeededclj

(handle-fee-adjustment-ledger-succeeded payload)

handle-issue-refundclj

(handle-issue-refund payload)

Seller (or an operator) refunds an amount against a paid order. Requires a caller-supplied :refund-id — that id is the ledger idempotency key and the PSP idempotency key, and is what makes a retried refund safe.

After settlement, seller refunds remain blocked for manual resolution. A GM discretionary reversal is instead funded entirely by @game and never claws back seller, platform, coseller, or future-earnings balances.

Seller (or an operator) refunds an amount against a paid order. Requires a
caller-supplied :refund-id — that id is the ledger idempotency key and the
PSP idempotency key, and is what makes a retried refund safe.

After settlement, seller refunds remain blocked for manual resolution. A GM
discretionary reversal is instead funded entirely by @game and never claws
back seller, platform, coseller, or future-earnings balances.
raw docstring

handle-mark-application-fee-refundedclj

(handle-mark-application-fee-refunded payload)

The payment provider returned a seller-direct application fee. The buyer's refund is already final; this idempotent ledger effect removes only the reversed commission from @commission-escrow.

The payment provider returned a seller-direct application fee. The buyer's
refund is already final; this idempotent ledger effect removes only the
reversed commission from @commission-escrow.
raw docstring

handle-mark-checkout-paidclj

(handle-mark-checkout-paid payload)

Buyer marks an aggregate checkout as paid. Cascades :paid to every order in the checkout. The buyer pays the full retail total once; commissions are invisible to them.

Buyer marks an aggregate checkout as paid. Cascades :paid to every order in
the checkout. The buyer pays the full retail total once; commissions are
invisible to them.
raw docstring

handle-mark-fulfilledclj

(handle-mark-fulfilled payload)

Seller records fulfillment/shipment for a paid order: sets fulfillment status and optional carrier / tracking-number / tracking-url. Orthogonal to the payment :status, so it is callable once the order is :paid (and still after :payment-received). Idempotent — re-marking with the same status is a success no-op that refreshes tracking fields.

Seller records fulfillment/shipment for a paid order: sets fulfillment status
and optional carrier / tracking-number / tracking-url. Orthogonal to the
payment :status, so it is callable once the order is :paid (and still after
:payment-received). Idempotent — re-marking with the same status is a success
no-op that refreshes tracking fields.
raw docstring

handle-mark-payment-leg-failedclj

(handle-mark-payment-leg-failed payload)

handle-mark-payment-leg-paidclj

(handle-mark-payment-leg-paid payload)

handle-mark-payment-receivedclj

(handle-mark-payment-received payload)

Seller confirms they received their payout for a specific order. Only callable once the buyer has paid the checkout (order is :paid).

Seller confirms they received their payout for a specific order. Only callable
once the buyer has paid the checkout (order is :paid).
raw docstring

handle-mark-refund-settledclj

(handle-mark-refund-settled payload)

The PSP confirmed the refund. Records the PSP refund id and emits the settle batch (@refunds-pending -> @refunds-paid). Idempotent: safe to call from the orchestration path AND from a redelivered webhook.

The PSP confirmed the refund. Records the PSP refund id and emits the settle
batch (@refunds-pending -> @refunds-paid). Idempotent: safe to call from the
orchestration path AND from a redelivered webhook.
raw docstring

handle-mark-return-receivedclj

(handle-mark-return-received payload)

Seller confirms the returned goods arrived, optionally noting their condition. The usual precondition for issuing the refund.

Seller confirms the returned goods arrived, optionally noting their
condition. The usual precondition for issuing the refund.
raw docstring

handle-mark-return-shippedclj

(handle-mark-return-shipped payload)

Buyer ships the goods back and records carrier / tracking details.

Buyer ships the goods back and records carrier / tracking details.
raw docstring

handle-prepare-card-funded-buyer-refundclj

(handle-prepare-card-funded-buyer-refund payload)

handle-propose-offerclj

(handle-propose-offer payload)

handle-query-capabilitiesclj

(handle-query-capabilities payload)

handle-query-cartclj

(handle-query-cart payload)

handle-query-cartsclj

(handle-query-carts payload)

handle-query-categoriesclj

(handle-query-categories payload)

handle-query-checkout-batchesclj

(handle-query-checkout-batches payload)

handle-query-checkout-groupclj

(handle-query-checkout-group payload)

handle-query-checkout-payment-detailsclj

(handle-query-checkout-payment-details payload)

Return the immutable order snapshots and aggregate application fee required to create a processor session. This is deliberately separate from the buyer order projection: commission stays hidden from buyers while the GM does not have to impersonate a seller to calculate the exact snapshotted fee.

Return the immutable order snapshots and aggregate application fee required
to create a processor session. This is deliberately separate from the buyer
order projection: commission stays hidden from buyers while the GM does not
have to impersonate a seller to calculate the exact snapshotted fee.
raw docstring

handle-query-checkoutsclj

(handle-query-checkouts payload)

handle-query-commerce-adaptersclj

(handle-query-commerce-adapters payload)

handle-query-hashtagsclj

(handle-query-hashtags payload)

handle-query-intentsclj

(handle-query-intents payload)

handle-query-offersclj

(handle-query-offers payload)

handle-query-ordersclj

(handle-query-orders payload)

handle-query-owned-cartclj

(handle-query-owned-cart payload)

handle-query-refundsclj

(handle-query-refunds payload)

List refunds across orders. :filters {:status "reserved"} is the recovery query for refunds whose PSP call never completed; {:status "blocked-manual"} is the post-settlement operator queue.

List refunds across orders. :filters {:status "reserved"} is the recovery
query for refunds whose PSP call never completed; {:status
"blocked-manual"} is the post-settlement operator queue.
raw docstring

handle-query-returnsclj

(handle-query-returns payload)

List returns across orders. The operator queue for auto-approved returns is :filters {:status "approved" :auto-approved true}.

List returns across orders. The operator queue for auto-approved returns is
:filters {:status "approved" :auto-approved true}.
raw docstring

handle-query-subscriptionsclj

(handle-query-subscriptions payload)

Subscriptions filtered by :buyer or :seller. The locked attribution chain is included deliberately: it is permanent once set, so it must be inspectable.

Subscriptions filtered by :buyer or :seller. The locked attribution chain is
included deliberately: it is permanent once set, so it must be inspectable.
raw docstring

handle-reconcile-seller-direct-fundingclj

(handle-reconcile-seller-direct-funding payload)

Correct the Market snapshot after an atomic, idempotent ledger batch has transferred the verified fee from buyer escrow to commission escrow and returned the seller's net to payment incoming. The batch precedes this event; a failed state update can then be retried without moving money a second time.

Correct the Market snapshot after an atomic, idempotent ledger batch has
transferred the verified fee from buyer escrow to commission escrow and
returned the seller's net to payment incoming. The batch precedes this event;
a failed state update can then be retried without moving money a second time.
raw docstring

handle-record-chargebackclj

(handle-record-chargeback payload)

A PSP dispute was opened against a checkout. Freeze the affected orders and record it — no ledger movement, because the money has not actually left and may come back if the dispute is won.

A PSP dispute was opened against a checkout. Freeze the affected orders and
record it — no ledger movement, because the money has not actually left and
may come back if the dispute is won.
raw docstring

handle-record-checkout-payment-refclj

(handle-record-checkout-payment-ref payload)

Merge late-arriving payment metadata into an existing checkout's payment-ref. Used to backfill Stripe fee data after the payment has already been marked paid. Idempotent when the merge does not change state.

Merge late-arriving payment metadata into an existing checkout's payment-ref.
Used to backfill Stripe fee data after the payment has already been marked
paid. Idempotent when the merge does not change state.
raw docstring

handle-record-external-refundclj

(handle-record-external-refund payload)

Ingest a refund created outside the market protocol (typically in the Stripe dashboard). The amount is allocated across the checkout's orders pro-rata by gross; unsettled portions are reserved on the ledger, settled portions are recorded :blocked-manual. Deduped on the PSP refund id.

Ingest a refund created outside the market protocol (typically in the Stripe
dashboard). The amount is allocated across the checkout's orders pro-rata by
gross; unsettled portions are reserved on the ledger, settled portions are
recorded :blocked-manual. Deduped on the PSP refund id.
raw docstring

handle-record-refund-card-paymentclj

(handle-record-refund-card-payment payload)

handle-record-refund-card-sessionclj

(handle-record-refund-card-session payload)

handle-record-refund-funding-charge-eventclj

(handle-record-refund-funding-charge-event payload)

handle-record-refund-funding-processor-feeclj

(handle-record-refund-funding-processor-fee payload)

handle-record-seller-checkout-paidclj

(handle-record-seller-checkout-paid payload)

Record a verified seller-owned charge and fund only its application fee.

Record a verified seller-owned charge and fund only its application fee.
raw docstring

handle-record-subscription-invoice-paidclj

(handle-record-subscription-invoice-paid payload)

Record any paid post-start subscription invoice (cycle or prorated update) as an ordinary paid order. Seller-direct invoices fund only their verified application fee; marketplace-owned invoices fund gross receipts.

Record any paid post-start subscription invoice (cycle or prorated update)
as an ordinary paid order. Seller-direct invoices fund only their verified
application fee; marketplace-owned invoices fund gross receipts.
raw docstring

handle-record-subscription-startedclj

(handle-record-subscription-started payload)

Create or attach a provider to a stable Market subscription. A Free Liam entitlement can therefore become a paid Stripe subscription without losing its identity or the attribution chain captured at signup.

Create or attach a provider to a stable Market subscription. A Free Liam
entitlement can therefore become a paid Stripe subscription without losing
its identity or the attribution chain captured at signup.
raw docstring

handle-record-woo-quoteclj

(handle-record-woo-quote payload)

handle-refund-card-funding-ledger-failedclj

(handle-refund-card-funding-ledger-failed payload)

handle-refund-card-funding-ledger-succeededclj

(handle-refund-card-funding-ledger-succeeded payload)

handle-refund-funding-charge-loss-ledger-failedclj

(handle-refund-funding-charge-loss-ledger-failed payload)

handle-refund-funding-charge-loss-ledger-succeededclj

(handle-refund-funding-charge-loss-ledger-succeeded payload)

handle-refund-funding-fee-ledger-failedclj

(handle-refund-funding-fee-ledger-failed payload)

handle-refund-funding-fee-ledger-succeededclj

(handle-refund-funding-fee-ledger-succeeded payload)

handle-refund-ledger-failedclj

(handle-refund-ledger-failed payload)

MoM callback: the reserve batch failed (typically the funding account no longer holds the order's gross). No PSP call was made.

MoM callback: the reserve batch failed (typically the funding account no
longer holds the order's gross). No PSP call was made.
raw docstring

handle-refund-ledger-succeededclj

(handle-refund-ledger-succeeded payload)

MoM callback: the reserve batch committed. Internal refunds await the PSP; external refunds await a top-level mark-refund-settled event. MoM ignores effects returned by callbacks, so this callback cannot launch the settle leg.

MoM callback: the reserve batch committed. Internal refunds await the PSP;
external refunds await a top-level mark-refund-settled event. MoM ignores
effects returned by callbacks, so this callback cannot launch the settle leg.
raw docstring

handle-refund-reverse-failedclj

(handle-refund-reverse-failed payload)

MoM callback: the reverse leg failed, so funds are stranded in @refunds-pending. Operator territory.

MoM callback: the reverse leg failed, so funds are stranded in
@refunds-pending. Operator territory.
raw docstring

handle-refund-reverse-succeededclj

(handle-refund-reverse-succeeded payload)

MoM callback: the reserved amount went back to the buyer. The refund is terminally failed and stops holding the order.

MoM callback: the reserved amount went back to the buyer. The refund is
terminally failed and stops holding the order.
raw docstring

handle-refund-settle-failedclj

(handle-refund-settle-failed payload)

MoM callback: the settle leg failed AFTER the PSP already refunded the buyer. The money really left, so this is not a failed refund — it is a ledger discrepancy for an operator, and it keeps holding the order.

MoM callback: the settle leg failed AFTER the PSP already refunded the buyer.
The money really left, so this is not a failed refund — it is a ledger
discrepancy for an operator, and it keeps holding the order.
raw docstring

handle-refund-settle-succeededclj

(handle-refund-settle-succeeded payload)

MoM callback: @refunds-pending -> @refunds-paid committed. The refund is done.

MoM callback: @refunds-pending -> @refunds-paid committed. The refund is done.
raw docstring

handle-register-categoryclj

(handle-register-category payload)

handle-register-commerce-adapterclj

(handle-register-commerce-adapter payload)

Register public, non-secret capabilities for a seller-owned commerce adapter. Runtime URLs and credentials stay in the GM; Market stores only enough data to validate listings and let clients render provider-neutral checkout UI.

Register public, non-secret capabilities for a seller-owned commerce adapter.
Runtime URLs and credentials stay in the GM; Market stores only enough data
to validate listings and let clients render provider-neutral checkout UI.
raw docstring

handle-register-hashtagclj

(handle-register-hashtag payload)

handle-remove-from-cartclj

(handle-remove-from-cart payload)

Buyer removes a previously-added listing line item from a cart. Only :auto-generated offers belonging to the actor can be removed this way; they are withdrawn and unconsidered atomically.

Buyer removes a previously-added listing line item from a cart. Only
:auto-generated offers belonging to the actor can be removed this way;
they are withdrawn and unconsidered atomically.
raw docstring

handle-request-returnclj

(handle-request-return payload)

Buyer opens a return against a paid order. A seller may also call this on their own order (goodwill / recall), in which case the return is created already approved. Idempotent: an open return with the same reason is returned as-is rather than duplicated.

Buyer opens a return against a paid order. A seller may also call this on
their own order (goodwill / recall), in which case the return is created
already approved. Idempotent: an open return with the same reason is
returned as-is rather than duplicated.
raw docstring

handle-reserve-seller-refundclj

(handle-reserve-seller-refund payload)

After platform-collected proceeds have settled, fund a voluntary refund from the seller's available Market balance. If insufficient, the atomic ledger effect fails and the refund returns to awaiting-seller-funding. Future seller earnings may make a later attempt fundable.

After platform-collected proceeds have settled, fund a voluntary refund
from the seller's available Market balance. If insufficient, the atomic
ledger effect fails and the refund returns to awaiting-seller-funding.
Future seller earnings may make a later attempt fundable.
raw docstring

handle-resolve-chargebackclj

(handle-resolve-chargeback payload)

A PSP dispute closed. won unfreezes the affected orders; lost closes the dispute and defers the money movement to the external-refund path (the game HTTP layer submits market/record-external-refund next), because the funds really did leave.

A PSP dispute closed. `won` unfreezes the affected orders; `lost` closes the
dispute and defers the money movement to the external-refund path (the game
HTTP layer submits market/record-external-refund next), because the funds
really did leave.
raw docstring

handle-retire-categoryclj

(handle-retire-category payload)

handle-retire-hashtagclj

(handle-retire-hashtag payload)

handle-retry-payment-legclj

(handle-retry-payment-leg payload)

handle-reverse-refundclj

(handle-reverse-refund payload)

The PSP rejected the refund after the ledger reserve committed. Returns the reserved amount to the buyer (@refunds-pending -> buyer).

The PSP rejected the refund after the ledger reserve committed. Returns the
reserved amount to the buyer (@refunds-pending -> buyer).
raw docstring

handle-rotate-card-funded-buyer-refund-attemptclj

(handle-rotate-card-funded-buyer-refund-attempt payload)

handle-set-marketplace-providerclj

(handle-set-marketplace-provider payload)

Game Master selects the game-wide marketplace provider — the SaaS that operates the marketplace and owns checkout/settlement. Native :intergraph runs checkout

  • payment itself; external providers own the whole flow while Intergraph captures the records as the cross-provider system of record.
Game Master selects the game-wide marketplace provider — the SaaS that operates
the marketplace and owns checkout/settlement. Native :intergraph runs checkout
+ payment itself; external providers own the whole flow while Intergraph
captures the records as the cross-provider system of record.
raw docstring

handle-set-returns-policyclj

(handle-set-returns-policy payload)

Game Master sets the returns policy: how long a buyer may open a return (:return-window-days), how long a seller has to respond before the request auto-approves (:return-response-days), and how long a denied return keeps holding payout (:post-denial-grace-days). Absent fields keep their defaults.

Game Master sets the returns policy: how long a buyer may open a return
(:return-window-days), how long a seller has to respond before the request
auto-approves (:return-response-days), and how long a denied return keeps
holding payout (:post-denial-grace-days). Absent fields keep their defaults.
raw docstring

handle-set-seller-defaultsclj

(handle-set-seller-defaults payload)

Register (or update) a seller's default commission rate (bps) and, optionally, the store commerce provider they run their store on (:shopify, :woocommerce, :printful, or native :intergraph — informational/system-of-record). This is a prerequisite for declaring capabilities and proposing offers.

Register (or update) a seller's default commission rate (bps) and, optionally,
the store commerce provider they run their store on (:shopify, :woocommerce,
:printful, or native :intergraph — informational/system-of-record). This is a
prerequisite for declaring capabilities and proposing offers.
raw docstring

handle-start-refund-card-fundingclj

(handle-start-refund-card-funding payload)

handle-unconsider-offerclj

(handle-unconsider-offer payload)

handle-update-capabilityclj

(handle-update-capability payload)

handle-update-cartclj

(handle-update-cart payload)

handle-update-categoryclj

(handle-update-category payload)

handle-update-hashtagclj

(handle-update-hashtag payload)

handle-update-intentclj

(handle-update-intent payload)

handle-update-offerclj

(handle-update-offer payload)

handle-update-subscription-statusclj

(handle-update-subscription-status payload)

handle-withdraw-capabilityclj

(handle-withdraw-capability payload)

handle-withdraw-intentclj

(handle-withdraw-intent payload)

handle-withdraw-offerclj

(handle-withdraw-offer payload)

hashtag-statusesclj


intent-statusesclj


manifestclj


marketplace-providersclj


offer-statusesclj


order-statusesclj


recurring-capability?clj

(recurring-capability? capability)

recurring-intervalsclj


refund-statusesclj


return-statusesclj


store-commerce-providersclj


terminal-return-statusesclj


validate-payloadclj

(validate-payload event-key payload)

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close