Testing webhook

Testing payment

post
https://api.cryptomus.com/v1/test-webhook/payment
COPY

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

NameParameter typeDefault valueDefinition
url_callback*stringmin:6max:150urlUrl to which webhooks with payment status will be sent
currency*stringInvoice currency code
network*stringInvoice network code
uuidstringuuidrandom uuid stringuuid of the invoice
order_idstringmin:1max:32alpha_dashrandom stringOrder ID of the invoice
status*stringpaidPayment statusAvailable options:processcheckpaidpaid_overfailwrong_amountcancelsystem_failrefund_processrefund_failrefund_paid

Parameter type

stringmin:6max:150url

Definition

Url to which webhooks with payment status will be sent

Parameter type

string

Definition

Invoice currency code

Parameter type

string

Definition

Invoice network code

Parameter type

stringuuid

Definition

uuid of the invoice

Parameter type

stringmin:1max:32alpha_dash

Definition

Order ID of the invoice

Parameter type

string

Definition

Payment statusAvailable options:- process- check- paid- paid_over- fail- wrong_amount- cancel- system_fail- refund_process- refund_fail- refund_paid

* - mandatory parameter

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.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"
}'
COPY

Response

Response example


1{
2  "state": 0,
3  "result": []
4}
COPY

Testing payout

post
https://api.cryptomus.com/v1/test-webhook/payout
COPY

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

Request

Query parameters

NameParameter typeDefault valueDefinition
url_callback*stringmin:6max:150urlUrl to which webhooks with payment status will be sent
currency*stringPayout currency code
network*stringPayout network code
uuidstringuuidrandom uuid stringuuid of the payout
order_idstringmin:1max:32alpha_dashrandom stringOrder ID of the payout
status*stringpaidPayout statusAvailable options:processcheckpaidfailcancelsystem_fail

Parameter type

stringmin:6max:150url

Definition

Url to which webhooks with payment status will be sent

Parameter type

string

Definition

Payout currency code

Parameter type

string

Definition

Payout network code

Parameter type

stringuuid

Definition

uuid of the payout

Parameter type

stringmin:1max:32alpha_dash

Definition

Order ID of the payout

Parameter type

string

Definition

Payout statusAvailable options:- process- check- paid- fail- cancel- system_fail

* - mandatory parameter

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.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"
}'
COPY

Response

Response example


1{
2  "state": 0,
3  "result": []
4}
COPY

Testing wallet

post
https://api.cryptomus.com/v1/test-webhook/wallet
COPY

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

Request

Query parameters

NameParameter typeDefault valueDefinition
url_callback*stringmin:6max:150urlUrl to which webhooks with payment status will be sent
currency*stringPayment currency code
network*stringPayment network code
uuidstringuuidrandom uuid stringuuid of business wallet
order_idstringmin:1max:32alpha_dashrandom stringOrder ID of the invoice
status*stringpaidPayment statusAvailable options:processcheckpaidpaid_overfailwrong_amountcancelsystem_failrefund_processrefund_failrefund_paid

Parameter type

stringmin:6max:150url

Definition

Url to which webhooks with payment status will be sent

Parameter type

string

Definition

Payment currency code

Parameter type

string

Definition

Payment network code

Parameter type

stringuuid

Definition

uuid of business wallet

Parameter type

stringmin:1max:32alpha_dash

Definition

Order ID of the invoice

Parameter type

string

Definition

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"
}'
COPY

Response

Response example


1{
2  "state": 0,
3  "result": []
4}
COPY

Possible 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}
COPY

If you don’t pass the required parameters:


1{
2	"state": 1,
3	"errors": {
4		"currency": ["validation.required"]
5	}
6}
COPY

If 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