Amberflo · Arazzo Workflow

Amberflo Upsert Customer

Version 1.0.0

Find a customer by ID and update it if it exists, otherwise create it.

1 workflow 1 source API 1 provider
View Spec View on GitHub Usage-Based BillingMeteringFinOpsAI Cost ManagementBillingMonetizationArazzoWorkflows

Provider

amberflo

Workflows

upsert-customer
Upsert a customer account by its unique customer ID.
Looks for an existing customer by ID and either updates the matched customer or creates a new one with the supplied details.
3 steps inputs: apiKey, customerEmail, customerId, customerName, lifecycleStage outputs: createdCustomerId, updatedCustomerId
1
findCustomer
Try to fetch the customer by ID, branching on whether it already exists.
2
updateExisting
Update the existing customer with the supplied details.
3
createNew
Create a new customer when no existing record matched the ID.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Amberflo Upsert Customer
  summary: Find a customer by ID and update it if it exists, otherwise create it.
  description: >-
    A common billing integration pattern. The workflow attempts to fetch a
    customer by their unique identifier and then branches: when the customer is
    found it updates the existing record, and when it is not found it creates a
    new customer. 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: customersApi
  url: ../openapi/amberflo-customers-api-openapi.yml
  type: openapi
workflows:
- workflowId: upsert-customer
  summary: Upsert a customer account by its unique customer ID.
  description: >-
    Looks for an existing customer by ID and either updates the matched customer
    or creates a new one with the supplied details.
  inputs:
    type: object
    required:
    - apiKey
    - customerId
    - customerName
    properties:
      apiKey:
        type: string
        description: Amberflo API key supplied in the X-API-KEY header.
      customerId:
        type: string
        description: Unique customer identifier to upsert.
      customerName:
        type: string
        description: Customer display name to write.
      customerEmail:
        type: string
        description: Optional customer contact email to write.
      lifecycleStage:
        type: string
        description: Lifecycle stage (ONBOARDING, TRAIL, ACTIVE, OFFBOARDED).
  steps:
  - stepId: findCustomer
    description: >-
      Try to fetch the customer by ID, branching on whether it already exists.
    operationId: getCustomerById
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    - name: customerId
      in: path
      value: $inputs.customerId
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 404
    outputs:
      matchedCustomerId: $response.body#/customerId
    onSuccess:
    - name: customerExists
      type: goto
      stepId: updateExisting
      criteria:
      - condition: $statusCode == 200
    - name: customerMissing
      type: goto
      stepId: createNew
      criteria:
      - condition: $statusCode == 404
  - stepId: updateExisting
    description: >-
      Update the existing customer with the supplied details.
    operationId: updateCustomer
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    requestBody:
      contentType: application/json
      payload:
        customerId: $inputs.customerId
        customerName: $inputs.customerName
        customerEmail: $inputs.customerEmail
        lifecycleStage: $inputs.lifecycleStage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      customerId: $response.body#/customerId
    onSuccess:
    - name: done
      type: end
  - stepId: createNew
    description: >-
      Create a new customer when no existing record matched the ID.
    operationId: createCustomer
    parameters:
    - name: X-API-KEY
      in: header
      value: $inputs.apiKey
    requestBody:
      contentType: application/json
      payload:
        customerId: $inputs.customerId
        customerName: $inputs.customerName
        customerEmail: $inputs.customerEmail
        lifecycleStage: $inputs.lifecycleStage
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      customerId: $response.body#/customerId
  outputs:
    updatedCustomerId: $steps.updateExisting.outputs.customerId
    createdCustomerId: $steps.createNew.outputs.customerId

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/amberflo-upsert-customer-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.