# Request New Payment (web page)

To initiate a new payment request using the CoinbarPay API, you will need to provide specific parameters and call the appropriate endpoint.&#x20;

Upon successfully processing this request, the CoinbarPay API will return a payment request token that you can use to initiate the payment process through the CoinbarPay Web Gateway, as described in the "Payment Flow" topic.

### Create request token

To make the API request, use the following :

## Generate a new payment request token

<mark style="color:green;">`POST`</mark> `https://sandbox.coinbar.io/coinbar/api/v2/pay/gateway/request`

#### Headers

| Name                                            | Type   | Description                                                              |
| ----------------------------------------------- | ------ | ------------------------------------------------------------------------ |
| CBPAY-API-KEY<mark style="color:red;">\*</mark> | String | {{<mark style="color:purple;">`SERVICE_CLIENT_ID`</mark>}}               |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/json                                                         |
| SIGNATURE<mark style="color:red;">\*</mark>     | String | <p>{{<code>SIGNATURE\_TOKEN</code>}}<br>HMAC SHA-256 body validation</p> |
| source<mark style="color:red;">\*</mark>        | String | String "web"                                                             |

#### Request Body

| Name                                                   | Type   | Description                                                                                                                                      |
| ------------------------------------------------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| service\_client\_id<mark style="color:red;">\*</mark>  | String | {{<mark style="color:purple;">`SERVICE_CLIENT_ID`</mark>}}                                                                                       |
| payment\_request\_id<mark style="color:red;">\*</mark> | String | Generated by Your application                                                                                                                    |
| input\_coin<mark style="color:red;">\*</mark>          | String | `"EUR"`                                                                                                                                          |
| products<mark style="color:red;">\*</mark>             | Array  | <p>Products, can be provided products details or just one product with total billing receipt. <br><br>See the section below for more details</p> |
| email<mark style="color:red;">\*</mark>                | String | Customer email                                                                                                                                   |
| surname                                                | String | Customer Last Name                                                                                                                               |
| name                                                   | String | Customer Name                                                                                                                                    |
| user\_id<mark style="color:red;">\*</mark>             | String | Generated by Your application                                                                                                                    |
| timestamp<mark style="color:red;">\*</mark>            | Number | `TIMESTAMP` of your request in milliseconds                                                                                                      |
| urlcallback                                            | String | <p>Custom webhook  <br><mark style="color:red;">-- obslolete parameter</mark></p>                                                                |

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

```json
{
    "result": "success",
    "request_token": "WlpZSkE3d3ZKa2NSTTl0VHNKTT....",
    "url_example": "?requestToken=WlpZSkE3d3ZKa2NSTTl0VHNKTTF...."
}
```

{% endtab %}
{% endtabs %}

### **Products body element:**&#x20;

Here's an example of products JSON body parameter :

{% code overflow="wrap" %}

```json
"products": [
    {
      "product_name": "Product 1",
      "product_price": 1.99,
      "product_amount": 1,
      "product_id": "id1",
      "product_type": "general"
    },
    {
      "product_name": "Product 2",
      "product_price": 0.99,
      "product_amount": 2,
      "product_id": "id2",
      "product_type": "general"
    }
]
```

{% endcode %}

{% hint style="info" %}
Valid response will contain request\_token , that will be used to call the Payment Gateway&#x20;
{% 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://docs.coinbar.io/api-web-integration/api-documentation/request-new-payment-web-page.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.
