⚙️
1Konto v1.0 API Docs
  • Welcome!
  • Reference
    • API Reference
    • Service
      • Service Information
      • Service Time
    • Authentication
      • Login and Authentication
    • Market Data
      • Get Top of Book
      • Get Order Book
    • Accounting
      • Get Account
      • Get Account Credit
      • Get Transactions
      • Transfers Instructions
        • Get Deposit Instructions
        • Get Withdraw Instructions
      • Withdraw Requests
        • Request Withdraw - Fiat
        • Request Withdraw - Blockchain
        • Querying for Withdraw Requests
    • Orders
      • Available Asset Pairs
      • Request Indicative Price
      • Market Order
      • Limit Order
      • RFQ - Request for Quote
        • Request Quote
        • Accept Quote
      • Querying for Orders
      • Get Order
Powered by GitBook
On this page
  • Submit Market Order
  • Example
  1. Reference
  2. Orders

Market Order

requires auth

Submit Market Order

Use this endpoint to submit Market orders to be executed.

Currently, clients can request available asset pairs from their 1Konto representative. In the near future this information will also be available via API.

** ** nbbo price will always be better or equal to top of the book quotes

POST /api/v1/routing/account/{accountId}/order

Path Parameters:

Path
Type
Description

accountId *

string

your account ID

Body Parameters:

Body
Type
Description

type

string

type of order (market)

source *

string

the asset you want to sell

destination *

string

the asset you want to buy

size *

string

the amount of source asset

Example

POST /api/v1/routing/account/yourAccountId/order
// Request body
{
  "type": "market",
  "source": "USDT",
  "destination": "BTC",
  "size": "10000 USDT"
}
// Successful Response body
{
    "order": {
        "orderId": "theOrderIdXXXXXX",
        "accountId": "yourAccountId",
        "userId": "",
        "size": "10000 USDT",
        "source": "USDT",
        "destination": "BTC",
        "type": "market",
        "submittedAt": "2023-02-21T22:07:38.6325464Z",
        "result": {
            "status": "filled",
            "price": "0.0000411222366 USDT/BTC",
            "invertedPrice": "24,317.743 BTC/USDT", 
            "executedAt": "2023-02-21T22:07:41.5738624Z",
            "total": "0.411222366 BTC",
            "error": ""
        }
    },
    "status": "ok",
    "httpStatusCode": 200
}

// Error Responses
// Error Response body
{
    "tradesSubmitted": false,
    "orderId": "string",
    "trades": [],
    "errors": [
        "InsufficientFunds for accountId: string"
    ],
    "status": "failedDependency",
    "httpStatusCode": 424
}
// Error Response body
{
  "status": 500,
  "error": "Internal Server Error"
}

// Credit Limit - Error Responses
// outside of normal business hours when submitting order
{
    "orderId": "theOrderIdXXXXXX",
    "errors": [
        "Credit Not Available: 10000 USDT credit requested can not be granted outside of normal business hours.",
    ],
    "status": "failedDependency",
    "httpStatusCode": 424
}

// when we have business hours but account credit available is not enough to fill the order
{
    "orderId": "theOrderIdXXXXXX",
    "errors": [
        "Insufficient Funds: Requested 10000 USDT but only 1000 USDT is available"
    ],
    "status": "failedDependency",
    "httpStatusCode": 424
}

// global credit is not available , or , credit limit not available for destination asset
{
    "orderId": "theOrderIdXXXXXX",
    "errors": [
        "Credit Not Available: Your account is in good standing, but credit is not available at this time. Please contact your account executive."
    ],
    "status": "failedDependency",
    "httpStatusCode": 424
}
PreviousRequest Indicative PriceNextLimit Order

Last updated 11 months ago

Page cover image