# Instructions

### 1. Calling the payment widget

To trigger a payment, you need to call our checkout widget with the following URL and mandatory parameters:

```
https://widget.mtpelerin.com/?_ctkn=<integrationKey>&tabs=merchant&bdc=<SettlementCurrency>&bda=<amountInSettlementCurrency>&oid=<merchant_order_id>
```

* **integrationKey:** the unique integration key that you will have received from us by email.
* **SettlementCurrency:** the crypto or fiat currency in which you want to denominate the payment.
* **amountInSettlementCurrency:** the payment amount in the SettlementCurrency.
* **merchant\_order\_id:** your internal payment order ID.

Here are all the codes that you can use for the SettlementCurrency parameter:

**Fiat codes:** AUD, CAD, CHF, CZK, DKK, EUR, GBP, HKD, HUF, JPY, MXN, NOK, NZD, PLN, SEK, SGD, USD, ZAR

**Crypto codes:** AVAX, BNB, BTC, BTC.b, BTCB, cbBTC, CELO, crvUSD, DAI, ETH, EURA, EURC, EURS, FRAX, GHO, LUSD, PAXG, POL, RBTC, RIF, S, sat, tzBTC, USDC, USDC.e, USDRIF, USDT, WBTC, WETH, XAUt, XDAI, XTZ, ZCHF

### 2. Payment confirmation

Once a payment has been made successfully, we call a webhook on your side to let you know that the transaction is completed. The webhook contains the following info:

```
{
    "id": "664369c938b3ca001a3cd44f" // our own transaction id,
    "amount": 123.45,
    "currency": "USDC",
    "external_id": "123456789", // The order id that you passed in the widget parameters (oid)
}
```

#### Webhook setup

For us to setup the webhook, we need from you the webhook URL that we must call, as well as 2 keys (authentication and signature) that we will exchange.

The authentication key will be used in the "Authentication" header.

The signature key will allow to compute a HMAC on your side. This HMAC will have to be the same as the "Mtp-Signature" header parameters. The HMAC has to be computed on the full request body. JS example:

```
const computedSignature = crypto.createHmac('sha256', SIGNATURE_KEY).update(JSON.stringify(body)).digest('hex')
```


---

# 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://developers.mtpelerin.com/checkout-payments/integration/instructions.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.
