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

# Google BigQuery

> Integrating Google BigQuery with our platform enables seamless data synchronization, enhancing your analytics capabilities.

export const SupportedOrderTypesNote = () => <Note>
    All order types are supported — not just online. You can import retail/in-store, wholesale, and marketplace orders alongside your e-commerce data. Use the `TYPE` field to identify the sales channel (e.g., `ONLINE`, `RETAIL`, `WHOLESALE`) and `EXTERNAL_STOREFRONT_ID` to separate data by store or location.
  </Note>;

export const OrderStructureNote = () => <Accordion title="How order data should be structured" icon="circle-info" defaultOpen>
    Each row represents a unique order line, identified by the combination of <code>ORDER_ID</code>, <code>PRODUCT_ID</code>, and <code>VARIANT_NO</code>.

    <table>
      <thead>
        <tr>
          <th>Requirement</th>
          <th>Description</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><strong>Unique rows</strong></td>
          <td>Each row must have a unique <code>ORDER_ID</code>–<code>PRODUCT_ID</code>–<code>VARIANT_NO</code> combination</td>
        </tr>
        <tr>
          <td><strong>Quantity handling</strong></td>
          <td>If multiple items of the same variant were bought, aggregate them using <code>QUANTITY_DECIMAL</code></td>
        </tr>
        <tr>
          <td><strong>Tax inclusion</strong></td>
          <td>All prices should <strong>include tax</strong></td>
        </tr>
        <tr>
          <td><strong>Header repetition</strong></td>
          <td>Order header fields (like <code>ORDER_ID</code>, <code>CURRENCY</code>, <code>TOTAL</code>) must be repeated for every line item in the same order</td>
        </tr>
        <tr>
          <td><strong>Updates</strong></td>
          <td>When updating an order, include the <code>UPDATED_AT</code> field along with the changed fields</td>
        </tr>
        <tr>
          <td><strong>Storefront mapping</strong></td>
          <td>To map data to a specific storefront, fill out <code>EXTERNAL_STOREFRONT_ID</code> and provide us with info about your existing storefronts, see <a href="#storefront-assignment">Storefront assignment</a></td>
        </tr>
      </tbody>
    </table>
  </Accordion>;

export const ProductAttributesV2Note = () => <Note>
    Product attributes are sent as a separate data type from inventory. Include product metadata (name, brand, category, etc.) in a dedicated Product Attributes table rather than the Inventory table.
  </Note>;

export const MerchantMappings = () => <>
    Merchant mappings connect your external storefront IDs to the platform's internal storefronts. They also optionally assign country-level marketing cost data based on country codes.

    <strong>Setup:</strong> Provide the following JSON structure to the commercial team:

    <pre>{`[
    {
        "externalStorefrontId": "STORE-001",
        "countries": ["SE", "NO", "DK"]
    },
    {
        "externalStorefrontId": "STORE-002",
        "countries": ["GB"]
    },
    {
        "externalStorefrontId": "STORE-003",
        "countries": ["US"]
    },
    {
        "externalStorefrontId": "STORE-004",
        "countries": []
    }
]`}</pre>

    <ResponseField name="externalStorefrontId" type="string" required>
      Your external storefront identifier. Can be any string but preferably something that represents the storefront.
    </ResponseField>
    <ResponseField name="countries" type="array">
      Array of ISO 3166 country codes (2 letters) for assigning marketing cost data. Use an empty array <code>[]</code> if no country filtering is needed.
    </ResponseField>
  </>;

export const CogsPriority = ({uppercase}) => <>
    COGS (Cost of Goods Sold) can be sent from multiple sources. When more than one is available for a product, the platform picks the highest-priority value:

    <Steps titleSize="p">
      <Step title="Order COGS">
        The actual unit cost on the order line ({uppercase ? <code>COGS</code> : <code>cogs</code>}). Always takes priority when set.
      </Step>
      <Step title="Inventory COGS">
        Unit cost from inventory data, matched by product and variant ({uppercase ? <code>COGS</code> : <code>cogs</code>}).
      </Step>
      <Step title="Estimated COGS">
        A preliminary estimate on the order ({uppercase ? <code>ESTIMATED_COGS</code> : <code>estimatedCogs</code>}). Useful when the real cost is not yet known at order time and arrives later via inventory.
      </Step>
      <Step title="Gross margin">
        Calculated fallback when no COGS data is available.
      </Step>
    </Steps>
  </>;

export const ProductAttributesCustomAttributesTabular = () => <>
    <ResponseField name="CUSTOM_ATTRIBUTE_1-20" type="VARCHAR">
      Up to 20 custom attributes for additional product or variant metadata.
      <br /><br />
      <strong>Example:</strong> season-2024
    </ResponseField>
  </>;

export const ProductAttributesOptionalFieldsTabular = () => <>
    <ResponseField name={productAttributeDefinitions.brand.externalId} type={productAttributeDefinitions.brand.dataType}>
      {productAttributeDefinitions.brand.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.brand.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.category.externalId} type={productAttributeDefinitions.category.dataType}>
      {productAttributeDefinitions.category.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.category.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.subCategory.externalId} type={productAttributeDefinitions.subCategory.dataType}>
      {productAttributeDefinitions.subCategory.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.subCategory.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.collection.externalId} type={productAttributeDefinitions.collection.dataType}>
      {productAttributeDefinitions.collection.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.collection.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.gender.externalId} type={productAttributeDefinitions.gender.dataType}>
      {productAttributeDefinitions.gender.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.gender.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.color.externalId} type={productAttributeDefinitions.color.dataType}>
      {productAttributeDefinitions.color.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.color.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.material.externalId} type={productAttributeDefinitions.material.dataType}>
      {productAttributeDefinitions.material.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.material.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.size.externalId} type={productAttributeDefinitions.size.dataType}>
      {productAttributeDefinitions.size.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.size.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.gtin.externalId} type={productAttributeDefinitions.gtin.dataType}>
      {productAttributeDefinitions.gtin.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.gtin.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.imageUrls.externalId} type="VARCHAR · multi">
      {productAttributeDefinitions.imageUrls.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.imageUrls.example}
    </ResponseField>
  </>;

export const ProductAttributesRequiredFieldsTabular = () => <>
    <ResponseField name={productAttributeDefinitions.productId.externalId} type={productAttributeDefinitions.productId.dataType} required>
      {productAttributeDefinitions.productId.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.productId.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.variantNo.externalId} type={productAttributeDefinitions.variantNo.dataType} required>
      {productAttributeDefinitions.variantNo.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.variantNo.example}
    </ResponseField>
    <ResponseField name={productAttributeDefinitions.name.externalId} type={productAttributeDefinitions.name.dataType} required>
      {productAttributeDefinitions.name.description}
      <br /><br />
      <strong>Example:</strong> {productAttributeDefinitions.name.example}
    </ResponseField>
  </>;

export const IndeliveriesOptionalFieldsTabular = () => <>
    <ResponseField name={indeliveryDefinitions.warehouse.externalId} type={indeliveryDefinitions.warehouse.dataType}>
      {indeliveryDefinitions.warehouse.description}
      <br /><br />
      <strong>Example:</strong> {indeliveryDefinitions.warehouse.example}
    </ResponseField>
  </>;

export const IndeliveriesRequiredFieldsTabular = () => <>
    <ResponseField name={indeliveryDefinitions.productId.externalId} type={indeliveryDefinitions.productId.dataType} required={indeliveryDefinitions.productId.required}>
      {indeliveryDefinitions.productId.description}
      <br /><br />
      <strong>Example:</strong> {indeliveryDefinitions.productId.example}
    </ResponseField>
    <ResponseField name={indeliveryDefinitions.indeliveryDate.externalId} type={indeliveryDefinitions.indeliveryDate.dataType} required={indeliveryDefinitions.indeliveryDate.required}>
      {indeliveryDefinitions.indeliveryDate.description}
      <br /><br />
      <strong>Format:</strong> {indeliveryDefinitions.indeliveryDate.format}<br />
      <strong>Example:</strong> {indeliveryDefinitions.indeliveryDate.example}
    </ResponseField>
    <ResponseField name={indeliveryDefinitions.quantity.externalId} type={indeliveryDefinitions.quantity.dataType} required={indeliveryDefinitions.quantity.required}>
      {indeliveryDefinitions.quantity.description}
      <br /><br />
      <strong>Format:</strong> {indeliveryDefinitions.quantity.format}<br />
      <strong>Example:</strong> {indeliveryDefinitions.quantity.example}
    </ResponseField>
    <ResponseField name={indeliveryDefinitions.variantNo.externalId} type={indeliveryDefinitions.variantNo.dataType} required={indeliveryDefinitions.variantNo.required}>
      {indeliveryDefinitions.variantNo.description}
      <br /><br />
      <strong>Example:</strong> {indeliveryDefinitions.variantNo.example}
    </ResponseField>
  </>;

export const OrderCustomLineAttributesTabular = () => <>
    <ResponseField name="CUSTOM_ATTRIBUTE_LINE_1-20" type="VARCHAR">
      Up to 20 custom attributes for additional order line metadata.
      <br /><br />
      <strong>Example:</strong> gift-wrapped
    </ResponseField>
  </>;

export const OrderCustomHeaderAttributesTabular = () => <>
    <ResponseField name="CUSTOM_ATTRIBUTE_1-20" type="VARCHAR">
      Up to 20 custom attributes for additional order header metadata.
      <br /><br />
      <strong>Example:</strong> loyalty-program
    </ResponseField>
  </>;

export const OrderReturnFieldsTabular = () => <>
    <ResponseField name={orderDefinitions.returnedAt.externalId} type={orderDefinitions.returnedAt.dataType}>
      {orderDefinitions.returnedAt.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.returnedAt.format}<br />
      <strong>Example:</strong> {orderDefinitions.returnedAt.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedQuantityDecimal.externalId} type={orderDefinitions.returnedQuantityDecimal.dataType}>
      {orderDefinitions.returnedQuantityDecimal.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.returnedQuantityDecimal.format}<br />
      <strong>Example:</strong> {orderDefinitions.returnedQuantityDecimal.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedReason.externalId} type={orderDefinitions.returnedReason.dataType}>
      {orderDefinitions.returnedReason.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.returnedReason.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedShipmentStatus.externalId} type={orderDefinitions.returnedShipmentStatus.dataType}>
      {orderDefinitions.returnedShipmentStatus.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.returnedShipmentStatus.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedShipmentId.externalId} type={orderDefinitions.returnedShipmentId.dataType}>
      {orderDefinitions.returnedShipmentId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.returnedShipmentId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedShippingProvider.externalId} type={orderDefinitions.returnedShippingProvider.dataType}>
      {orderDefinitions.returnedShippingProvider.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.returnedShippingProvider.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.returnedWarehouse.externalId} type={orderDefinitions.returnedWarehouse.dataType}>
      {orderDefinitions.returnedWarehouse.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.returnedWarehouse.example}
    </ResponseField>
  </>;

export const OrderLineOptionalFieldsTabular = () => <>
    <ResponseField name={orderDefinitions.warehouse.externalId} type={orderDefinitions.warehouse.dataType}>
      {orderDefinitions.warehouse.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.warehouse.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.tax.externalId} type={orderDefinitions.tax.dataType}>
      {orderDefinitions.tax.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.tax.format}<br />
      <strong>Example:</strong> {orderDefinitions.tax.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.taxRate.externalId} type={orderDefinitions.taxRate.dataType}>
      {orderDefinitions.taxRate.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.taxRate.format}<br />
      <strong>Example:</strong> {orderDefinitions.taxRate.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.cogs.externalId} type={orderDefinitions.cogs.dataType}>
      {orderDefinitions.cogs.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.cogs.format}<br />
      <strong>Example:</strong> {orderDefinitions.cogs.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.cogsCurrency.externalId} type={orderDefinitions.cogsCurrency.dataType}>
      {orderDefinitions.cogsCurrency.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.cogsCurrency.format}<br />
      <strong>Example:</strong> {orderDefinitions.cogsCurrency.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.promotionId.externalId} type={orderDefinitions.promotionId.dataType}>
      {orderDefinitions.promotionId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.promotionId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.promotionAmount.externalId} type={orderDefinitions.promotionAmount.dataType}>
      {orderDefinitions.promotionAmount.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.promotionAmount.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.promotionType.externalId} type={orderDefinitions.promotionType.dataType}>
      {orderDefinitions.promotionType.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.promotionType.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.statusLine.externalId} type={orderDefinitions.statusLine.dataType}>
      {orderDefinitions.statusLine.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.statusLine.format}<br />
      <strong>Example:</strong> {orderDefinitions.statusLine.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.shipmentId.externalId} type={orderDefinitions.shipmentId.dataType}>
      {orderDefinitions.shipmentId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.shipmentId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.shipmentStatus.externalId} type={orderDefinitions.shipmentStatus.dataType}>
      {orderDefinitions.shipmentStatus.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.shipmentStatus.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.shippingProviderLine.externalId} type={orderDefinitions.shippingProviderLine.dataType}>
      {orderDefinitions.shippingProviderLine.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.shippingProviderLine.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.estimatedCogs.externalId} type={orderDefinitions.estimatedCogs.dataType}>
      {orderDefinitions.estimatedCogs.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.estimatedCogs.format}<br />
      <strong>Example:</strong> {orderDefinitions.estimatedCogs.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.estimatedCogsCurrency.externalId} type={orderDefinitions.estimatedCogsCurrency.dataType}>
      {orderDefinitions.estimatedCogsCurrency.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.estimatedCogsCurrency.format}<br />
      <strong>Example:</strong> {orderDefinitions.estimatedCogsCurrency.example}
    </ResponseField>
  </>;

export const OrderLineRequiredFieldsTabular = () => <>
    <ResponseField name={orderDefinitions.productId.externalId} type={orderDefinitions.productId.dataType} required={orderDefinitions.productId.required}>
      {orderDefinitions.productId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.productId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.variantNo.externalId} type={orderDefinitions.variantNo.dataType} required={orderDefinitions.variantNo.required}>
      {orderDefinitions.variantNo.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.variantNo.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.quantityDecimal.externalId} type={orderDefinitions.quantityDecimal.dataType} required={orderDefinitions.quantityDecimal.required}>
      {orderDefinitions.quantityDecimal.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.quantityDecimal.format}<br />
      <strong>Example:</strong> {orderDefinitions.quantityDecimal.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.originalPrice.externalId} type={orderDefinitions.originalPrice.dataType} required={orderDefinitions.originalPrice.required}>
      {orderDefinitions.originalPrice.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.originalPrice.format}<br />
      <strong>Example:</strong> {orderDefinitions.originalPrice.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.paidPrice.externalId} type={orderDefinitions.paidPrice.dataType} required={orderDefinitions.paidPrice.required}>
      {orderDefinitions.paidPrice.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.paidPrice.format}<br />
      <strong>Example:</strong> {orderDefinitions.paidPrice.example}
    </ResponseField>
  </>;

export const OrderHeaderOptionalFieldsTabular = () => <>
    <ResponseField name={orderDefinitions.city.externalId} type={orderDefinitions.city.dataType}>
      {orderDefinitions.city.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.city.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.region.externalId} type={orderDefinitions.region.dataType}>
      {orderDefinitions.region.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.region.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.zipCode.externalId} type={orderDefinitions.zipCode.dataType}>
      {orderDefinitions.zipCode.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.zipCode.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.customerIdentifier.externalId} type={orderDefinitions.customerIdentifier.dataType}>
      {orderDefinitions.customerIdentifier.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.customerIdentifier.example}<br />
      <strong>Default:</strong> <code>UNKNOWN</code>
    </ResponseField>
    <ResponseField name={orderDefinitions.externalStorefrontId.externalId} type={orderDefinitions.externalStorefrontId.dataType}>
      {orderDefinitions.externalStorefrontId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.externalStorefrontId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.paymentProvider.externalId} type={orderDefinitions.paymentProvider.dataType}>
      {orderDefinitions.paymentProvider.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.paymentProvider.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.shippingProvider.externalId} type={orderDefinitions.shippingProvider.dataType}>
      {orderDefinitions.shippingProvider.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.shippingProvider.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.status.externalId} type={orderDefinitions.status.dataType}>
      {orderDefinitions.status.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.status.format}<br />
      <strong>Example:</strong> {orderDefinitions.status.example}<br />
      <strong>Default:</strong> <code>UNKNOWN</code>
    </ResponseField>
    <ResponseField name={orderDefinitions.type.externalId} type={orderDefinitions.type.dataType}>
      {orderDefinitions.type.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.type.example}<br />
      <strong>Default:</strong> <code>ONLINE</code>
    </ResponseField>
    <ResponseField name={orderDefinitions.voucher.externalId} type={orderDefinitions.voucher.dataType}>
      {orderDefinitions.voucher.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.voucher.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.voucherDiscount.externalId} type={orderDefinitions.voucherDiscount.dataType}>
      {orderDefinitions.voucherDiscount.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.voucherDiscount.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.voucherType.externalId} type={orderDefinitions.voucherType.dataType}>
      {orderDefinitions.voucherType.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.voucherType.example}
    </ResponseField>
  </>;

export const OrderHeaderRequiredFieldsTabular = () => <>
    <ResponseField name={orderDefinitions.orderId.externalId} type={orderDefinitions.orderId.dataType} required={orderDefinitions.orderId.required}>
      {orderDefinitions.orderId.description}
      <br /><br />
      <strong>Example:</strong> {orderDefinitions.orderId.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.createdAt.externalId} type="datetime" required={orderDefinitions.createdAt.required}>
      {orderDefinitions.createdAt.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.createdAt.format}<br />
      <strong>Example:</strong> {orderDefinitions.createdAt.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.country.externalId} type={orderDefinitions.country.dataType} required={orderDefinitions.country.required}>
      {orderDefinitions.country.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.country.format}<br />
      <strong>Example:</strong> {orderDefinitions.country.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.currency.externalId} type={orderDefinitions.currency.dataType} required={orderDefinitions.currency.required}>
      {orderDefinitions.currency.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.currency.format}<br />
      <strong>Example:</strong> {orderDefinitions.currency.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.shipping.externalId} type={orderDefinitions.shipping.dataType} required={orderDefinitions.shipping.required}>
      {orderDefinitions.shipping.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.shipping.format}<br />
      <strong>Example:</strong> {orderDefinitions.shipping.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.taxTotal.externalId} type={orderDefinitions.taxTotal.dataType} required={orderDefinitions.taxTotal.required}>
      {orderDefinitions.taxTotal.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.taxTotal.format}<br />
      <strong>Example:</strong> {orderDefinitions.taxTotal.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.total.externalId} type={orderDefinitions.total.dataType} required={orderDefinitions.total.required}>
      {orderDefinitions.total.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.total.format}<br />
      <strong>Example:</strong> {orderDefinitions.total.example}
    </ResponseField>
    <ResponseField name={orderDefinitions.updatedAt.externalId} type="datetime" required>
      {orderDefinitions.updatedAt.description}
      <br /><br />
      <strong>Format:</strong> {orderDefinitions.updatedAt.format}<br />
      <strong>Example:</strong> {orderDefinitions.updatedAt.example}
    </ResponseField>
  </>;

export const InventoryV2FieldsTabular = () => <>
    <ResponseField name={inventoryDefinitions.productId.externalId} type={inventoryDefinitions.productId.dataType} required>
      {inventoryDefinitions.productId.description}
      <br /><br />
      <strong>Example:</strong> {inventoryDefinitions.productId.example}
    </ResponseField>
    <ResponseField name={inventoryDefinitions.variantNo.externalId} type={inventoryDefinitions.variantNo.dataType} required>
      {inventoryDefinitions.variantNo.description}
      <br /><br />
      <strong>Example:</strong> {inventoryDefinitions.variantNo.example}
    </ResponseField>
    <ResponseField name={inventoryDefinitions.inventoryQuantity.externalId} type={inventoryDefinitions.inventoryQuantity.dataType} required>
      {inventoryDefinitions.inventoryQuantity.description}
      <br /><br />
      <strong>Format:</strong> {inventoryDefinitions.inventoryQuantity.format}<br />
      <strong>Example:</strong> {inventoryDefinitions.inventoryQuantity.example}
    </ResponseField>
    <ResponseField name={inventoryDefinitions.warehouse.externalId} type={inventoryDefinitions.warehouse.dataType} required>
      {inventoryDefinitions.warehouse.description}
      <br /><br />
      <strong>Example:</strong> {inventoryDefinitions.warehouse.example}
    </ResponseField>
    <ResponseField name={inventoryDefinitions.cogs.externalId} type={inventoryDefinitions.cogs.dataType} required>
      {inventoryDefinitions.cogs.description}
      <br /><br />
      <strong>Format:</strong> {inventoryDefinitions.cogs.format}<br />
      <strong>Example:</strong> {inventoryDefinitions.cogs.example}
    </ResponseField>
    <ResponseField name={inventoryDefinitions.currency.externalId} type={inventoryDefinitions.currency.dataType} required>
      {inventoryDefinitions.currency.description}
      <br /><br />
      <strong>Format:</strong> {inventoryDefinitions.currency.format}<br />
      <strong>Example:</strong> {inventoryDefinitions.currency.example}
    </ResponseField>
  </>;

export const productAttributeDefinitions = {
  "productId": {
    "level": "Required",
    "dataType": "string",
    "example": "AK0898",
    "format": "",
    "name": "productId",
    "description": "Unique product identifier. Must match the product ID used in your website's data layer and in orders/inventory data.",
    "optional": "❌",
    "required": true,
    "externalId": "PRODUCT_ID"
  },
  "variantNo": {
    "level": "Required",
    "dataType": "string",
    "example": "BUF036",
    "format": "",
    "name": "variantNo",
    "description": "Product variant number. Unique identifier of product variant (e.g., style, color, size combination).",
    "optional": "❌",
    "required": true,
    "externalId": "VARIANT_NO"
  },
  "name": {
    "level": "Required",
    "dataType": "string",
    "example": "Black Dress no. 1",
    "format": "",
    "name": "name",
    "description": "Product name.",
    "optional": "❌",
    "required": true,
    "externalId": "NAME"
  },
  "brand": {
    "level": "Optional",
    "dataType": "string",
    "example": "BrandA",
    "format": "",
    "name": "brand",
    "description": "Product brand.",
    "optional": "✔",
    "required": false,
    "externalId": "BRAND"
  },
  "category": {
    "level": "Optional",
    "dataType": "string",
    "example": "Apparel",
    "format": "",
    "name": "category",
    "description": "Product category.",
    "optional": "✔",
    "required": false,
    "externalId": "CATEGORY"
  },
  "subCategory": {
    "level": "Optional",
    "dataType": "string",
    "example": "Dresses",
    "format": "",
    "name": "subCategory",
    "description": "Product subcategory.",
    "optional": "✔",
    "required": false,
    "externalId": "SUB_CATEGORY"
  },
  "collection": {
    "level": "Optional",
    "dataType": "string",
    "example": "Summer 2024",
    "format": "",
    "name": "collection",
    "description": "Product collection.",
    "optional": "✔",
    "required": false,
    "externalId": "COLLECTION"
  },
  "gender": {
    "level": "Optional",
    "dataType": "string",
    "example": "Women",
    "format": "",
    "name": "gender",
    "description": "Gender targeting for the product.",
    "optional": "✔",
    "required": false,
    "externalId": "GENDER"
  },
  "color": {
    "level": "Optional",
    "dataType": "string",
    "example": "Black",
    "format": "",
    "name": "color",
    "description": "Color of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "COLOR"
  },
  "material": {
    "level": "Optional",
    "dataType": "string",
    "example": "Cotton",
    "format": "",
    "name": "material",
    "description": "Material of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "MATERIAL"
  },
  "size": {
    "level": "Optional",
    "dataType": "string",
    "example": "M",
    "format": "",
    "name": "size",
    "description": "Size of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "SIZE"
  },
  "gtin": {
    "level": "Optional",
    "dataType": "string",
    "example": "734567890123",
    "format": "",
    "name": "gtin",
    "description": "GTIN (barcode) of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "GTIN"
  },
  "imageUrls": {
    "level": "Optional",
    "dataType": "string",
    "example": "https://example.com/image.jpg",
    "format": "",
    "name": "imageUrls",
    "description": "Image URLs for the variant. Must be publicly accessible. Max size: 20MB.",
    "optional": "✔",
    "required": false,
    "externalId": "IMAGE_URLS",
    "multiValue": "✔"
  }
};

export const orderDefinitions = {
  "city": {
    "level": "Order header",
    "format": "",
    "example": "Stockholm",
    "dataType": "string",
    "name": "city",
    "description": "Customer's shipping city. Used for geographic analysis and reporting.",
    "optional": "✔",
    "required": false,
    "externalId": "CITY"
  },
  "cogs": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "200",
    "dataType": "number",
    "name": "cogs",
    "description": "Cost of Goods Sold per unit. Highest priority in COGS resolution — overrides inventory COGS when set. See COGS priority. Required if using MMM profitability-based optimization targets (NGP2 / NGP3).",
    "optional": "✔",
    "required": false,
    "externalId": "COGS"
  },
  "cogsCurrency": {
    "level": "Order line",
    "format": "ISO 4217",
    "example": "USD",
    "dataType": "string",
    "name": "cogsCurrency",
    "description": "Currency of the COGS value. Required when COGS is specified.",
    "optional": "Yes, unless COGS is set",
    "required": false,
    "externalId": "COGS_CURRENCY"
  },
  "country": {
    "level": "Order header",
    "format": "ISO 3166",
    "example": "SE",
    "dataType": "string",
    "name": "country",
    "description": "Customer's country code. Used for geographic segmentation and storefront mapping.",
    "optional": "❌",
    "required": true,
    "externalId": "COUNTRY"
  },
  "createdAt": {
    "level": "Order header",
    "format": "ISO 8601 - UTC",
    "example": "2025-01-13T11:36:45Z",
    "dataType": "date",
    "name": "createdAt",
    "description": "Timestamp when the order was placed. Used as the primary date for order analytics.",
    "optional": "❌",
    "required": true,
    "externalId": "CREATED_AT"
  },
  "currency": {
    "level": "Order header",
    "format": "ISO 4217",
    "example": "SEK",
    "dataType": "string",
    "name": "currency",
    "description": "Currency of all monetary values in the order (prices, totals, shipping, tax).",
    "optional": "❌",
    "required": true,
    "externalId": "CURRENCY"
  },
  "customAttribute1": {
    "level": "Order header",
    "format": "",
    "example": "VIP customer",
    "dataType": "string",
    "name": "customAttribute1",
    "description": "First custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_1"
  },
  "customAttribute2": {
    "level": "Order header",
    "format": "",
    "example": "Store name",
    "dataType": "string",
    "name": "customAttribute2",
    "description": "Second custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_3"
  },
  "customAttribute3": {
    "level": "Order header",
    "format": "",
    "example": "Seasonal sale",
    "dataType": "string",
    "name": "customAttribute3",
    "description": "Third custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_4"
  },
  "customAttribute4": {
    "level": "Order header",
    "format": "",
    "example": "Affiliate partner",
    "dataType": "string",
    "name": "customAttribute4",
    "description": "Fourth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_5"
  },
  "customAttribute5": {
    "level": "Order header",
    "format": "",
    "example": "Loyalty tier",
    "dataType": "string",
    "name": "customAttribute5",
    "description": "Fifth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_6"
  },
  "customAttribute6": {
    "level": "Order header",
    "format": "",
    "example": "Referral source",
    "dataType": "string",
    "name": "customAttribute6",
    "description": "Sixth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_11"
  },
  "customAttribute7": {
    "level": "Order header",
    "format": "",
    "example": "Order priority",
    "dataType": "string",
    "name": "customAttribute7",
    "description": "Seventh custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_12"
  },
  "customAttribute8": {
    "level": "Order header",
    "format": "",
    "example": "Gift order",
    "dataType": "string",
    "name": "customAttribute8",
    "description": "Eighth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_13"
  },
  "customAttribute9": {
    "level": "Order header",
    "format": "",
    "example": "Subscription ID",
    "dataType": "string",
    "name": "customAttribute9",
    "description": "Ninth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_14"
  },
  "customAttribute10": {
    "level": "Order header",
    "format": "",
    "example": "Cohort",
    "dataType": "string",
    "name": "customAttribute10",
    "description": "Tenth custom order attribute. Use for business-specific data like customer segments, sales channels, or campaign tags.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_15"
  },
  "customAttributeLine1": {
    "level": "Order line",
    "format": "",
    "example": "Bundle ID",
    "dataType": "string",
    "name": "customAttributeLine1",
    "description": "First custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_2"
  },
  "customAttributeLine2": {
    "level": "Order line",
    "format": "",
    "example": "Bundle name",
    "dataType": "string",
    "name": "customAttributeLine2",
    "description": "Second custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_7"
  },
  "customAttributeLine3": {
    "level": "Order line",
    "format": "",
    "example": "Subscription plan",
    "dataType": "string",
    "name": "customAttributeLine3",
    "description": "Third custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_8"
  },
  "customAttributeLine4": {
    "level": "Order line",
    "format": "",
    "example": "Custom engraving",
    "dataType": "string",
    "name": "customAttributeLine4",
    "description": "Fourth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_9"
  },
  "customAttributeLine5": {
    "level": "Order line",
    "format": "",
    "example": "Warranty type",
    "dataType": "string",
    "name": "customAttributeLine5",
    "description": "Fifth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_10"
  },
  "customAttributeLine6": {
    "level": "Order line",
    "format": "",
    "example": "Gift message",
    "dataType": "string",
    "name": "customAttributeLine6",
    "description": "Sixth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_16"
  },
  "customAttributeLine7": {
    "level": "Order line",
    "format": "",
    "example": "Assembly required",
    "dataType": "string",
    "name": "customAttributeLine7",
    "description": "Seventh custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_17"
  },
  "customAttributeLine8": {
    "level": "Order line",
    "format": "",
    "example": "Personalization",
    "dataType": "string",
    "name": "customAttributeLine8",
    "description": "Eighth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_18"
  },
  "customAttributeLine9": {
    "level": "Order line",
    "format": "",
    "example": "Return policy",
    "dataType": "string",
    "name": "customAttributeLine9",
    "description": "Ninth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_19"
  },
  "customAttributeLine10": {
    "level": "Order line",
    "format": "",
    "example": "Lot number",
    "dataType": "string",
    "name": "customAttributeLine10",
    "description": "Tenth custom line item attribute. Use for item-specific data like bundle identifiers, gift wrapping, or special handling.",
    "optional": "✔",
    "required": false,
    "externalId": "ORDER_CUSTOM_ATTRIBUTE_20"
  },
  "customerIdentifier": {
    "level": "Order header",
    "format": "",
    "example": "david@dema.ai",
    "dataType": "string",
    "name": "customerIdentifier",
    "description": "Unique customer identifier for cohort analysis and repeat purchase tracking. Can be customer ID, email, or hashed email.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOMER_IDENTIFIER",
    "default": "UNKNOWN"
  },
  "externalStorefrontId": {
    "level": "Order header",
    "format": "",
    "example": "CH-233",
    "dataType": "string",
    "name": "externalStorefrontId",
    "description": "Identifier for the storefront or sales channel where the order originated. Used to separate analytics by storefront.",
    "optional": "✔",
    "required": false,
    "externalId": "EXTERNAL_STOREFRONT_ID",
    "default": ""
  },
  "orderId": {
    "level": "Order header",
    "format": "",
    "example": "D12345",
    "dataType": "string",
    "name": "orderId",
    "description": "Unique order identifier from your e-commerce system. Used to link order lines and match with returns.",
    "optional": "❌",
    "required": true,
    "externalId": "ORDER_ID"
  },
  "originalPrice": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "1000",
    "dataType": "number",
    "name": "originalPrice",
    "description": "Full retail price per unit before any discounts. Including tax, excluding order-level voucher discounts.",
    "optional": "❌",
    "required": true,
    "externalId": "ORIGINAL_PRICE"
  },
  "paidPrice": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "900",
    "dataType": "number",
    "name": "paidPrice",
    "description": "Actual price paid per unit after item-level discounts. Including tax, excluding order-level voucher discounts.",
    "optional": "❌",
    "required": true,
    "externalId": "PAID_PRICE"
  },
  "paymentProvider": {
    "level": "Order header",
    "format": "",
    "example": "Klarna",
    "dataType": "string",
    "name": "paymentProvider",
    "description": "Payment method or provider used for the transaction (e.g., Klarna, Stripe, PayPal, Credit Card).",
    "optional": "✔",
    "required": false,
    "externalId": "PAYMENT_PROVIDER"
  },
  "productId": {
    "level": "Order line",
    "format": "",
    "example": "AK0898",
    "dataType": "string",
    "name": "productId",
    "description": "Unique product identifier. Must match the product ID used in your website's data layer for accurate attribution.",
    "optional": "❌",
    "required": true,
    "externalId": "PRODUCT_ID"
  },
  "promotionAmount": {
    "level": "Order line",
    "format": "",
    "example": "100",
    "dataType": "string",
    "name": "promotionAmount",
    "description": "Discount amount applied per unit from a promotion rule. Used for promotion performance analysis.",
    "optional": "✔",
    "required": false,
    "externalId": "PROMOTION_AMOUNT"
  },
  "promotionId": {
    "level": "Order line",
    "format": "",
    "example": "promotion-12345",
    "dataType": "string",
    "name": "promotionId",
    "description": "Identifier of the promotion rule applied to this item. Links to your promotion management system.",
    "optional": "✔",
    "required": false,
    "externalId": "PROMOTION_ID"
  },
  "promotionType": {
    "level": "Order line",
    "format": "FIXED | PERCENTAGE",
    "example": "FIXED",
    "dataType": "enum",
    "name": "promotionType",
    "description": "How the promotion discount is calculated. FIXED for absolute amounts, PERCENTAGE for percentage-based discounts.",
    "optional": "✔",
    "required": false,
    "externalId": "PROMOTION_TYPE"
  },
  "quantityDecimal": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "2.5",
    "dataType": "number",
    "name": "quantityDecimal",
    "description": "Number of units sold. Supports decimals for products sold by weight or length. Aggregate if multiple of the same variant.",
    "optional": "❌",
    "required": true,
    "externalId": "QUANTITY"
  },
  "region": {
    "level": "Order header",
    "format": "",
    "example": "California",
    "dataType": "string",
    "name": "region",
    "description": "State, province, or region for the order. Used for regional sales analysis and reporting.",
    "optional": "✔",
    "required": false,
    "externalId": "REGION"
  },
  "returnId": {
    "level": "Order line",
    "format": "",
    "example": "RETURN-1",
    "dataType": "string",
    "name": "returnId",
    "description": "Unique return identifier. Used for unreferenced returns when order ID is not available.",
    "optional": "❌",
    "required": true,
    "externalId": "RETURN_ID"
  },
  "returnedAt": {
    "level": "Order line",
    "format": "ISO 8601 - UTC",
    "example": "2025-01-14T11:36:45Z",
    "dataType": "date",
    "name": "returnedAt",
    "description": "Timestamp when the return was processed. Used to calculate time-to-return metrics.",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_AT"
  },
  "returnedQuantityDecimal": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "1.5",
    "dataType": "number",
    "name": "returnedQuantityDecimal",
    "description": "Number of units returned. Supports decimals for products sold by weight or length.",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_QUANTITY"
  },
  "returnedReason": {
    "level": "Order line",
    "format": "",
    "example": "TOO_SMALL",
    "dataType": "string",
    "name": "returnedReason",
    "description": "Customer's reason for returning the item (e.g., TOO_SMALL, DEFECTIVE, WRONG_ITEM, CHANGED_MIND).",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_REASON"
  },
  "returnedShipmentStatus": {
    "level": "Order line",
    "format": "CREATED | SHIPPED | DELIVERED | CANCELLED",
    "example": "DELIVERED",
    "dataType": "enum",
    "name": "returnedShipmentStatus",
    "description": "Current status of the return shipment tracking the item's journey back to the warehouse.",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_SHIPMENT_STATUS"
  },
  "returnedShipmentId": {
    "level": "Order line",
    "format": "",
    "example": "SHIP-RET-001",
    "dataType": "string",
    "name": "returnedShipmentId",
    "description": "Tracking identifier for the return shipment from the shipping carrier.",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_SHIPMENT_ID"
  },
  "returnedShippingProvider": {
    "level": "Order line",
    "format": "",
    "example": "UPS",
    "dataType": "string",
    "name": "returnedShippingProvider",
    "description": "Carrier handling the return shipment (e.g., UPS, FedEx, DHL, PostNord).",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_SHIPPING_PROVIDER"
  },
  "returnedWarehouse": {
    "level": "Order line",
    "format": "",
    "example": "Main Warehouse",
    "dataType": "string",
    "name": "returnedWarehouse",
    "description": "Destination warehouse where the returned item will be received and processed. Use the same warehouse names consistently across orders, inventory, and indeliveries — we recommend using human-readable names rather than internal IDs.",
    "optional": "✔",
    "required": false,
    "externalId": "RETURNED_WAREHOUSE"
  },
  "shipmentId": {
    "level": "Order line",
    "format": "",
    "example": "SHIP-001",
    "dataType": "string",
    "name": "shipmentId",
    "description": "Tracking identifier for the outbound shipment from the shipping carrier.",
    "optional": "✔",
    "required": false,
    "externalId": "SHIPMENT_ID"
  },
  "shipmentStatus": {
    "level": "Order line",
    "format": "CREATED | SHIPPED | DELIVERED | CANCELLED",
    "example": "CREATED",
    "dataType": "enum",
    "name": "shipmentStatus",
    "description": "Current status of the outbound shipment tracking the item's delivery to the customer.",
    "optional": "✔",
    "required": false,
    "externalId": "SHIPMENT_STATUS"
  },
  "shipping": {
    "level": "Order header",
    "format": "Non-negative",
    "example": "80",
    "dataType": "number",
    "name": "shipping",
    "description": "Total shipping fees charged to the customer, including tax. Set to 0 for free shipping.",
    "optional": "❌",
    "required": true,
    "externalId": "SHIPPING"
  },
  "shippingProvider": {
    "level": "Order header",
    "format": "",
    "example": "UPS",
    "dataType": "string",
    "name": "shippingProvider",
    "description": "Primary carrier for the order (e.g., UPS, FedEx, DHL, PostNord). Can be overridden per line item.",
    "optional": "✔",
    "required": false,
    "externalId": "SHIPPING_PROVIDER"
  },
  "shippingProviderLine": {
    "level": "Order line",
    "format": "",
    "example": "UPS",
    "dataType": "string",
    "name": "shippingProviderLine",
    "description": "Carrier for this specific line item. Use when items ship from different locations or via different carriers.",
    "optional": "✔",
    "required": false,
    "externalId": "SHIPPING_PROVIDER_LINE"
  },
  "status": {
    "level": "Order header",
    "format": "PENDING | IN_PROGRESS | COMPLETED | CANCELLED",
    "example": "PENDING",
    "dataType": "enum",
    "name": "status",
    "description": "Overall order fulfillment status. CANCELLED orders are excluded from revenue calculations by default.",
    "optional": "✔",
    "required": false,
    "externalId": "STATUS",
    "default": "UNKNOWN"
  },
  "statusLine": {
    "level": "Order line",
    "format": "PENDING | IN_PROGRESS | COMPLETED | CANCELLED",
    "example": "PENDING",
    "dataType": "enum",
    "name": "statusLine",
    "description": "Fulfillment status for this specific line item. Overrides the order-level status when set.",
    "optional": "✔",
    "required": false,
    "externalId": "STATUS_LINE",
    "default": "UNKNOWN"
  },
  "tax": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "30",
    "dataType": "number",
    "name": "tax",
    "description": "Tax amount per unit based on paid price.",
    "optional": "No, unless tax rate is set",
    "required": false,
    "externalId": "TAX"
  },
  "taxRate": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "25",
    "dataType": "number",
    "name": "taxRate",
    "description": "Tax rate as a percentage (e.g., 25 for 25% VAT).",
    "optional": "No, unless tax is set",
    "required": false,
    "externalId": "TAX_RATE"
  },
  "taxTotal": {
    "level": "Order header",
    "format": "Non-negative",
    "example": "200",
    "dataType": "number",
    "name": "taxTotal",
    "description": "Total tax for the entire order, including product tax and shipping tax. Based on final paid amounts.",
    "optional": "❌",
    "required": true,
    "externalId": "TAX_TOTAL"
  },
  "total": {
    "level": "Order header",
    "format": "Non-negative",
    "example": "3000",
    "dataType": "number",
    "name": "total",
    "description": "Final order amount paid by customer after all discounts. Includes tax but excludes shipping. Includes cancelled items.",
    "optional": "❌",
    "required": true,
    "externalId": "TOTAL"
  },
  "type": {
    "level": "Order header",
    "format": "",
    "example": "ONLINE",
    "dataType": "string",
    "name": "type",
    "description": "Sales channel type (e.g., ONLINE, RETAIL, WHOLESALE, MARKETPLACE). Used to segment order analytics.",
    "optional": "✔",
    "required": false,
    "externalId": "TYPE",
    "default": "ONLINE"
  },
  "updatedAt": {
    "level": "Order header",
    "format": "ISO 8601 - UTC",
    "example": "2025-01-13T11:36:45Z",
    "dataType": "date",
    "name": "updatedAt",
    "description": "Timestamp of the last order modification. Required when updating existing orders with new data.",
    "optional": "✔",
    "required": false,
    "externalId": "UPDATED_AT"
  },
  "variantNo": {
    "level": "Order line",
    "format": "",
    "example": "BUF036",
    "dataType": "string",
    "name": "variantNo",
    "description": "Unique variant identifier combining attributes like size and color. Must match inventory data for COGS lookup.",
    "optional": "❌",
    "required": true,
    "externalId": "VARIANT_NO"
  },
  "voucher": {
    "level": "Order header",
    "format": "",
    "example": "BLACK_WEEK25",
    "dataType": "string",
    "name": "voucher",
    "description": "Voucher or discount code entered by the customer at checkout. Used for campaign performance tracking.",
    "optional": "✔",
    "required": false,
    "externalId": "VOUCHER"
  },
  "voucherDiscount": {
    "level": "Order header",
    "format": "",
    "example": "1000",
    "dataType": "number",
    "name": "voucherDiscount",
    "description": "Total discount amount applied by the voucher code. Deducted from order total.",
    "optional": "✔",
    "required": false,
    "externalId": "VOUCHER_DISCOUNT"
  },
  "voucherType": {
    "level": "Order header",
    "format": "",
    "example": "DISCOUNT",
    "dataType": "string",
    "name": "voucherType",
    "description": "Category of voucher (e.g., DISCOUNT, FREE_SHIPPING, GIFT_CARD, LOYALTY_REWARD). Used for voucher analysis.",
    "optional": "✔",
    "required": false,
    "externalId": "VOUCHER_TYPE"
  },
  "warehouse": {
    "level": "Order line",
    "format": "",
    "example": "Main Warehouse",
    "dataType": "string",
    "name": "warehouse",
    "description": "Fulfillment warehouse for this line item. Use the same warehouse names consistently across orders, inventory, and indeliveries — we recommend using human-readable names rather than internal IDs.",
    "optional": "❌",
    "required": true,
    "externalId": "WAREHOUSE"
  },
  "estimatedCogs": {
    "level": "Order line",
    "format": "Non-negative",
    "example": "200",
    "dataType": "number",
    "name": "estimatedCogs",
    "description": "Estimated Cost of Goods Sold per unit. Used as a fallback when actual COGS is not available from orders or inventory. See COGS priority.",
    "optional": "✔",
    "required": false,
    "externalId": "ESTIMATED_COGS"
  },
  "estimatedCogsCurrency": {
    "level": "Order line",
    "format": "ISO 4217",
    "example": "USD",
    "dataType": "string",
    "name": "estimatedCogsCurrency",
    "description": "Currency of the estimated COGS value. Required when estimatedCogs is specified.",
    "optional": "Yes, unless estimatedCogs is set",
    "required": false,
    "externalId": "ESTIMATED_COGS_CURRENCY"
  },
  "zipCode": {
    "level": "Order header",
    "format": "No space",
    "example": "11613",
    "dataType": "string",
    "name": "zipCode",
    "description": "Customer's postal code without spaces. Used for geographic analysis and delivery zone reporting. Required if using incrementality testing — geo-experiments use postal code zones to define treatment and control regions.",
    "optional": "✔",
    "required": false,
    "externalId": "ZIP_CODE"
  }
};

export const inventoryDefinitions = {
  "date": {
    "level": "Row level",
    "dataType": "date",
    "example": "2025-06-15",
    "format": "YYYY-MM-DD",
    "name": "date",
    "description": "Snapshot date of the inventory record. Required when multiple inventory snapshots can exist at the same time.",
    "optional": "❌",
    "required": true,
    "externalId": "DATE",
    "multiValue": "❌"
  },
  "brand": {
    "level": "Product level",
    "dataType": "string",
    "example": "BrandA",
    "format": "",
    "name": "brand",
    "description": "Product brand.",
    "optional": "✔",
    "required": false,
    "externalId": "BRAND",
    "multiValue": "❌"
  },
  "category": {
    "level": "Product level",
    "dataType": "string",
    "example": "Apparel",
    "format": "",
    "name": "category",
    "description": "Product category.",
    "optional": "✔",
    "required": false,
    "externalId": "CATEGORY",
    "multiValue": "❌"
  },
  "cogs": {
    "level": "Variant level",
    "dataType": "number",
    "example": 120,
    "format": "Non-negative",
    "name": "cogs",
    "description": "Purchase price of the variant. Used as a fallback when order-level COGS is not set. See COGS priority.",
    "optional": "❌",
    "required": true,
    "externalId": "COGS",
    "multiValue": "❌"
  },
  "gtin": {
    "level": "Variant level",
    "dataType": "string",
    "example": "734567890123",
    "format": "",
    "name": "gtin",
    "description": "GTIN of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "GTIN",
    "multiValue": "❌"
  },
  "collection": {
    "level": "Product level",
    "dataType": "string",
    "example": "Summer collection",
    "format": "",
    "name": "collection",
    "description": "Product collection.",
    "optional": "✔",
    "required": false,
    "externalId": "COLLECTION",
    "multiValue": "❌"
  },
  "color": {
    "level": "Variant level",
    "dataType": "string",
    "example": "Black",
    "format": "",
    "name": "color",
    "description": "Color of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "COLOR",
    "multiValue": "❌"
  },
  "currency": {
    "level": "Product level",
    "dataType": "string",
    "example": "SEK",
    "format": "ISO 4217",
    "name": "currency",
    "description": "Currency code for purchase price.",
    "optional": "❌",
    "required": true,
    "externalId": "CURRENCY",
    "multiValue": "❌"
  },
  "customAttribute1": {
    "level": "Variant level",
    "dataType": "string",
    "example": "season-2024",
    "format": "",
    "name": "customAttribute1",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_1",
    "multiValue": "❌"
  },
  "customAttribute2": {
    "level": "Variant level",
    "dataType": "string",
    "example": "Kids",
    "format": "",
    "name": "customAttribute2",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_2",
    "multiValue": "❌"
  },
  "customAttribute3": {
    "level": "Variant level",
    "dataType": "string",
    "example": "sustainable",
    "format": "",
    "name": "customAttribute3",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_3",
    "multiValue": "❌"
  },
  "customAttribute4": {
    "level": "Variant level",
    "dataType": "string",
    "example": "limited-edition",
    "format": "",
    "name": "customAttribute4",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_4",
    "multiValue": "❌"
  },
  "customAttribute5": {
    "level": "Variant level",
    "dataType": "string",
    "example": "bestseller",
    "format": "",
    "name": "customAttribute5",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_5",
    "multiValue": "❌"
  },
  "customAttribute6": {
    "level": "Variant level",
    "dataType": "string",
    "example": "eco-friendly",
    "format": "",
    "name": "customAttribute6",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_6",
    "multiValue": "❌"
  },
  "customAttribute7": {
    "level": "Variant level",
    "dataType": "string",
    "example": "new-arrival",
    "format": "",
    "name": "customAttribute7",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_7",
    "multiValue": "❌"
  },
  "customAttribute8": {
    "level": "Variant level",
    "dataType": "string",
    "example": "sale-item",
    "format": "",
    "name": "customAttribute8",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_8",
    "multiValue": "❌"
  },
  "customAttribute9": {
    "level": "Variant level",
    "dataType": "string",
    "example": "gift-ready",
    "format": "",
    "name": "customAttribute9",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_9",
    "multiValue": "❌"
  },
  "customAttribute10": {
    "level": "Variant level",
    "dataType": "string",
    "example": "premium",
    "format": "",
    "name": "customAttribute10",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_10",
    "multiValue": "❌"
  },
  "customAttribute11": {
    "level": "Variant level",
    "dataType": "string",
    "example": "exclusive",
    "format": "",
    "name": "customAttribute11",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_11",
    "multiValue": "❌"
  },
  "customAttribute12": {
    "level": "Variant level",
    "dataType": "string",
    "example": "handmade",
    "format": "",
    "name": "customAttribute12",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_12",
    "multiValue": "❌"
  },
  "customAttribute13": {
    "level": "Variant level",
    "dataType": "string",
    "example": "imported",
    "format": "",
    "name": "customAttribute13",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_13",
    "multiValue": "❌"
  },
  "customAttribute14": {
    "level": "Variant level",
    "dataType": "string",
    "example": "organic",
    "format": "",
    "name": "customAttribute14",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_14",
    "multiValue": "❌"
  },
  "customAttribute15": {
    "level": "Variant level",
    "dataType": "string",
    "example": "vegan",
    "format": "",
    "name": "customAttribute15",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_15",
    "multiValue": "❌"
  },
  "customAttribute16": {
    "level": "Variant level",
    "dataType": "string",
    "example": "recycled",
    "format": "",
    "name": "customAttribute16",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_16",
    "multiValue": "❌"
  },
  "customAttribute17": {
    "level": "Variant level",
    "dataType": "string",
    "example": "vintage",
    "format": "",
    "name": "customAttribute17",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_17",
    "multiValue": "❌"
  },
  "customAttribute18": {
    "level": "Variant level",
    "dataType": "string",
    "example": "clearance",
    "format": "",
    "name": "customAttribute18",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_18",
    "multiValue": "❌"
  },
  "customAttribute19": {
    "level": "Variant level",
    "dataType": "string",
    "example": "preorder",
    "format": "",
    "name": "customAttribute19",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_19",
    "multiValue": "❌"
  },
  "customAttribute20": {
    "level": "Variant level",
    "dataType": "string",
    "example": "backorder",
    "format": "",
    "name": "customAttribute20",
    "description": "Additional custom attribute for product or variant.",
    "optional": "✔",
    "required": false,
    "externalId": "CUSTOM_ATTRIBUTE_20",
    "multiValue": "❌"
  },
  "gender": {
    "level": "Product level",
    "dataType": "string",
    "example": "Women",
    "format": "",
    "name": "gender",
    "description": "Gender targeting for the product.",
    "optional": "✔",
    "required": false,
    "externalId": "GENDER",
    "multiValue": "❌"
  },
  "imageUrls": {
    "level": "Variant level",
    "dataType": "string",
    "example": "https://example.com/image.jpg",
    "format": "",
    "name": "imageUrls",
    "description": "Image URLs for the variant. Must be a publicly accessible URL. Max size: 20MB.",
    "optional": "✔",
    "required": false,
    "externalId": "IMAGE_URLS",
    "multiValue": "✔"
  },
  "inventoryQuantity": {
    "level": "Variant level",
    "dataType": "number",
    "example": 124,
    "format": "Non-negative",
    "name": "inventoryQuantity",
    "description": "Available inventory quantity.",
    "optional": "❌",
    "required": true,
    "externalId": "QUANTITY",
    "multiValue": "❌"
  },
  "material": {
    "level": "Variant level",
    "dataType": "string",
    "example": "Polyester",
    "format": "",
    "name": "material",
    "description": "Material of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "MATERIAL",
    "multiValue": "❌"
  },
  "name": {
    "level": "Product level",
    "dataType": "string",
    "example": "Black Dress no. 1",
    "format": "",
    "name": "name",
    "description": "Product name.",
    "optional": "❌",
    "required": true,
    "externalId": "NAME",
    "multiValue": "❌"
  },
  "productId": {
    "level": "Product level",
    "dataType": "string",
    "example": "AK0898",
    "format": "",
    "name": "productId",
    "description": "Unique product identifier. Same as in your datalayer on the website.",
    "optional": "❌",
    "required": true,
    "externalId": "PRODUCT_ID",
    "multiValue": "❌"
  },
  "size": {
    "level": "Variant level",
    "dataType": "string",
    "example": "M",
    "format": "",
    "name": "size",
    "description": "Size of the product variant.",
    "optional": "✔",
    "required": false,
    "externalId": "SIZE",
    "multiValue": "❌"
  },
  "subCategory": {
    "level": "Product level",
    "dataType": "string",
    "example": "Dresses",
    "format": "",
    "name": "subCategory",
    "description": "Product subcategory.",
    "optional": "✔",
    "required": false,
    "externalId": "SUB_CATEGORY",
    "multiValue": "❌"
  },
  "variantNo": {
    "level": "Variant level",
    "dataType": "string",
    "example": "BUF036",
    "format": "",
    "name": "variantNo",
    "description": "Product variant number. Unique identifier of product variant (eg. style, color, size).",
    "optional": "❌",
    "required": true,
    "externalId": "VARIANT_NO",
    "multiValue": "❌"
  },
  "warehouse": {
    "level": "Variant level",
    "format": "",
    "example": "Main Warehouse",
    "dataType": "string",
    "name": "warehouse",
    "description": "Warehouse identifier. Use the same warehouse names consistently across orders, inventory, and indeliveries — we recommend using human-readable names rather than internal IDs.",
    "optional": "❌",
    "required": true,
    "externalId": "WAREHOUSE",
    "multiValue": "❌"
  }
};

export const indeliveryDefinitions = {
  "indeliveryDate": {
    "level": "Variant level",
    "format": "ISO 8601",
    "example": "2025-02-20",
    "dataType": "date",
    "name": "indeliveryDate",
    "description": "Expected or actual date of delivery for the items to the warehouse.",
    "optional": "❌",
    "required": true,
    "externalId": "INDELIVERY_DATE"
  },
  "productId": {
    "level": "Product level",
    "format": "",
    "example": "AK0898",
    "dataType": "string",
    "name": "productId",
    "description": "Unique product identifier.",
    "optional": "❌",
    "required": true,
    "externalId": "PRODUCT_ID"
  },
  "quantity": {
    "level": "Variant level",
    "format": "Non-negative",
    "example": "1",
    "dataType": "number",
    "name": "quantity",
    "description": "Quantity of items in delivery.",
    "optional": "❌",
    "required": true,
    "externalId": "QUANTITY"
  },
  "variantNo": {
    "level": "Variant level",
    "format": "",
    "example": "BUF036",
    "dataType": "string",
    "name": "variantNo",
    "description": "Product variant number. Unique identifier of product variant (eg. style, color, size).",
    "optional": "❌",
    "required": true,
    "externalId": "VARIANT_NO"
  },
  "warehouse": {
    "level": "Variant level",
    "format": "",
    "example": "Main Warehouse",
    "dataType": "string",
    "name": "warehouse",
    "description": "Warehouse identifier. Use the same warehouse names consistently across orders, inventory, and indeliveries — we recommend using human-readable names rather than internal IDs.",
    "optional": "✔",
    "required": false,
    "externalId": "WAREHOUSE"
  }
};

## Supported data types

<CardGroup cols={3}>
  <Card title="Indeliveries" icon="truck" href="#indeliveries">
    Incoming products
  </Card>

  <Card title="Inventory" icon="boxes-stacked" href="#inventory">
    Stock levels
  </Card>

  <Card title="Orders" icon="file-invoice-dollar" href="#orders">
    Customer transactions
  </Card>

  <Card title="Product Attributes" icon="tags" href="#product-attributes">
    Product metadata & descriptions
  </Card>
</CardGroup>

<SupportedOrderTypesNote />

## Prerequisites

Before setting up the BigQuery integration, ensure you have:

* A Google Cloud project with **BigQuery** enabled
* Tables or views in BigQuery containing your data, with columns matching our [schema](#data-schema)
* A Google Cloud service account with **BigQuery Data Viewer** and **BigQuery Job User** roles granted on the relevant dataset(s)

## Good to know

<AccordionGroup>
  <Accordion title="COGS priority" icon="ranking-star">
    <CogsPriority uppercase />
  </Accordion>

  <Accordion title="Storefront assignment" icon="store">
    If you operate multiple storefronts, include `EXTERNAL_STOREFRONT_ID` in your data for per-row storefront assignment.

    #### Merchant mappings

    <MerchantMappings />
  </Accordion>

  <Accordion title="Column naming" icon="font">
    BigQuery column names are **case-sensitive**. Ensure your column names exactly match the names specified in the [Data schema](#data-schema) section below (all upper-case, e.g. `ORDER_ID`, `PRODUCT_ID`).
  </Accordion>

  <Accordion title="Data types" icon="database">
    Use standard BigQuery SQL types when creating your tables. The recommended mappings are:

    | Dema type | BigQuery type                       |
    | --------- | ----------------------------------- |
    | String    | `STRING`                            |
    | Integer   | `INT64`                             |
    | Decimal   | `FLOAT64` or `NUMERIC`              |
    | Boolean   | `BOOL`                              |
    | Date      | `DATE`                              |
    | Timestamp | `TIMESTAMP`                         |
    | Array     | `REPEATED` mode on the field's type |
  </Accordion>
</AccordionGroup>

## Step-by-step integration guide

<Steps>
  <Step title="Create a service account">
    In the [Google Cloud Console](https://console.cloud.google.com/iam-admin/serviceaccounts), create a dedicated service account for the Dema integration:

    1. Go to **IAM & Admin → Service Accounts** and click **Create service account**.
    2. Give it a descriptive name (e.g. `dema-bigquery-reader`).
    3. Grant the following roles on the project or at the dataset level:
       * **BigQuery Data Viewer** — allows reading table data.
       * **BigQuery Job User** — allows running query jobs.
    4. Click **Done** to save the service account.
  </Step>

  <Step title="Generate a service account key">
    1. Open the service account you just created and navigate to the **Keys** tab.
    2. Click **Add Key → Create new key** and choose **JSON**.
    3. Download the generated `.json` key file — you will share this with your Customer Success Manager.

    <Warning>
      Keep the key file secure. Anyone with access to it can read your BigQuery data.
    </Warning>
  </Step>

  <Step title="Share credentials">
    Provide the following information to your Customer Success Manager:

    <Note>
      Send the key file and connection details via secure password sharing.
    </Note>

    ```json Example theme={null}
    {
      "type": "service_account",
      "project_id": "your-gcp-project-id",
      "private_key_id": "abc123...",
      "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
      "client_email": "dema-bigquery-reader@your-gcp-project-id.iam.gserviceaccount.com",
      "client_id": "123456789",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "dataset": "your_dataset",
      "table": "your_table"
    }
    ```
  </Step>

  <Step title="Specifying data tables and schema">
    Ensure each BigQuery table or view aligns with [our schema](#data-schema). Columns must be named exactly as specified below. This is crucial for accurate data integration.
  </Step>

  <Step title="Finalizing integration">
    After sharing credentials and verifying the data mapping, our team will finalise the integration, enabling data flow from BigQuery into our platform.
  </Step>
</Steps>

<Note> **Multiple values** Some fields allow multiple values. These fields should be stored as a `REPEATED` (array) column, e.g. `["value1", "value2", "value3"]`. </Note>

***

## Data schema

### Indeliveries

Track incoming product deliveries to your warehouses.

<AccordionGroup>
  <Accordion title="All fields" icon="list">
    **Required:**

    <IndeliveriesRequiredFieldsTabular />

    **Optional:**

    <IndeliveriesOptionalFieldsTabular />
  </Accordion>
</AccordionGroup>

***

### Inventory

Stock levels across your warehouses. Product attributes (name, brand, category, etc.) are sent separately via [Product Attributes](#product-attributes). See [COGS priority](#cogs-priority) for how cost values are resolved.

<AccordionGroup>
  <Accordion title="Fields" icon="list" defaultOpen>
    <InventoryV2FieldsTabular />
  </Accordion>
</AccordionGroup>

***

### Orders

Customer transaction data including order details and line items. See [COGS priority](#cogs-priority) for how cost values are resolved.

<AccordionGroup>
  <OrderStructureNote />

  <Accordion title="Order header fields" icon="file-invoice">
    **Required:**

    <OrderHeaderRequiredFieldsTabular />

    **Optional:**

    <OrderHeaderOptionalFieldsTabular />
  </Accordion>

  <Accordion title="Order line fields" icon="list-ul">
    **Required:**

    <OrderLineRequiredFieldsTabular />

    **Optional:**

    <OrderLineOptionalFieldsTabular />
  </Accordion>

  <Accordion title="Return fields (within orders)" icon="rotate-left">
    Include these fields to record returns directly in your orders table.

    <OrderReturnFieldsTabular />
  </Accordion>

  <Accordion title="Custom attributes" icon="tags">
    **Order header level:**

    <OrderCustomHeaderAttributesTabular />

    **Order line level:**

    <OrderCustomLineAttributesTabular />
  </Accordion>
</AccordionGroup>

***

### Product Attributes

<ProductAttributesV2Note />

Product metadata including names, categories, and descriptive attributes for your catalog.

<AccordionGroup>
  <Accordion title="Required fields" icon="asterisk" defaultOpen>
    <ProductAttributesRequiredFieldsTabular />
  </Accordion>

  <Accordion title="Optional fields" icon="list">
    <ProductAttributesOptionalFieldsTabular />
  </Accordion>

  <Accordion title="Custom attributes" icon="tags">
    <ProductAttributesCustomAttributesTabular />
  </Accordion>
</AccordionGroup>

***

## Troubleshooting and support

For common issues and solutions, contact our support team directly for assistance.

## Additional resources

* Google Cloud service account documentation: [Creating and managing service accounts](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
* BigQuery access control: [BigQuery IAM roles](https://cloud.google.com/bigquery/docs/access-control)
* BigQuery data types reference: [BigQuery data types](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types)
