Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.grainfinance.co/llms.txt

Use this file to discover all available pages before exploring further.

Grain’s API provides a comprehensive set of endpoints for managing hedging, spot transactions, pricing, and fund movements — enabling seamless integration of FX workflows into your platform.

Base URL

https://api.grainfinance.co/v1

Authentication

All endpoints use HTTP Basic Authentication. Your Client ID is the username and your Secret is the password.
curl https://api.grainfinance.co/v1/... \
  -u "{clientId}:{secret}"
You can find your credentials in the Grain Dashboard under Developer → API Keys. Each environment (Sandbox and Live) has separate credentials.

Environments

EnvironmentBase URL
Sandboxhttps://api.grainfinance.co/v1 (use Sandbox credentials)
Livehttps://api.grainfinance.co/v1 (use Live credentials)
Switch between environments by swapping your Client ID and Secret — the base URL is the same for both.

Response format

All responses are JSON. Errors follow a consistent structure:
{
  "message": "A description of the error"
}
HTTP status codes follow standard conventions: 2xx for success, 4xx for client errors, 5xx for server errors.