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 '
{
"items": [
{
"name": "<string>",
"unitPrice": 123,
"currency": "AFN",
"quantity": 1,
"offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 8.988465674311579e+307,
"value": 8.988465674311579e+307
}
],
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userEmail": "[email protected]",
"backdateStartDate": 4503599627370495,
"billingCycleAnchor": 4503599627370495,
"trialEnd": 4503599627370495,
"skipTrial": false,
"skipNotifications": false
}
'{
"status": "<string>",
"data": {
"subscription": {
"id": "<string>",
"status": "all",
"createdAt": 4503599627370495,
"currentIntervalEnd": 4503599627370495,
"currentIntervalStart": 4503599627370495,
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderNumber": "<string>",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "PENDING",
"object": "order"
},
"object": "subscription",
"cancelAtIntervalEnd": false,
"canceledAt": null,
"userId": null,
"user": null,
"lastPaymentId": null,
"lastPaymentNumber": null,
"lastPayment": null
}
}
}Create a new Subscription for a User. User must have a valid customer ID of Payment Provider set. Requires billing details with at least a country code and postal code if country is one of US, CA, UA, IN.
Note: User must have a valid customer ID of Payment Provider set and this customer must have a valid default payment method set (Payment Provider dashboard).
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 '
{
"items": [
{
"name": "<string>",
"unitPrice": 123,
"currency": "AFN",
"quantity": 1,
"offerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 8.988465674311579e+307,
"value": 8.988465674311579e+307
}
],
"userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"userEmail": "[email protected]",
"backdateStartDate": 4503599627370495,
"billingCycleAnchor": 4503599627370495,
"trialEnd": 4503599627370495,
"skipTrial": false,
"skipNotifications": false
}
'{
"status": "<string>",
"data": {
"subscription": {
"id": "<string>",
"status": "all",
"createdAt": 4503599627370495,
"currentIntervalEnd": 4503599627370495,
"currentIntervalStart": 4503599627370495,
"orderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderNumber": "<string>",
"order": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"number": "<string>",
"status": "PENDING",
"object": "order"
},
"object": "subscription",
"cancelAtIntervalEnd": false,
"canceledAt": null,
"userId": null,
"user": null,
"lastPaymentId": null,
"lastPaymentNumber": null,
"lastPayment": null
}
}
}POST /v0/subscriptions/create Request body
1 elementShow child attributes
Name of the Item. Required if Offer ID is not provided. Can be used to override the Offer name.
New unit price in cents (min: 100). Required if Offer ID is not provided. Can be used to override the Offer price.
x <= 9007199254740991Valid currency code. Required if value is provided. Required if Offer ID is not provided. Can be used to override the Offer currency.
Note: Currently needs to match Workspace currency.AFN, ALL, DZD, AOA, ARS, AMD, AWG, AUD, AZN, BSD, BDT, BBD, BZD, BMD, BOB, BAM, BWP, BRL, BHD, GBP, BND, BGN, BIF, BYN, KHR, CAD, CVE, KYD, KWD, XAF, XPF, CLP, CNY, COP, KMF, CDF, CRC, HRK, CZK, DKK, DJF, DOP, XCD, EGP, ETB, EUR, FKP, FJD, GMD, GEL, GIP, GTQ, GNF, GYD, HTG, HNL, HKD, HUF, ISK, INR, IDR, ILS, JMD, JPY, JOD, KZT, KES, KGS, LAK, LBP, LSL, LRD, MOP, MKD, MGA, MWK, MYR, MVR, MRO, MUR, MXN, MDL, MNT, MAD, MZN, MMK, NAD, NPR, ANG, TWD, NZD, NIO, NGN, NOK, OMR, PKR, PAB, PGK, PYG, PEN, PHP, PLN, QAR, RON, RUB, RWF, SHP, SVC, WST, STD, SAR, RSD, SCR, SLL, SGD, SBD, SOS, ZAR, KRW, LKR, SRD, SZL, SEK, CHF, TJS, TZS, THB, TND, TOP, TTD, TRY, UGX, UAH, AED, UYU, USD, UZS, VUV, VEF, VND, XOF, YER, ZMW, SLE, XCG, SSP, VES, MRU, STN, VED Optional quantity (default: 1).
1 <= x <= 1.7976931348623157e+308Optional valid Offer ID. Adds Offer reference to the Item.
Note: name, value and currency are derived from the Offer if not provided.
- name: Offer name with full specification
- value: Offer price
- currency: Offer currencyDeprecated. Use value instead.
100 <= x <= 1.7976931348623157e+308Deprecated. Use unitPrice instead.
100 <= x <= 1.7976931348623157e+3080 <= x <= 90071992547409910 <= x <= 90071992547409910 <= x <= 9007199254740991POST /v0/subscriptions/create Positive response
"success"Show child attributes
Show child attributes
all, active, canceled, incomplete, incomplete_expired, past_due, trialing, paused, unpaid 0 <= x <= 90071992547409910 <= x <= 90071992547409910 <= x <= 9007199254740991Show child attributes
PENDING, PAID, FAILED, UNPAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, EXPIRED order subscription 0 <= x <= 9007199254740991Show child attributes
one_time, subscription_initial, subscription_update, subscription_interval, subscription_extra, claim_free PENDING, PAID, FAILED, UNPAID, CANCELLED, REFUNDED, PARTIALLY_REFUNDED, EXPIRED payment