Testing webhook
Testing 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
Query parameters
Name | Parameter type | Default value | Definition |
---|---|---|---|
url_callback* | stringmin:6max:150url | Url to which webhooks with payment status will be sent | |
currency* | string | Invoice currency code | |
network* | string | Invoice network code | |
uuid | stringuuid | random uuid string | uuid of the invoice |
order_id | stringmin:1max:32alpha_dash | random string | Order ID of the invoice |
status* | string | paid | Payment statusAvailable options:• process• check• paid• paid_over• fail• wrong_amount• cancel• system_fail• refund_process• refund_fail• refund_paid |
Parameter type
stringmin:6max:150urlDefinition
Url to which webhooks with payment status will be sentParameter type
stringDefinition
Invoice currency codeParameter type
stringDefinition
Invoice network codeParameter type
stringuuidDefinition
uuid of the invoiceParameter type
stringmin:1max:32alpha_dashDefinition
Order ID of the invoiceParameter type
stringDefinition
Payment statusAvailable options:- process- check- paid- paid_over- fail- wrong_amount- cancel- system_fail- refund_process- refund_fail- refund_paid
* - mandatory parameter
Request example
curl https://api.cryptomus.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"
}'
COPYResponse
Response example
1{
2 "state": 0,
3 "result": []
4}
COPYTesting payout
To validate the signature from the webhook data array, use the payment API key.
Request
Query parameters
Name | Parameter type | Default value | Definition |
---|---|---|---|
url_callback* | stringmin:6max:150url | Url to which webhooks with payment status will be sent | |
currency* | string | Payout currency code | |
network* | string | Payout network code | |
uuid | stringuuid | random uuid string | uuid of the payout |
order_id | stringmin:1max:32alpha_dash | random string | Order ID of the payout |
status* | string | paid | Payout statusAvailable options:• process• check• paid• fail• cancel• system_fail |
Parameter type
stringmin:6max:150urlDefinition
Url to which webhooks with payment status will be sentParameter type
stringDefinition
Payout currency codeParameter type
stringDefinition
Payout network codeParameter type
stringuuidDefinition
uuid of the payoutParameter type
stringmin:1max:32alpha_dashDefinition
Order ID of the payoutParameter type
stringDefinition
Payout statusAvailable options:- process- check- paid- fail- cancel- system_fail
* - mandatory parameter
Request example
curl https://api.cryptomus.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"
}'
COPYResponse
Response example
1{
2 "state": 0,
3 "result": []
4}
COPYTesting wallet
To validate the signature from the webhook data array, use the payment API key.
Request
Query parameters
Name | Parameter type | Default value | Definition |
---|---|---|---|
url_callback* | stringmin:6max:150url | Url to which webhooks with payment status will be sent | |
currency* | string | Payment currency code | |
network* | string | Payment network code | |
uuid | stringuuid | random uuid string | uuid of business wallet |
order_id | stringmin:1max:32alpha_dash | random string | Order ID of the invoice |
status* | string | paid | Payment statusAvailable options:• process• check• paid• paid_over• fail• wrong_amount• cancel• system_fail• refund_process• refund_fail• refund_paid |
Parameter type
stringmin:6max:150urlDefinition
Url to which webhooks with payment status will be sentParameter type
stringDefinition
Payment currency codeParameter type
stringDefinition
Payment network codeParameter type
stringuuidDefinition
uuid of business walletParameter type
stringmin:1max:32alpha_dashDefinition
Order ID of the invoiceParameter type
stringDefinition
Payment statusAvailable options:- process- check- paid- paid_over- fail- wrong_amount- cancel- system_fail- refund_process- refund_fail- refund_paid
* - mandatory parameter
Request example
curl https://api.cryptomus.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"
}'
COPYResponse
Response example
1{
2 "state": 0,
3 "result": []
4}
COPYPossible errors
Validation errors
code : 422
Example responses:
If you pass uuid or order_id and invoice/static wallet/payout is not found:
1{
2 "state": 1,
3 "message": "Not found payment"
4}
COPY
1{
2 "state": 1,
3 "message": "Not found payout"
4}
COPY
1{
2 "state": 1,
3 "message": "Not found wallet"
4}
COPYIf you don’t pass the required parameters:
1{
2 "state": 1,
3 "errors": {
4 "currency": ["validation.required"]
5 }
6}
COPYIf the provided currency and network are not crypto or not supported:
1{
2 "state": 1,
3 "message": "Payment service not found"
4}
COPY
1{
2 "state": 1,
3 "message": "Payout service not found"
4}
COPY