Files

1752 lines
42 KiB
YAML

openapi: 3.0.3
info:
title: Formance Simple orchestration Service API
version: 0.1.0
paths:
/v2/_info:
get:
summary: Get server info
operationId: v2GetServerInfo
tags:
- Orchestration
responses:
200:
description: Server information
content:
application/json:
schema:
$ref: '#/components/schemas/V2ServerInfo'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/triggers:
get:
summary: List triggers
operationId: v2ListTriggers
description: List triggers
tags:
- Orchestration
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/PageSize'
- 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/V2ListTriggersResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
post:
summary: Create trigger
operationId: v2CreateTrigger
description: Create trigger
tags:
- Orchestration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/V2TriggerData'
responses:
201:
description: Created trigger
content:
application/json:
schema:
$ref: '#/components/schemas/V2CreateTriggerResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/triggers/{triggerID}:
parameters:
- name: triggerID
description: The trigger id
in: path
schema:
type: string
required: true
get:
summary: Read trigger
operationId: v2ReadTrigger
description: Read trigger
tags:
- Orchestration
responses:
200:
description: A specific trigger
content:
application/json:
schema:
$ref: '#/components/schemas/V2ReadTriggerResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
delete:
summary: Delete trigger
operationId: v2DeleteTrigger
description: Read trigger
tags:
- Orchestration
responses:
204:
description: Trigger deleted
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/triggers/{triggerID}/test:
parameters:
- name: triggerID
description: The trigger id
in: path
schema:
type: string
required: true
post:
summary: Test trigger
operationId: testTrigger
description: Test trigger
tags:
- Orchestration
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
"200":
description: Test a trigger
content:
application/json:
schema:
$ref: '#/components/schemas/V2TestTriggerResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/triggers/{triggerID}/occurrences:
parameters:
- name: triggerID
description: The trigger id
in: path
schema:
type: string
required: true
get:
summary: List triggers occurrences
operationId: v2ListTriggersOccurrences
description: List triggers occurrences
tags:
- Orchestration
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/PageSize'
responses:
200:
description: List of triggers occurrences
content:
application/json:
schema:
$ref: '#/components/schemas/V2ListTriggersOccurrencesResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/workflows:
get:
summary: List registered workflows
operationId: v2ListWorkflows
description: List registered workflows
tags:
- Orchestration
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/PageSize'
responses:
200:
description: List of workflows
content:
application/json:
schema:
$ref: '#/components/schemas/V2ListWorkflowsResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
post:
summary: Create workflow
operationId: v2CreateWorkflow
description: Create a workflow
tags:
- Orchestration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/V2CreateWorkflowRequest'
responses:
201:
description: Created workflow
content:
application/json:
schema:
$ref: '#/components/schemas/V2CreateWorkflowResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/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
description: Get a flow by id
operationId: v2GetWorkflow
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
200:
description: The workflow
content:
application/json:
schema:
$ref: '#/components/schemas/V2GetWorkflowResponse'
delete:
summary: Delete a flow by id
tags:
- Orchestration
description: Delete a flow by id
operationId: v2DeleteWorkflow
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
204:
description: No content
/v2/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: v2RunWorkflow
parameters:
- in: query
name: wait
required: false
description: Wait end of the workflow before return
schema:
type: boolean
tags:
- Orchestration
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/V2RunWorkflowRequest'
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
201:
description: The workflow instance
content:
application/json:
schema:
$ref: '#/components/schemas/V2RunWorkflowResponse'
/v2/instances:
get:
description: List instances of a workflow
summary: List instances of a workflow
operationId: v2ListInstances
parameters:
- $ref: '#/components/parameters/Cursor'
- $ref: '#/components/parameters/PageSize'
- 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
responses:
200:
description: List of workflow instances
content:
application/json:
schema:
$ref: '#/components/schemas/V2ListRunsResponse'
default:
$ref: '#/components/responses/V2ErrorResponse'
/v2/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: v2GetInstance
tags:
- Orchestration
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
200:
description: The workflow instance
content:
application/json:
schema:
$ref: '#/components/schemas/V2GetWorkflowInstanceResponse'
/v2/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: v2SendEvent
tags:
- Orchestration
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
204:
description: No content
/v2/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: v2CancelEvent
tags:
- Orchestration
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
204:
description: No content
/v2/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: v2GetInstanceHistory
tags:
- Orchestration
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
200:
description: The workflow instance history
content:
application/json:
schema:
$ref: '#/components/schemas/V2GetWorkflowInstanceHistoryResponse'
/v2/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: v2GetInstanceStageHistory
tags:
- Orchestration
responses:
default:
$ref: '#/components/responses/V2ErrorResponse'
200:
description: The workflow instance stage history
content:
application/json:
schema:
$ref: '#/components/schemas/V2GetWorkflowInstanceHistoryStageResponse'
components:
parameters:
Cursor:
name: cursor
in: query
description: |
Parameter used in pagination requests.
Set to the value of next for the next page of results.
Set to the value of previous for the previous page of results.
No other parameters can be set when this parameter is set.
schema:
type: string
example: aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==
PageSize:
name: pageSize
in: query
description: |
The maximum number of results to return per page.
example: 100
schema:
type: integer
format: int64
minimum: 1
maximum: 1000
schemas:
V2ServerInfo:
type: object
required:
- version
properties:
version:
type: string
V2Error:
type: object
required:
- errorCode
- errorMessage
properties:
errorCode:
type: string
enum:
- VALIDATION
- NOT_FOUND
- INTERNAL
errorMessage:
type: string
V2WorkflowConfig:
type: object
required:
- stages
properties:
name:
type: string
stages:
type: array
items:
type: object
additionalProperties: { }
V2Workflow:
type: object
required:
- config
- createdAt
- updatedAt
- id
properties:
config:
$ref: '#/components/schemas/V2WorkflowConfig'
createdAt:
type: string
format: date-time
updatedAt:
type: string
format: date-time
id:
type: string
V2StageStatus:
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
V2WorkflowInstance:
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/V2StageStatus'
terminated:
type: boolean
terminatedAt:
type: string
format: date-time
error:
type: string
V2WorkflowInstanceHistoryStage:
type: object
required:
- name
- input
- startedAt
- terminated
- attempt
properties:
name:
type: string
input:
$ref: '#/components/schemas/V2WorkflowInstanceHistoryStageInput'
output:
$ref: '#/components/schemas/V2WorkflowInstanceHistoryStageOutput'
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
V2WorkflowInstanceHistory:
type: object
required:
- name
- input
- terminated
- startedAt
properties:
name:
type: string
input:
$ref: '#/components/schemas/V2Stage'
error:
type: string
terminated:
type: boolean
startedAt:
type: string
format: date-time
terminatedAt:
type: string
format: date-time
V2WorkflowInstanceHistoryList:
type: array
items:
$ref: '#/components/schemas/V2WorkflowInstanceHistory'
V2WorkflowInstanceHistoryStageList:
type: array
items:
$ref: '#/components/schemas/V2WorkflowInstanceHistoryStage'
V2ListWorkflowsResponse:
type: object
properties:
cursor:
type: object
required:
- pageSize
- hasMore
- data
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: ""
data:
type: array
items:
$ref: '#/components/schemas/V2Workflow'
required:
- cursor
V2TriggerData:
type: object
required:
- event
- workflowID
properties:
event:
type: string
workflowID:
type: string
filter:
type: string
vars:
type: object
additionalProperties: true
name:
type: string
V2Trigger:
allOf:
- $ref: '#/components/schemas/V2TriggerData'
- type: object
required:
- id
- createdAt
properties:
id:
type: string
createdAt:
type: string
format: date-time
V2TriggerOccurrence:
type: object
required:
- triggerID
- date
- event
properties:
date:
type: string
format: date-time
workflowInstanceID:
type: string
workflowInstance:
$ref: '#/components/schemas/V2WorkflowInstance'
triggerID:
type: string
error:
type: string
event:
type: object
additionalProperties: true
V2ListTriggersOccurrencesResponse:
type: object
properties:
cursor:
type: object
required:
- pageSize
- hasMore
- data
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: ""
data:
type: array
items:
$ref: '#/components/schemas/V2TriggerOccurrence'
required:
- cursor
V2ListTriggersResponse:
type: object
properties:
cursor:
type: object
required:
- pageSize
- hasMore
- data
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: ""
data:
type: array
items:
$ref: '#/components/schemas/V2Trigger'
required:
- cursor
V2ReadWorkflowResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Workflow'
V2CreateWorkflowRequest:
$ref: '#/components/schemas/V2WorkflowConfig'
V2CreateWorkflowResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Workflow'
V2CreateTriggerResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Trigger'
V2RunWorkflowRequest:
type: object
additionalProperties:
type: string
V2RunWorkflowResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2WorkflowInstance'
V2ListRunsResponse:
type: object
properties:
cursor:
type: object
required:
- pageSize
- hasMore
- data
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: ""
data:
type: array
items:
$ref: '#/components/schemas/V2WorkflowInstance'
required:
- cursor
V2GetWorkflowResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Workflow'
V2GetWorkflowInstanceResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2WorkflowInstance'
V2GetWorkflowInstanceHistoryResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2WorkflowInstanceHistoryList'
V2GetWorkflowInstanceHistoryStageResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2WorkflowInstanceHistoryStageList'
V2StageSendSourceWallet:
type: object
required:
- id
properties:
id:
type: string
balance:
type: string
V2StageSendDestinationWallet:
$ref: '#/components/schemas/V2StageSendSourceWallet'
V2StageSendSourceAccount:
type: object
required:
- id
properties:
id:
type: string
ledger:
type: string
V2StageSendDestinationAccount:
$ref: '#/components/schemas/V2StageSendSourceAccount'
V2StageSendSourcePayment:
type: object
required:
- id
properties:
id:
type: string
V2StageSendDestinationPayment:
type: object
required:
- psp
properties:
psp:
type: string
V2StageSendSource:
type: object
properties:
wallet:
$ref: '#/components/schemas/V2StageSendSourceWallet'
account:
$ref: '#/components/schemas/V2StageSendSourceAccount'
payment:
$ref: '#/components/schemas/V2StageSendSourcePayment'
V2StageSendDestination:
type: object
properties:
wallet:
$ref: '#/components/schemas/V2StageSendDestinationWallet'
account:
$ref: '#/components/schemas/V2StageSendDestinationAccount'
payment:
$ref: '#/components/schemas/V2StageSendDestinationPayment'
V2StageSend:
type: object
properties:
amount:
$ref: '#/components/schemas/V2Monetary'
destination:
$ref: '#/components/schemas/V2StageSendDestination'
source:
$ref: '#/components/schemas/V2StageSendSource'
metadata:
type: object
additionalProperties:
type: string
timestamp:
type: string
format: date-time
V2StageDelay:
type: object
properties:
until:
type: string
format: date-time
duration:
type: string
V2StageWaitEvent:
type: object
required:
- event
properties:
event:
type: string
V2UpdateAccount:
type: object
properties:
id:
type: string
metadata:
type: object
additionalProperties:
type: string
ledger:
type: string
required:
- id
- ledger
- metadata
V2Update:
type: object
properties:
account:
$ref: '#/components/schemas/V2UpdateAccount'
V2Stage:
anyOf:
- $ref: '#/components/schemas/V2StageSend'
- $ref: '#/components/schemas/V2StageDelay'
- $ref: '#/components/schemas/V2StageWaitEvent'
- $ref: '#/components/schemas/V2Update'
V2StripeTransferRequest:
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'
V2ActivityStripeTransfer:
$ref: '#/components/schemas/V2StripeTransferRequest'
V2ActivityListWallets:
type: object
properties:
name:
type: string
V2ActivityListWalletsOutput:
$ref: '#/components/schemas/V2ListWalletsResponse'
V2ListWalletsResponse:
type: object
required:
- cursor
properties:
cursor:
allOf:
- $ref: '#/components/schemas/V2Cursor'
- properties:
data:
items:
$ref: '#/components/schemas/V2Wallet'
type: array
type: object
required:
- data
V2Wallet:
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
V2Cursor:
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: ""
V2ActivityGetAccount:
type: object
required:
- id
- ledger
properties:
id:
type: string
ledger:
type: string
V2ActivityAddAccountMetadata:
type: object
properties:
id:
type: string
ledger:
type: string
metadata:
type: object
additionalProperties:
type: string
required:
- id
- ledger
- metadata
V2ActivityCreateTransaction:
type: object
properties:
ledger:
type: string
data:
$ref: '#/components/schemas/V2PostTransaction'
V2ActivityGetPayment:
type: object
required:
- id
properties:
id:
type: string
V2ActivityConfirmHold:
type: object
required:
- id
properties:
id:
type: string
V2ActivityCreditWallet:
type: object
properties:
id:
type: string
data:
$ref: '#/components/schemas/V2CreditWalletRequest'
V2CreditWalletRequest:
type: object
required:
- amount
- sources
- metadata
properties:
amount:
$ref: '#/components/schemas/V2Monetary'
metadata:
type: object
additionalProperties:
type: string
description: Metadata associated with the wallet.
reference:
type: string
sources:
type: array
items:
$ref: '#/components/schemas/V2Subject'
balance:
type: string
description: The balance to credit
timestamp:
type: string
format: date-time
example:
amount:
asset: USD/2
amount: 100
metadata:
key: ""
sources: [ ]
V2LedgerAccountSubject:
type: object
required:
- type
- identifier
properties:
type:
type: string
identifier:
type: string
V2WalletSubject:
type: object
required:
- type
- identifier
properties:
type:
type: string
identifier:
type: string
balance:
type: string
V2Subject:
discriminator:
propertyName: type
mapping:
ACCOUNT: '#/components/schemas/V2LedgerAccountSubject'
WALLET: '#/components/schemas/V2WalletSubject'
oneOf:
- $ref: '#/components/schemas/V2LedgerAccountSubject'
- $ref: '#/components/schemas/V2WalletSubject'
V2ActivityDebitWallet:
type: object
properties:
id:
type: string
data:
$ref: '#/components/schemas/V2DebitWalletRequest'
V2DebitWalletRequest:
type: object
required:
- amount
- metadata
properties:
amount:
$ref: '#/components/schemas/V2Monetary'
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/V2Subject'
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
V2ActivityGetWallet:
type: object
required:
- id
properties:
id:
type: string
V2ActivityVoidHold:
type: object
required:
- id
properties:
id:
type: string
V2ActivityGetAccountOutput:
$ref: '#/components/schemas/V2AccountResponse'
V2ActivityCreateTransactionOutput:
$ref: '#/components/schemas/V2CreateTransactionResponse'
V2CreateTransactionResponse:
properties:
data:
type: array
items:
$ref: '#/components/schemas/V2Transaction'
type: object
required:
- data
V2Transaction:
type: object
properties:
timestamp:
type: string
format: date-time
postings:
type: array
items:
$ref: '#/components/schemas/V2Posting'
reference:
type: string
example: ref:001
metadata:
$ref: '#/components/schemas/V2Metadata'
txid:
type: integer
format: bigint
minimum: 0
required:
- postings
- timestamp
- txid
- metadata
V2ActivityGetPaymentOutput:
$ref: '#/components/schemas/V2PaymentResponse'
V2PaymentResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Payment'
V2Payment:
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/V2Connector'
type:
type: string
enum:
- PAY-IN
- PAYOUT
- TRANSFER
- OTHER
status:
$ref: '#/components/schemas/V2PaymentStatus'
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/V2PaymentAdjustment'
metadata:
$ref: '#/components/schemas/V2PaymentMetadata'
V2Connector:
type: string
enum:
- STRIPE
- DUMMY-PAY
- WISE
- MODULR
- CURRENCY-CLOUD
- BANKING-CIRCLE
- MANGOPAY
- MONEYCORP
V2PaymentAdjustment:
type: object
required:
- status
- amount
- date
- raw
- absolute
properties:
status:
$ref: '#/components/schemas/V2PaymentStatus'
amount:
type: integer
format: bigint
minimum: 0
example: 100
date:
type: string
format: date-time
raw:
type: object
absolute:
type: boolean
V2PaymentStatus:
type: string
enum:
- PENDING
- ACTIVE
- TERMINATED
- FAILED
- SUCCEEDED
- CANCELLED
V2PaymentMetadata:
type: object
properties:
key:
type: string
nullable: true
V2ActivityDebitWalletOutput:
$ref: '#/components/schemas/V2DebitWalletResponse'
V2DebitWalletResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Hold'
V2Hold:
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/V2Subject'
V2ActivityGetWalletOutput:
$ref: '#/components/schemas/V2GetWalletResponse'
V2GetWalletResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2WalletWithBalances'
V2WalletWithBalances:
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/V2AssetHolder'
ledger:
type: string
V2AssetHolder:
type: object
required:
- assets
properties:
assets:
type: object
additionalProperties:
type: integer
format: bigint
V2WorkflowInstanceHistoryStageInput:
type: object
properties:
GetAccount:
$ref: '#/components/schemas/V2ActivityGetAccount'
AddAccountMetadata:
$ref: '#/components/schemas/V2ActivityAddAccountMetadata'
CreateTransaction:
$ref: '#/components/schemas/V2ActivityCreateTransaction'
StripeTransfer:
$ref: '#/components/schemas/V2ActivityStripeTransfer'
GetPayment:
$ref: '#/components/schemas/V2ActivityGetPayment'
ConfirmHold:
$ref: '#/components/schemas/V2ActivityConfirmHold'
CreditWallet:
$ref: '#/components/schemas/V2ActivityCreditWallet'
DebitWallet:
$ref: '#/components/schemas/V2ActivityDebitWallet'
GetWallet:
$ref: '#/components/schemas/V2ActivityGetWallet'
VoidHold:
$ref: '#/components/schemas/V2ActivityVoidHold'
ListWallets:
$ref: '#/components/schemas/V2ActivityListWallets'
V2WorkflowInstanceHistoryStageOutput:
type: object
properties:
GetAccount:
$ref: '#/components/schemas/V2ActivityGetAccountOutput'
CreateTransaction:
$ref: '#/components/schemas/V2ActivityCreateTransactionOutput'
GetPayment:
$ref: '#/components/schemas/V2ActivityGetPaymentOutput'
DebitWallet:
$ref: '#/components/schemas/V2ActivityDebitWalletOutput'
GetWallet:
$ref: '#/components/schemas/V2ActivityGetWalletOutput'
ListWallets:
$ref: '#/components/schemas/V2ListWalletsResponse'
V2Monetary:
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.
V2PostTransaction:
type: object
required:
- metadata
properties:
timestamp:
type: string
format: date-time
postings:
type: array
items:
$ref: '#/components/schemas/V2Posting'
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/V2Metadata'
V2Metadata:
type: object
additionalProperties:
type: string
example: { admin: "true" }
V2Posting:
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
V2AccountResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Account'
V2ReadTriggerResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2Trigger'
V2Account:
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/V2Volumes'
effectiveVolumes:
$ref: '#/components/schemas/V2Volumes'
V2Volume:
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
V2Volumes:
type: object
additionalProperties:
$ref: '#/components/schemas/V2Volume'
example:
USD:
input: 100
output: 10
balance: 90
EUR:
input: 100
output: 10
balance: 90
V2TestTriggerResponse:
type: object
required:
- data
properties:
data:
$ref: '#/components/schemas/V2TriggerTest'
V2TriggerTest:
type: object
properties:
filter:
type: object
properties:
match:
type: boolean
error:
type: string
variables:
type: object
additionalProperties:
type: object
properties:
value:
type: string
error:
type: string
responses:
V2ErrorResponse:
description: General error
content:
application/json:
schema:
$ref: '#/components/schemas/V2Error'