> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.clixpesa.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.clixpesa.com/_mcp/server.

# Create an offramp

POST https://ramps.clixpesa.com/offramp
Content-Type: application/json

Creates a crypto-to-fiat transaction. Omit transaction_hash to receive transfer instructions, then submit the hash with the update endpoint.

Reference: https://docs.clixpesa.com/api-reference/ramps-api/offramps/create-offramp

## Servers

- `https://ramps.clixpesa.com` (Production, default)
- `http://localhost:3000` (Local development and Base Sepolia mock onramp)

## Request

### Headers

- `idempotency-key` (string, optional) — Unique request key. Reuse the same value when retrying the same transaction.

### Body (application/json)

This endpoint expects an object.

- `amount` (string, required) — Amount of blockchain asset the customer will send.
- `source` (OfframpPostRequestBodyContentApplicationJsonSchemaSource, required) — An account on a supported blockchain network.
- `destination` (OfframpPostRequestBodyContentApplicationJsonSchemaDestination, required) — A fiat payment account.
- `transaction_hash` (string, optional) — Hash of an on-chain transfer that has already been submitted.

## Response

### 200

Transfer instructions or confirmation that the fiat payout is processing.

- `Offramps_createOfframp_Response_200`
  - OfframpsCreateOfframpResponse2000
  - OfframpsCreateOfframpResponse2001

## Errors

### 400 Bad Request Error

The request could not be completed.

- `error` (string, required)

### 422 Unprocessable Entity Error

The request could not be completed.

- `error` (string, required)

### 500 Internal Server Error

The request could not be completed.

- `error` (string, required)

## Types

### OfframpPostRequestBodyContentApplicationJsonSchemaSource

An account on a supported blockchain network.

- `currency` (string, required) — Blockchain asset symbol.
- `chain` (string, required) — Blockchain network name.
- `address` (string, required) — Destination or source blockchain account address.

### OfframpPostRequestBodyContentApplicationJsonSchemaDestination

A fiat payment account.

- `currency` (string, required) — ISO 4217 fiat currency code.
- `payment_rail` (enum, required)
  - Allowed values: `momo`, `paybill`, `sepa`, `ach`, `crypto`, `wire`, `swift`
- `bank_name` (string, required) — Bank, mobile network, or payment provider name.
- `account_number` (string, required) — Phone number, bank account, or payment account identifier.
- `account_name` (string, optional) — Name associated with the fiat account.

### OfframpsCreateOfframpResponse2000

- `txId` (string, required)
- `status` ("pending", required)
- `instructions` (OfframpPostResponsesContentApplicationJsonSchemaOneOf0Instructions, required)

### OfframpsCreateOfframpResponse2001

The on-chain transfer was accepted and the fiat payout is processing.

- `txId` (string, required)
- `status` ("processing", required)
- `instructions` (OfframpPostResponsesContentApplicationJsonSchemaOneOf1Instructions, required)

### OfframpPostResponsesContentApplicationJsonSchemaOneOf0Instructions

- `message` (string, required)
- `amount` (string, required)
- `currency` (string, required)
- `to_address` (string, required)
- `from_address` (string, required)
- `chain` (string, required)

### OfframpPostResponsesContentApplicationJsonSchemaOneOf1Instructions

- `message` (string, required)
- `amount` (string, required)
- `currency` (string, required)
- `account_number` (string, required)

## Examples

**Request**

```json
{
  "amount": "1",
  "source": {
    "currency": "USDC",
    "chain": "Base",
    "address": "0x1111111111111111111111111111111111111111"
  },
  "destination": {
    "currency": "KES",
    "payment_rail": "momo",
    "bank_name": "Safaricom",
    "account_number": "254700000000"
  }
}
```

**Response**

```json
{
  "instructions": {
    "amount": "string",
    "chain": "string",
    "currency": "string",
    "from_address": "string",
    "message": "string",
    "to_address": "string"
  },
  "status": "string",
  "txId": "string"
}
```

**SDK Code**

```python
import requests

url = "https://ramps.clixpesa.com/offramp"

payload = {
    "amount": "1",
    "source": {
        "currency": "USDC",
        "chain": "Base",
        "address": "0x1111111111111111111111111111111111111111"
    },
    "destination": {
        "currency": "KES",
        "payment_rail": "momo",
        "bank_name": "Safaricom",
        "account_number": "254700000000"
    }
}
headers = {
    "idempotency-key": "docs-mock-onramp-001",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://ramps.clixpesa.com/offramp';
const options = {
  method: 'POST',
  headers: {'idempotency-key': 'docs-mock-onramp-001', 'Content-Type': 'application/json'},
  body: '{"amount":"1","source":{"currency":"USDC","chain":"Base","address":"0x1111111111111111111111111111111111111111"},"destination":{"currency":"KES","payment_rail":"momo","bank_name":"Safaricom","account_number":"254700000000"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://ramps.clixpesa.com/offramp"

	payload := strings.NewReader("{\n  \"amount\": \"1\",\n  \"source\": {\n    \"currency\": \"USDC\",\n    \"chain\": \"Base\",\n    \"address\": \"0x1111111111111111111111111111111111111111\"\n  },\n  \"destination\": {\n    \"currency\": \"KES\",\n    \"payment_rail\": \"momo\",\n    \"bank_name\": \"Safaricom\",\n    \"account_number\": \"254700000000\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("idempotency-key", "docs-mock-onramp-001")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://ramps.clixpesa.com/offramp")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["idempotency-key"] = 'docs-mock-onramp-001'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"amount\": \"1\",\n  \"source\": {\n    \"currency\": \"USDC\",\n    \"chain\": \"Base\",\n    \"address\": \"0x1111111111111111111111111111111111111111\"\n  },\n  \"destination\": {\n    \"currency\": \"KES\",\n    \"payment_rail\": \"momo\",\n    \"bank_name\": \"Safaricom\",\n    \"account_number\": \"254700000000\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://ramps.clixpesa.com/offramp")
  .header("idempotency-key", "docs-mock-onramp-001")
  .header("Content-Type", "application/json")
  .body("{\n  \"amount\": \"1\",\n  \"source\": {\n    \"currency\": \"USDC\",\n    \"chain\": \"Base\",\n    \"address\": \"0x1111111111111111111111111111111111111111\"\n  },\n  \"destination\": {\n    \"currency\": \"KES\",\n    \"payment_rail\": \"momo\",\n    \"bank_name\": \"Safaricom\",\n    \"account_number\": \"254700000000\"\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ramps.clixpesa.com/offramp', [
  'body' => '{
  "amount": "1",
  "source": {
    "currency": "USDC",
    "chain": "Base",
    "address": "0x1111111111111111111111111111111111111111"
  },
  "destination": {
    "currency": "KES",
    "payment_rail": "momo",
    "bank_name": "Safaricom",
    "account_number": "254700000000"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'idempotency-key' => 'docs-mock-onramp-001',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://ramps.clixpesa.com/offramp");
var request = new RestRequest(Method.POST);
request.AddHeader("idempotency-key", "docs-mock-onramp-001");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"amount\": \"1\",\n  \"source\": {\n    \"currency\": \"USDC\",\n    \"chain\": \"Base\",\n    \"address\": \"0x1111111111111111111111111111111111111111\"\n  },\n  \"destination\": {\n    \"currency\": \"KES\",\n    \"payment_rail\": \"momo\",\n    \"bank_name\": \"Safaricom\",\n    \"account_number\": \"254700000000\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "idempotency-key": "docs-mock-onramp-001",
  "Content-Type": "application/json"
]
let parameters = [
  "amount": "1",
  "source": [
    "currency": "USDC",
    "chain": "Base",
    "address": "0x1111111111111111111111111111111111111111"
  ],
  "destination": [
    "currency": "KES",
    "payment_rail": "momo",
    "bank_name": "Safaricom",
    "account_number": "254700000000"
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://ramps.clixpesa.com/offramp")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```