# Alpaca integrations: orders and positions

> Create an order and create a watchlist in Alpaca. Connect Alpaca to the rest of your finance stack with Tray.ai.

**Canonical page:** https://tray.ai/connectors/alpaca-integrations/
**Categories:** Finance
**Connects through:** HTTP Connector

## Overview

Alpaca is a brokerage platform with an API for trading US stocks, options, and crypto, plus paper trading accounts for testing strategies. Tray.ai connects to Alpaca through the HTTP Connector, so your workflows can call the Alpaca API alongside the rest of your stack.

## Use cases

### Orders

Read, create, update, and delete orders in Alpaca from any Tray.ai workflow. The Alpaca API covers calls such as create an order and list orders.

- Create an order
- List orders
- Get an order

### Positions

Read and update positions in Alpaca from any Tray.ai workflow. The Alpaca API covers calls such as list open positions and get an open position.

- List open positions
- Get an open position
- Close a position

### Watchlists

Read, create, update, and delete watchlists in Alpaca from any Tray.ai workflow. The Alpaca API covers calls such as list watchlists and create a watchlist.

- List watchlists
- Create a watchlist
- Update a watchlist

### Assets

Read assets in Alpaca from any Tray.ai workflow. The Alpaca API covers calls such as list assets and get an asset.

- List assets
- Get an asset

### Account activities

Read account activities in Alpaca from any Tray.ai workflow. The Alpaca API covers calls such as list account activities and list activities by type.

- List account activities
- List activities by type

## Challenges Tray.ai solves

### Keeping Alpaca credentials out of logs

A raw API call usually means pasting a key or token into the request, where it ends up in step inputs, logs, and screenshots.

**How Tray.ai helps:** Store Alpaca credentials once as a Tray.ai authentication and reference them from the HTTP Connector. Tray.ai masks authentication values in logs, so the secret never shows up in a step's input or output.

### Going from the Alpaca API docs to a working call

Translating an example request from API docs into a workflow step means copying the method, URL, headers, and body by hand.

**How Tray.ai helps:** Paste a cURL example from the Alpaca API docs into the HTTP Connector and Tray.ai fills in the method, URL, headers, and body for you.

### Handling files and non-JSON responses

Not every API answers in JSON. Some return XML, files, or binary data, or expect a multipart upload.

**How Tray.ai helps:** The HTTP Connector parses JSON and XML responses, returns files you can pass to the next step, and sends multipart form data for uploads.

## Frequently asked questions

### Does Tray.ai connect to Alpaca?

Yes. Tray.ai connects to Alpaca through the HTTP Connector, which calls the Alpaca API directly. Any call the Alpaca API documents can run as a step in a Tray.ai workflow.

### How does Tray.ai authenticate with Alpaca?

The Alpaca API uses an API key in a request header and basic authentication. You save it once as a Tray.ai authentication, and the HTTP Connector adds it to every request.

### Can I get a dedicated Alpaca connector?

Alpaca runs through the HTTP Connector rather than a dedicated connector. If your team wants one, the Tray.ai connector SDK can build a dedicated Alpaca connector from the Alpaca API.

## Learn more

- Tray iPaaS: https://tray.ai/platform/ipaas/
- Tray Helix agents: https://tray.ai/helix/agents/
- Agent Gateway for MCP: https://tray.ai/platform/agent-gateway/
- Book a demo: https://tray.ai/contact/
