More resources
Subscribe to transaction data

Subscribe to transaction data#

Support to subscribe the transaction-related data from all addresses in the project dimension, when subscribition is enabled, data and status will be pushed.

The subscription interface needs to make some technical preparations and pay attention to the following instruction:

Idempotent The webhook callback API needs to support idempotency.

Retry times If we do not receive a successful HTTP 200 response, we will attempt to retry the webhook, with the delay between each retry increasing. After the initial attempt, we will make up to 7 additional attempts.

The retry intervals are as follows: 1, 5, 10, 30, 60, 120, 240 minutes

Pause push The following situations will pause the sending of notifications

  • At least 100 notifications failed within a week.
  • At least 500 notifications failed during the entire lifecycle.

Request URL#

POST https://www.okx.com/api/v5/waas/subscribe

Request parameters#

ParameterTypeRequiredDescription
urlStringYesUrl for webhook callback
typeStringYesCurrently supports TRANSACTION-Any transaction related to any address will trigger BLOCK_HEIGHT-Any block generated will trigger
chainIdStringnoUnique identifier of the chain

Response parameters#

ParameterTypeDescription

Request example#

shell
curl --location --request POST 'https://www.okx.com/api/v5/waas/subscribe' \
--header 'OK-ACCESS-PROJECT: 86af********d1bc' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z' \
--data '{
  "callbackUrl":"http://your.server.com/webhook",
  "type":"TRANSACTION"
}'

Response example#

200
{
	"code": "0",
	"msg": "success",
	"data": []
}