This page provides information on the context object of payment intent webhooks.
Find out how to set a webhook, basic structure of the callbacks, and more here.

Both withdrawal.created and withdrawal.completed events have the same context structure. In the following table, an explanation for the Withdrawal context property is provided:

PropertyTypeDescription
idstringUnique identifier of the particular Withdrawal.
merchantobjectContains the information about the merchant ID.
idstringThe Merchant ID in Coinify's system.
subaccountobject / nullThe ID of the sub-account involved in the Withdrawal. Is equal to null if no subaccount was provided.
idstringThe unique identifier of the subaccount.
orderIdstringMerchant's internal ID of the order.
statestringThe current state of the Withdrawal. Can be created or completed.
amountsobjectContains the information about the base FIAT amount used to create a withdrawal and the final cryptocurrency amount that will be sent out.
baseAmountstringThe FIAT amount used for creating the withdrawal.
baseCurrencystringThe FIAT currency of the base amount. Three-letter ISO currency code.
finalAmountstringThe cryptocurrency amount that is sent to the withdrawal address.
finalCurrencystringThe cryptocurrency that the withdrawal will be executed in. Shown as a cryptocurrency ticker.
destinationobjectContains the information of the receiving cryptocurrency address.
tagstring / nullThe addressTag specified in the Create Withdrawal request. Also called memo, depending on the cryptocurrency.
addressstringThe address to which the finalAmount is sent.
transactionIdstring / nullThe ID of the cryptocurrency transaction on the blockchain. Only visible after the withdrawal is sent out and is in the completed state.
contextobject / nullThe context provided upon creating the withdrawal. Check Create Withdrawal for more info.
memostring / nullThe optional text provided at the moment of creating the withdrawal.

Please find the available Withdrawal webhook events and their payload examples in the following text.

withdrawal.created

Event name: withdrawal.created

This event is sent once the Withdrawal is created.

{
  "id": "b03c1269-fb84-454c-8d3a-8bf0251d5910",
  "time": "2023-03-17T09:19:31.916Z",
  "event": "withdrawal.created",
  "context": {
    "id": "ef9f5df9-3669-4a3e-a298-783623bdfa9a",
    "merchant": {
      "id": "d560b17e-bae5-4fbf-8822-518273498c7a"
    },
    "subaccount": null,
    "orderId": "12345671234567",
    "state": "created",
    "amounts": {
      "baseAmount": "30",
      "baseCurrency": "USD",
      "finalAmount": null,
      "finalCurrency": "USDC"
    },
    "destination": {
      "tag": null,
      "address": "0x8c58D12ce7219B6F53B1803d00b7021CB8e9A4c6"
    },
    "transactionId": null,
    "context": {"purpose":"settlement"},
    "memo": "Re-ocurring withdrawal"
  }
}

withdrawal.completed

Event name: withdrawal.completed

This event is sent once the requested Withdrawal cryptocurrency has been sent to the designated address.

{
  "id": "dfc1f3ec-cd6a-4a6a-afb6-2f38a4661dd4",
  "time": "2023-03-17T09:21:01.029Z",
  "event": "withdrawal.completed",
  "context": {
    "id": "ef9f5df9-3669-4a3e-a298-783623bdfa9a",
    "merchant": {
      "id": "d560b17e-bae5-4fbf-8822-518273498c7a"
    },
    "subaccount": null,
    "orderId": "12345671234567",
    "state": "completed",
    "amounts": {
      "baseAmount": "30",
      "baseCurrency": "USD",
      "finalAmount": "29.7",
      "finalCurrency": "USDC"
    },
    "destination": {
      "tag": null,
      "address": "0x8c58D12ce7219B6F53B1803d00b7021CB8e9A4c6"
    },
    "transactionId": "0xdc7ca76fc3b59c6462323811b36dc3fbaee350e0984482e842657ea28da3d4dc",
    "context": {"purpose":"settlement"},
    "memo": "Re-ocurring withdrawal"
  }
}

withdrawal.cancelled

Event name: withdrawal.cancelled

In very rare cases Coinify may need to intervene into the otherwise fully automated Withdrawal process. As a result, the Withdrawal may end up in the cancelled state. When that happens our system will send out the following webhook:

{
  "id": "1e43e74b-4244-43a1-8951-c07b86bca218",
  "time": "2024-01-30T13:00:59.286Z",
  "event": "withdrawal.cancelled",
  "context": {
    "id": "2ee7d806-b075-4899-ad4e-659360f45068",
    "merchant": {
      "id": "d560b17e-bae5-4fbf-8822-518273498c7a"
    },
    "subaccount": null,
    "orderId": "d7bff15b-a109-43d5-a2ea-cacde1909643",
    "state": "cancelled",
    "amounts": {
      "baseAmount": "30",
      "baseCurrency": "USD",
      "finalAmount": "29.54444526",
      "finalCurrency": "USDC"
    },
    "destination": {
      "tag": null,
      "address": "0x965933D5C73ef443f3a2E4B370c3b6C964fc76eC"
    },
    "transactionId": null,
    "context": null,
    "memo": null
  }
}

There are a couple of reasons a withdrawal might be cancelled, like for example if a receiving blockchain address triggers Coinify's risk engine. For further clarification on why a withdrawal was cancelled feel free to contact our API support.