Orders

Orders buy or sell market instruments (stocks, bonds, letras, CEDEARs). Preview an order to show fees and totals, create it, then track completion asynchronously.

Recommended flow:

  1. Preview the order to show the user fees and the estimated total.
  2. Create the order.
  3. Track completion via GET /broker/v1/api/order/{orderAnyId} or the order-status-update webhook.

Create an order

curl -X POST https://sandbox.manteca.dev/broker/v1/api/order \
  -H "md-api-key: $MD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "userAnyId": "64ec95a93adb2d241db28a78",
      "side": "BUY",
      "type": "LIMIT",
      "settlement": "DAY",
      "asset": "AL30",
      "against": "ARS",
      "assetAmount": "10",
      "price": "24322",
      "externalId": "693cacbe-da94-4adc-af41-056028f988ae"
  }'
{
  "id": "65bbe29cfbe4be99d4be0378",
  "userId": "65bab11c23331f98515d2e50",
  "status": "PENDING",
  "side": "BUY",
  "type": "LIMIT",
  "settlement": "DAY",
  "asset": "AL30",
  "against": "ARS",
  "amount": 10,
  "filledAmount": 0,
  "price": 24322,
  "fee": 0.0026,
  "finalClaimInfo": { "asset": "ARS", "total": 2438.53, "base": 2432.2, "totalFees": 6.33 },
  "finalCreditInfo": { "asset": "AL30", "total": 0, "base": 0, "totalFees": 0 },
  "externalId": "693cacbe-da94-4adc-af41-056028f988ae",
  "creationTime": "2024-02-01T15:27:40.211-03:00"
}

Order fields

FieldTypeNotes
userAnyIdstringRequired. User identifier: the Manteca internal user id, the user's numberId, or the externalId you assigned.
sideenumRequired. BUY or SELL.
typeenumRequired. MARKET or LIMIT.
settlementenumRequired. INSTANT or DAY.
assetstringRequired. Instrument ticker (for example AL30).
againstenumRequired. ARS or USD.
assetAmountstringWhole units of the instrument. Send exactly one of assetAmount or againstAmount.
againstAmountstringAmount of currency. Send exactly one of assetAmount or againstAmount.
pricestringRequired for LIMIT. Expressed per 100 units.
externalIdstringOptional. Your reference, used for idempotency.

Idempotency. Set externalId to a UUID from your side to avoid duplicate orders on retries.


Order statuses

StatusDescription
PENDING_EXECUTIONFCI subscriptions and redemptions: accepted and scheduled for the fund's executionTime.
PENDINGCreated but not yet sent to market.
SENTSent to market; awaiting result.
COMPLETEDExecuted successfully.
FAILEDSent but could not complete.
CANCELLEDCancelled before completing.

Typical lifecycle: PENDING → SENT → COMPLETED | FAILED | CANCELLED. FCI orders go PENDING_EXECUTION → COMPLETED. Partially executed orders have filledAmount < amount.


Order creation error codes

internalStatusHTTPDescription
MIN_ASSET_AMOUNT400Below the minimum instrument amount.
ORDER_MARKET_PRICE_OVERRIDE400Price override not allowed for market order.
MISSING_PRICE400price required for a limit order.
BANK_HOLIDAY400Market closed (bank holiday).
INVALID_ASSET400Instrument not supported.
DUPLICATE_REQUEST400The same request is still being processed.
PRICE_OUT_OF_BOUNDS400Price outside allowed bounds.
INVALID_PRICE_STEP_SIZE400Price does not respect the step size.
MIN_AMOUNT / MAX_AMOUNT400Amount outside allowed range.
TICK_SIZE400Amount does not respect the tick size.
NO_FUNDS400Insufficient funds.
PERSON_DEPOSIT_LIMIT403Person operational limit reached.
NO_USD_ACCOUNT / NO_ARS_ACCOUNT403Missing required currency account.
UNFINISHED_PARKING403A prior parking operation is unfinished.
COMPANY_RESERVES409Company reserves insufficient.
ORDER_EXISTS409An order with this externalId already exists.

Endpoint references

For retry policy and idempotency, see Errors and controls.


Did this page help you?