> For the complete documentation index, see [llms.txt](https://bify.gitbook.io/rwa-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bify.gitbook.io/rwa-docs/bify-commerce/architecture.md).

# Commerce Architecture

![BIFY Commerce architecture](/files/91SnEco5pA399TR9q32x)

## Ownership boundaries

| Layer              | Responsibility                                                                    |
| ------------------ | --------------------------------------------------------------------------------- |
| Partner storefront | Product presentation, catalogue, cart, customer-facing order context              |
| Partner backend    | Price, inventory, order ID, fulfilment, API integration                           |
| BIFY SDK           | Server calls, hosted checkout initialization, webhook verification                |
| BIFY backend       | Session scope, encrypted customer details, payment verification, settlement state |
| Commerce contracts | On-chain purchase, certificate, reward, access, and voting enforcement            |

## Settlement sequence

1. The partner backend sends BIFY a trusted order snapshot.
2. BIFY returns a short-lived checkout session.
3. The BIFY browser component collects customer and delivery details.
4. The customer sends the exact USDC amount from a compatible wallet or exchange.
5. BIFY verifies token, network, recipient, amount, reference, transaction success, and replay state.
6. BIFY records the purchase and emits a signed settlement event.
7. The partner fulfils the physical order.
8. The customer claims a recipient wallet and mints the non-transferable certificate. Rewards and access use the settled purchase as their basis.

Payment does not require a wallet connection on the partner website. A wallet is used for certificate or reward actions when the customer chooses to claim an on-chain entitlement.

## Data boundary

Customer email, phone, shipping, and billing data remain backend-controlled and are not written to Commerce contracts. On-chain identifiers are scoped hashes and references, not a product catalogue or an inventory record.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://bify.gitbook.io/rwa-docs/bify-commerce/architecture.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
