Intents (Fixed Settlements)
Define the fixed economics of a transaction before hand.
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.
get
/api/v1/partner/{public_api_key}/intent
Create Intent

X-Quoine-Auth

Encoded payload must contain:
1
{
2
"token_id": "{created in Liquid web app, link above}",
3
"path": "/realtime",
4
"delegate_path": "/api/v1/partner/{public_api_key}/intent",
5
"nonce": {current unix timestamp}
6
}
Copied!

Strategy

The strategy field is optional, and defaults to ONE_TO_ONE_ATTEMPTED .
Strategy
Description
ONE_TO_ONE_ATTEMPTED
This causes the intent to be "consumed" the first time a user attempts to fulfil it. (Note: this refers to clicking "Buy now", not simply rendering the widget with the intent_id)
ONE_TO_MANY
This allows the intent to be reused multiple times. (Note: the partner_* fields will appear in each transaction created with the intent unless overridden in the widget configuration.)

Example

Notation
Javascript
1
POST https://partners.liquid.com/api/v1/partner/{public_api_key}/intent
2
{
3
"partner_ref": "optional external reference",
4
"payout_settlement": {
5
"method": "LIQUID_PARTNER_WALLET",
6
"currency": "JPY",
7
"quantity": "6500"
8
}
9
}
10
11
200
12
{
13
"success": true,
14
"environment": "SANDBOX",
15
"message": "Intent created. This intent can now be fulfilled by the widget.",
16
"payload": {
17
"id": "d627cead-8298-441c-a85a-bdf9c664877a",
18
"created_at": "1623231760578",
19
"expires_at": null,
20
"strategy": "ONE_TO_MANY",
21
"funding_settlement": null,
22
"payout_settlement": {
23
"method": "LIQUID_PARTNER_WALLET",
24
"currency": "JPY",
25
"quantity": "6540"
26
},
27
"partner_order_id": "searchable order id, max 40 characters",
28
"partner_ref": "Signed JWT",
29
"partner_tags": [
30
"campaign_id"
31
]
32
}
33
}
Copied!
1
const jwt = require("jwt-simple");
2
const axios = require("axios");
3
4
const tokenId = "";
5
const tokenSecret = "";
6
const publicApiKey = "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
7
8
const path = `/api/v1/partner/${publicApiKey}/intent`;
9
const apiBase = "https://partners.liquid.com";
10
11
const xQuoineAuth = jwt.encode(
12
{
13
token_id: tokenId,
14
path: "/realtime",
15
delegate_path: path,
16
nonce: Date.now(),
17
},
18
tokenSecret
19
);
20
21
axios({
22
method: "post",
23
url: apiBase + path,
24
headers: {
25
"X-Quoine-Auth": xQuoineAuth,
26
},
27
data: {
28
public_api_key: "pk_sandbox_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
29
payout_settlement: {
30
method: "LIQUID_PARTNER_WALLET",
31
currency: "JPY",
32
quantity: "6540",
33
},
34
strategy: "ONE_TO_MANY",
35
36
partner_order_id: "searchable order id, max 40 characters",
37
partner_ref: "Signed JWT",
38
partner_tags: ["campaign_id"],
39
},
40
})
41
.then((response) => {
42
console.log(response.data);
43
})
44
.catch((err) => console.log(err));
45
Copied!
Note: In this example funding_settlement is not set to allow the user to choose how to fund the transaction.

Pass the Intent ID to the Widget

1
{
2
"public_api_key": "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
3
"config_version": "1.2",
4
"intent_id": "634fa9ca-75b6-4ecc-bc61-e2555fe06323"
5
}
Copied!
This will cause the widget to start on the quote screen, but the payout currency and quantity will be locked.
Last modified 4mo ago