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

# Entity dependencies

> Parent and child entities that must be uploaded together

Some entities depend on others. **Do not upload a child entity without uploading its parent in the same session first.**

If you upload only the child, Connector will fail or produce incomplete data.

## Rules

* Upload **parent entities before** dependent child entities.
* Before `start-upload`, the session must contain **both** the parent and the child (see `entities` in `GET /status`).
* Receipts must be uploaded **together with receipt line items** — do not start Connector with `receipts` alone if `receipt-items` are part of your integration.

## Dependency table

| Parent (`entity_name`)   | Child (`entity_name`)        | Task types (reference)                                      |
| ------------------------ | ---------------------------- | ----------------------------------------------------------- |
| `posting`                | `postingproduct`             | `posting` → `posting-products`                              |
| `pricedocument`          | `priceproduct`, `pricestore` | `prices` → `price-products`, `price-stores`                 |
| `purchaseorder`          | `purchaseorderproduct`       | `purchaseorders` → `purchaseorder-products`                 |
| `receipt`                | `receiptitem`                | `receipts` → `receipt-items`                                |
| `receipt`                | `receiptmarkerm2m`           | `receipts` → `receipt-markers-m2m`                          |
| `receipt`, `receiptitem` | `promotionreceiptitemm2m`    | `receipts`, `receipt-items` → `receipt-item-promotions-m2m` |
| `receive`                | `receiveproduct`             | `receives` → `receive-products`                             |
| `relocate`               | `relocateproduct`            | `relocates` → `relocate-products`                           |
| `supplierrefund`         | `supplierrefundproduct`      | `supplier-refunds` → `supplier-refund-products`             |
| `writeoff`               | `writeoffproduct`            | `writeoffs` → `writeoff-products`                           |

For `promotionreceiptitemm2m`, upload **`receipt` first**, then **`receiptitem`**, then the M2M entity.

## Example session flow

```text theme={null}
POST .../receipt       -> success
POST .../receiptitem   -> success
GET  .../status        -> entities: ["receipts", "receipt-items"], can_start_upload: true
POST .../start-upload  -> STARTED
```

Uploading `receiptitem` without `receipt` in the same session is not supported.

When onboarding, tell support which **parent steps (task types)** you will send via API so the workflow is configured correctly.
