---
title: "Create a ramp"
url: https://docs.truemarkets.co/api/gateway/create-ramp
description: "Creates an onramp that buys crypto with fiat, or an offramp that converts the user's stablecoin balance to fiat, through the given provider. The response's redirect_url is the provider page the user completes the ramp on."
---

Docs index: https://docs.truemarkets.co/llms.txt

# Create a ramp

Creates an onramp that buys crypto with fiat, or an offramp that converts the user's stablecoin balance to fiat, through the given provider. The response's `redirect_url` is the provider page the user completes the ramp on.

An offramp tops any shortfall up from the user's CeFi balance first, which requires enough CeFi PYUSD, and returns a `bridge_plan` when the user's own cross-chain funds must move first: sign its payloads, submit them to `POST /ramps/{id}/bridge/execute`, then call `POST /ramps/{id}/prepare`.

An onramp has nothing to sign, and is subject to provider preconditions: phone verification, accepted provider terms, an active wallet, and amount limits.

**Rate limit:** counts against the Money movement limit, 20 a minute and 300 a day (user token, per user); 200 a minute and 3,000 a day (organization api key, per organization). See [Rate limits](https://docs.truemarkets.co/developer-resources/rate-limits).

## Request

```
POST https://api.truemarkets.co/v1/gateway/ramps
```

### Authentication

Bearer token in `Authorization`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `TM-On-Behalf-Of` | header | string (uuid) | no | Act as one of your organization's users. The value is the `user_id` returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: `400` for a personal token, a repeated header or a non-UUID, `403` for a user outside your organization. Not accepted on organization-scoped routes. |

### Body

`application/json`, required

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `payment_method` | string, one of `COINBASE`, `PAYPAL`, `APPLE_PAY`, `GOOGLE_PAY` | yes | Rail the ramp is funded or paid out through. DeFi routes the provider from it, so it is the caller's only choice of venue. `APPLE_PAY` and `GOOGLE_PAY` are onramp-only and require a `channel`. |
| `direction` | string, one of `onramp`, `offramp` | yes | `onramp` buys crypto with fiat. `offramp` sells crypto for fiat. |
| `amount` | string | yes | Decimal string. Fiat to spend on an onramp, or settlement stablecoin to sell on an offramp. Greater than 0 and at most 100000. |
| `channel` | string, one of `web`, `ios`, `android` | no | Surface the request originates from. Required for `APPLE_PAY` and `GOOGLE_PAY`. |

## Responses

Every error status returns the same body, described in [Errors](https://docs.truemarkets.co/developer-resources/errors.md).

### 201

Ramp created successfully

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Ramp ID, used by every other ramp endpoint |
| `redirect_url` | string | yes | Provider page the user completes the sale on |
| `bridge_plan` | object | no | Present when the user's own funds must move onto the settlement chain before the offramp transfer. Sign every payload and submit the signatures to `POST /ramps/{id}/bridge/execute`. |
| `bridge_plan.id` | string | yes | Bridge ID |
| `bridge_plan.payloads` | array of object | yes |  |
| `bridge_plan.payloads[].digest` | string | yes | Lowercase hex SHA-256 of the `payload` bytes. A signing API that takes a pre-hashed input signs the hex-decoded digest; a library that hashes its input takes `payload` instead. Passing the hex digest to a library that hashes signs the wrong bytes. |
| `bridge_plan.payloads[].payload` | string | yes | The exact text to sign: a Turnkey activity as JSON, including its trailing newline. Sign its UTF-8 bytes as-is with ECDSA P-256 and SHA-256; never decode, reformat or re-serialize it. |
| `bridge_plan.steps` | array of object | yes |  |
| `bridge_plan.steps[].kind` | string | yes | The kind of movement, e.g. a same-chain swap or a cross-chain bridge |
| `bridge_plan.steps[].amount` | string | yes | Amount moved in this step, as a decimal string |
| `bridge_plan.steps[].asset_symbol` | string | yes | Symbol debited in this step |
| `bridge_plan.steps[].dst_asset_symbol` | string | no | Symbol credited in this step, when it differs from the debited one |
| `bridge_plan.steps[].src_chain` | string | yes | Chain the step debits from |
| `bridge_plan.shortfall` | object | yes | The amount of the settlement asset the bridge plan covers |
| `bridge_plan.shortfall.amount` | string | yes | Amount to be bridged, as a decimal string |
| `bridge_plan.shortfall.asset_symbol` | string | yes | Settlement asset symbol |

### 400

Bad request

### 401

Unauthorized

### 403

Forbidden. On order creation this also covers an asset that is not available to trade from the country the request came from.

### 404

Not found

### 409

Conflict

### 422

Request is well-formed but cannot be processed (e.g. leverage missing or out of range for a perp order)

### 500

Internal server error

### 503

Service unavailable
