orders.v1.OrdersService
GetBatchReplaceStatus
Retrieve durable execution status for one admitted batch replacement.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/orders.v1.OrdersReadService/GetBatchReplaceStatus' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"batchRequestId": "1",
"subaccountId": "6789012345678"
}'Responses
{
"acceptedCount": 1,
"acceptedTsNs": "1735689600000000000",
"admissionStatus": "BATCH_REPLACE_ADMISSION_STATUS_ADMITTED",
"batchRequestId": "1",
"items": [
{
"actionTaken": "AMENDED",
"code": "value",
"itemIndex": 1,
"oldOrderId": "9876543210123",
"orderStatus": "PENDING",
"phase": "BATCH_REPLACE_PHASE_ADMITTED",
"replacementOrderId": "9876543210123",
"updatedTsNs": "1735689600000000000"
}
],
"rejectedCount": 1,
"updatedTsNs": "1735689600000000000"
}orders.v1.GetBatchReplaceStatusRequestorders.v1.GetBatchReplaceStatusResponseOptional public subaccount ID. When omitted, subaccount-scoped API keys use their bound subaccount; other callers use their authenticated root account.
Server-issued batch identity from BatchReplaceOrders.
Server-issued batch identity.
Aggregate admission status returned by the write receipt.
Zero-based item index from the write request.
Current recoverable phase.
Original order targeted by the replacement.
Assigned successor order ID. Zero for an amended item or rejection before assignment.
Current successor status, or the amended order's status, when available.
Stable rejection or terminal error code. Empty when none.
Latest status timestamp in nanoseconds since epoch.
REPLACED admits a successor. AMENDED keeps the order under old_order_id with no successor, and order_status describes it. Unspecified for rejected items.
Number of admitted items.
Number of rejected items.
Server acceptance timestamp in nanoseconds since epoch.
Latest batch status timestamp in nanoseconds since epoch.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| api-key-policy-required | 403 | permission_denied | API Key Policy Required | This API key must have a policy attached before it can be used for reading. |
| api-key-root-scope-only | 403 | permission_denied | API Key Root Scope Only | This API key is scoped to the master account and cannot read sub-accounts. |
| api-key-spot-read-deny | 403 | permission_denied | API Key Spot Read Denied | API key policy does not allow reading spot data. |
| api-key-subaccount-mismatch | 403 | permission_denied | API Key Subaccount Mismatch | This API key is scoped to a different sub-account than the one requested. |
| api-key-sub-scope-only | 403 | permission_denied | API Key Sub Scope Only | This API key is scoped to a specific sub-account and cannot read the master account. |
| api-key-unknown | 403 | permission_denied | API Key Unknown | API key referenced in the request could not be resolved by the Orders service. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| invalid-before-ts-ns | 400 | invalid_argument | Invalid beforeTsNs | beforeTsNs must be an unsigned integer. |
| invalid-end-time | 400 | invalid_argument | Invalid End Time | endTime must be RFC3339. |
| invalid-limit | 400 | invalid_argument | Invalid Limit | Limit must be between 1 and 1000. |
| invalid-offset | 400 | invalid_argument | Invalid Offset | Offset must be zero or positive. |
| invalid-order-id | 400 | invalid_argument | Invalid Order ID | order_id is invalid. |
| invalid-order-status | 400 | invalid_argument | Invalid Order Status | Order status value is invalid. |
| invalid-page-token | 400 | invalid_argument | Invalid Page Token | pageToken is invalid for this account or request. |
| invalid-side | 400 | invalid_argument | Invalid Side | Side must be BUY or SELL. |
| invalid-start-time | 400 | invalid_argument | Invalid Start Time | startTime must be RFC3339. |
| invalid-subaccount-id | 400 | invalid_argument | Invalid Subaccount ID | Subaccount ID is invalid. |
| invalid-symbol | 400 | invalid_argument | Invalid Symbol | Symbol format is invalid. |
| invalid-trigger-id | 400 | invalid_argument | Invalid Trigger ID | trigger_id is invalid. |
| invalid-trigger-status | 400 | invalid_argument | Invalid Trigger Status | Trigger status value is invalid. |
| invalid-trigger-type | 400 | invalid_argument | Invalid Trigger Type | triggerType value is invalid. |
| not-found | 404 | not_found | Not Found | Not found. |
| order-id-required | 400 | invalid_argument | Order ID Required | order_id is required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| policy-spot-read-deny | 403 | permission_denied | Spot Read Denied | Effective policy does not allow reading spot data for this API key or sub-account. |
| request-too-large | 413 | invalid_argument | Request Too Large | Request body too large. |
| subaccount-read-forbidden | 403 | permission_denied | Sub-account Read Forbidden | You do not have permission to read this sub-account. |
| trigger-id-required | 400 | invalid_argument | Trigger ID Required | trigger_id is required. |
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| unavailable | 503 | unavailable | Service Unavailable | Service unavailable. |
| unknown-symbol | 400 | invalid_argument | Unknown Symbol | Unknown symbol. |
| upstream-error | 502 | unavailable | Upstream Error | Upstream dependency error. |
| validation-error | 400 | invalid_argument | Validation Error | Request validation failed. |