Skip to main content
Commerce V1 orchestrates payment processing through flow specifications — directed graphs of typed nodes connected by UUIDs. Each flow defines the operations, branching logic, and state transitions for a specific payment type such as a sale or refund.

Flow structure

A flow is a JSON object with the following top-level fields:
FieldTypeDescription
namestringHuman-readable name for the flow
startstring (uuid)The id of the first node to execute
nodesarrayList of node objects that make up the flow
Each node has a type and a data object. The fields in data differ by node type.

Node types

Start

Marks the entry point of the flow. Every flow must have exactly one start node, and the top-level start field must reference its id.
id
string (uuid)
required
Unique identifier for this node.
next
string (uuid)
required
The node to route to when the flow begins.

Transaction

Pauses the flow and dispatches a CloudEvent to your processor integration. The flow resumes when your integration responds with a Finish event.
id
string (uuid)
required
Unique identifier for this node.
startEventType
string
required
The ce-type of the Custom Transaction Event sent to your integration.
configuration
string
required
A key passed to your integration to select which operation to perform.
timeOut
number
required
Seconds before the transaction is considered failed.
next
string (uuid)
required
The gateway node to route to after the transaction completes.

Gateway

Evaluates the result from your integration’s Finish event and routes the flow to the appropriate next node. If no rule matches, the flow execution fails.
id
string (uuid)
required
Unique identifier for this node.
continuesWith
array
required
Routing rules evaluated against the Finish event’s result.

Requirement

Signals that an external action must be completed before the flow can continue — for example, a 3DS authentication challenge presented to the cardholder. The flow pauses until it receives a confirmation event routed through the next gateway.
id
string (uuid)
required
Unique identifier for this node.
requires
string
required
The type of requirement to fulfill.
ValueDescription
TDS3D Secure redirect
ManualCapturePayment requires a manual capture
next
string (uuid)
required
The gateway node to route to after the requirement is signaled.
timeOut
number
required
Seconds before the requirement is considered failed.

Transition

Sets the flow’s outcome state and then routes to the next node. Use this node to record whether a flow path ended in success or failure before reaching the end.
id
string (uuid)
required
Unique identifier for this node.
targetState
string
required
The payment state to set. Allowed values:
ValueDescription
acceptedPayment has been accepted
authorizedPayment has been authorized
completedPayment has been completed
failedPayment has failed
next
string (uuid)
required
The node to route to after the state is set.

End

Marks a terminal point in the flow. A flow can have multiple end nodes — for example, one per outcome path.
id
string (uuid)
required
Unique identifier for this node.

Schema

Download the JSON Schema (Draft 2020-12): flow.schema.json

Examples

The payment flow handles a card sale with optional 3DS v1 authentication. If the processor requires 3DS, the flow pauses for the cardholder challenge and then confirms authentication before completing the sale.
Payment flow example showing a card sale with optional 3DS v1 authentication