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 type | Metafield key | Description |
|---|---|---|
| Invoice | invoice_url | Sellsy invoice URL |
| Order | order_url | Sellsy purchase order URL |
| Quote | estimate_url | Sellsy quote URL |
| Credit note | creditnote_url | Sellsy credit note URL |
| Delivery note | delivery_url | Sellsy delivery note URL |
| Proforma | proforma_url | Sellsy 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:
- Go to Orders > All orders
- Click an order
- 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 type | meta_data key | Description |
|---|---|---|
| Invoice | orderinvoicer.invoice_url | Sellsy invoice URL |
| Order | orderinvoicer.order_url | Sellsy purchase order URL |
| Quote | orderinvoicer.estimate_url | Sellsy quote URL |
| Credit note | orderinvoicer.creditnote_url | Sellsy credit note URL |
| Delivery note | orderinvoicer.delivery_url | Sellsy delivery note URL |
| Proforma | orderinvoicer.proforma_url | Sellsy proforma document URL |
Accessing metadata in WooCommerce
Via the REST API:
GET /wp-json/wc/v3/orders/{id}Via the WordPress interface:
- Go to WooCommerce > Orders
- Click an order
- 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