# Testing webhook

## Testing payment (testing\_payment)

**POST** `https://api.heleket.com/v1/test-webhook/payment`

To validate the signature from the webhook data array, use the payment API key.

To ensure that you are correctly receiving webhooks and can validate the signature, you should use this method to test webhooks for payment.  
Please note that no data is saved to the database, and any data received in the webhook is only stored in an array for testing purposes to ensure the correctness of the signature and to test the retrieval of this array from us.

To test a webhook with an existing invoice, please provide its uuid or order ID. If these parameters are not provided, the webhook will be sent with a test invoice.

## Request

### Body parameters

| Name | Parameter type | Default value | Definition |
| --- | --- | --- | --- |
| url\_callback (required) | string<br>min:6<br>max:150<br>url|  | URL to which webhooks with payment status will be sent |
| currency (required) | string |  | Invoice currency code |
| network (required) | string |  | Invoice network code |
| uuid | string<br>uuid| random uuid string | uuid of the invoice |
| order\_id | string<br>min:1<br>max:32<br>alpha\_dash| random string | Order ID of the invoice |
| status (required) | string | paid | Payment status<br>Available options:<br>• process<br>• check<br>• paid<br>• paid\_over<br>• fail<br>• wrong\_amount<br>• cancel<br>• system\_fail<br>• refund\_process<br>• refund\_fail<br>• refund\_paid<br>• locked|

> You may to pass one of the uuid or order\_id parameters, if you pass both, the account will be identified by uuid

### Request example

```
curl https://api.heleket.com/v1/test-webhook/payment \
-X POST \
-H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
	"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
	"currency": "ETH",
	"url_callback": "https://your.site/callback",
	"network": "eth",
	"status": "paid"
}'
```

## Response

### Response example

```
{
  "state": 0,
  "result": []
}
```

## Testing payout (testing\_payout)

**POST** `https://api.heleket.com/v1/test-webhook/payout`

To validate the signature from the webhook data array, use the payment API key.

## Request

### Body parameters

| Name | Parameter type | Default value | Definition |
| --- | --- | --- | --- |
| url\_callback (required) | string<br>min:6<br>max:150<br>url|  | URL to which webhooks with payment status will be sent |
| currency (required) | string |  | Payout currency code |
| network (required) | string |  | Payout network code |
| uuid | string<br>uuid| random uuid string | uuid of the payout |
| order\_id | string<br>min:1<br>max:32<br>alpha\_dash| random string | Order ID of the payout |
| status (required) | string | paid | Payout status<br>Available options:<br>• process<br>• check<br>• paid<br>• fail<br>• cancel<br>• system\_fail|

> You may to pass one of the uuid or order\_id parameters, if you pass both, the account will be identified by uuid

### Request example

```
curl https://api.heleket.com/v1/test-webhook/payout \
-X POST -H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
	"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
	"currency": "ETH",
	"url_callback": "https://your.site/callback",
	"network": "eth",
	"status": "paid"
}'
```

## Response

### Response example

```
{
  "state": 0,
  "result": []
}
```

## Testing wallet (testing\_wallet)

**POST** `https://api.heleket.com/v1/test-webhook/wallet`

To validate the signature from the webhook data array, use the payment API key.

## Request

### Body parameters

| Name | Parameter type | Default value | Definition |
| --- | --- | --- | --- |
| url\_callback (required) | string<br>min:6<br>max:150<br>url|  | URL to which webhooks with payment status will be sent |
| currency (required) | string |  | Payment currency code |
| network (required) | string |  | Payment network code |
| uuid | string<br>uuid| random uuid string | uuid of business wallet<br>Required if order\_id is missing|
| order\_id | string<br>min:1<br>max:32<br>alpha\_dash| random string | Order ID of the invoice<br>Required if uuid is missing|
| status (required) | string | paid | Payment status<br>Available options:<br>• process<br>• check<br>• paid<br>• paid\_over<br>• fail<br>• wrong\_amount<br>• cancel<br>• system\_fail<br>• refund\_process<br>• refund\_fail<br>• refund\_paid<br>• locked|

### Request example

```
curl https://api.heleket.com/v1/test-webhook/wallet \
-X POST -H 'merchant: 860166ce-478c-4087-9813-55cfb6c34580' \
-H 'sign: a466b82fad9415cdbf5f47802b8d376c' \
-H 'Content-Type: application/json' \
-d '{
	"uuid": "e1830f1b-50fc-432e-80ec-15b58ccac867",
	"currency": "ETH",
	"url_callback": "https://your.site/callback",
	"network": "eth",
	"status": "paid"
}'
```

## Response

### Response example

```
{
  "state": 0,
  "result": []
}
```

## Possible errors

### Validation errors

code : 422

example responses:

If you pass _uuid_ or _order\_id_ and invoice/static wallet/payout is not found:

```
{
    "state": 1,
    "message": "Not found payment"
}
```

```
{
    "state": 1,
    "message": "Not found payout"
}
```

```
{
    "state": 1,
    "message": "Not found wallet"
}
```

If you don’t pass the required parameters:

```
{
	"state": 1,
	"errors": {
		"currency": ["validation.required"]
	}
}
```

If the provided currency and network are not crypto or not supported:

```
{
    "state": 1,
    "message": "Payment service not found"
}
```

```
{
    "state": 1,
    "message": "Payout service not found"
}
```
