# Email billing callbacks

{% hint style="danger" %}
Handling callbacks correctly is crucial to ensure your integration’s business logic works as expected. It is highly recommended to validate payment statuses and callbacks before acting on it inside your system.
{% endhint %}

Refer to [this section](/guides/api-basics/callbacks.md) to get more information on what callbacks are and how to validate them before acting on it inside your system.

| Type           | Event       | Description                                                                                                      |
| -------------- | ----------- | ---------------------------------------------------------------------------------------------------------------- |
| `Subscription` | `paid`      | The invoice, linked to the subscription, is successfully paid in full before the subscription's expiration date. |
| `Subscription` | `cancelled` | <p>The subscription is not paid before the expiration date or is manually cancelled using API.</p><p><br></p>    |

{% tabs %}
{% tab title="paid" %}
{% code overflow="wrap" %}

```json
{
  "data": {
    "id": "4e9820e8-2805-47cc-a7d9-6e53bb17b59b",
    "name": "User-friendly high-level policy",
    "amount": "100.43",
    "period": "month",
    "status": "active",
    "currency": "USD",
    "custom_id": "fb241e79-b9d4-4b9b-a93f-38c43d4faf06",
    "created_at": "2023-06-16T13:45:36+00:00",
    "payer_name": "John Doe",
    "payer_email": "johndoe@email.me",
    "cancelled_at": null,
    "product_name": "Virtual systematic hub",
    "period_quantity": 1,
    "current_period_paid": true,
    "product_description": "Use the primary RAM card, then you can synthesize the multi-byte bus!",
    "success_redirect_url": "https://successRedirectUrl.me/",
    "current_period_ends_at": "2023-07-20T23:16:55+00:00",
    "unsuccess_redirect_url": "https://unsuccessRedirectUrl.me/",
    "current_period_starts_at": "2023-06-20T23:16:55+00:00"
  },
  "type": "Subscription",
  "event": "paid"
}
```

{% endcode %}
{% endtab %}

{% tab title="cancelled" %}
{% code overflow="wrap" %}

```json
{
  "data": {
    "id": "cd4489a2-471e-41ad-ae5e-80b60f0756ad",
    "name": "Programmable contextually-based hub",
    "amount": "1000.0",
    "period": "month",
    "status": "cancelled",
    "currency": "CNY",
    "custom_id": "e0da1c36-f564-4ad1-a173-7bda750ba7d4",
    "created_at": "2023-06-20T13:37:04+00:00",
    "payer_name": "John Doe",
    "payer_email": "johndoe@email.me",
    "cancelled_at": "2023-06-30T00:15:00+00:00",
    "product_name": "Down-sized scalable workforce",
    "period_quantity": 1,
    "current_period_paid": false,
    "product_description": "Try to navigate the EXE monitor, maybe it will parse the neural port!",
    "success_redirect_url": "https://successRedirectUrl.me/",
    "current_period_ends_at": "2023-06-30T00:00:00+00:00",
    "unsuccess_redirect_url": "https://unsuccessRedirectUrl.me/",
    "current_period_starts_at": "2023-05-31T00:00:00+00:00"
  },
  "type": "Subscription",
  "event": "cancelled"
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.cryptopay.me/guides/email-billing/email-billing-callbacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
