Order Invoicer

Order metadata

Understand the metadata automatically added to orders

Overview

Order Invoicer automatically adds metadata to your orders to maintain traceability between your e-commerce platform and your invoicing software. This metadata makes it easy to link orders to the documents that are generated (invoices, quotes, purchase orders, etc.).

Types of metadata

Traceability metadata

The following metadata is added automatically to each processed order:

Invoice URL

Link to the invoice generated in Sellsy

Order URL

Link to the purchase order in Sellsy

Quote URL

Link to the quote generated in Sellsy

Credit note URL

Link to the credit note in Sellsy

Delivery note URL

Link to the delivery note in Sellsy

Proforma URL

Link to the proforma document in Sellsy

Supported platforms

Shopify

In Shopify, metadata is stored as metafields on orders.

Metafield structure

{
  "ownerId": "gid://shopify/Order/123456789",
  "key": "invoice_url",
  "value": "https://app.sellsy.com/invoice/12345",
  "type": "url"
}

Shopify metadata keys

Document typeMetafield keyDescription
Invoiceinvoice_urlSellsy invoice URL
Orderorder_urlSellsy purchase order URL
Quoteestimate_urlSellsy quote URL
Credit notecreditnote_urlSellsy credit note URL
Delivery notedelivery_urlSellsy delivery note URL
Proformaproforma_urlSellsy proforma document URL

Accessing metadata in Shopify

Via the GraphQL API:

query getOrderMetafields($id: ID!) {
  order(id: $id) {
    metafields(first: 10) {
      edges {
        node {
          key
          value
          type
        }
      }
    }
  }
}

Via the Shopify interface:

  1. Go to Orders > All orders
  2. Click an order
  3. In the Metafields section, you will see the URLs of the generated documents

Download button for your customers

Order Invoicer provides an app block that you can add to your Shopify theme to let your customers download their invoices directly from their customer account.

The button only appears when the invoice_url metafield is present on the order.

Learn more: See our download button installation guide for the full setup.

WooCommerce

In WooCommerce, metadata is stored as meta_data on orders.

meta_data structure

{
  "meta_data": [
    {
      "key": "orderinvoicer.invoice_url",
      "value": "https://app.sellsy.com/invoice/12345"
    }
  ]
}

WooCommerce metadata keys

Document typemeta_data keyDescription
Invoiceorderinvoicer.invoice_urlSellsy invoice URL
Orderorderinvoicer.order_urlSellsy purchase order URL
Quoteorderinvoicer.estimate_urlSellsy quote URL
Credit noteorderinvoicer.creditnote_urlSellsy credit note URL
Delivery noteorderinvoicer.delivery_urlSellsy delivery note URL
Proformaorderinvoicer.proforma_urlSellsy proforma document URL

Accessing metadata in WooCommerce

Via the REST API:

GET /wp-json/wc/v3/orders/{id}

Via the WordPress interface:

  1. Go to WooCommerce > Orders
  2. Click an order
  3. In the Custom data tab, you will see the Order Invoicer metadata

Practical use

Order traceability

The metadata lets you:

  • Quickly find the Sellsy document corresponding to an order
  • Check the processing status of an order
  • Access documents directly from your e-commerce platform
  • Keep both systems consistent

Integration with third-party tools

You can use this metadata to:

  • Automate workflows based on the document URLs
  • Create cross-referenced reports between e-commerce and invoicing
  • Build custom integrations
  • Sync statuses between platforms

Usage examples

Shopify verification script

// Check whether an order has been processed
async function checkOrderProcessed(orderId) {
  const order = await shopify.order.get(orderId);
  const metafields = order.metafields;
  
  const invoiceUrl = metafields.find(m => m.key === 'invoice_url');
  if (invoiceUrl) {
    console.log('Commande traitée - Facture:', invoiceUrl.value);
  }
}

WooCommerce verification script

// Check whether an order has been processed
function check_order_processed($order_id) {
    $order = wc_get_order($order_id);
    $invoice_url = $order->get_meta('orderinvoicer.invoice_url');
    
    if ($invoice_url) {
        echo 'Commande traitée - Facture: ' . $invoice_url;
    }
}

Error handling

Troubleshooting

If the metadata is not being added, check:

  • The API permissions of your e-commerce platform
  • The error logs in your Order Invoicer dashboard

On this page