> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daya.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration Model

> Merchant balances, customer allocations, and product boundaries

## Overview

Daya Coins follows a merchant-managed account model. Daya maintains your business's aggregate Coins balance and transaction records; your business maintains the breakdown of those assets across its own customers.

## Responsibility model

| Daya                                                    | Your business                                              |
| ------------------------------------------------------- | ---------------------------------------------------------- |
| Maintain the merchant Coins balance and portfolio       | Maintain a customer-level subledger                        |
| Execute quotes, orders, deposits, and withdrawals       | Associate each operation with the correct customer         |
| Return order, transaction, balance, and portfolio state | Poll and reconcile API state idempotently                  |
| Apply account-level API authorization                   | Protect keys and enforce authorization in your application |

## Separate product balances

Coins, Stocks, and the Business API keep independent balances. You can display them together, but they are not one spendable pool.

<Warning>
  Do not fund a Coins order from a Stocks or Business API balance. Check the Coins balance before creating the order. Moving value between products is a separate operation — never assume a cross-product movement and a trade settle atomically.
</Warning>

## Customer allocation workflow

<Steps>
  <Step title="Record the instruction">Create an internal operation ID and record the customer, asset, side, and intended amount.</Step>
  <Step title="Quote and order">Request a quote, then place the order with its `quote_id`. Save one `Idempotency-Key` for this logical order and reuse it for every retry.</Step>
  <Step title="Store the Daya order ID">Link the returned order to the customer operation in your system.</Step>
  <Step title="Wait for a final outcome">Process the terminal order webhook, or poll `GET /orders/{id}` until the order is `filled` or `failed`.</Step>
  <Step title="Update the subledger">Apply the filled quantity, cash movement, and fees to the customer exactly once.</Step>
  <Step title="Reconcile">Compare the sum of customer allocations against the aggregate Daya Coins balance and portfolio.</Step>
</Steps>

## Reconciliation

Persist the last state you processed for every order and transaction, make customer-ledger updates idempotent, and periodically compare the sum of customer allocations with the aggregate Daya balance and portfolio.

<Note>
  Configure signed order and money-movement webhooks in the Daya Dashboard. Keep API polling and periodic reconciliation as fallbacks for delayed, duplicated, or missed deliveries.
</Note>
