Skip to main content

GetLimitOrderByExternalReference

Retrieves a limit order by its external reference.

Convenient lookup using client-provided external reference identifier.

Method Options​

Authorisation specification of the GetLimitOrderByExternalReference method.

TypeMETHOD_TYPE_READ
Access LevelMETHOD_ACCESS_LEVEL_AUTHORISED
Roles
  • ROLE_TRADING_ADMIN
  • ROLE_TRADING_VIEWER
  • ROLE_TRADING_LIMIT_ORDER_ADMIN
  • ROLE_TRADING_LIMIT_ORDER_VIEWER

Parameters​

Request and response parameter message overview:

Input: GetLimitOrderByExternalReferenceRequest Message​

FieldTypeRequiredDescription
ExternalReference

string

True

The external reference identifier.

LiveLedgerData

bool

False

When true, fetches live ledger data including fill status. When false, returns only stored metadata.

Returns: LimitOrder Message​

Code Examples​

Select supported SDK in the language of your choice for a full example of how to invoke the this method:

package main

import (
"context"
"log"

limit_orderv1 "github.com/meshtrade/api/go/trading/limit_order/v1"
)

func main() {
ctx := context.Background()

// Default configuration is used and credentials come from MESH_API_CREDENTIALS
// environment variable or default discovery methods. Zero config required
// unless you want custom configuration.
service, err := limit_orderv1.NewLimitOrderService()
if err != nil {
log.Fatalf("Failed to create service: %v", err)
}
defer service.Close()

// Get a limit order by its external reference identifier
// This is useful when you track orders in your own system using custom IDs
externalRef := "my-trading-system-order-123"

request := &limit_orderv1.GetLimitOrderByExternalReferenceRequest{
ExternalReference: externalRef,
}

// Call the GetLimitOrderByExternalReference method
limitOrder, err := service.GetLimitOrderByExternalReference(ctx, request)
if err != nil {
log.Fatalf("GetLimitOrderByExternalReference failed: %v", err)
}

// Response contains the limit order matching the external reference
log.Printf("✓ Limit order found by external reference:")
log.Printf(" External reference: %s", limitOrder.ExternalReference)
log.Printf(" Resource name: %s", limitOrder.Name)
log.Printf(" Account: %s", limitOrder.Account)
log.Printf(" Side: %s", limitOrder.Side)
log.Printf(" Limit price: %s %s", limitOrder.LimitPrice.Value.Value, limitOrder.LimitPrice.Token.Code)
log.Printf(" Quantity: %s %s", limitOrder.Quantity.Value.Value, limitOrder.Quantity.Token.Code)
log.Printf("\nNote: External references must be unique within your group hierarchy")
}

Advanced Configuration​

For advanced client configuration options (custom endpoints, TLS settings, timeouts), see the SDK Configuration Guide.

Other Methods​