HTTP API

Handshake

GET/api/v1/handshake/{domain}/sessions
GET
/api/v1/handshake/{domain}/sessions

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Query Parameters

mine?boolean

Only return sessions where the caller is a party

status?string

Filter by session status (NEGOTIATING, AGREED, ...)

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_by?string

Sort field (created_at, updated_at, round)

sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"

Response Body

application/json

curl -X GET "https://example.com/api/v1/handshake/string/sessions"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "sessions": [    {      "active_offer_id": "string",      "created_at": "2019-08-24T14:15:22Z",      "domain": "string",      "initiator": {        "id": "string",        "kind": "auth_user",        "label": "string"      },      "policy": {        "max_rounds": 0,        "offer_ttl_seconds": 0,        "session_ttl_seconds": 0,        "settlement_timeout_seconds": 0      },      "responder": {        "id": "string",        "kind": "auth_user",        "label": "string"      },      "round": 0,      "session_id": "string",      "settlement_id": "string",      "status": "NEGOTIATING",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST/api/v1/handshake/{domain}/sessions
POST
/api/v1/handshake/{domain}/sessions

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions" \  -H "Content-Type: application/json" \  -d '{    "counterparty_id": "string",    "counterparty_kind": "auth_user"  }'
{  "opening_offer": null,  "session": {    "active_offer_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "domain": "string",    "initiator": {      "id": "string",      "kind": "auth_user",      "label": "string"    },    "policy": {      "max_rounds": 0,      "offer_ttl_seconds": 0,      "session_ttl_seconds": 0,      "settlement_timeout_seconds": 0    },    "responder": {      "id": "string",      "kind": "auth_user",      "label": "string"    },    "round": 0,    "session_id": "string",    "settlement_id": "string",    "status": "NEGOTIATING",    "updated_at": "2019-08-24T14:15:22Z"  }}
GET/api/v1/handshake/{domain}/sessions/{id}
GET
/api/v1/handshake/{domain}/sessions/{id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/handshake/string/sessions/string"
{  "active_offer_id": "string",  "created_at": "2019-08-24T14:15:22Z",  "domain": "string",  "initiator": {    "id": "string",    "kind": "auth_user",    "label": "string"  },  "policy": {    "max_rounds": 0,    "offer_ttl_seconds": 0,    "session_ttl_seconds": 0,    "settlement_timeout_seconds": 0  },  "responder": {    "id": "string",    "kind": "auth_user",    "label": "string"  },  "round": 0,  "session_id": "string",  "settlement_id": "string",  "status": "NEGOTIATING",  "updated_at": "2019-08-24T14:15:22Z"}
POST/api/v1/handshake/{domain}/sessions/{id}/cancel
POST
/api/v1/handshake/{domain}/sessions/{id}/cancel

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/cancel"
{  "message": "string",  "rolled_back": true,  "session_id": "string"}
GET/api/v1/handshake/{domain}/sessions/{id}/history
GET
/api/v1/handshake/{domain}/sessions/{id}/history

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Query Parameters

view?string

View mode: "transcript" (default) or "concessions"

Response Body

application/json

curl -X GET "https://example.com/api/v1/handshake/string/sessions/string/history"
{  "concessions": [    {      "deltas": [        {          "currency_deltas": [            {              "currency_id": "string",              "delta": 0.1            }          ],          "items_added": [            "string"          ],          "items_removed": [            "string"          ],          "party_id": "string",          "terms_changed": [            "string"          ]        }      ],      "round": 0    }  ],  "offers": [    {      "bundle": {        "initiator_gives": {          "currency_legs": [            {              "amount": 0.1,              "currency_id": "string"            }          ],          "item_legs": [            {              "item_id": "string",              "quantity": 0            }          ],          "terms": [            {              "binding": true,              "key": "string",              "value": "string"            }          ]        },        "responder_gives": {          "currency_legs": [            {              "amount": 0.1,              "currency_id": "string"            }          ],          "item_legs": [            {              "item_id": "string",              "quantity": 0            }          ],          "terms": [            {              "binding": true,              "key": "string",              "value": "string"            }          ]        }      },      "created_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z",      "in_reply_to": "string",      "offer_id": "string",      "proposed_by": "string",      "round": 0,      "session_id": "string",      "status": "OPEN"    }  ],  "session_id": "string",  "view": "string"}
POST/api/v1/handshake/{domain}/sessions/{id}/offers
POST
/api/v1/handshake/{domain}/sessions/{id}/offers

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/offers" \  -H "Content-Type: application/json" \  -d '{    "bundle": {      "initiator_gives": {},      "responder_gives": {}    }  }'
{  "bundle": {    "initiator_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    },    "responder_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    }  },  "created_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "in_reply_to": "string",  "offer_id": "string",  "proposed_by": "string",  "round": 0,  "session_id": "string",  "status": "OPEN"}
POST/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/accept
POST
/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/accept

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string
offer_id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/offers/string/accept"
{  "accepted_offer_id": "string",  "deadline_at": "2019-08-24T14:15:22Z",  "initiator_stage": {    "confirmed": true,    "item_lock_ids": [      "string"    ],    "ledger_hold_ids": [      "string"    ],    "party_id": "string",    "staged": true  },  "responder_stage": {    "confirmed": true,    "item_lock_ids": [      "string"    ],    "ledger_hold_ids": [      "string"    ],    "party_id": "string",    "staged": true  },  "session_id": "string",  "settlement_id": "string",  "status": "STAGING"}
POST/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/reject
POST
/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/reject

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string
offer_id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/offers/string/reject"
{  "bundle": {    "initiator_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    },    "responder_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    }  },  "created_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "in_reply_to": "string",  "offer_id": "string",  "proposed_by": "string",  "round": 0,  "session_id": "string",  "status": "OPEN"}
POST/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/withdraw
POST
/api/v1/handshake/{domain}/sessions/{id}/offers/{offer_id}/withdraw

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string
offer_id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/offers/string/withdraw"
{  "bundle": {    "initiator_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    },    "responder_gives": {      "currency_legs": [        {          "amount": 0.1,          "currency_id": "string"        }      ],      "item_legs": [        {          "item_id": "string",          "quantity": 0        }      ],      "terms": [        {          "binding": true,          "key": "string",          "value": "string"        }      ]    }  },  "created_at": "2019-08-24T14:15:22Z",  "expires_at": "2019-08-24T14:15:22Z",  "in_reply_to": "string",  "offer_id": "string",  "proposed_by": "string",  "round": 0,  "session_id": "string",  "status": "OPEN"}
POST/api/v1/handshake/{domain}/sessions/{id}/settlement/confirm
POST
/api/v1/handshake/{domain}/sessions/{id}/settlement/confirm

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/settlement/confirm" \  -H "Content-Type: application/json" \  -d '{}'
{  "outcome": "WAITING_FOR_COUNTERPARTY",  "settlement": {    "accepted_offer_id": "string",    "deadline_at": "2019-08-24T14:15:22Z",    "initiator_stage": {      "confirmed": true,      "item_lock_ids": [        "string"      ],      "ledger_hold_ids": [        "string"      ],      "party_id": "string",      "staged": true    },    "responder_stage": {      "confirmed": true,      "item_lock_ids": [        "string"      ],      "ledger_hold_ids": [        "string"      ],      "party_id": "string",      "staged": true    },    "session_id": "string",    "settlement_id": "string",    "status": "STAGING"  }}
POST/api/v1/handshake/{domain}/sessions/{id}/settlement/stage
POST
/api/v1/handshake/{domain}/sessions/{id}/settlement/stage

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string
id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/sessions/string/settlement/stage"
{  "accepted_offer_id": "string",  "deadline_at": "2019-08-24T14:15:22Z",  "initiator_stage": {    "confirmed": true,    "item_lock_ids": [      "string"    ],    "ledger_hold_ids": [      "string"    ],    "party_id": "string",    "staged": true  },  "responder_stage": {    "confirmed": true,    "item_lock_ids": [      "string"    ],    "ledger_hold_ids": [      "string"    ],    "party_id": "string",    "staged": true  },  "session_id": "string",  "settlement_id": "string",  "status": "STAGING"}
POST/api/v1/handshake/{domain}/settlements/sweep
POST
/api/v1/handshake/{domain}/settlements/sweep

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

domain*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/handshake/string/settlements/sweep"
{  "cancelled": 0,  "message": "string"}

On this page