# API

At the heart of the order book are the following simple operations, exposed by our clearing house contract:

1. **PlaceOrder:**

The supported time-in-force options are as follows:

(a)  IOC (immediate or cancel): The order is treated as a taker order and is immediately executed against the book. Partial executions are allowed. Any remaining order size is ignored.

(b)  FOK (fill or kill): Similar to IOC, the order is immediately executed against the book. However, only full executions are allowed. If the order is not able to be completely filled, it will be rejected.

(c)  GTC (good till cancel): The order is sent to rest on the book until the user explicitly cancels the order.

If the postOnly flag is set to false, then the order is allowed to be first executed against the book. Any remaining order size will then rest on the book.

(d)  GTD (good till date): This is similar to GTC, but a user also specifies a deadline. When the deadline is exceeded, the order becomes expired and no longer participates in order matching.

The user can set stop-loss and take-profit trigger prices.

2. **CancelOrder**

Cancel or remove orders from the book.&#x20;

<figure><img src="https://752543198-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNnFrq0zfoCZICZmerpEY%2Fuploads%2FP0WHW8NbZIi368CCzgUR%2FScreenshot%202024-06-24%20at%209.50.49%E2%80%AFPM.png?alt=media&#x26;token=6fff7e82-edd4-472c-9049-cee21fe0a4ac" alt=""><figcaption><p>Flow chart showing how order moves throughout the system</p></figcaption></figure>
