# S2S MoMo (RWF)

## Initiate S2S

<table><thead><tr><th width="224">Authorization</th><th>Set to Bearer PUBLIC_KEY</th></tr></thead><tbody><tr><td>Content-Type</td><td>Set value to <code>application/json</code></td></tr></tbody></table>

{% hint style="info" %}
The public key can be gotten from the 'Settings' page on your Startbutton dashboard.&#x20;
{% endhint %}

Post a request to the URL below, where the base URL is determined by the environment you are in.

<details>

<summary>BaseUrls</summary>

Sandbox/PROD: <https://api.startbutton.tech&#x20>;

</details>

{% tabs %}
{% tab title="Endpoint" %}
POST  `{{baseurl}}/transaction/initialize/s2s/mobile_money`
{% endtab %}
{% endtabs %}

#### Sample code:

{% tabs %}
{% tab title="Required parameters" %}

<pre><code><strong>{
</strong>    "provider": "MTN",
    "phone": "131313131",
    "amount": 2000,
    "email": "RWF-momo-test@customer.com",
    "currency": "RWF"
}
</code></pre>

{% endtab %}

{% tab title="To simulate a failed scenario" %}

```
{
    "provider": "MTN",
    "phone": "740000030",
    "amount": 2000,
    "email": "RWF-momo-test@customer.com",
    "currency": "RWF"
}
```

{% endtab %}

{% tab title="Optional parameters" %}

<pre><code><strong>{
</strong>    "provider": "MTN",
    "phone": "250785283918",
    "amount": 2000,
    "email": "RWF-momo-test@customer.com",
    "currency": "RWF",
    "reference": "eybr34muxk"
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="info" %}
We support only two Mobile money providers: MTN & Airtel and as the case may be, you are expected to pass any of the 2 as the provider.
{% endhint %}

#### Sample response:

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

```
{
    "success": true,
    "message": "Payment Request Successful",
    "data": {
        "reference": "a76b2d362692",
        "nextStep": "PIN"
    }
}
```

{% endtab %}

{% tab title="Failed response" %}

```
{
    "success": false,
    "message": "Payment failed",
    "data": {}
}
```

{% endtab %}
{% endtabs %}
