# Capture order company name to metafield

Copies the company name from order addresses into an order metafield at creation time.

Canonical URL: https://templates.jsworkflows.com/templates/capture-order-company-name-to-metafield/

## When to use this template

This template is built for Shopify stores using the JsWorkflows app.

Use this template when you want a ready-made workflow for this use case: Copies the company name from order addresses into an order metafield at creation time.

It is designed for Shopify B2B operations and gives you a production-ready starting point instead of building the automation from scratch.

This workflow uses the Shopify webhook trigger model and starts from the "Order created" trigger. It includes setup fields for merchant-facing values, so you can configure the workflow before installing it.

## Metadata

- Category: B2B
- Trigger: Order created
- Workflow type: Shopify webhook
- Complexity: easy
- Usage class: starter-friendly

## Connected services

- None

## Additional Shopify scopes

- write_orders

## Setup fields

- Metafield namespace (`ORDER_METAFIELD_NAMESPACE`)
  - Type: text
  - Storage: config
  - Required: yes
  - Description: Namespace for the order metafield that will store the company name.
- Metafield key (`ORDER_METAFIELD_KEY`)
  - Type: text
  - Storage: config
  - Required: yes
  - Description: Key for the order metafield that will store the company name.
- Metafield type (`ORDER_METAFIELD_TYPE`)
  - Type: text
  - Storage: config
  - Required: yes
  - Description: Metafield type used when writing the company name.

## Setup guide

## Before you start

This template writes the company name found on a new order into an order metafield. It uses the shipping company when available and falls back to the billing company.

## Configure in setup

- `Metafield namespace`: namespace to write on the order
- `Metafield key`: key to write on the order
- `Metafield type`: metafield type, usually `single_line_text_field`

## Notes

- Orders with no company name in either address are skipped
- The workflow writes directly to the order metafield using Shopify GraphQL

