⚙️
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 Limit Order
  • Example
  1. Reference
  2. Orders

Limit Order

requires auth

Submit Limit Order

Use this endpoint to submit Limit 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/limit

Path Parameters:

Path
Type
Description

accountId *

string

your account ID

Body Parameters:

Body
Type
Description

accountId *

object (ID)

type

string

type of order (limit)

source *

string

the asset you want to sell

destination *

string

the asset you want to buy

size *

string

the amount of source asset

limit

string

price limit for execution, expressed as Source/Destination. Example: BTC/USD -> $59000 USD.

endAt

string

Time when you want the order to cancel. YY-MM-DDTHH:MM:SEC.

Example 2019-08-24T14:15:22Z

Example

POST /api/v1/routing/account/yourAccountId/order/limit
// Request body
{
    "accountId": {
        "value": "yourAccountId"
    },
    "type": "limit",
    "source": "USDT",
    "destination": "BTC",
    "size": "10000",
    "clientOrderId": "string",
    "limit": "0.0000411222366",
    "endAt": "2023-08-24T14:15:22Z"
}
// Successful Response body
{
    "order": {
        "orderId": "theOrderIdXXXXXX",
        "accountId": "yourAccountId",
        "userId": "",
        "size": "10000 USDT",
        "source": "USDT",
        "destination": "BTC",
        "type": "limit",
        "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": [
        "Invalid input provided"
    ],
    "status": "failedDependency",
    "httpStatusCode": 400
}
// 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
}
PreviousMarket OrderNextRFQ - Request for Quote

Last updated 8 months ago

Page cover image