Shopify · Arazzo Workflow

Shopify Upsert Customer Then Place Order

Version 1.0.0

Find or create a customer by email, then place an order for that customer.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CommerceE-CommercePaymentsRetailShopping CartT1ArazzoWorkflows

Provider

shopify

Workflows

upsert-customer-then-order
Reuse or create a customer by email, then place and confirm an order.
Resolves the customer by email (reusing or creating), places an order for that email, and reads the order back.
4 steps inputs: email, firstName, lastName, quantity, variantId outputs: order, orderId, orderName
1
findCustomer
Search for an existing customer by email, returning at most one match.
2
createCustomer
Create a new customer when no existing one matched the email.
3
placeOrder
Place an order tied to the resolved customer email containing the variant line item.
4
getOrder
Read the order back to confirm it was placed.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Shopify Upsert Customer Then Place Order
  summary: Find or create a customer by email, then place an order for that customer.
  description: >-
    A resilient checkout-capture flow. The workflow searches for a customer by
    email and branches: an existing customer is reused as-is while a missing one
    is created. Either path converges on placing an order tied to that customer
    email and reading the order back. This avoids duplicate customers when the
    same buyer returns. Every step spells out its request inline so the flow can
    be read and executed without opening the underlying OpenAPI description.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-420.10
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-420.10
      capability_name: Customer Data Management
      spec: shopify-customers-api-openapi.yml
      confidence: 0.85
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: customersApi
  url: ../openapi/shopify-customers-api-openapi.yml
  type: openapi
- name: ordersApi
  url: ../openapi/shopify-orders-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-customer-then-order
  summary: Reuse or create a customer by email, then place and confirm an order.
  description: >-
    Resolves the customer by email (reusing or creating), places an order for
    that email, and reads the order back.
  inputs:
    type: object
    required:
    - email
    - variantId
    - quantity
    properties:
      email:
        type: string
        description: Customer email used to resolve the customer and stamp the order.
      firstName:
        type: string
        description: First name used when creating a new customer.
      lastName:
        type: string
        description: Last name used when creating a new customer.
      variantId:
        type: integer
        description: The product variant ID to order.
      quantity:
        type: integer
        description: Quantity of the variant.
  steps:
  - stepId: findCustomer
    description: Search for an existing customer by email, returning at most one match.
    operationId: searchCustomers
    parameters:
    - name: query
      in: query
      value: "email:$inputs.email"
    - name: limit
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedCustomerId: $response.body#/customers/0/id
    onSuccess:
    - name: customerExists
      type: goto
      stepId: placeOrder
      criteria:
      - context: $response.body
        condition: $.customers.length > 0
        type: jsonpath
    - name: customerMissing
      type: goto
      stepId: createCustomer
      criteria:
      - context: $response.body
        condition: $.customers.length == 0
        type: jsonpath
  - stepId: createCustomer
    description: Create a new customer when no existing one matched the email.
    operationId: createCustomer
    requestBody:
      contentType: application/json
      payload:
        customer:
          email: $inputs.email
          first_name: $inputs.firstName
          last_name: $inputs.lastName
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      customerId: $response.body#/customer/id
  - stepId: placeOrder
    description: >-
      Place an order tied to the resolved customer email containing the variant
      line item.
    operationId: createOrder
    requestBody:
      contentType: application/json
      payload:
        order:
          email: $inputs.email
          financial_status: pending
          line_items:
          - variant_id: $inputs.variantId
            quantity: $inputs.quantity
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      orderId: $response.body#/order/id
      orderName: $response.body#/order/name
  - stepId: getOrder
    description: Read the order back to confirm it was placed.
    operationId: getOrder
    parameters:
    - name: order_id
      in: path
      value: $steps.placeOrder.outputs.orderId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      order: $response.body#/order
  outputs:
    orderId: $steps.placeOrder.outputs.orderId
    orderName: $steps.placeOrder.outputs.orderName
    order: $steps.getOrder.outputs.order

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/shopify-upsert-customer-then-order-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.