# API Reference

{% hint style="info" %}
The API interface is only available to Premium Partners. Please visit \[[Onboarding](/get-started/onboarding.md#premium-partner)] to check how to apply.

You will get your own *`partnerId`* and *`APIPrivateKeys`* to call APIs once you become Premium Partner.
{% endhint %}

## Summary

* [List all cryptocurrencies](/reference/api-reference/apis/list-all-cryptocurrencies.md)
  * List all the cryptocurrencies supported by FaTPay;
* [List all fiat currencies and payment methods](/reference/api-reference/apis/list-all-fiat-currencies-and-payment-methods.md)
  * List all the fiat currencies and its' payment methods supported by FaTPay;
* [Retrieve quoted price](/reference/api-reference/apis/retrieve-quoted-price.md)
  * Query cryptocurrency quotes based on fiat currency amount and present exchange rate;
* [List all orders](/reference/api-reference/apis/list-all-orders.md)
  * Query orders list;
* [Webhook for order events](/reference/api-reference/webhooks/webhook-for-order-events.md)
  * Webhook notification will be sent by FaTPay to the partner when the order status is changed;

## Guide

Please follow this guide to call FaTPay API interface.

### Domain

> <https://api.ramp.fatpay.xyz/>

### Request Protocol

<table><thead><tr><th>Protocol<select><option value="0edf5b19ca2b48548cfdd4a95caa6b1d" label="HTTPS" color="blue"></option><option value="f7127ed8a22a4be1a88a587578730afd" label="HTTP" color="blue"></option></select></th><th>Method<select multiple><option value="206aa06ae46f4a359d74b9d64415fc62" label="GET" color="blue"></option><option value="455bf6afe8ce41bda6c9d62fe502debb" label="POST" color="blue"></option></select></th><th>Content-Type<select multiple><option value="444c5596c56d4212b73bb88824763a04" label="application/json" color="blue"></option><option value="40d7161cb170499194363128d527b97e" label="multipart/form-data" color="blue"></option></select></th></tr></thead><tbody><tr><td><span data-option="0edf5b19ca2b48548cfdd4a95caa6b1d">HTTPS</span></td><td><span data-option="206aa06ae46f4a359d74b9d64415fc62">GET, </span><span data-option="455bf6afe8ce41bda6c9d62fe502debb">POST</span></td><td><span data-option="444c5596c56d4212b73bb88824763a04">application/json, </span><span data-option="40d7161cb170499194363128d527b97e">multipart/form-data</span></td></tr></tbody></table>

{% hint style="warning" %}
FaTPay API is HTTPS-only.
{% endhint %}

### Encoding

`UTF-8`

### Common header parameters <a href="#common-header-params" id="common-header-params"></a>

The following common parameters should be included in headers of FaTPay API requests.

{% hint style="warning" %}
Keys and values are case-sensitive.
{% endhint %}

<table><thead><tr><th width="194">Key</th><th width="121">Format</th><th>Description</th></tr></thead><tbody><tr><td><code>X-Fp-Partner-Id</code></td><td>String</td><td>Assigned by FaTPay during onboarding process to be Premium Partner, e.g. <em>mqMBpCIP630LJxLY</em></td></tr><tr><td><code>X-Fp-Nonce</code></td><td>Integer(6)</td><td>Random integer, e.g. <em>183216</em></td></tr><tr><td><code>X-Fp-Timestamp</code></td><td>Integer(10)</td><td>Unix timestamp in second, e.g. <em>1656600459</em></td></tr><tr><td><code>X-Fp-Version</code></td><td>String</td><td>Version of FaTPay API, e.g. <em>v1.0</em></td></tr><tr><td><code>X-Fp-Signature</code></td><td>String</td><td>Signature generated by request parameters and <code>APIPrivateKey</code>. Check [<a data-mention href="/pages/rkLKL3eVbRwxBcXNKOIy">/pages/rkLKL3eVbRwxBcXNKOIy</a>] for signature algorithm.</td></tr></tbody></table>

### Responses

Normally, the API response consists of `code`, `msg` and `data`. `data` would be *null* if `code` is not `10000`. The returned `data` might be an `Object` or `Array`. It depends on the specific API.

{% hint style="info" %}
Check \[[Errors](/appendix/errors.md)] for the definitions of error codes and messages.
{% endhint %}

<table><thead><tr><th width="131">Key</th><th width="99">Type</th><th width="146">Required</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>String</td><td>Y</td><td>Error code</td></tr><tr><td>msg</td><td>String</td><td>Y</td><td>Error message</td></tr><tr><td>data</td><td>Object</td><td>N</td><td><code>Object</code>/<code>Array</code></td></tr></tbody></table>

{% code title="API response example" overflow="wrap" %}

```javascript
// data in response is an object
{
  "code": "10000",
  "msg": "success",
  "data": {
    "foo": "bar"
  }
}

// data in response is an array
{
  "code": "10000",
  "msg": "success",
  "data": [
    {
      "foo": "bar1"
    },
    {
      "foo": "bar2"
    }
  ]
}

// data in response is null
{
  "code": "10003",
  "msg": "Signature error",
  "data": null
}
```

{% endcode %}

{% hint style="info" %}
All fields of the objects contained in *`data`* will be returned if *`code`* is 100000. Even there is no value for some fields. They will be also responded as empty string.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.fatpay.org/reference/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
