DevelopersOsai website ↗
API v1
Exchange / API reference

Preview Replacement

Request and response reference for POST /v1/exchange/markets/{market}/orders/{order}/replace/preview.

POST/v1/exchange/markets/{market}/orders/{order}/replace/preview
Authentication: Console sessionPermission: exchange.replace
Use the base URL and access configuration provided to your institution. Examples are request templates, not transaction results. Field tables focus on client fields; preserve additional metadata returned by the configured service.

Request

This interface uses an approved institutional session, not a financial API key. Session writes also need Origin and CSRF protection. Use the JavaScript sample within an authorized browser integration.

Request templatecURL
curl -X POST "$OSAI_CONSOLE_BASE_URL/v1/exchange/markets/$MARKET_ID/orders/$ORDER_ID/replace/preview" \
  -H "Content-Type: application/json" \
  -H "Origin: $OSAI_APP_ORIGIN" \
  -H "X-CSRF-Token: $OSAI_CSRF_TOKEN" \
  --cookie "$OSAI_SESSION_COOKIE_FILE" \
  --data '{
  "command_id": "<command_id>",
  "account_id": "<account_id>",
  "client_order_id": "<client_order_id>",
  "side": "<side>",
  "type": "<type>",
  "time_in_force": "<time_in_force>",
  "quantity": "1",
  "limit_price": "1",
  "protection_price": "1",
  "expected_version": "1"
}'

Parameters

NameLocationRequirementDescription
marketpath · stringRequiredUse the value defined for this resource.
orderpath · stringRequiredUse the value defined for this resource.
Originheader · stringRequiredUse the value defined for this resource.
X-CSRF-Tokenheader · stringRequiredUse the value defined for this resource.

Request body

Send JSON with Content-Type: application/json. Nested field names identify their parent object; required markers apply within that object. Replace template values using the relevant resource and configured instrument rules.

FieldTypeDescription & constraints
command_idRequired in parent objectstringDefined by the resource contract.
account_idRequired in parent objectstringDefined by the resource contract.
client_order_idRequired in parent objectstringDefined by the resource contract.
sideRequired in parent objectstringDefined by the resource contract.
typeRequired in parent objectstringDefined by the resource contract.
time_in_forceRequired in parent objectstringDefined by the resource contract.
quantityRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
limit_priceRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
protection_priceRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
expected_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$

Responses

Inspect HTTP status before parsing a body. These tables describe client response fields rather than invented successful transaction payloads.

200 · HTTP 200 response
FieldTypeDescription & constraints
preview_idRequired in parent objectstringDefined by the resource contract.
market_idRequired in parent objectstringDefined by the resource contract.
market_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
instructionRequired in parent objectobjectDefined by the resource contract.
instruction.command_idRequired in parent objectstringDefined by the resource contract.
instruction.kindRequired in parent objectstringDefined by the resource contract.
instruction.requestRequired in parent objectobjectDefined by the resource contract.
instruction.request.institution_idRequired in parent objectstringDefined by the resource contract.
instruction.request.account_idRequired in parent objectstringDefined by the resource contract.
instruction.request.actor_idRequired in parent objectstringDefined by the resource contract.
instruction.request.client_order_idRequired in parent objectstringDefined by the resource contract.
instruction.request.sideRequired in parent objectstringDefined by the resource contract.
instruction.request.typeRequired in parent objectstringDefined by the resource contract.
instruction.request.time_in_forceRequired in parent objectstringDefined by the resource contract.
instruction.request.quantityRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
instruction.request.limit_priceRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
instruction.request.protection_priceRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
instruction.target_order_idOptionalstringDefined by the resource contract.
instruction.expected_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_scheduleRequired in parent objectobjectDefined by the resource contract.
fee_schedule.schedule_idRequired in parent objectstringDefined by the resource contract.
fee_schedule.versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.effective_fromRequired in parent objectstringdate-timeDefined by the resource contract.
fee_schedule.effective_untilRequired in parent objectstringdate-timeDefined by the resource contract.
fee_schedule.makerRequired in parent objectobjectDefined by the resource contract.
fee_schedule.maker.currencyRequired in parent objectstringDefined by the resource contract.
fee_schedule.maker.minor_scaleRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.maker.numeratorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.maker.denominatorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.maker.roundingRequired in parent objectstringDefined by the resource contract.Values: FLOOR, CEILING
fee_schedule.takerRequired in parent objectobjectDefined by the resource contract.
fee_schedule.taker.currencyRequired in parent objectstringDefined by the resource contract.
fee_schedule.taker.minor_scaleRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.taker.numeratorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.taker.denominatorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
fee_schedule.taker.roundingRequired in parent objectstringDefined by the resource contract.Values: FLOOR, CEILING
taker_fee_at_boundRequired in parent objectobjectDefined by the resource contract.
taker_fee_at_bound.currencyRequired in parent objectstringDefined by the resource contract.
taker_fee_at_bound.amount_minorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
taker_fee_at_bound.schedule_idRequired in parent objectstringDefined by the resource contract.
taker_fee_at_bound.schedule_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
maker_fee_at_boundRequired in parent objectobjectDefined by the resource contract.
maker_fee_at_bound.currencyRequired in parent objectstringDefined by the resource contract.
maker_fee_at_bound.amount_minorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
maker_fee_at_bound.schedule_idRequired in parent objectstringDefined by the resource contract.
maker_fee_at_bound.schedule_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
exact_notional_at_boundRequired in parent objectobjectDefined by the resource contract.
exact_notional_at_bound.currencyRequired in parent objectstringDefined by the resource contract.
exact_notional_at_bound.numeratorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
exact_notional_at_bound.denominatorRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
book_sequenceRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
identity_policy_idRequired in parent objectstringDefined by the resource contract.
identity_policy_versionRequired in parent objectstringExact nonnegative base-10 integer; never a JSON number.Pattern: ^(0|[1-9][0-9]*)$
created_atRequired in parent objectstringdate-timeDefined by the resource contract.
expires_atRequired in parent objectstringdate-timeDefined by the resource contract.
terms_hashRequired in parent objectstringDefined by the resource contract.
400 · Invalid bounded instruction

No client body fields are defined for this response.

401 · Authentication required

No client body fields are defined for this response.

403 · Permission, recent verified MFA or CSRF denied

No client body fields are defined for this response.

409 · Version, preview, instruction or capacity conflict

No client body fields are defined for this response.

503 · Unavailable or unknown commit outcome; query the original command before retrying

No client body fields are defined for this response.

Retries & recovery

Keep the original request identifiers and any required idempotency key. A timeout does not establish failure. Read the original resource or command before another financial write; use expected versions for concurrent changes.

16 suggested pages

Get startedIntroductionIntegrate institutional FX and stablecoin trading with quotes, orders, market data, account records and settlement reporting.Get startedQuickstartMake an authenticated read, request a quote and follow an instruction without losing its original references.Get startedAuthenticationUse the correct authentication scheme for API credentials, Console sessions and market-data feeds.Get startedErrorsDistinguish invalid inputs, denied access, conflicts, rate limits and uncertain outcomes.Get startedRate limitsUse response headers, bounded concurrency and backoff rather than repeated bursts.Get startedAmounts & precisionKeep minor-unit money, fixed-point FX rates and instrument-scaled quantities exact.Get startedPagination & recoveryUse each resource’s pagination model and preserve stable recovery checkpoints.Financial workflowsQuotes & acceptanceRequest explicit FX economics, review conditions and retain accepted terms.Financial workflowsTrade lifecycleTrack funding, execution and settlement as distinct business transitions.Financial workflowsBalances & transactionsRead institutional financial positions and reconcile movements by currency.Financial workflowsBeneficiariesRegister beneficiaries and coordinate their institutional approval lifecycle.Financial workflowsCredential managementCreate, inspect, rotate and revoke application credentials without exposing secrets.Events & reliabilityIdempotencyPrevent duplicate financial effects across retries and uncertain outcomes.Events & reliabilityWebhooks & verificationVerify deliveries, persist original events and make downstream processing idempotent.Events & reliabilityEvent payloadsUnderstand the customer event envelope and business transitions behind subscriptions.Events & reliabilityDelivery retries & replayRepair webhook delivery without creating a second business event.