# Getting Started

We have provided a list of endpoints to make the integration and onboarding seamless. Below is the description of how to authenticate with our endpoints and a list of endpoints needed to successfully onboard.&#x20;

### Getting Started&#x20;

To Authenticate you do the following:&#x20;

1. Onboard on the [partner onboarding list ](https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/OnboardPartner)to get your partner ID and credentials&#x20;
2. Whitelist your IP (Please ensure IPS are static IPs ) -Follow the Telegram channel and  request IP whitelisting through our technical team.
3. You will be required to perform KYC & sign a contract before your IP can be considered for whitelisting. To Start your [KYC](<https://kyc.fuspay.finance >) visit <https://kyc.fuspay.finance&#x20>;
4. [Activate your Axis account ](https://exchanger-api.fuspay.finance/api/v1/no-auth/Axis/Activate/)using your partner ID&#x20;

### Authentication&#x20;

1. IP must be whitelisted&#x20;
2. Authorization Header {Authorization: "Bearer partner\_secret\_key" }. In every request, your secret key will be added to the authorization header as a bearer token

### KYC&#x20;

The Axis system is KYC dependent- meaning only orders from a user that has done KYC will be fulfilled. If a non KYC user initiates an order the order is left in a pending state until the user performs KYC or their KYC data is posted to the B2CUpdateKYC endpoint.&#x20;

There are 2 types of KYC for a user&#x20;

1. Basic KYC&#x20;
2. Extended KYC (E-KYC)

With Each KYC category there are transactional limits.

#### Two  Ways of doing KYC

<table data-full-width="true"><thead><tr><th>Method</th><th>Ideal for </th><th>Note</th></tr></thead><tbody><tr><td>Method 1</td><td>This is for B2C merchants that have already done KYC for their users </td><td>This is done by posting your users' existing KYC data to this endpoint <br><br> <mark style="color:green;"><code>POST</code></mark> <code>https://exchanger-api.fuspay.finance/</code>api/v1/no-auth/Axis/B2cUpdateUserKyc<br><br></td></tr><tr><td>Method 2 </td><td>This is for B2B merchants that haven't done KYC for their users </td><td>While creating on-ramp and off-ramp orders,  Axis requires some KYC data (firstname, lastname, email, &#x26; phonenumber).<br><br>If the above KYC data is not on our users KYC database, Axis will return a KYC URL where your user can perform a one-time transactional KYC .<br></td></tr><tr><td></td><td></td><td></td></tr></tbody></table>

### Webhook/Callback Signature&#x20;

Callback signatures are used as an integrity test.&#x20;

{% hint style="warning" %} <mark style="background-color:purple;">SHA-512</mark>  is the encryption algorithm used to sign the callback/webhooks; the event body is signed with the concatenation of the public key and secret key

sha512(body, public\_key+secret\_key)
{% endhint %}

Partner Onboarding Endpoints

{% hint style="warning" %}
This endpoint returns a one time link containing your ID and Credentials .&#x20;
{% endhint %}

## This endpoint is to register a partner&#x20;

<mark style="color:green;">`POST`</mark> `https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/OnboardPartner.`

Partner's Public, Secret Keys, and partners ID will be sent to Partner email as a one-time link.&#x20;

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Request Body

| Name                                            | Type   | Description                   |
| ----------------------------------------------- | ------ | ----------------------------- |
| partner\_code<mark style="color:red;">\*</mark> | String | a code signifying the partner |
| email<mark style="color:red;">\*</mark>         | String | email of the partner          |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

### Example request- Code.

{% tabs %}
{% tab title="Nodejs" %}

```javascript
const fetch = require('node-fetch');

fetch("https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/OnboardPartner", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "partner_code": "Binance",
    "email": "sample@example.com"
  }
})
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

{% endtab %}

{% tab title="cURL" %}

```
curl "https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/OnboardPartner" \
  -H 'Content-Type: application/json' \
  -X POST \
  -b 'connect.sid'='s%3AoNBPv4ez8npeuKVKlS9KwX_1Dshiamlf.n8opjPuoF3XsU%2Be0VTLMUe6xzeAXmpCfQrpW9KW1KDs' \
  -d '{
  "partner_code": "Binance",
  "email": "sample@example.com"
}' 
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
After onboarding on the partner onboarding endpoint, you have to provide the IPs for your system. As the IPs need to whitelist on our system.&#x20;
{% endhint %}

### Partner Activate Endpoint &#x20;

## This is used to activate partner ID to start using axis

<mark style="color:green;">`POST`</mark> `https://exchanger-api.fuspay.finance/api/v1/no-auth/Axis/Activate/`

#### Headers

| Name                                           | Type   | Description     |
| ---------------------------------------------- | ------ | --------------- |
| x-partner-id<mark style="color:red;">\*</mark> | String | your partner ID |

#### Request Body

| Name | Type   | Description                                       |
| ---- | ------ | ------------------------------------------------- |
|      | String | Body of request is empty requires only the header |

{% tabs %}
{% tab title="200: OK Successful " %}
{ success: true, message: string, data: null }
{% endtab %}

{% tab title="400: Bad Request Error" %}

```javascript
{
     error: true,
     message: string,
     data: null
     }

```

{% endtab %}
{% endtabs %}

###

### Regenerate Partners Public & Private Keys

## This endpoint is used by partners to regenerate their keys&#x20;

<mark style="color:green;">`POST`</mark> `https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/OnboardPartner./`

A One time reset link is sent to the partner email address to regenerate the keys

**Old keys becomes invalid**

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Content-type<mark style="color:red;">\*</mark>  | String | application/json         |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer pk\_partner\_xxxx |

#### Request Body

| Name                                            | Type   | Description                                    |
| ----------------------------------------------- | ------ | ---------------------------------------------- |
| email<mark style="color:red;">\*</mark>         | String | <sample@example.com>                           |
| signature<mark style="color:red;">\*</mark>     | String | sha512-req-body-signed-with-sk\_partner\_xxxxx |
| partner\_code<mark style="color:red;">\*</mark> | String | the partner code used on partner onboarding    |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}
{% endtabs %}

#### Example Request- Code

{% tabs %}
{% tab title="Node" %}

```javascript
const fetch = require('node-fetch');

fetch("https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/GenKeysForPartner", {
  "method": "POST",
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer pk_partner_xxxx",
  },
  "body": {
    "email": "sample@example.com",
    "partner_code":"",
    "signature": "sha512-req-body-signed-with-sk_partner_xxxxx"
  }
})
  .then(response => console.log(response))
  .catch(err => console.error(err));
```

{% endtab %}
{% endtabs %}

### Digital Signature

## This endpoint is used to sign the request body. and generate the digital signature.

<mark style="color:green;">`POST`</mark> `https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/SignRequestSha512/`

The object is signed without including the signature field. Also sign exactly the fields that would be posted to the endpoint

<mark style="color:red;">**Please make sure we have whitelisted all your IPs**</mark>

<mark style="color:red;">**Only Collection or Order creation requires using of merchant secret and partner secret all other request to be signed are to be signed using partner secret alone**</mark>&#x20;

#### Headers

| Name                                           | Type   | Description      |
| ---------------------------------------------- | ------ | ---------------- |
| Content-Type<mark style="color:red;">\*</mark> | String | application/json |

#### Example Request Body

Request body may be different depending on what you would like to sign&#x20;

| Name                                                     | Type   | Description                                                            |
| -------------------------------------------------------- | ------ | ---------------------------------------------------------------------- |
| partner\_order\_id<mark style="color:red;">\*</mark>     | String | the order id on partners end                                           |
| amount\_to\_collect<mark style="color:red;">\*</mark>    | String | the amount to be collected                                             |
| timestamp<mark style="color:red;">\*</mark>              | String | the time the order was created                                         |
| currency<mark style="color:red;">\*</mark>               | String | the currency of collection eg GHS, NGN                                 |
| partner\_callback\_url<mark style="color:red;">\*</mark> | String | the url where payment confirmation would be posted                     |
| partner\_redirect\_url                                   | String | partners site where users would be redirected after successful payment |
| secret<mark style="color:red;">\*</mark>                 | String | Signed with  partner secret.                                           |

#### Sample code

{% tabs %}
{% tab title="NodeJs" %}

```javascript
const request = require('request');


const options = {
  method: 'POST',
  url: 'https://exchanger-api.fuspay.finance/api/v1/no-auth/PartnerP2P/SignRequestSha512',
  headers: {'Content-Type': 'application/json'},
  body: {
    partner_order_id: 'FUSPAY-00400-001-091-008',
    amount_to_collect: '30',
    timestamp: 1693285902419,
    order_expiration: 1693285902419,
    intrapay_merchant_id: "",
    partner_id: ""
    currency: 'NGN',
    partner_callback_url: 'https://webhook.site/xxxxxxxx',
    partner_redirect_url: 'https://google.com',
    secret: '4LJDHGA-SJTECNA-XXXX-XXXXsk_partner_ph25sjy-qtfeoxy-rqbvzyq-z-xx'
  },
  json: true
};

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
```

{% endtab %}
{% endtabs %}


---

# 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://axis-docs.fuspay.finance/getting-started.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.
