POST
/
subscriptions
curl --request POST \
  --url https://sandbox-api.billingrails.com/v1/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "collection_method": "<string>",
  "billing_cycle_type": "anniversary",
  "start_at": "2023-11-07T05:31:56Z",
  "items": [
    {
      "fee_id": "<string>",
      "quantity": 123
    }
  ],
  "plan_id": "<string>",
  "account_id": "<string>",
  "payment_method_id": "<string>"
}'
{
  "subscription": {
    "object": "subscription",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "plan_id": "<string>",
    "account_id": "<string>",
    "payment_method_id": "<string>",
    "status": "draft",
    "currency": "<string>",
    "amount": 123,
    "collection_method": "<string>",
    "billing_cycle_type": "anniversary",
    "has_metered_fees": true,
    "multi_interval": true,
    "started_at": "2023-11-07T05:31:56Z",
    "canceled_at": "2023-11-07T05:31:56Z",
    "current_period_start": "2023-11-07T05:31:56Z",
    "current_period_end": "2023-11-07T05:31:56Z",
    "trial_period_start": "2023-11-07T05:31:56Z",
    "trial_period_end": "2023-11-07T05:31:56Z",
    "first_billing_at": "2023-11-07T05:31:56Z",
    "previous_billing_at": "2023-11-07T05:31:56Z",
    "billed_through": "2023-11-07T05:31:56Z",
    "items": [
      {
        "fee_id": "<string>",
        "quantity": 123
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Subscription paylaod

The body is of type object.

Response

200 - application/json

Subscription created

The response is of type object.