Cryptopay API
  • Welcome
  • Guides
    • Introduction
    • Environments
    • Creating a Test Account
    • API Credentials
    • API Basics
      • Responses
      • Date formats
      • Authentication
        • How it works
        • Signature
        • Creating a signature. Code samples
      • Callbacks
    • API Client Libraries
    • API Reference
    • Cryptocurrency Payments
    • Currencies
      • Supported Currencies
      • Currency Icons
    • Confirmations
    • Tools for accepting payments
    • Prebuilt integrations
      • E-commerce payment plugins
      • Payment and software providers
    • Channels
      • Channel payment
      • Payment statuses
      • Channel payment sequence
      • Create a Channel
      • Visual representation at Cashier
      • Channel hosted page
      • Channel payment callbacks
    • Invoices
      • Invoice statuses
      • Invoice payment sequence
      • How to handle unresolved invoices
        • Underpaid
        • Overpaid
        • Paid late
        • Illicit resource
        • Invoice refunds sequence
      • Create an invoice
      • Visual presentation at Cashier
      • Invoice hosted page
      • Online checkout
        • How-to
      • Payment links
      • Invoice callbacks
    • Payouts
      • Payout statuses
      • Payout sequence
      • Payout fees consideration
        • Network fees
      • Create a Coin Withdrawal
        • Possible errors
        • Withdrawals from fiat accounts
        • Withdrawals from cryptocurrency accounts
        • high_risk_address error message
      • Visual representation at Cashier
      • Minimum transaction amount
      • Coin Withdrawal callbacks
      • Travel Rule Compliance
    • Email Billing
      • Create an email billing
      • Email billing callbacks
    • Testing
      • Channels
      • Invoices
      • Payouts
    • Risks
    • Customers
    • Transactions types and Statuses
Powered by GitBook
On this page
  1. Guides
  2. Email Billing

Create an email billing

PreviousEmail BillingNextEmail billing callbacks

Last updated 1 year ago

At the moment Cryptopay offers a system that allows for the creation and management of email billing exclusively through the API. Remember, that in a merchant's account, the email billing items are viewable without the capacity to make edits.

Let's :

curl -X POST \
https://business-sandbox.cryptopay.me/api/subscriptions \
-H 'Authorization: HMAC ***' \
-H 'Content-Type: application/json' \
-H 'Date: Tue, 19 Mar 2019 10:11:40 GMT' \
-d '{"custom_id":"209584732", "name":"subscriptionName", "amount":"10", "currency":"EUR", "period":"month", "period_quantity":"1", "starts_at":"2023-08-25T15:53:02+00:00", "payer_email":"payer_email@email.com", "payer_name":"John Doe", "product_name":"Product name", "product_description":"Product description", "success_redirect_url":"https://successRedirectUrl.me/", "unsuccess_redirect_url":"https://unsuccessRedirectUrl.me/"}'

Let us go through the parameters we used in our request above:

  • custom_id - we recommend you to specify a certain reference by which you associate your customer with the payment

  • name - descriptive name for the subscription.

  • amount - subscription price.

  • currency - the currency of payment, i.e. the currency into which the cryptocurrency received will be converted and in which the merchant will be credited to the balance

  • period - periodicity of the subscription. Can be one of the following:

    • day

    • week

    • month

    • year

  • period_quantity - number describing the jumps in periodicity (e.g., 2 for every two weeks).

  • starts_at - date before which the first payment should be made. Аfter this date, the subscription will be cancelled.

  • payer_email - email of the subscribing user.

  • payer_name - name of the payer.

  • product_name - name of the product.

  • product_description - description of the product.

  • success_redirect_url - URL for successful payment redirection.

  • unsuccess_redirect_url - URL for unsuccessful payment redirection.

You will receive all that information back with status of the subscription and its id

{
    "data": {
        "id": "8b0c6e70-16ba-4b97-87ea-378de1e04ad5",
        "status": "active",
        "custom_id": "209584732",
        "name": "subscriptionName",
        "amount": "10.0",
        "currency": "EUR",
        "period": "month",
        "period_quantity": 1,
        "current_period_starts_at": "2023-08-10T15:53:02+00:00",
        "current_period_ends_at": "2023-08-25T15:53:02+00:00",
        "current_period_paid": false,
        "payer_email": "payer_email@email.com",
        "payer_name": "John Doe",
        "product_name": "Product name",
        "product_description": "Product description",
        "success_redirect_url": "https://successRedirectUrl.me/",
        "unsuccess_redirect_url": "https://unsuccessRedirectUrl.me/",
        "created_at": "2023-08-10T15:53:02+00:00",
        "cancelled_at": null
    }
}

It's crucial to note that the minimum acceptable date for the starts_at field is 3 days from the moment of the request creation, considering the current time. Additionally, from the moment of the request until the starts_at date, the subscription will be in an active status. It is assumed that during this period, the subscribing customer will have access to the designated product.

Upon successful subscription creation, you gain control over various management aspects:

By leveraging these endpoints, you can manage subscriptions, track statuses, and ensure an optimal customer experience.

List of subscriptions: Retrieve a list of all project subscriptions using .

Individual subscription: Fetch a subscription by its ID using the .

Retrieval by custom id: Acquire a subscription using its custom ID through .

Manual Subscription Cancellation: For cases requiring manual intervention, utilise to cancel subscriptions as needed.

create a subscription
specific API endpoint
corresponding API endpoint
dedicated API endpoint
this API endpoint