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

# Common Workflows

> End-to-end processes that combine multiple TWICE features to accomplish business objectives.

## Definition

<Snippet file="definitions/common-workflows-definition.mdx" />

Most operational work in TWICE follows one of a small set of end-to-end workflows. Each workflow chains together the four core asset types — **SKU**, **Stock Item**, **Listing**, and **Order** — plus the **Customer** record that triggers the transaction.

## Rental fulfillment

The default flow for any short-term rental or booking.

| Step                  | Entity touched    | What happens                                                                                          |
| :-------------------- | :---------------- | :---------------------------------------------------------------------------------------------------- |
| 1. Customer reserves  | Order, Customer   | A new Order is created in `Draft`. A line item references the Listing and the rental period           |
| 2. Stock commitment   | Stock Item        | The fulfillment rules on the Listing match candidate Stock Items. One is `Committed` to the line item |
| 3. Payment            | Payment           | Authorization or capture runs via the connected payment provider                                      |
| 4. Pickup or delivery | Order, Stock Item | The Stock Item moves to `Fulfilled`; the order State becomes `Active`                                 |
| 5. Return             | Stock Item        | The Stock Item moves to `Returned` and back to `Available`; the order State becomes `Completed`       |
| 6. Close-out          | Order             | Final invoicing, deposits returned, order archived                                                    |

Failure modes — late returns, damage, partial returns — all hang off step 5 and may create child orders or attribute changes on the Stock Item.

## Resale processing

Acquiring used inventory and selling it as a finite-quantity Listing.

1. **Intake** — a Stock Item is created (manually or via bulk import) with attributes for `purchase_price`, `condition`, and `acquisition_date`
2. **Grading** — staff fill in condition attributes; photos are uploaded against the Stock Item
3. **Listing** — a Listing is created or matched. Fulfillment rules link the Listing to this Stock Item via SKU and condition
4. **Pricing** — a sale-type pricing table is added to the Listing; depreciation formulas can reference the Stock Item's age and purchase price
5. **Sale** — a customer Order moves the Stock Item from `Available` to `Committed` and then `Fulfilled`
6. **Archival** — once sold, the Stock Item is archived but stays linked to the order for history

## Buyback operations

Buying items back from a customer — typically as trade-in for a new sale or rental credit.

1. **Quote** — a buyback order is opened with the Customer; line items reference the SKU and condition the customer is returning
2. **Intake** — when the item arrives, a new Stock Item is created against the SKU with `acquisition_source = buyback`
3. **Credit** — payment runs in the opposite direction — outbound credit applied to the customer balance or settled via a payment account
4. **Reintroduction** — the new Stock Item enters the resale or rental pool depending on its condition

## Maintenance tracking

Keeping rental pool inventory serviceable.

| Step                   | Entity touched | What happens                                                                                                                   |
| :--------------------- | :------------- | :----------------------------------------------------------------------------------------------------------------------------- |
| 1. Trigger             | Stock Item     | Manual flag (`Needs service`) or formula-based (e.g. `usage_times > 50`)                                                       |
| 2. Reserve for service | Stock Item     | The item is `Committed` to an internal service reservation, removing it from public availability                               |
| 3. Work performed      | Documents      | Service notes and invoices are attached to the Stock Item                                                                      |
| 4. Return to pool      | Stock Item     | The reservation closes; the Stock Item attributes (`last_service_date`, `service_count`) update; status returns to `Available` |

## Inventory transfers

Moving Stock Items between service locations.

1. **Source location** — staff select Stock Items in the Inventory table and trigger a transfer
2. **In transit** — the Stock Items are flagged as `Committed` to the transfer reservation; the source location no longer counts them as available
3. **Receipt** — at the destination, staff confirm receipt; the Stock Items' `service_location` attribute updates
4. **Audit** — the transfer is captured in the Activity log against each Stock Item with both source and destination IDs

## Where workflows live in the product

* **Inventory** view drives the resale, maintenance, and transfer workflows
* **Orders** view drives rental fulfillment and buyback
* **Catalog** view is the connective tissue — Listings and their fulfillment rules decide which Stock Items each workflow can touch
* **Activity log** on every entity is your audit trail across all of the above

## Related

<CardGroup cols={2}>
  <Card title="Design Patterns" icon="shapes" href="/docs/concepts/repeating-patterns/design-patterns">
    The data model these workflows operate on
  </Card>

  <Card title="Usage Patterns" icon="hand-pointer" href="/docs/concepts/repeating-patterns/usage-patterns">
    Day-to-day interaction patterns
  </Card>

  <Card title="Status vs State" icon="arrows-rotate" href="/docs/concepts/repeating-patterns/status-vs-state">
    How records transition through each workflow
  </Card>
</CardGroup>
