WooCommerce · Arazzo Workflow

WooCommerce Create Customer with Billing and Order

Version 1.0.0

Create a customer with a full billing address, then place an order reusing that address.

1 workflow 1 source API 1 provider
View Spec View on GitHub eCommerceOpen SourceOrdersProductsWordPressArazzoWorkflows

Provider

woocommerce

Workflows

create-customer-with-billing-order
Create a customer with billing details and place an order for them.
Creates a customer with a billing address, places an order reusing that billing address, and reads the order back to verify it.
3 steps inputs: address1, city, country, email, firstName, lastName, postcode, productId, quantity, state outputs: customerId, orderId, orderStatus
1
createCustomer
createCustomer
Create a customer account with a complete billing address.
2
createOrder
createOrder
Place an order for the customer reusing the same billing address and a single line item.
3
getOrder
getOrder
Read the order back to confirm it was recorded with the billing address.

Source API Descriptions

Arazzo Workflow Specification

woocommerce-create-customer-with-billing-order-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: WooCommerce Create Customer with Billing and Order
  summary: Create a customer with a full billing address, then place an order reusing that address.
  description: >-
    Captures a buyer with billing details and immediately turns it into a paid
    order. The workflow creates a customer with a complete billing address, then
    places an order for that customer carrying the same billing address and a
    line item, and finally reads the order back to confirm it. 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
sourceDescriptions:
- name: woocommerceRestApi
  url: ../openapi/woocommerce-rest-api-openapi.yml
  type: openapi
workflows:
- workflowId: create-customer-with-billing-order
  summary: Create a customer with billing details and place an order for them.
  description: >-
    Creates a customer with a billing address, places an order reusing that
    billing address, and reads the order back to verify it.
  inputs:
    type: object
    required:
    - email
    - firstName
    - lastName
    - address1
    - city
    - postcode
    - country
    - productId
    - quantity
    properties:
      email:
        type: string
        description: Customer email address.
      firstName:
        type: string
        description: Customer first name.
      lastName:
        type: string
        description: Customer last name.
      address1:
        type: string
        description: Billing address line 1.
      city:
        type: string
        description: Billing city.
      state:
        type: string
        description: Billing state, province, or district.
      postcode:
        type: string
        description: Billing postal code.
      country:
        type: string
        description: Billing ISO 3166-1 alpha-2 country code.
      productId:
        type: integer
        description: ID of the product to order.
      quantity:
        type: integer
        description: Quantity of the product to order.
  steps:
  - stepId: createCustomer
    description: >-
      Create a customer account with a complete billing address.
    operationId: createCustomer
    requestBody:
      contentType: application/json
      payload:
        email: $inputs.email
        first_name: $inputs.firstName
        last_name: $inputs.lastName
        billing:
          first_name: $inputs.firstName
          last_name: $inputs.lastName
          address_1: $inputs.address1
          city: $inputs.city
          state: $inputs.state
          postcode: $inputs.postcode
          country: $inputs.country
          email: $inputs.email
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      customerId: $response.body#/id
  - stepId: createOrder
    description: >-
      Place an order for the customer reusing the same billing address and a
      single line item.
    operationId: createOrder
    requestBody:
      contentType: application/json
      payload:
        status: pending
        customer_id: $steps.createCustomer.outputs.customerId
        billing:
          first_name: $inputs.firstName
          last_name: $inputs.lastName
          address_1: $inputs.address1
          city: $inputs.city
          state: $inputs.state
          postcode: $inputs.postcode
          country: $inputs.country
          email: $inputs.email
        line_items:
        - product_id: $inputs.productId
          quantity: $inputs.quantity
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      orderId: $response.body#/id
  - stepId: getOrder
    description: >-
      Read the order back to confirm it was recorded with the billing address.
    operationId: getOrder
    parameters:
    - name: id
      in: path
      value: $steps.createOrder.outputs.orderId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      orderId: $response.body#/id
      orderStatus: $response.body#/status
  outputs:
    customerId: $steps.createCustomer.outputs.customerId
    orderId: $steps.getOrder.outputs.orderId
    orderStatus: $steps.getOrder.outputs.orderStatus