POST
/
v0
/
subscriptions
/
create
curl --request POST \
  --url https://api.fungies.io/v0/subscriptions/create \
  --header 'Content-Type: application/json' \
  --header 'x-fngs-public-key: <api-key>' \
  --header 'x-fngs-secret-key: <api-key>' \
  --data '{
  "userId": "<string>",
  "userEmail": "<string>",
  "backdateStartDate": 4503599627370495,
  "billingCycleAnchor": 4503599627370495,
  "trialEnd": 4503599627370495,
  "skipTrial": true,
  "skipNotifications": true,
  "items": [
    {
      "offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "value": 123,
      "quantity": 1
    }
  ]
}'
{
  "status": "<string>",
  "data": {
    "subscription": {
      "object": "subscription",
      "id": "<string>",
      "status": "all",
      "createdAt": 4503599627370495,
      "currentIntervalEnd": 4503599627370495,
      "currentIntervalStart": 4503599627370495,
      "cancelAtIntervalEnd": false,
      "canceledAt": null,
      "userId": null,
      "user": null,
      "orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "orderNumber": "<string>",
      "order": {
        "object": "order",
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "number": "<string>",
        "status": "PENDING"
      },
      "lastPaymentId": null,
      "lastPaymentNumber": null,
      "lastPayment": null
    }
  }
}

Authorizations

x-fngs-public-key
string
header
required
x-fngs-secret-key
string
header
required

Body

application/json
POST /v0/subscriptions/create Request body
items
object[]
required
userId
string
userEmail
string
backdateStartDate
integer | null
Required range: 0 <= x <= 9007199254740991
billingCycleAnchor
integer | null
Required range: 0 <= x <= 9007199254740991
trialEnd
integer | null
Required range: 0 <= x <= 9007199254740991
skipTrial
boolean
skipNotifications
boolean

Response

200
application/json
POST /v0/subscriptions/create Positive response
status
string
required
Allowed value: "success"
data
object
required