POST
/
subscriptions
curl --request POST \
  --url https://api.sulu.sh/v0/subscriptions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "customerId": "<string>",
  "planId": "<string>",
  "name": "<string>",
  "startedAt": "2023-11-07T05:31:56Z",
  "endingAt": "2023-11-07T05:31:56Z"
}'
{
  "id": "<string>",
  "object": "subscription",
  "customerId": "<string>",
  "planId": "<string>",
  "name": "<string>",
  "status": "active",
  "createdAt": "2023-11-07T05:31:56Z",
  "startedAt": "2023-11-07T05:31:56Z",
  "endingAt": "2023-11-07T05:31:56Z",
  "terminatedAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
customerId
string
required

Unique identifier for a customer

planId
string
required

Unique identifier for a plan

name
string
required

The name of the subscription.

startedAt
string
required

The date and time when the subscription started.

endingAt
string

The date and time when the subscription will end.

Response

201
application/json
Subscription created successfully
id
string
object
enum<string>
Available options:
subscription
customerId
string
planId
string
name
string
status
enum<string>
Available options:
active,
terminated
createdAt
string
startedAt
string
endingAt
string
terminatedAt
string