send
statement is the main and most powerful stage of the Workflow definition. It allows you to natively send money from a payment to a ledger account, from a ledger account to a wallet and from a wallet to a payment initiation, handling the implementation of the actual underlying semantics.
It can be added to a Workflow definition by creating a new stage with the send
type:
send
statement is composed of three main attributes:
source
: the source of the funds to be sentdestination
: the destination of the funds to be sentamount
: the amount of funds to be sent
source
and destination
parts can reference either a ledger account, a wallet or a payment.
Compatibility matrix
↘️ Ledger account | ↘️ Wallet | ↘️ Payment | |
---|---|---|---|
↗️ Ledger account | ✅ | ✅ | Partial support [1] |
↗️ Wallet | ✅ | ✅ | Partial support [1] |
↗️ Payment | ✅ | ✅ | ❌ |
send
statement can be used with a payment block as the destination, which will initiate a payment to the PSP defined in the psp
attribute. This is currently supported only for the stripe
connector, though support for other connectors will be added in the future.
Source types
Ledger account
A ledger account can be referenced by providing theaccount
attribute, which is composed of the id
and ledger
attributes, referencing the account address and the ledger name respectively:
Wallet
A wallet can be referenced by providing thewallet
attribute:
Payment
A payment can be referenced by providing thepayment
attribute:
Destination types
Ledger account
A ledger account can be referenced by providing theaccount
and ledger
attributes:
Wallet
A wallet can be referenced by providing thewallet
attribute:
Payment
Beyond the syntax, it’s important to understand the effective behaviour of defining a payment block as the destination of asend
statement.
Here, we won’t reference a payment by its identifier (as it doesn’t exist yet), but rather the connector we want to use to initiate a payment. This is done by providing the psp
attribute:
send
statement will create a payment initiation request to the PSP defined in the psp
attribute. The payment initiation request will be sent to the PSP with the amount and asset defined in the amount
attribute.