subscriptions
Update Subscription
subscriptions
Update Subscription
Update Subscription items and handle proration behavior. Can modify prices, quantities, and add/remove items.
PATCH
/
v0
/
subscriptions
/
{subscriptionIdOrNumber}
/
update
curl --request PATCH \
--url https://api.fungies.io/v0/subscriptions/{subscriptionIdOrNumber}/update \
--header 'Content-Type: application/json' \
--header 'x-fngs-public-key: <api-key>' \
--header 'x-fngs-secret-key: <api-key>' \
--data '{
"prorationBehavior": "none",
"items": [
{
"name": "Premium Plan",
"unitPrice": 10000,
"currency": "USD",
"quantity": 1,
"offerId": "123e4567-e89b-12d3-a456-426614174000",
"price": 8.988465674311579e+307,
"value": 8.988465674311579e+307
}
]
}'
{
"status": "<string>",
"data": {
"success": true
}
}
Path Parameters
Subscription ID or order number
Body
application/json
PATCH /v0/subscriptions/:subscriptionIdOrNumber/update Request body
Name of the Item. Required if Offer ID is not provided. Can be used to override the Offer name.
Example:
"Premium Plan"
New unit price in cents (min: 100). Required if Offer ID is not provided. Can be used to override the Offer price.
Required range:
100 < x <= 9007199254740991
Example:
10000
Valid 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.
Available options:
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
Example:
"USD"
Optional quantity (default: 1).
Required range:
1 <= x <= 1.7976931348623157e+308
Example:
1
Optional 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 currency
Example:
"123e4567-e89b-12d3-a456-426614174000"
Deprecated. Use value instead.
Required range:
100 <= x <= 1.7976931348623157e+308
Deprecated. Use unitPrice instead.
Required range:
100 <= x <= 1.7976931348623157e+308
Available options:
none
, create_prorations
, always_invoice
curl --request PATCH \
--url https://api.fungies.io/v0/subscriptions/{subscriptionIdOrNumber}/update \
--header 'Content-Type: application/json' \
--header 'x-fngs-public-key: <api-key>' \
--header 'x-fngs-secret-key: <api-key>' \
--data '{
"prorationBehavior": "none",
"items": [
{
"name": "Premium Plan",
"unitPrice": 10000,
"currency": "USD",
"quantity": 1,
"offerId": "123e4567-e89b-12d3-a456-426614174000",
"price": 8.988465674311579e+307,
"value": 8.988465674311579e+307
}
]
}'
{
"status": "<string>",
"data": {
"success": true
}
}