---
description: Payment report implemented using webhooks
---

# Webhooks

### Setting up webhooks <a href="#setting-up-webhooks" id="setting-up-webhooks"></a>

To set up webhooks you need to go to the “Store Connection” section of the Personal Account, go to the “Store Management” subsection.

* Then enter the URL address in the system from which the payment is made, to this address will be sent data on the status of payments.
* Specify the CMS system to be used, in case the CMS system is not used you should select “None of the above listed”.
* Specify the password that will be used in the signature of the message sent from swcpay.

Pay attention! If you want to submit a payment linked to cryptocurrency - use Amount and Currency. If you want to submit a payment linked to fiat, for example, to USD - use AmountFiat and FiatCurrency.

FiatCurrency can be omitted if the payment is in cryptocurrency (can be ignored, default is always USD).

Response Type: JSON

Parameters

<table><thead><tr><th width="170">Name</th><th width="458">Description</th><th>Type</th></tr></thead><tbody><tr><td>PaymentId</td><td>Transaction ID in the swcpay system</td><td>int</td></tr><tr><td>ShopId</td><td>Shop Id in swcpay system</td><td>string</td></tr><tr><td>Amount</td><td>Amount of payment in cryptocurrency. Optional parameter if sent by AmountFiat</td><td>Double</td></tr><tr><td>AmountFiat</td><td>Amount of payment in fiat. Optional parameter if Amount is passed</td><td>Double</td></tr><tr><td>FiatCurrency</td><td>Fiat currency <br>Values: USD, EUR, TRY</td><td>string</td></tr><tr><td>Currency</td><td>Currency of payment</td><td>string</td></tr><tr><td>Email</td><td>Payer's e-mail</td><td>string</td></tr><tr><td>ClientId</td><td>Unique identifier of the user in the system from which the payment is made</td><td>string</td></tr><tr><td>Status</td><td>Payment status <br>Possible values: <br>Success - the payment was successful <br>Canceled - payment was cancelled (check with swcpay technical support for the reason) <br>Insufficient - payment is underpaid (the payment is considered underpaid if the payment window has expired and the payment has not been fully executed and the callback will contain AmountUSD and Amount corresponding to the real amount of funds received)</td><td>string</td></tr><tr><td>BillingID</td><td>Unique payment identifier in the system from which the payment is made</td><td>string</td></tr><tr><td>Signature</td><td>A checksum to verify the authenticity of the request (to ensure that the request came from swcpay)</td><td>string</td></tr><tr><td>Insufficient</td><td>If "Confirm underpayments" is set in the shop settings, the underpayments will automatically be confirmed as successfully made after the end of the payment validity period (window). You will then receive a second callback, which will give information about the amount actually received (underpaid). You need to process this callback on the payment generation side and modify the original payment to match the actual funds received</td><td>Boolean</td></tr><tr><td>Source.Amount</td><td>The amount specified when creating the payment</td><td>Double</td></tr><tr><td>Source.Type</td><td>Pointer to the currency to which Source.Amount value was specified. Can take values USD, EUR, TRY, Crypto.</td><td>String</td></tr><tr><td>Test</td><td>Indicates whether the payment will be a test payment. This parameter is optional and should only be used to carry out tests. To use this parameter, you should be authenticated by the shop. If authentication is passed and the request is sent with Test=true, you will see three buttons on the payment form "Payment successful", "Payment cancelled", "Payment underpaid", clicking on which, there will be sent the corresponding callbacks to your CallbackUrl. The total number of attempts to send is 30, the interval between attempts is 15 seconds. Test payments are not displayed in your shop and are not counted</td><td>Boolean</td></tr></tbody></table>

**Signature check:**

1. A string of the following kind should be generated: "PaymentId":"ShopId":"Email":"Currency":"Password" (Without inverted commas with a colon)
2. Encrypt the resulting string using the MD5 algorithm
3. Compare the resulting string with the one that came in via Webhook
4. If the strings match, an HTTP Status 200 response should be returned (Mandatory) Webhook JSON example:

```json
{
  "PaymentId": 2359,
  "ShopId": "L9Sp6TCXh7",
  "Amount": 100,
  "Currency": "USDT",
  "Email": "Leilani.Macejkovic@yahoo.com",
  "ClientId": "542",
  "Status": "Success",
  "Signature": "b13deba2ab89a5bcc572b9878aa7acc5",
  "BillingID": "04202508500704000400",
  "AmountFiat": 100.1,
  "FiatCurrency": "USD",
  "Insufficient": false,
  "Source": {
    "Amount": 100,
    "Type": "Crypto"
  },
  "Test": false
}
```
