1. In the UI, create a discount to apply to your trial period
    See https://docs.bill.pro/docs/create-product-groups-and-pricing-elements#create-discounts

  1. In the UI, create a subscription product

  1. Create a customer with the UI, or API, or use the CSV upload
    For the UI, see https://docs.bill.pro/docs/create-your-customers For the API, see https://docs.bill.pro/reference/create-customer

  1. Create a subscription order in the API
    • See https://docs.bill.pro/reference/create-subscription-order
      curl --request POST \  
           --url 'https://test.billing.gg/api/v1/orders/create_subscription_order' \
           --header 'Authorization: Bearer <<apiKey>>' \
           --header 'accept: application/json' \
           --header 'content-type: application/json' \
           --data '
      {
        "order": {
          "currency": "EUR",
          "customer_id": 307,
          "invoice_id": "MyInvoiceID",
          "recurring_collection_interval": "MONTH",
          "start_date": "17/07/2024 14:00",
          "start_date_unix": "",
          "redirect_url": "https://success.example.com/",
          "failed_redirect_url": "https://failed.example.com/",
          "note": "Test subscription",
          "create_checkout": true,
          "order_product": {
            "product_id": 156
          }
        }
      }'

  1. Accept the initial payment via payment link or custom checkout

  1. Get the billing events of the order.
    • See https://docs.bill.pro/reference/list-scheduled-payments
      • In a subscription there is one event that is scheduled at the end of the first billing cycle
        curl --request GET \  
             --url 'https://test.billing.gg/api/v1/orders/<<order_id>>/scheduled_payments'
             --header 'Authorization: Bearer <<apiKey>>' \
             --header 'accept: application/json' \
             --header 'content-type: application/json'

  1. Adjust the date of the next billing event to the end of the trial period.
    • See https://docs.bill.pro/reference/update-a-scheduled-payment
      curl --request PUT \  
           --url 'https://test.billing.gg/api/v1/orders/<<order_id>>/scheduled_payments/<<spid>>' \
           --header 'Authorization: Bearer <<apiKey>>' \
           --header 'accept: application/json' \
           --header 'content-type: application/json' \
           --data '
      {
        "scheduled_payment": {
          "scheduled_at": "2024-07-19T14:00:00.000Z",
          "status": "scheduled"
        }
      }
      '