# Create Order - Using Payment Pages

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

So,  if you want a payment page (a screen that allows your users input their phone number & network), Please include *<mark style="color:green;">**x-partner-id, x-merchant-secret**</mark>* in the **header** and ignore *<mark style="color:red;">**intrapay\_merchant\_id**</mark>* in the request body.

**Note:** The intrapay merchant id is different for each account (currency) created on Intrapay. You can find your intrapay merchant id at the bottom left AFTER YOU HAVE SETUP the wallet of that currency.&#x20;

The merchant secret is also different per currency. Find your merchant secret at the partner mapping screen by clicking on your name on the partner list.

<mark style="color:green;">Orders start to appear on Intrapay dashboard after user has visited the payment page and has accepted payment on their phone.</mark>&#x20;

#### Headers

| Name                                                | Type   | Description                                                                                                                 |
| --------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
| x-merchant-secret<mark style="color:red;">\*</mark> | String | The secret key of the merchant (this is different for each country) and can be gotten from your dashboard (partner mapping) |
| Content-Type<mark style="color:red;">\*</mark>      | String | application/json                                                                                                            |
| x-partner-id<mark style="color:red;">\*</mark>      | String | The ID of the partner (Binance) sending the order                                                                           |
| Authorization<mark style="color:red;">\*</mark>     | String | Authorization is a bearer token which is Partners public key                                                                |

#### Request Body

| Name                                                     | Type   | Description                                                                                                     |
| -------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------- |
| partner\_order\_id<mark style="color:red;">\*</mark>     | String | Id of order generated on partners' system                                                                       |
| amount\_to\_collect<mark style="color:red;">\*</mark>    | String | amount seller or buy as listed                                                                                  |
| timestamp<mark style="color:red;">\*</mark>              | Number | Time order was created. unix or epoch time in milleseconds (GMT+0)                                              |
| order\_expiration<mark style="color:red;">\*</mark>      | String | the time to be elapsed before order becomes invalid.  unix or epoch time in millseconds (GMT+0)                 |
| currency<mark style="color:red;">\*</mark>               | String | currency the buyer is paying the merchant with                                                                  |
| partner\_callback\_url<mark style="color:red;">\*</mark> | String | payment notification used by IntraPay to notify Partner System about the Payment status of the order            |
| partner\_redirect\_url<mark style="color:red;">\*</mark> | String | provided by partner. url to redirect partner's users                                                            |
| signature<mark style="color:red;">\*</mark>              | String | SHA-512 of request payload signed with both merchant and partner secret key(SK\_merchant\_xxx+SK\_partner\_xxx) |
| phone                                                    | String | The phone number of the sender. for Mobile Money only                                                           |
| mobile\_money\_network                                   | String | This is the mobile money provider. eg MTN, VOD, ATM                                                             |

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

{% code overflow="wrap" %}

```javascript
//API response
OK 





//Callback Response 1
{ "partner_order_id": "FUSPAY-Y-20251", "callbak_data": "OK" }




//Callback response 2
{"": "https://intrapay.fuspay.finance/b2b?partner_id=p60037&currency=KHS&amount=1001&fee=0&order_id=593163277406920704&lang=eng-NG&country=kenya&tk=YN6ITFY-ECIEG2A-VCEAT2I-ARZKZEA7388"}

```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request failed responses" %}

{% code overflow="wrap" %}

```javascript
{ "status": "error", "message": "Public Key combination is not valid", "partner_order_id": "FUSPAY-Y-20251", "signature": "8cb88b058e32460560d707788c759f25201c5a353596c9d271922ba2b0f89541f779642c08a8993bc37ab96cd7cb97ff291a38b6d29ab6642e0979de9077a992" }



```

{% endcode %}
{% endtab %}
{% endtabs %}

#### Example Request- Code

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

```javascript
const request = require('request')
const options = {
  method: 'POST',
  url: 'http://localhost:5000/api/v1/no-auth/PartnerP2P/CreateOrder',
  headers: {
    'Content-Type': 'application/json',
    'x-partner-id': 'pxxxx',
    'x-merchant-secret': 'xxx-xxx-xxx',
    Authorization: 'Bearer pk_partner_xxxxxxxx'
  },
  body: {
    partner_order_id: 'my-server-order-id',
    amount_to_collect: '10',
    phone: "254XXXXXX",
    mobile_money_network: "MTN",
    timestamp: 1693285902419,
    order_expiration: 1693285902419,
    currency: 'GHS', // GHS | KHS | NGN | UGX | ZAR
    partner_callback_url: 'https://xxx...',
    partner_redirect_url: 'https://example.com?status=success&order=my-server-order-id',
    signature: 'fe04ee69d4f9a93c71f3d1bbf37d49d541e5c4fb159c4a75924f398262e2af146d0e2e33b1379a9b57c641d822c410158e03b64faab34dc98d528bfa234f9dd3'
  },
  json: true
};

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

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

{% endtab %}
{% endtabs %}
