Webhook Documentation
Webhooks allow real-time communication between systems.
Webhooks are used to synchronize disparate systems by publishing automated messages with predefined payloads that can be interpreted by integrated systems. They allow real-time communication between applications, enabling instant updates and data sharing without the need for continuous polling.
CoinSub webhooks provide notifications when specific actions occur on your account, such as when a customer subscribes to a product, purchases a one-off product, makes a payment, or cancels a subscription. By setting up webhooks, you can automate processes and keep your systems in sync with CoinSub in real-time.
How to Use the Webhooks
Sign into CoinSub
Sign into or create a new account by connecting your wallet to CoinSub.
Navigate to Merchant Settings
For new users: After signing in, you will be redirected to the merchant settings page.
For existing users: From the dashboard, select the merchant settings located on the sidebar.
Input Webhook URL
Input your webhook URL and other merchant details in the settings.
Webhook Triggers
The webhook is triggered during the following actions:
When a customer subscribes to a product.
When a customer purchases a one-off product.
When a customer makes a payment.
When a customer cancels a subscription.
Data Sent by the Webhook
Subscription
When a subscriber subscribes to a product, the webhook sends the following data:
Fields:
type
: "subscribe" (Type of action being executed)subscriber_id
: Unique identifier of the subscribersubscription_product_id
: ID of the subscribed productsubscription_product_name
: Name of the subscribed productcustom_field_values
: Custom field values (if any)metadata
: Additional metadata containing:subscription_data
:created_on
: Creation date of the subscriptionduration_days
: Duration of the subscription in dayslast_payment_processed
: Date of the last payment processednext_payment_due
: Date when the next payment is duestart_date
: Start date of the subscriptionstatus
: Current status of the subscriptionsubscription_product_id
: ID of the subscription product
transaction_id
: ID of the transaction
subscription_date
: Date and time when the subscription was made
Payment
When a subscriber makes a payment, the webhook sends the following data:
Fields:
type
: "payment" (Type of action being executed)subscriber_id
: Unique identifier of the subscriberprice_usd
: Payment amount in USDsubscription_product_id
: ID of the subscription productsubscription_product_name
: Name of the subscription productcustom_field_values
: Custom field values (if any)metadata
: Additional metadata containing:payment_data
:created_on
: Creation date of the payment recordmerchant_id
: Unique identifier of the merchantpayment_processed
: Date when the payment was processedprice_usd
: Payment amount in USDsubscriber_id
: Unique identifier of the subscribersubscription_product_id
: ID of the subscription product
transaction_id
: ID of the transaction
payment_date
: Date and time when the payment was made
Cancellation
When a subscriber cancels a subscription, the webhook sends the following data:
Fields:
type
: "cancelled" (Type of action being executed)subscriber_id
: Unique identifier of the subscribersubscription_product_id
: ID of the subscription productsubscription_product_name
: Name of the subscription productcustom_field_values
: Custom field values (if any)metadata
: Additional metadata containing:cancelled_data
:merchant_id
: Unique identifier of the merchantpayment_processed
: Date when the payment was processedsubscriber_id
: Unique identifier of the subscribersubscription_product_id
: ID of the subscription product
cancelled_date
: Date and time when the subscription was canceled
Retry Mechanism
If the webhook fails to deliver the data, it will retry up to 5 times, with each retry occurring every 5-10 minutes.
Conclusion
This documentation outlines how to use the webhook and the data it sends for different subscriber actions. Ensure you set your webhook URL in the merchant settings on the dashboard to receive these notifications.
Last updated