Initiate settlement
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
parties: [
{
role: '<string>',
wallet_address: '<string>',
principal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
external_reference: '<string>',
name: '<string>',
chain_id: 123
}
],
legs: [
{
leg_type: '<string>',
instrument_id: '<string>',
quantity: 1,
party_role: '<string>',
chain_id: 123,
token_standard: '<string>',
recipient_party_role: '<string>',
external_reference: '<string>'
}
],
timeout_at: '2023-11-07T05:31:56Z',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template_slug: '<string>',
external_reference: '<string>'
})
};
fetch('https://api.keystoneos.xyz/v1/settlements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.keystoneos.xyz/v1/settlements"
payload = {
"idempotency_key": "<string>",
"parties": [
{
"role": "<string>",
"wallet_address": "<string>",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"chain_id": 123
}
],
"legs": [
{
"leg_type": "<string>",
"instrument_id": "<string>",
"quantity": 1,
"party_role": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"recipient_party_role": "<string>",
"external_reference": "<string>"
}
],
"timeout_at": "2023-11-07T05:31:56Z",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_slug": "<string>",
"external_reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.keystoneos.xyz/v1/settlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"parties": [
{
"role": "<string>",
"wallet_address": "<string>",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"chain_id": 123
}
],
"legs": [
{
"leg_type": "<string>",
"instrument_id": "<string>",
"quantity": 1,
"party_role": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"recipient_party_role": "<string>",
"external_reference": "<string>"
}
],
"timeout_at": "2023-11-07T05:31:56Z",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_slug": "<string>",
"external_reference": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_version": 123,
"external_reference": "<string>",
"settlement_type": "<string>",
"parties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"wallet_address": "<string>",
"chain_id": 123,
"status": "<string>",
"confirmed_at": "2023-11-07T05:31:56Z",
"wallet_address_hint": "<string>",
"counterparty_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"legs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leg_type": "<string>",
"instrument_id": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"quantity": "<string>",
"direction": "<string>",
"party_role": "<string>",
"status": "<string>",
"external_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"recipient_party_role": "<string>",
"deposit_secret": "<string>",
"deposit_key": "<string>"
}
],
"state": "<string>",
"timeout_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"trade_type": "<string>",
"linked_settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coordinator": "<string>",
"coordinator_chain": "<string>",
"triggered_by": {},
"audit_anchor_hash": "<string>",
"repo_terms": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenor_days": 123,
"rate_bps": 123,
"haircut_bps": 123,
"margin_band_lower": "<string>",
"margin_band_upper": "<string>",
"close_leg_settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Settlements
Initiate settlement
Create a new settlement. Validates the template and parties, then creates the settlement in the template’s initial state. The settlement engine is enqueued automatically to advance through the template’s action chain. The request is idempotent - sending the same idempotency_key returns the existing settlement.
POST
/
v1
/
settlements
Initiate settlement
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
idempotency_key: '<string>',
parties: [
{
role: '<string>',
wallet_address: '<string>',
principal_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
external_reference: '<string>',
name: '<string>',
chain_id: 123
}
],
legs: [
{
leg_type: '<string>',
instrument_id: '<string>',
quantity: 1,
party_role: '<string>',
chain_id: 123,
token_standard: '<string>',
recipient_party_role: '<string>',
external_reference: '<string>'
}
],
timeout_at: '2023-11-07T05:31:56Z',
template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template_slug: '<string>',
external_reference: '<string>'
})
};
fetch('https://api.keystoneos.xyz/v1/settlements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.keystoneos.xyz/v1/settlements"
payload = {
"idempotency_key": "<string>",
"parties": [
{
"role": "<string>",
"wallet_address": "<string>",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"chain_id": 123
}
],
"legs": [
{
"leg_type": "<string>",
"instrument_id": "<string>",
"quantity": 1,
"party_role": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"recipient_party_role": "<string>",
"external_reference": "<string>"
}
],
"timeout_at": "2023-11-07T05:31:56Z",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_slug": "<string>",
"external_reference": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.keystoneos.xyz/v1/settlements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"idempotency_key": "<string>",
"parties": [
{
"role": "<string>",
"wallet_address": "<string>",
"principal_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"chain_id": 123
}
],
"legs": [
{
"leg_type": "<string>",
"instrument_id": "<string>",
"quantity": 1,
"party_role": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"recipient_party_role": "<string>",
"external_reference": "<string>"
}
],
"timeout_at": "2023-11-07T05:31:56Z",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_slug": "<string>",
"external_reference": "<string>"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"idempotency_key": "<string>",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template_version": 123,
"external_reference": "<string>",
"settlement_type": "<string>",
"parties": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"role": "<string>",
"platform_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"external_reference": "<string>",
"name": "<string>",
"wallet_address": "<string>",
"chain_id": 123,
"status": "<string>",
"confirmed_at": "2023-11-07T05:31:56Z",
"wallet_address_hint": "<string>",
"counterparty_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"legs": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"leg_type": "<string>",
"instrument_id": "<string>",
"chain_id": 123,
"token_standard": "<string>",
"quantity": "<string>",
"direction": "<string>",
"party_role": "<string>",
"status": "<string>",
"external_reference": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"recipient_party_role": "<string>",
"deposit_secret": "<string>",
"deposit_key": "<string>"
}
],
"state": "<string>",
"timeout_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"trade_type": "<string>",
"linked_settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"coordinator": "<string>",
"coordinator_chain": "<string>",
"triggered_by": {},
"audit_anchor_hash": "<string>",
"repo_terms": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenor_days": 123,
"rate_bps": 123,
"haircut_bps": 123,
"margin_band_lower": "<string>",
"margin_band_upper": "<string>",
"close_leg_settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}Authorizations
Auth0 JWT access token. See Authentication for details.
Body
application/json
Required string length:
1 - 255Minimum array length:
1Show child attributes
Show child attributes
Minimum array length:
1Show child attributes
Show child attributes
Maximum string length:
100Maximum string length:
255Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I