# Book a trade

## Goal

Book a trade done in another system.

You can then take advantage of Integral's advanced analytics, reporting, and credit management.

## Prerequisites

- Your REST API app.
- Integral API login with trading permission.
- A trade done in another system.


## Steps

```mermaid
flowchart TD
  LOGIN(Step 1: Login) --> BOOK(Step 2: Book trade)
  click LOGIN "#step-1-login"
  click BOOK "#step-2-book-a-trade"
```

### Step 1: Login

Use the [Login and get token](/openapi/integral-api-reference/rest/authentication-api/login) endpoint.

See the related [Login](/developer-portal/tutorials/tutorialauth/) tutorial.

Your access token is in `SSO_TOKEN` of the response header. Your token is valid for limited time.

Pass the `SSO_TOKEN` cookie value with all of your subsequent API requests.

```json Payload application/json
{
  "user": "apiUserId",
  "pass": "This is a long password!",
  "org": "apiOrganizationId"
}
```

### Step 2: Book a trade

Use the [Book a trade](/openapi/integral-api-reference/rest/trades/booktrade) endpoint.

```json Payload application/json
{
  "type": "Spot",
  "channel": "1",
  "clientRequestId": "req Spot 644",
  "counterparty": "BrokerOrg",
  "counterpartyAccount": "BrokerOrgLE",
  "counterpartyTrader": "BrokerOrgUser",
  "coverRate": 1.1234,
  "creditMode": 2,
  "creditValuationAdjustment": 1.44,
  "customerAccount": "CustOrg1le1",
  "customerOrg": "CustOrg1",
  "trader": "CustOrg1User",
  "dealtAmount": 2000000,
  "dealtIns": "USD",
  "note": "Notes on trade",
  "rate": 1.09706,
  "rateId": "2022-05-12-GBPUSD-SP-435cd558",
  "referenceId": "ref A4f2",
  "side": "SELL",
  "spotRate": 1.09696,
  "stp": true,
  "symbol": "GBP/USD",
  "tradeDate": "2022-05-12",
  "valueDate": "2022-05-17"
}
```