When initiating a request for payment, for example, it is undesirable to permit modifying certain transaction parameters, such as payout destination, currency and quantity.
An intent
can be created with a fixed set of economics and any other parameters, without reference a quote. This intent
can then be shared with the user for them to fulfil. In the payment example this means passing the intent_id
to the initialization object of the widget.
A default (but still user changeable) currency can be set for either side of the transaction by setting the default_transaction
in the widget initialization.
POST https://partners.liquid.com/api/v1/intent{"public_api_key": "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","partner_reference": "optional external reference","payout_settlement": {"method": "LIQUID_PARTNER_WALLET","currency": "JPY","quantity": "6500"}}200{"success": true,"environment": "SANDBOX","message": "Transaction Order created. This order can now be fulfilled by a user in the widget.","payload": {"id": "634fa9ca-75b6-4ecc-bc61-e2555fe06323","created_at": "1606894572490","partner_id": "57e7b496-f2fd-4505-88d2-72afc7b3967e","partner_reference": "optional external reference","funding_settlement": null,"payout_settlement": {"method": "LIQUID_PARTNER_WALLET","currency": "JPY","quantity": "6500"}}}
Notice how in this example funding_settlement
is not set to allow the user to choose how to fund the transaction.
See widget configuration.
{"public_api_key": "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","intent": "634fa9ca-75b6-4ecc-bc61-e2555fe06323"}
This will cause the widget to start on the quote screen, but the payout currency and quantity will be locked.