How it works

Follow these 13 simple steps to start creating Katana sales orders from Square orders automatically

Square logo icon

Order Created

App connector: Square • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger captures Square orders the instant they're placed through POS or online checkout, enabling immediate workflow initiation that ensures production teams have order visibility without manual entry or delays.

When an order is created in Square (through Square POS, online ordering, or API), Square sends a webhook to MESA triggering this workflow. The webhook captures complete order data including customer ID, line items with catalog object IDs and quantities, total amounts, currency, discounts, and timestamps.

Retrieve Customer

App connector: Square • Time to complete: 0 minutes (Auto-configured)
Why this matters: Fetches complete customer information including contact details and shipping address needed for creating comprehensive Katana customer records and sales orders with proper fulfillment data.

This step retrieves the Square customer record using the customer ID from the order webhook. It returns complete customer data including given name, family name, company name, email address, phone number, and complete address with all components. This comprehensive data enables creation of detailed Katana customer and sales order records.

Loop over Square line items

App connector: Loop • Time to complete: 1 minute
Why this matters: Processes each product in the order separately to collect SKUs, ensuring multi-item orders capture all products needed for Katana variant matching and sales order line item creation.

This loop iterates through the order's line items array. For every product, the loop executes catalog object retrieval to fetch SKU information. This per-product processing builds the SKU list needed for Katana product matching in later steps.

Retrieve Catalog Object

App connector: Square • Time to complete: 0 minutes (Auto-configured)
Why this matters: Fetches complete product catalog information including SKU from Square's catalog system, providing the product identifier needed to match Square products with Katana manufacturing variants.

This step retrieves the Square catalog object using the catalog object ID from the line item. It returns catalog data including item variation details with SKU, pricing, and product attributes. The SKU is captured for Katana product matching.

Get List of Customers

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Searches Katana for an existing customer record using email address to determine whether to create a new customer or use an existing one, preventing duplicate customer records in the manufacturing system.

This step queries Katana's customer database using the Square customer's email address with limit 1 to return only the first match. It searches for customers matching the email and returns customer records including Katana customer ID if found. If no match exists, the array is empty.

Paths

App connector: Paths • Time to complete: 0 minutes (Auto-configured)
Why this matters: Creates a decision point that routes the workflow down different paths based on whether the customer exists in Katana, enabling conditional processing that handles both new and existing customers appropriately.

This Paths step establishes a branching structure with two possible routes: Path 1 (customer exists) and Path 2 (customer doesn't exist). The workflow evaluates conditions on each path and executes the appropriate branch. This prevents attempting to create duplicate customers or referencing customer IDs that don't exist.

Path 1 Rule - Has Existing Customer

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Evaluates whether a Katana customer was found and routes to sales order creation using the existing customer ID, skipping unnecessary customer creation when records already exist.

This path checks if the Katana customer array is not empty. If true (customer found), the workflow follows Path 1 which matches products and creates the sales order. If false (no customer found), this path is skipped and Path 2 executes instead.

Get List of Variants by SKUs

App connector: Katana • Time to complete: 1 minute
Why this matters: Queries Katana's API with all SKUs from the order to find matching product variants, establishing the connection between Square products and Katana manufacturing items needed for sales order creation.

This custom JavaScript step queries Katana's variants endpoint with the SKU list collected from the loop.

// Gets SKU array from loop
const skusListSquare = vars.loop_1.items;
// Creates query string like "sku=SKU1&sku=SKU2&sku=SKU3"
const skusParameter = skusListSquare.map(sku => `sku=${sku}`).join('&');
// Queries Katana API with OAuth
const oauth = new Oauth('refresh_token', 'katana');
const response = oauth.get(`${baseUrl}?${skusParameter}`);
// Returns matching Katana variants with IDs
Mesa.output.next({skus_list_katana: skusListKatana});

The code sends an authenticated GET request to Katana's API, passing all SKUs as query parameters, and returns matching product variants including Katana variant IDs needed for the sales order line items.

SKU matching requirement: This assumes you use the same SKUs in both Square and Katana. If SKUs differ, you'd need custom mapping logic.

Create Sales Order

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Creates the manufacturing sales order in Katana with all product, customer, pricing, and shipping details, triggering production planning and inventory allocation for fulfillment.

This step creates a Katana sales order using the existing customer ID. The sales order includes:

  1. order_no: "1" (can be customized to use Square order number)
  2. customer_id: Existing Katana customer ID
  3. order_created_date: Square order timestamp
  4. currency: Order currency from Square
  5. sales_order_rows: Array of line items with quantity, variant_id (from Katana product matching), price_per_unit, and total_discount
  6. addresses: Shipping address array with complete customer address from Square

The sales order creation triggers Katana's manufacturing workflow, allocating materials, scheduling production, and updating inventory forecasts.

Path 2 Rule - Is New Customer

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Evaluates whether a Katana customer was NOT found and routes to customer creation followed by sales order creation, ensuring new customers get proper manufacturing system records.

This path checks if the Katana customer array is empty. If true (no customer found), the workflow follows Path 2 which creates a new customer then creates the sales order. If false (customer exists), this path is skipped.

Create Customer

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Creates a new Katana customer record with complete contact and shipping information from Square, establishing the customer relationship needed for sales order creation and future orders.

This step creates a Katana customer using Square customer data. It includes:

  1. name: Full name combining given and family names
  2. first_name: Customer's first name
  3. last_name: Customer's last name
  4. company: Company name if provided
  5. email: Email address
  6. phone: Phone number
  7. addresses: Array with shipping address including all address components

The created customer is returned with Katana customer ID used in the subsequent sales order creation.

Katana Get List of Variants by SKUs

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Queries Katana's API with SKUs for new customer orders, identical to step 9 but executed in the new customer path to ensure product matching occurs regardless of customer status.

This step is identical to step 9, using the same custom code to match Square SKUs with Katana product variants. It's duplicated in Path 2 to ensure product matching happens after customer creation.

katana logo icon

Create Sales Order

App connector: Katana • Time to complete: 0 minutes (Auto-configured)
Why this matters: Creates the manufacturing sales order using the newly created customer ID, completing the full workflow of customer creation and order placement for first-time Square customers.

This step is identical to step 10 except it uses the newly created Katana customer ID from step 12. All other sales order details (line items, pricing, shipping address) remain the same.

Make it your own

Customize this workflow even further:

Use Square order numbers
Modify the order_no field in sales order creation to use Square's order number instead of "1", maintaining consistent order identification across both systems.
Add order notes or tags
Enhance the sales order creation to include Square order notes, customer notes, or custom metadata that provides manufacturing teams with additional context.
Send team notifications
Add Slack or email steps after sales order creation that notify your production team of new manufacturing orders with product details and customer information.
Filter by product type
Add filters that check Square product categories or names and only create Katana sales orders for specific product types, focusing manufacturing on made-to-order items while excluding stock items.

Frequently asked questions

What happens if products have different SKUs in Square vs Katana?
The workflow will fail at the product matching step since it searches by exact SKU match. You'd need to either standardize SKUs across both systems or implement custom mapping logic that translates Square SKUs to Katana variant IDs.
Can I customize the order number in Katana?
Yes, edit the "Create Sales Order" steps and change the order_no field from "1" to use Square's order identifier or a custom format combining Square order number with date or other identifiers.
Will this handle partial orders if only some products exist in both systems?
No, the current workflow expects all products to have matching SKUs. If some products don't exist in Katana, the variant matching will fail. Consider adding error handling that creates sales orders with only matched products or sends alerts for missing products.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to start creating Katana sales orders from Square orders automatically?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 13 min setup • Cancel anytime