> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rampnow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Onramp & Offramp Intent API Quickstart

> Create a buy or sell order from your backend and send the user to Rampnow's hosted checkout

Your backend creates the order; Rampnow's hosted checkout handles verification and payment. Set `orderType` to `buy` (onramp) or `sell` (offramp). Examples run against **sandbox**.

<Tip>
  Using an AI coding agent? Connect it to these docs first: [Build with AI](/quickstart/build-with-ai).
</Tip>

<Steps>
  <Step title="Get your API key and secret">
    Find them in the [Partner Dashboard](https://partner.rampnow.io) under **API Hub**. Keep the secret on your server. No account yet? Email [support@rampnow.io](mailto:support@rampnow.io).
  </Step>

  <Step title="Add a signing helper">
    Every call carries `X-RAMPNOW-API-KEY`, `X-RAMPNOW-TIMESTAMP` and `X-RAMPNOW-SIGN` (hex HMAC-SHA256 of `timestamp + METHOD + path + body`).

    ```javascript Node.js theme={null}
    const crypto = require("crypto");

    const BASE_URL = "https://api.sandbox.rampnow.io";

    async function rampnow(method, path, payload) {
      const body = payload ? JSON.stringify(payload) : "";
      const timestamp = String(Math.floor(Date.now() / 1000));
      const signature = crypto
        .createHmac("sha256", process.env.RAMPNOW_API_SECRET)
        .update(timestamp + method + path + body)
        .digest("hex");

      const res = await fetch(BASE_URL + path, {
        method,
        headers: {
          "Content-Type": "application/json",
          "X-RAMPNOW-API-KEY": process.env.RAMPNOW_API_KEY,
          "X-RAMPNOW-TIMESTAMP": timestamp,
          "X-RAMPNOW-SIGN": signature,
        },
        body: body || undefined,
      });
      return res.json();
    }
    ```

    Other languages and a test vector: [Authentication](/api-reference/authentication).
  </Step>

  <Step title="Get a quote">
    <Tabs>
      <Tab title="Onramp (buy)">
        ```javascript theme={null}
        const quote = await rampnow("POST", "/api/partner/v1/ext/ramp_order/quote", {
          orderType: "buy",
          srcCurrency: "EUR",
          srcChain: "fiat",
          srcAmount: "250",
          dstCurrency: "ETH",
          dstChain: "ethereum",
        });
        ```
      </Tab>

      <Tab title="Offramp (sell)">
        ```javascript theme={null}
        const quote = await rampnow("POST", "/api/partner/v1/ext/ramp_order/quote", {
          orderType: "sell",
          srcCurrency: "USDT",
          srcChain: "ethereum",
          srcAmount: "500",
          dstCurrency: "EUR",
          dstChain: "fiat",
        });
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Create the order">
    <Tabs>
      <Tab title="Onramp (buy)">
        ```javascript theme={null}
        const { data } = await rampnow("POST", "/api/partner/v1/ext/ramp_order/checkout", {
          orderType: "buy",
          externalOrderUid: "order-1001",
          srcCurrency: "EUR",
          srcChain: "fiat",
          srcAmount: "250",
          dstCurrency: "ETH",
          dstChain: "ethereum",
          returnUrl: "https://your-app.com/orders/order-1001",
          user: {
            firstName: "John",
            lastName: "Doe",
            email: "john@example.com",
            phone: "+491234567890",
            dateOfBirth: "1990-01-15",
            gender: "male",
            country: "DE",
          },
          wallet: {
            crytpoAccountDetail: { address: "0xUserWalletAddress", custodyType: "unhosted" },
          },
        });
        ```
      </Tab>

      <Tab title="Offramp (sell)">
        ```javascript theme={null}
        const { data } = await rampnow("POST", "/api/partner/v1/ext/ramp_order/checkout", {
          orderType: "sell",
          externalOrderUid: "order-1001",
          srcCurrency: "USDT",
          srcChain: "ethereum",
          srcAmount: "500",
          dstCurrency: "EUR",
          dstChain: "fiat",
          returnUrl: "https://your-app.com/orders/order-1001",
          user: {
            firstName: "John",
            lastName: "Doe",
            email: "john@example.com",
            phone: "+491234567890",
            dateOfBirth: "1990-01-15",
            gender: "male",
            country: "DE",
          },
          wallet: {
            bankAccountDetail: {
              name: "John Doe",
              iban: "DE89370400440532013000",
              bic: "COBADEFFXXX",
              country: "DE",
              currency: "EUR",
            },
          },
        });
        ```
      </Tab>
    </Tabs>

    The response holds `orderUid`, `userUid` and `redirectUrl`.
  </Step>

  <Step title="Redirect the user">
    ```javascript theme={null}
    window.location.href = data.redirectUrl;
    ```

    The user verifies and pays (buy) or sends crypto (sell), then lands on your `returnUrl`.
  </Step>

  <Step title="Track the order">
    Add your webhook URL in the Partner Dashboard under **API Hub**. Rampnow posts on every status change; `completed` means done. Or poll:

    ```javascript theme={null}
    const order = await rampnow("GET", "/api/partner/v1/ext/ramp_order/order-1001");
    ```

    See [Webhook](/api-reference/webhook) and [Order Status](/api-reference/order-status).
  </Step>
</Steps>

<Card title="Full guide" icon="book-open" href="/quickstart/ramp-intent/overview">
  Field reference, fees, retries and the hosted checkout in detail
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.