Skip to main content
POST
/
v1
/
instructions
Submit settlement instruction
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    template_slug: '<string>',
    role: '<string>',
    party: {
      external_reference: '<string>',
      wallet_address: '<string>',
      name: '<string>',
      chain_id: 123
    },
    legs: [
      {
        instrument_id: '<string>',
        quantity: 1,
        direction: 'deliver',
        leg_type: 'asset_delivery',
        chain_id: 123,
        token_standard: '<string>'
      }
    ],
    timeout_at: '2023-11-07T05:31:56Z',
    idempotency_key: '<string>',
    trade_reference: '<string>'
  })
};

fetch('https://api.keystoneos.xyz/v1/instructions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "trade_reference": "<string>",
  "status": "<string>",
  "settlement_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "template_slug": "<string>",
  "role": "<string>",
  "party": {},
  "legs": [
    {}
  ],
  "timeout_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "created_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Auth0 JWT access token. See Authentication for details.

Body

application/json
template_slug
string
required
Required string length: 1 - 100
role
string
required
Required string length: 1 - 100
party
InstructionPartyInput · object
required
legs
InstructionLegInput · object[]
required
Minimum array length: 1
timeout_at
string<date-time>
required
idempotency_key
string
required
Required string length: 1 - 255
trade_reference
string | null
Maximum string length: 255

Response

Successful Response

Read schema for settlement instructions.

Maps party_data/legs_data from the ORM model to party/legs in the response using validation_alias with populate_by_name so both names are accepted.

id
string<uuid>
required
trade_reference
string
required
status
string
required
settlement_id
string<uuid> | null
required
template_slug
string
required
role
string
required
party
Party · object
required
legs
Legs · object[]
required
timeout_at
string<date-time>
required
expires_at
string<date-time>
required
created_at
string<date-time>
required