mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
1593 lines
38 KiB
YAML
1593 lines
38 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: Formance Simple orchestration Service API
|
|
version: 0.1.0
|
|
paths:
|
|
/_info:
|
|
get:
|
|
summary: Get server info
|
|
operationId: getServerInfo
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: Server information
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ServerInfo'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
/triggers:
|
|
get:
|
|
summary: List triggers
|
|
operationId: listTriggers
|
|
description: List triggers
|
|
tags:
|
|
- orchestration.v1
|
|
parameters:
|
|
- name: name
|
|
in: query
|
|
description: search by name
|
|
required: false
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: List of triggers
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ListTriggersResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
post:
|
|
summary: Create trigger
|
|
operationId: createTrigger
|
|
description: Create trigger
|
|
tags:
|
|
- orchestration.v1
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TriggerData'
|
|
responses:
|
|
'201':
|
|
description: Created trigger
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CreateTriggerResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/triggers/{triggerID}:
|
|
parameters:
|
|
- name: triggerID
|
|
description: The trigger id
|
|
in: path
|
|
schema:
|
|
type: string
|
|
required: true
|
|
get:
|
|
summary: Read trigger
|
|
operationId: readTrigger
|
|
description: Read trigger
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: A specific trigger
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ReadTriggerResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
delete:
|
|
summary: Delete trigger
|
|
operationId: deleteTrigger
|
|
description: Read trigger
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'204':
|
|
description: Trigger deleted
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/triggers/{triggerID}/occurrences:
|
|
parameters:
|
|
- name: triggerID
|
|
description: The trigger id
|
|
in: path
|
|
schema:
|
|
type: string
|
|
required: true
|
|
get:
|
|
summary: List triggers occurrences
|
|
operationId: listTriggersOccurrences
|
|
description: List triggers occurrences
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: List of triggers occurrences
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ListTriggersOccurrencesResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
/workflows:
|
|
get:
|
|
summary: List registered workflows
|
|
operationId: listWorkflows
|
|
description: List registered workflows
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: List of workflows
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ListWorkflowsResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
post:
|
|
summary: Create workflow
|
|
operationId: createWorkflow
|
|
description: Create a workflow
|
|
tags:
|
|
- orchestration.v1
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CreateWorkflowRequest'
|
|
responses:
|
|
'201':
|
|
description: Created workflow
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/CreateWorkflowResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/workflows/{flowId}:
|
|
parameters:
|
|
- in: path
|
|
description: The flow id
|
|
name: flowId
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
get:
|
|
summary: Get a flow by id
|
|
tags:
|
|
- orchestration.v1
|
|
description: Get a flow by id
|
|
operationId: getWorkflow
|
|
responses:
|
|
'200':
|
|
description: The workflow
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GetWorkflowResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
delete:
|
|
summary: Delete a flow by id
|
|
tags:
|
|
- orchestration.v1
|
|
description: Delete a flow by id
|
|
operationId: deleteWorkflow
|
|
responses:
|
|
'204':
|
|
description: No content
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/workflows/{workflowID}/instances:
|
|
parameters:
|
|
- in: path
|
|
description: The flow id
|
|
name: workflowID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
post:
|
|
description: Run workflow
|
|
summary: Run workflow
|
|
operationId: runWorkflow
|
|
parameters:
|
|
- in: query
|
|
name: wait
|
|
required: false
|
|
description: Wait end of the workflow before return
|
|
schema:
|
|
type: boolean
|
|
tags:
|
|
- orchestration.v1
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RunWorkflowRequest'
|
|
responses:
|
|
'201':
|
|
description: The workflow instance
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RunWorkflowResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/instances:
|
|
get:
|
|
description: List instances of a workflow
|
|
summary: List instances of a workflow
|
|
operationId: listInstances
|
|
parameters:
|
|
- in: query
|
|
description: A workflow id
|
|
name: workflowID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: false
|
|
- in: query
|
|
description: Filter running instances
|
|
name: running
|
|
schema:
|
|
type: boolean
|
|
example: true
|
|
required: false
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: List of workflow instances
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ListRunsResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
/instances/{instanceID}:
|
|
parameters:
|
|
- in: path
|
|
description: The instance id
|
|
name: instanceID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
get:
|
|
summary: Get a workflow instance by id
|
|
description: Get a workflow instance by id
|
|
operationId: getInstance
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: The workflow instance
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GetWorkflowInstanceResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
/instances/{instanceID}/events:
|
|
parameters:
|
|
- in: path
|
|
description: The instance id
|
|
name: instanceID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
post:
|
|
summary: Send an event to a running workflow
|
|
description: Send an event to a running workflow
|
|
operationId: sendEvent
|
|
tags:
|
|
- orchestration.v1
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- name
|
|
properties:
|
|
name:
|
|
type: string
|
|
responses:
|
|
'204':
|
|
description: No content
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/instances/{instanceID}/abort:
|
|
parameters:
|
|
- in: path
|
|
description: The instance id
|
|
name: instanceID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
put:
|
|
summary: Cancel a running workflow
|
|
description: Cancel a running workflow
|
|
operationId: cancelEvent
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'204':
|
|
description: No content
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:write
|
|
/instances/{instanceID}/history:
|
|
parameters:
|
|
- in: path
|
|
description: The instance id
|
|
name: instanceID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
get:
|
|
summary: Get a workflow instance history by id
|
|
description: Get a workflow instance history by id
|
|
operationId: getInstanceHistory
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: The workflow instance history
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GetWorkflowInstanceHistoryResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
/instances/{instanceID}/stages/{number}/history:
|
|
parameters:
|
|
- in: path
|
|
description: The instance id
|
|
name: instanceID
|
|
schema:
|
|
type: string
|
|
example: xxx
|
|
required: true
|
|
- in: path
|
|
description: The stage number
|
|
name: number
|
|
schema:
|
|
type: integer
|
|
example: 0
|
|
required: true
|
|
get:
|
|
summary: Get a workflow instance stage history
|
|
description: Get a workflow instance stage history
|
|
operationId: getInstanceStageHistory
|
|
tags:
|
|
- orchestration.v1
|
|
responses:
|
|
'200':
|
|
description: The workflow instance stage history
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/GetWorkflowInstanceHistoryStageResponse'
|
|
default:
|
|
$ref: '#/components/responses/ErrorResponse'
|
|
security:
|
|
- Authorization:
|
|
- orchestration:read
|
|
components:
|
|
schemas:
|
|
ServerInfo:
|
|
type: object
|
|
required:
|
|
- version
|
|
properties:
|
|
version:
|
|
type: string
|
|
Error:
|
|
type: object
|
|
required:
|
|
- errorCode
|
|
- errorMessage
|
|
properties:
|
|
errorCode:
|
|
type: string
|
|
enum:
|
|
- VALIDATION
|
|
- NOT_FOUND
|
|
- INTERNAL
|
|
errorMessage:
|
|
type: string
|
|
WorkflowConfig:
|
|
type: object
|
|
required:
|
|
- stages
|
|
properties:
|
|
name:
|
|
type: string
|
|
stages:
|
|
type: array
|
|
items:
|
|
type: object
|
|
additionalProperties: {}
|
|
Workflow:
|
|
type: object
|
|
required:
|
|
- config
|
|
- createdAt
|
|
- updatedAt
|
|
- id
|
|
properties:
|
|
config:
|
|
$ref: '#/components/schemas/WorkflowConfig'
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
id:
|
|
type: string
|
|
StageStatus:
|
|
type: object
|
|
required:
|
|
- stage
|
|
- instanceID
|
|
- startedAt
|
|
properties:
|
|
stage:
|
|
type: number
|
|
instanceID:
|
|
type: string
|
|
startedAt:
|
|
type: string
|
|
format: date-time
|
|
terminatedAt:
|
|
type: string
|
|
format: date-time
|
|
error:
|
|
type: string
|
|
WorkflowInstance:
|
|
type: object
|
|
required:
|
|
- workflowID
|
|
- id
|
|
- createdAt
|
|
- updatedAt
|
|
- terminated
|
|
properties:
|
|
workflowID:
|
|
type: string
|
|
id:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
updatedAt:
|
|
type: string
|
|
format: date-time
|
|
status:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/StageStatus'
|
|
terminated:
|
|
type: boolean
|
|
terminatedAt:
|
|
type: string
|
|
format: date-time
|
|
error:
|
|
type: string
|
|
WorkflowInstanceHistoryStage:
|
|
type: object
|
|
required:
|
|
- name
|
|
- input
|
|
- startedAt
|
|
- terminated
|
|
- attempt
|
|
properties:
|
|
name:
|
|
type: string
|
|
input:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistoryStageInput'
|
|
output:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistoryStageOutput'
|
|
error:
|
|
type: string
|
|
terminated:
|
|
type: boolean
|
|
startedAt:
|
|
type: string
|
|
format: date-time
|
|
terminatedAt:
|
|
type: string
|
|
format: date-time
|
|
lastFailure:
|
|
type: string
|
|
attempt:
|
|
type: integer
|
|
nextExecution:
|
|
type: string
|
|
format: date-time
|
|
WorkflowInstanceHistory:
|
|
type: object
|
|
required:
|
|
- name
|
|
- input
|
|
- terminated
|
|
- startedAt
|
|
properties:
|
|
name:
|
|
type: string
|
|
input:
|
|
$ref: '#/components/schemas/Stage'
|
|
error:
|
|
type: string
|
|
terminated:
|
|
type: boolean
|
|
startedAt:
|
|
type: string
|
|
format: date-time
|
|
terminatedAt:
|
|
type: string
|
|
format: date-time
|
|
WorkflowInstanceHistoryList:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistory'
|
|
WorkflowInstanceHistoryStageList:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistoryStage'
|
|
ListWorkflowsResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/components/schemas/Workflow'
|
|
type: array
|
|
required:
|
|
- data
|
|
TriggerData:
|
|
type: object
|
|
required:
|
|
- event
|
|
- workflowID
|
|
properties:
|
|
event:
|
|
type: string
|
|
workflowID:
|
|
type: string
|
|
filter:
|
|
type: string
|
|
vars:
|
|
type: object
|
|
additionalProperties: true
|
|
name:
|
|
type: string
|
|
Trigger:
|
|
allOf:
|
|
- $ref: '#/components/schemas/TriggerData'
|
|
- type: object
|
|
required:
|
|
- id
|
|
- createdAt
|
|
properties:
|
|
id:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
TriggerOccurrence:
|
|
type: object
|
|
required:
|
|
- triggerID
|
|
- date
|
|
- event
|
|
properties:
|
|
date:
|
|
type: string
|
|
format: date-time
|
|
workflowInstanceID:
|
|
type: string
|
|
workflowInstance:
|
|
$ref: '#/components/schemas/WorkflowInstance'
|
|
triggerID:
|
|
type: string
|
|
event:
|
|
type: object
|
|
additionalProperties: true
|
|
error:
|
|
type: string
|
|
ListTriggersOccurrencesResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/components/schemas/TriggerOccurrence'
|
|
type: array
|
|
required:
|
|
- data
|
|
ListTriggersResponse:
|
|
type: object
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/components/schemas/Trigger'
|
|
type: array
|
|
required:
|
|
- data
|
|
CreateWorkflowRequest:
|
|
$ref: '#/components/schemas/WorkflowConfig'
|
|
CreateWorkflowResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Workflow'
|
|
CreateTriggerResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Trigger'
|
|
RunWorkflowRequest:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
RunWorkflowResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/WorkflowInstance'
|
|
ListRunsResponse:
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
items:
|
|
$ref: '#/components/schemas/WorkflowInstance'
|
|
type: array
|
|
GetWorkflowResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Workflow'
|
|
GetWorkflowInstanceResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/WorkflowInstance'
|
|
GetWorkflowInstanceHistoryResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistoryList'
|
|
GetWorkflowInstanceHistoryStageResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/WorkflowInstanceHistoryStageList'
|
|
StageSendSourceWallet:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
balance:
|
|
type: string
|
|
StageSendDestinationWallet:
|
|
$ref: '#/components/schemas/StageSendSourceWallet'
|
|
StageSendSourceAccount:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
ledger:
|
|
type: string
|
|
StageSendDestinationAccount:
|
|
$ref: '#/components/schemas/StageSendSourceAccount'
|
|
StageSendSourcePayment:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
StageSendDestinationPayment:
|
|
type: object
|
|
required:
|
|
- psp
|
|
properties:
|
|
psp:
|
|
type: string
|
|
StageSendSource:
|
|
type: object
|
|
properties:
|
|
wallet:
|
|
$ref: '#/components/schemas/StageSendSourceWallet'
|
|
account:
|
|
$ref: '#/components/schemas/StageSendSourceAccount'
|
|
payment:
|
|
$ref: '#/components/schemas/StageSendSourcePayment'
|
|
StageSendDestination:
|
|
type: object
|
|
properties:
|
|
wallet:
|
|
$ref: '#/components/schemas/StageSendDestinationWallet'
|
|
account:
|
|
$ref: '#/components/schemas/StageSendDestinationAccount'
|
|
payment:
|
|
$ref: '#/components/schemas/StageSendDestinationPayment'
|
|
StageSend:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
$ref: '#/components/schemas/Monetary'
|
|
destination:
|
|
$ref: '#/components/schemas/StageSendDestination'
|
|
source:
|
|
$ref: '#/components/schemas/StageSendSource'
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
StageDelay:
|
|
type: object
|
|
properties:
|
|
until:
|
|
type: string
|
|
format: date-time
|
|
duration:
|
|
type: string
|
|
StageWaitEvent:
|
|
type: object
|
|
required:
|
|
- event
|
|
properties:
|
|
event:
|
|
type: string
|
|
UpdateAccount:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
ledger:
|
|
type: string
|
|
required:
|
|
- id
|
|
- ledger
|
|
- metadata
|
|
Update:
|
|
type: object
|
|
properties:
|
|
account:
|
|
$ref: '#/components/schemas/UpdateAccount'
|
|
Stage:
|
|
anyOf:
|
|
- $ref: '#/components/schemas/StageSend'
|
|
- $ref: '#/components/schemas/StageDelay'
|
|
- $ref: '#/components/schemas/StageWaitEvent'
|
|
- $ref: '#/components/schemas/Update'
|
|
StripeTransferRequest:
|
|
type: object
|
|
properties:
|
|
connectorID:
|
|
type: string
|
|
amount:
|
|
type: integer
|
|
format: bigint
|
|
minimum: 0
|
|
example: 100
|
|
asset:
|
|
type: string
|
|
example: USD
|
|
destination:
|
|
type: string
|
|
example: acct_1Gqj58KZcSIg2N2q
|
|
waitingValidation:
|
|
type: boolean
|
|
example: false
|
|
default: false
|
|
metadata:
|
|
type: object
|
|
description: >
|
|
A set of key/value pairs that you can attach to a transfer object.
|
|
|
|
It can be useful for storing additional information about the
|
|
transfer in a structured format.
|
|
example:
|
|
order_id: '6735'
|
|
ActivityStripeTransfer:
|
|
$ref: '#/components/schemas/StripeTransferRequest'
|
|
ActivityListWallets:
|
|
type: object
|
|
properties:
|
|
name:
|
|
type: string
|
|
ListWalletsResponse:
|
|
type: object
|
|
required:
|
|
- cursor
|
|
properties:
|
|
cursor:
|
|
allOf:
|
|
- $ref: '#/components/schemas/Cursor'
|
|
- properties:
|
|
data:
|
|
items:
|
|
$ref: '#/components/schemas/Wallet'
|
|
type: array
|
|
type: object
|
|
required:
|
|
- data
|
|
Wallet:
|
|
type: object
|
|
required:
|
|
- name
|
|
- id
|
|
- metadata
|
|
- createdAt
|
|
- ledger
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: The unique ID of the wallet.
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
description: Metadata associated with the wallet.
|
|
name:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
ledger:
|
|
type: string
|
|
Cursor:
|
|
type: object
|
|
required:
|
|
- pageSize
|
|
properties:
|
|
pageSize:
|
|
type: integer
|
|
format: int64
|
|
minimum: 1
|
|
maximum: 1000
|
|
example: 15
|
|
hasMore:
|
|
type: boolean
|
|
example: false
|
|
previous:
|
|
type: string
|
|
example: YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=
|
|
next:
|
|
type: string
|
|
example: ''
|
|
ActivityGetAccount:
|
|
type: object
|
|
required:
|
|
- id
|
|
- ledger
|
|
properties:
|
|
id:
|
|
type: string
|
|
ledger:
|
|
type: string
|
|
ActivityAddAccountMetadata:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
ledger:
|
|
type: string
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
required:
|
|
- id
|
|
- ledger
|
|
- metadata
|
|
ActivityCreateTransaction:
|
|
type: object
|
|
properties:
|
|
ledger:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/PostTransaction'
|
|
ActivityRevertTransaction:
|
|
type: object
|
|
required:
|
|
- id
|
|
- ledger
|
|
properties:
|
|
ledger:
|
|
type: string
|
|
id:
|
|
type: string
|
|
ActivityGetPayment:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
ActivityConfirmHold:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
ActivityCreditWallet:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/CreditWalletRequest'
|
|
CreditWalletRequest:
|
|
type: object
|
|
required:
|
|
- amount
|
|
- sources
|
|
- metadata
|
|
properties:
|
|
amount:
|
|
$ref: '#/components/schemas/Monetary'
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
description: Metadata associated with the wallet.
|
|
reference:
|
|
type: string
|
|
sources:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Subject'
|
|
balance:
|
|
type: string
|
|
description: The balance to credit
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
example:
|
|
amount:
|
|
asset: USD/2
|
|
amount: 100
|
|
metadata:
|
|
key: ''
|
|
sources: []
|
|
LedgerAccountSubject:
|
|
type: object
|
|
required:
|
|
- type
|
|
- identifier
|
|
properties:
|
|
type:
|
|
type: string
|
|
identifier:
|
|
type: string
|
|
WalletSubject:
|
|
type: object
|
|
required:
|
|
- type
|
|
- identifier
|
|
properties:
|
|
type:
|
|
type: string
|
|
identifier:
|
|
type: string
|
|
balance:
|
|
type: string
|
|
Subject:
|
|
discriminator:
|
|
propertyName: type
|
|
mapping:
|
|
ACCOUNT: '#/components/schemas/LedgerAccountSubject'
|
|
WALLET: '#/components/schemas/WalletSubject'
|
|
oneOf:
|
|
- $ref: '#/components/schemas/LedgerAccountSubject'
|
|
- $ref: '#/components/schemas/WalletSubject'
|
|
ActivityDebitWallet:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/DebitWalletRequest'
|
|
DebitWalletRequest:
|
|
type: object
|
|
required:
|
|
- amount
|
|
- metadata
|
|
properties:
|
|
amount:
|
|
$ref: '#/components/schemas/Monetary'
|
|
pending:
|
|
type: boolean
|
|
description: >-
|
|
Set to true to create a pending hold. If false, the wallet will be
|
|
debited immediately.
|
|
metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
description: Metadata associated with the wallet.
|
|
description:
|
|
type: string
|
|
destination:
|
|
$ref: '#/components/schemas/Subject'
|
|
balances:
|
|
type: array
|
|
items:
|
|
type: string
|
|
description: A targeted balance (use '*' for all)
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
description: cannot be used in conjunction with `pending` property
|
|
example:
|
|
amount:
|
|
asset: USD/2
|
|
amount: 100
|
|
metadata:
|
|
key: ''
|
|
pending: true
|
|
ActivityGetWallet:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
ActivityVoidHold:
|
|
type: object
|
|
required:
|
|
- id
|
|
properties:
|
|
id:
|
|
type: string
|
|
ActivityGetAccountOutput:
|
|
$ref: '#/components/schemas/AccountResponse'
|
|
ActivityCreateTransactionOutput:
|
|
$ref: '#/components/schemas/CreateTransactionResponse'
|
|
CreateTransactionResponse:
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Transaction'
|
|
type: object
|
|
required:
|
|
- data
|
|
Transaction:
|
|
type: object
|
|
properties:
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
postings:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Posting'
|
|
reference:
|
|
type: string
|
|
example: ref:001
|
|
metadata:
|
|
$ref: '#/components/schemas/Metadata'
|
|
id:
|
|
type: integer
|
|
format: bigint
|
|
minimum: 0
|
|
reverted:
|
|
type: boolean
|
|
required:
|
|
- postings
|
|
- timestamp
|
|
- id
|
|
- metadata
|
|
- reverted
|
|
ActivityRevertTransactionOutput:
|
|
$ref: '#/components/schemas/RevertTransactionResponse'
|
|
RevertTransactionResponse:
|
|
$ref: '#/components/schemas/CreateTransactionResponse'
|
|
ActivityGetPaymentOutput:
|
|
$ref: '#/components/schemas/PaymentResponse'
|
|
PaymentResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Payment'
|
|
Payment:
|
|
type: object
|
|
required:
|
|
- id
|
|
- reference
|
|
- connectorID
|
|
- sourceAccountID
|
|
- destinationAccountID
|
|
- type
|
|
- status
|
|
- initialAmount
|
|
- scheme
|
|
- asset
|
|
- createdAt
|
|
- raw
|
|
- adjustments
|
|
- metadata
|
|
properties:
|
|
id:
|
|
type: string
|
|
example: XXX
|
|
reference:
|
|
type: string
|
|
sourceAccountID:
|
|
type: string
|
|
destinationAccountID:
|
|
type: string
|
|
connectorID:
|
|
type: string
|
|
provider:
|
|
$ref: '#/components/schemas/Connector'
|
|
type:
|
|
type: string
|
|
enum:
|
|
- PAY-IN
|
|
- PAYOUT
|
|
- TRANSFER
|
|
- OTHER
|
|
status:
|
|
$ref: '#/components/schemas/PaymentStatus'
|
|
initialAmount:
|
|
type: integer
|
|
format: bigint
|
|
minimum: 0
|
|
example: 100
|
|
scheme:
|
|
type: string
|
|
enum:
|
|
- visa
|
|
- mastercard
|
|
- amex
|
|
- diners
|
|
- discover
|
|
- jcb
|
|
- unionpay
|
|
- sepa debit
|
|
- sepa credit
|
|
- sepa
|
|
- apple pay
|
|
- google pay
|
|
- a2a
|
|
- ach debit
|
|
- ach
|
|
- rtp
|
|
- unknown
|
|
- other
|
|
asset:
|
|
type: string
|
|
example: USD
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
raw:
|
|
type: object
|
|
nullable: true
|
|
adjustments:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/PaymentAdjustment'
|
|
metadata:
|
|
$ref: '#/components/schemas/PaymentMetadata'
|
|
Connector:
|
|
type: string
|
|
enum:
|
|
- STRIPE
|
|
- DUMMY-PAY
|
|
- WISE
|
|
- MODULR
|
|
- CURRENCY-CLOUD
|
|
- BANKING-CIRCLE
|
|
- MANGOPAY
|
|
- MONEYCORP
|
|
PaymentAdjustment:
|
|
type: object
|
|
required:
|
|
- status
|
|
- amount
|
|
- date
|
|
- raw
|
|
- absolute
|
|
properties:
|
|
status:
|
|
$ref: '#/components/schemas/PaymentStatus'
|
|
amount:
|
|
type: integer
|
|
format: bigint
|
|
minimum: 0
|
|
example: 100
|
|
date:
|
|
type: string
|
|
format: date-time
|
|
raw:
|
|
type: object
|
|
absolute:
|
|
type: boolean
|
|
PaymentStatus:
|
|
type: string
|
|
enum:
|
|
- PENDING
|
|
- ACTIVE
|
|
- TERMINATED
|
|
- FAILED
|
|
- SUCCEEDED
|
|
- CANCELLED
|
|
PaymentMetadata:
|
|
type: object
|
|
properties:
|
|
key:
|
|
type: string
|
|
nullable: true
|
|
ActivityDebitWalletOutput:
|
|
$ref: '#/components/schemas/DebitWalletResponse'
|
|
DebitWalletResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Hold'
|
|
Hold:
|
|
type: object
|
|
required:
|
|
- id
|
|
- walletID
|
|
- metadata
|
|
- description
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: The unique ID of the hold.
|
|
walletID:
|
|
type: string
|
|
description: The ID of the wallet the hold is associated with.
|
|
metadata:
|
|
type: object
|
|
description: Metadata associated with the hold.
|
|
additionalProperties:
|
|
type: string
|
|
description:
|
|
type: string
|
|
destination:
|
|
$ref: '#/components/schemas/Subject'
|
|
ActivityGetWalletOutput:
|
|
$ref: '#/components/schemas/GetWalletResponse'
|
|
GetWalletResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/WalletWithBalances'
|
|
WalletWithBalances:
|
|
type: object
|
|
required:
|
|
- name
|
|
- id
|
|
- metadata
|
|
- createdAt
|
|
- balances
|
|
- ledger
|
|
properties:
|
|
id:
|
|
type: string
|
|
format: uuid
|
|
description: The unique ID of the wallet.
|
|
metadata:
|
|
type: object
|
|
description: Metadata associated with the wallet.
|
|
additionalProperties:
|
|
type: string
|
|
name:
|
|
type: string
|
|
createdAt:
|
|
type: string
|
|
format: date-time
|
|
balances:
|
|
type: object
|
|
required:
|
|
- main
|
|
properties:
|
|
main:
|
|
$ref: '#/components/schemas/AssetHolder'
|
|
ledger:
|
|
type: string
|
|
AssetHolder:
|
|
type: object
|
|
required:
|
|
- assets
|
|
properties:
|
|
assets:
|
|
type: object
|
|
additionalProperties:
|
|
type: integer
|
|
format: bigint
|
|
WorkflowInstanceHistoryStageInput:
|
|
type: object
|
|
properties:
|
|
GetAccount:
|
|
$ref: '#/components/schemas/ActivityGetAccount'
|
|
AddAccountMetadata:
|
|
$ref: '#/components/schemas/ActivityAddAccountMetadata'
|
|
CreateTransaction:
|
|
$ref: '#/components/schemas/ActivityCreateTransaction'
|
|
RevertTransaction:
|
|
$ref: '#/components/schemas/ActivityRevertTransaction'
|
|
StripeTransfer:
|
|
$ref: '#/components/schemas/ActivityStripeTransfer'
|
|
GetPayment:
|
|
$ref: '#/components/schemas/ActivityGetPayment'
|
|
ConfirmHold:
|
|
$ref: '#/components/schemas/ActivityConfirmHold'
|
|
CreditWallet:
|
|
$ref: '#/components/schemas/ActivityCreditWallet'
|
|
DebitWallet:
|
|
$ref: '#/components/schemas/ActivityDebitWallet'
|
|
GetWallet:
|
|
$ref: '#/components/schemas/ActivityGetWallet'
|
|
VoidHold:
|
|
$ref: '#/components/schemas/ActivityVoidHold'
|
|
ListWallets:
|
|
$ref: '#/components/schemas/ActivityListWallets'
|
|
WorkflowInstanceHistoryStageOutput:
|
|
type: object
|
|
properties:
|
|
GetAccount:
|
|
$ref: '#/components/schemas/ActivityGetAccountOutput'
|
|
CreateTransaction:
|
|
$ref: '#/components/schemas/ActivityCreateTransactionOutput'
|
|
RevertTransaction:
|
|
$ref: '#/components/schemas/ActivityRevertTransactionOutput'
|
|
GetPayment:
|
|
$ref: '#/components/schemas/ActivityGetPaymentOutput'
|
|
DebitWallet:
|
|
$ref: '#/components/schemas/ActivityDebitWalletOutput'
|
|
GetWallet:
|
|
$ref: '#/components/schemas/ActivityGetWalletOutput'
|
|
ListWallets:
|
|
$ref: '#/components/schemas/ListWalletsResponse'
|
|
Monetary:
|
|
type: object
|
|
required:
|
|
- asset
|
|
- amount
|
|
properties:
|
|
asset:
|
|
type: string
|
|
description: The asset of the monetary value.
|
|
amount:
|
|
type: integer
|
|
format: bigint
|
|
description: The amount of the monetary value.
|
|
PostTransaction:
|
|
type: object
|
|
required:
|
|
- metadata
|
|
properties:
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
postings:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Posting'
|
|
script:
|
|
type: object
|
|
properties:
|
|
plain:
|
|
type: string
|
|
example: "vars {\naccount $user\n}\nsend [COIN 10] (\n\tsource = @world\n\tdestination = $user\n)\n"
|
|
vars:
|
|
type: object
|
|
properties: {}
|
|
additionalProperties: true
|
|
example:
|
|
user: users:042
|
|
required:
|
|
- plain
|
|
reference:
|
|
type: string
|
|
example: ref:001
|
|
metadata:
|
|
$ref: '#/components/schemas/Metadata'
|
|
Metadata:
|
|
type: object
|
|
additionalProperties:
|
|
type: string
|
|
example:
|
|
admin: 'true'
|
|
Posting:
|
|
type: object
|
|
properties:
|
|
amount:
|
|
type: integer
|
|
format: bigint
|
|
minimum: 0
|
|
example: 100
|
|
asset:
|
|
type: string
|
|
example: COIN
|
|
destination:
|
|
type: string
|
|
example: users:002
|
|
source:
|
|
type: string
|
|
example: users:001
|
|
required:
|
|
- amount
|
|
- asset
|
|
- destination
|
|
- source
|
|
AccountResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Account'
|
|
ReadTriggerResponse:
|
|
type: object
|
|
required:
|
|
- data
|
|
properties:
|
|
data:
|
|
$ref: '#/components/schemas/Trigger'
|
|
Account:
|
|
type: object
|
|
required:
|
|
- address
|
|
- metadata
|
|
properties:
|
|
address:
|
|
type: string
|
|
example: users:001
|
|
metadata:
|
|
type: object
|
|
properties: {}
|
|
additionalProperties:
|
|
type: string
|
|
example:
|
|
admin: 'true'
|
|
volumes:
|
|
$ref: '#/components/schemas/Volumes'
|
|
effectiveVolumes:
|
|
$ref: '#/components/schemas/Volumes'
|
|
Volume:
|
|
type: object
|
|
properties:
|
|
input:
|
|
type: integer
|
|
format: bigint
|
|
output:
|
|
type: integer
|
|
format: bigint
|
|
balance:
|
|
type: integer
|
|
format: bigint
|
|
required:
|
|
- input
|
|
- output
|
|
example:
|
|
input: 100
|
|
output: 20
|
|
balance: 80
|
|
Volumes:
|
|
type: object
|
|
additionalProperties:
|
|
$ref: '#/components/schemas/Volume'
|
|
example:
|
|
USD:
|
|
input: 100
|
|
output: 10
|
|
balance: 90
|
|
EUR:
|
|
input: 100
|
|
output: 10
|
|
balance: 90
|
|
responses:
|
|
ErrorResponse:
|
|
description: General error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Error'
|