Enhanced Discount Management in FastSpring APIs

With applyDiscountImmediately and expanded discount parameters, FastSpring has introduced new API features designed to give you more control over how discounts are applied and managed.

You can use both features with several FastSpring endpoints to enhance the flexibility and functionality of your discount and coupon strategies.

📘

Phased rollout

FastSpring is gradually rolling out the features described on this page. As a result, they may not yet be enabled for your account.

applyDiscountImmediately

The applyDiscountImmediately field lets you specify whether a discount should be applied immediately or deferred until the next billing cycle. This field provides greater control over how discounts are handled during subscription changes.

Endpoint Applications

  • POST /coupons:
    • applyDiscountImmediately is available in both the request and response. When you create a coupon, you can specify applyDiscountImmediately in the request to control discount behavior.
    • FastSpring will return applyDiscountImmediately in the request response.
  • POST /subscriptions/estimate:
    • applyDiscountImmediately is available in the response body only. It indicates whether the discount is applied immediately during proration.

Expanded Discount Parameters

FastSpring has also expanded the available discount parameters, providing greater precision and flexibility in defining discounts.

The following table lists the fields relevant to this update:

FieldDescription
typeThe type of discount, either flat or percent.
amountThe discount amount if the type is flat.
percentThe percentage discount if the type is percent.
productsA list of product IDs to which the discount applies.
discountPeriodCountThe duration of the discount period.
applyDiscountImmediatelyIndicates whether or not the discount is applied immediately.

Endpoint Applications

  • POST /coupons:
    • You can use these expanded discount parameters in your request when creating a coupon. The response will also include this detailed discount information.
  • POST /subscriptions/estimate:
    • Discount parameters are included in FastSpring's response, giving you detailed information about discounts applied to the current and proposed plans.

The next section describes how these features apply to each relevant endpoint in the FastSpring API.


POST /subscriptions/estimate

Use this endpoint to preview proposed changes to a subscription before finalizing the change. The response will include detailed information about the current and proposed plans, including any discounts applied.

The following shows a sample request and response using the new parameters:

{
    "subscription": "XhwlbkKtTW-qMD5HuYowsQ",  // Unique identifier for the subscription.
    "product": "add-on-subscription",  // Product identifier for the subscription change.
    "prorate": true,  // Whether to prorate the subscription change.
    "quantity": 2,  // Quantity of the add-on.
    "coupons": ["10-percent-off", "add-on-1"]  // Array of coupon codes you want to apply.
}
{
    "subscription": "ThwlbkKtSW-qMD5HuYolsQ",  // Unique identifier for the subscription.
    "currency": "USD",
    "timezone": "UTC",
    "periodStartDate": 1710720000000,
    "periodStartDateDisplay": "3/18/24",
    "periodStartDateDisplayISO8601": "2024-03-18",
    "periodEndDate": 1713312000000,
    "periodEndDateDisplay": "4/17/24",
    "periodEndDateDisplayISO8601": "2024-04-17",
    "isProratable": true,  // Indicates if the subscription change is proratable.
    "prorationStatus": "Available",  // Status of the proration.
    "currentPlan": {
        "display": "Add-on Subscription",
        "product": "add-on-subscription",
        "billingFrequency": "1 month",
        "price": 200.00,
        "priceDisplay": "$200.00",
        "discount": 38.00,
        "discountDisplay": "$38.00",
        "discounts": [
            {
                "discountPath": "10-percent-off",
                "discountDuration": null,
                "percentValue": 10.0,
                "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
            },
            {
                "discountPath": "add-on-1",
                "discountDuration": null,
                "percentValue": 10.0,
                "applyDiscountImmediately": false  // Indicates if the discount is applied immediately.
            }
        ],
        "quantity": 1,
        "subtotal": 162.00,
        "subtotalDisplay": "$162.00",
        "tax": 0.00,
        "taxDisplay": "$0.00",
        "total": 162.00,
        "totalDisplay": "$162.00",
        "taxPercent": 0.00,
        "taxPercentDisplay": "0%",
        "periodStartDate": 1710720000000,
        "periodStartDateDisplay": "3/18/24",
        "periodStartDateDisplayISO8601": "2024-03-18",
        "periodEndDate": 1710720000000,
        "periodEndDateDisplay": "3/18/24",
        "periodEndDateDisplayISO8601": "2024-03-18",
        "proratedItemCharge": 324.00,
        "proratedItemChargeDisplay": "$324.00",
        "proratedItemCredit": 162.00,
        "proratedItemCreditDisplay": "$162.00",
        "proratedItemSubtotal": 162.00,
        "proratedItemSubtotalDisplay": "$162.00",
        "proratedItemTax": 0.00,
        "proratedItemTaxDisplay": "$0.00",
        "proratedItemTotal": 162.00,
        "proratedItemTotalDisplay": "$162.00",
        "addons": [
            {
                "display": "Add on 2",
                "product": "add-on-2",
                "price": 100.00,
                "priceDisplay": "$100.00",
                "discount": 10.00,
                "discountDisplay": "$10.00",
                "discounts": [
                  {
                      "discountPath": "10-percent-off",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  },
                  {
                      "discountPath": "add-on-1",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  }
                ],
                "quantity": 1,
                "subtotal": 90.00,
                "subtotalDisplay": "$90.00",
                "tax": 6.98,
                "taxDisplay": "$6.98",
                "total": 96.98,
                "totalDisplay": "$96.98",
                "taxPercent": 7.76,
                "taxPercentDisplay": "7.76%",
                "proratedItemCharge": 0.00,
                "proratedItemChargeDisplay": "$0.00",
                "proratedItemCredit": 0.00,
                "proratedItemCreditDisplay": "$0.00",
                "proratedItemSubtotal": 0.00,
                "proratedItemSubtotalDisplay": "$0.00",
                "proratedItemTax": 0.00,
                "proratedItemTaxDisplay": "$0.00",
                "proratedItemTotal": 0.00,
                "proratedItemTotalDisplay": "$0.00"
            },
            {
                "display": "Add on 1",
                "product": "add-on-1",
                "price": 100.00,
                "priceDisplay": "$100.00",
                "discount": 10.00,
                "discountDisplay": "$10.00",
                "discounts": [
                  {
                      "discountPath": "10-percent-off",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  },
                  {
                      "discountPath": "add-on-1",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": false  // Indicates if the discount is applied immediately.
                  }
                ],
                "quantity": 1,
                "subtotal": 90.00,
                "subtotalDisplay": "$90.00",
                "tax": 0.00,
                "taxDisplay": "$0.00",
                "total": 90.00,
                "totalDisplay": "$90.00",
                "taxPercent": 0.00,
                "taxPercentDisplay": "0%",
                "proratedItemCharge": 0.00,
                "proratedItemChargeDisplay": "$0.00",
                "proratedItemCredit": 0.00,
                "proratedItemCreditDisplay": "$0.00",
                "proratedItemSubtotal": 0.00,
                "proratedItemSubtotalDisplay": "$0.00",
                "proratedItemTax": 0.00,
                "proratedItemTaxDisplay": "$0.00",
                "proratedItemTotal": 0.00,
                "proratedItemTotalDisplay": "$0.00"
            }
        ],
        "subscriptionSubtotal": 342.00,
        "subscriptionSubtotalDisplay": "$342.00",
        "subscriptionTax": 6.98,
        "subscriptionTaxDisplay": "$6.98",
        "subscriptionTotal": 348.98,
        "subscriptionTotalDisplay": "$348.98",
        "subscriptionProratedCredit": 162.00,
        "subscriptionProratedCreditDisplay": "$162.00"
    },
    "proposedPlan": {
        "display": "Add-on Subscription",
        "product": "add-on-subscription",
        "billingFrequency": "1 month",
        "price": 200.00,
        "priceDisplay": "$200.00",
        "discount": 38.00,
        "discountDisplay": "$38.00",
        "discounts": [
                  {
                      "discountPath": "10-percent-off",
                      "discountDuration": 1,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  },
                  {
                      "discountPath": "add-on-1",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": false  // Indicates if the discount is applied immediately.
                  }
                ],
        "quantity": 2,
        "subtotal": 324.00,
        "subtotalDisplay": "$324.00",
        "tax": 0.00,
        "taxDisplay": "$0.00",
        "total": 324.00,
        "totalDisplay": "$324.00",
        "taxPercent": 0.00,
        "taxPercentDisplay": "0%",
        "periodStartDate": 1710720000000,
        "periodStartDateDisplay": "3/18/24",
        "periodStartDateDisplayISO8601": "2024-03-18",
        "periodEndDate": 1713312000000,
        "periodEndDateDisplay": "4/17/24",
        "periodEndDateDisplayISO8601": "2024-04-17",
        "proratedItemCharge": 324.00,
        "proratedItemChargeDisplay": "$324.00",
        "proratedItemCredit": 162.00,
        "proratedItemCreditDisplay": "$162.00",
        "proratedItemSubtotal": 162.00,
        "proratedItemSubtotalDisplay": "$162.00",
        "proratedItemTax": 0.00,
        "proratedItemTaxDisplay": "$0.00",
        "proratedItemTotal": 162.00,
        "proratedItemTotalDisplay": "$162.00",
        "addons": [
            {
                "display": "Add on 2",
                "product": "add-on-2",
                "price": 100.00,
                "priceDisplay": "$100.00",
                "discount": 10.00,
                "discountDisplay": "$10.00",
                "discounts": [
                  {
                      "discountPath": "10-percent-off",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  },
                  {
                      "discountPath": "add-on-1",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": false  // Indicates if the discount is applied immediately.
                  }
                ],
                "quantity": 1,
                "subtotal": 90.00,
                "subtotalDisplay": "$90.00",
                "tax": 6.98,
                "taxDisplay": "$6.98",
                "total": 96.98,
                "totalDisplay": "$96.98",
                "taxPercent": 7.76,
                "taxPercentDisplay": "7.76%",
                "proratedItemCharge": 0.00,
                "proratedItemChargeDisplay": "$0.00",
                "proratedItemCredit": 0.00,
                "proratedItemCreditDisplay": "$0.00",
                "proratedItemSubtotal": 0.00,
                "proratedItemSubtotalDisplay": "$0.00",
                "proratedItemTax": 0.00,
                "proratedItemTaxDisplay": "$0.00",
                "proratedItemTotal": 0.00,
                "proratedItemTotalDisplay": "$0.00"
            },
            {
                "display": "Add on 1",
                "product": "add-on-1",
                "price": 100.00,
                "priceDisplay": "$100.00",
                "discount": 10.00,
                "discountDisplay": "$10.00",
                "discounts": [
                  {
                      "discountPath": "10-percent-off",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": true  // Indicates if the discount is applied immediately.
                  },
                  {
                      "discountPath": "add-on-1",
                      "discountDuration": null,
                      "percentValue": 10.0,
                      "applyDiscountImmediately": false  // Indicates if the discount is applied immediately.
                  }
                ],
                "quantity": 1,
                "subtotal": 90.00,
                "subtotalDisplay": "$90.00",
                "tax": 0.00,
                "taxDisplay": "$0.00",
                "total": 90.00,
                "totalDisplay": "$90.00",
                "taxPercent": 0.00,
                "taxPercentDisplay": "0%",
                "proratedItemCharge": 0.00,
                "proratedItemChargeDisplay": "$0.00",
                "proratedItemCredit": 0.00,
                "proratedItemCreditDisplay": "$0.00",
                "proratedItemSubtotal": 0.00,
                "proratedItemSubtotalDisplay": "$0.00",
                "proratedItemTax": 0.00,
                "proratedItemTaxDisplay": "$0.00",
                "proratedItemTotal": 0.00,
                "proratedItemTotalDisplay": "$0.00"
            }
        ],
        "subscriptionSubtotal": 504.00,
        "subscriptionSubtotalDisplay": "$504.00",
        "subscriptionTax": 6.98,
        "subscriptionTaxDisplay": "$6.98",
        "subscriptionTotal": 510.98,
        "subscriptionTotalDisplay": "$510.98",
        "subscriptionProratedCharge": 324.00,
        "subscriptionProratedChargeDisplay": "$324.00"
    },
    "amountDue": {
        "prorationSubtotal": 162.00,
        "prorationSubtotalDisplay": "$162.00",
        "prorationTax": 0.00,
        "prorationTaxDisplay": "$0.00",
        "totalAmountDue": 162.00,
        "totalAmountDueDisplay": "$162.00",
        "nextChargeDate": 1713398400000,
        "nextChargeDateDisplay": "4/18/24",
        "nextChargeDateDisplayISO8601": "2024-04-18",
        "nextChargeAmount": 510.98,
        "nextChargeAmountDisplay": "$510.98"
    }
}

Proration and Applying Discounts Immediately

The prorate flag is a boolean parameter you set in your API request. It determines whether changes to the subscription should be prorated (adjusted for the current billing cycle).

Behavior Based on Prorate

  • When prorate is true:
    • If the discount has a duration of 1 and applyDiscountImmediately is true, the discount is used during proration.
    • These discounts won't appear in the proposed plan or the next charge amount since they've already been applied.
  • When prorate is false:
    • If the discount has a duration of 1 and applyDiscountImmediately is true, FastSpring displays the discount in the proposed plan.
    • These discounts are included in the next charge amount because they haven't been used yet and will apply in the next billing cycle.

For more information, including the full response body for the /subscriptions/estimate endpoint, see Preview a proposed prorated plan change.

Overriding Order-Level Coupons During Plan Changes

To override an order-level coupon during a subscription plan change, send an empty array in the coupons parameter of the request body.

When you make calls to update a subscription or to estimate the impact of a subscription change, the empty coupons parameter will prevent FastSpring from applying any existing coupons to the change.

The following shows a sample request and response to POST /subscriptions/estimate that overrides any order-level coupons:

{
    "subscription": "XhwlbkKtTW-qMD5HuYowsQ",  
    "product": "add-on-subscription",  
    "prorate": true, 
    "coupons": [],  // Empty array that overrides any existing coupons.
}
{
    "subscription": "x7sif3EHQ9Cq5CozyphVMw",
    "currency": "USD",
    "timezone": "UTC",
    "periodStartDate": 1718841600000,
    "periodStartDateDisplay": "6/20/24",
    "periodStartDateDisplayISO8601": "2024-06-20",
    "periodEndDate": 1721347200000,
    "periodEndDateDisplay": "7/19/24",
    "periodEndDateDisplayISO8601": "2024-07-19",
    "endDate": null,
    "endDateDisplay": null,
    "endDateDisplayISO8601": null,
    "remainingPeriods": -1,
    "nextChargeDate": 1721433600000,
    "nextChargeDateDisplay": "7/20/24",
    "nextChargeDateDisplayISO8601": "2024-07-20",
    "isProratable": true,
    "prorationStatus": "Available",
    "currentPlan": {
        "display": "Basic",
        "product": "basic",
        "billingFrequency": "1 month",
        "price": 100.00,
        "priceDisplay": "$100.00",
        "discount": 20.00,
        "discountDisplay": "$20.00",
        "quantity": 1,
        "subtotal": 80.00,
        "subtotalDisplay": "$80.00",
        "tax": 0.00,
        "taxDisplay": "$0.00",
        "total": 80.00,
        "totalDisplay": "$80.00",
        "taxPercent": 0.00,
        "taxPercentDisplay": "0%",
        "periodStartDate": 1718841600000,
        "periodStartDateDisplay": "6/20/24",
        "periodStartDateDisplayISO8601": "2024-06-20",
        "periodEndDate": 1718928000000,
        "periodEndDateDisplay": "6/21/24",
        "periodEndDateDisplayISO8601": "2024-06-21",
        "prorationUtilizedDays": 1,
        "prorationRemainingDays": 29,
        "prorationTotalDays": 30,
        "proratedItemCharge": 4.83,
        "proratedItemChargeDisplay": "$4.83",
        "proratedItemCredit": 77.33,
        "proratedItemCreditDisplay": "$77.33",
        "proratedItemSubtotal": -72.50,
        "proratedItemSubtotalDisplay": "-$72.50",
        "proratedItemTax": 0.00,
        "proratedItemTaxDisplay": "$0.00",
        "proratedItemTotal": -72.50,
        "proratedItemTotalDisplay": "-$72.50",
        "addons": [],
        "subscriptionSubtotal": 80.00,
        "subscriptionSubtotalDisplay": "$80.00",
        "subscriptionTax": 0.00,
        "subscriptionTaxDisplay": "$0.00",
        "subscriptionTotal": 80.00,
        "subscriptionTotalDisplay": "$80.00",
        "subscriptionProratedCredit": 77.33,
        "subscriptionProratedCreditDisplay": "$77.33"
    },
    "proposedPlan": {
        "display": "Spotify",
        "product": "spotify",
        "billingFrequency": "1 month",
        "price": 5.00,
        "priceDisplay": "$5.00",
        "discount": 0.00,
        "discountDisplay": "$0.00",
        "quantity": 1,
        "subtotal": 5.00,
        "subtotalDisplay": "$5.00",
        "tax": 0.00,
        "taxDisplay": "$0.00",
        "total": 5.00,
        "totalDisplay": "$5.00",
        "taxPercent": 0.00,
        "taxPercentDisplay": "0%",
        "periodStartDate": 1718928000000,
        "periodStartDateDisplay": "6/21/24",
        "periodStartDateDisplayISO8601": "2024-06-21",
        "periodEndDate": 1721347200000,
        "periodEndDateDisplay": "7/19/24",
        "periodEndDateDisplayISO8601": "2024-07-19",
        "prorationUtilizedDays": 1,
        "prorationRemainingDays": 29,
        "prorationTotalDays": 30,
        "proratedItemCharge": 4.83,
        "proratedItemChargeDisplay": "$4.83",
        "proratedItemCredit": 77.33,
        "proratedItemCreditDisplay": "$77.33",
        "proratedItemSubtotal": -72.50,
        "proratedItemSubtotalDisplay": "-$72.50",
        "proratedItemTax": 0.00,
        "proratedItemTaxDisplay": "$0.00",
        "proratedItemTotal": -72.50,
        "proratedItemTotalDisplay": "-$72.50",
        "addons": [],
        "subscriptionSubtotal": 5.00,
        "subscriptionSubtotalDisplay": "$5.00",
        "subscriptionTax": 0.00,
        "subscriptionTaxDisplay": "$0.00",
        "subscriptionTotal": 5.00,
        "subscriptionTotalDisplay": "$5.00",
        "subscriptionProratedCharge": 4.83,
        "subscriptionProratedChargeDisplay": "$4.83"
    },
    "amountDue": {
        "prorationSubtotal": -72.50,
        "prorationSubtotalDisplay": "-$72.50",
        "prorationTax": 0.00,
        "prorationTaxDisplay": "$0.00",
        "totalAmountDue": 0.00,
        "totalAmountDueDisplay": "$0.00",
        "nextChargeDate": 1721433600000,
        "nextChargeDateDisplay": "7/20/24",
        "nextChargeDateDisplayISO8601": "2024-07-20",
        "nextChargeAmount": 5.00,
        "nextChargeAmountDisplay": "$5.00"
    }
}

Proration and Applying Discounts Immediately

POST /coupons

Use this endpoint to create a new coupon.

The new features previously described on this page let you define flexible promotional campaigns, including percentage or flat discounts, product-specific discounts, and time duration discounts.

The following shows a sample request and response using the POST /coupon parameters:

{
  "coupon": "Black-Friday-2021",  // Optional coupon ID.
  "discount": {  // Required discount object specifying the type and amount.
    "type": "flat",  // Type of discount, either 'flat' or 'percent'.
    "amount": {  // The discount amount for each currency if the type is 'flat'.
      "USD": 10,  // Discount amount in USD.
    },
    "percent": 25,  // Percentage discount.
    "products": [  // List of product IDs to which the discount applies.
      "saas-app-annual",
      "saas-app-monthly"
    ],
    "discountPeriodCount": 3,  // Duration of the discount period in billing cycles.
    "applyDiscountImmediately": true  // Indicates if the discount should be applied immediately.
  },
  "combine": false,  // Whether the coupon discount should be combined with product discounts.
  "reason": {  // Optional discount reason visible to end users in different languages.
    "en": "Black Friday Savings"
  },
  "limit": 5,  // Optional limit for each coupon code.
  "available": {  // Optional availability period for the coupon.
    "start": "2021-11-24T00:00:00Z",  // Start time of coupon availability.
    "end": "2021-11-29T00:00:00Z"  // End time of coupon availability.
  },
  "codes": [  // Optional array of actual coupon codes that trigger the discount.
    "BF21",
    "BL21"
  ],
  "products": [  // Optional array of product IDs to which the discount applies.
    "saas-app-annual",
    "saas-app-monthly"
  ],
  "externalDownloadService": true, 
  "shippingFee": true  
}

{
  "coupon": "Black-Friday-2021",
  "discount": {
    "hasMultipleDiscounts": true,
    "discounts": [
      {
        "type": "flat",
        "amount": {
          "USD": 10,
          "EUR": 10
        },
        "percent": 25,
        "products": [
          "saas-app-annual",
          "saas-app-monthly"
        ],
        "discountPeriodCount": 3,
        "applyDiscountImmediately": true
      }
    ]
  },
  "combine": false,
  "reason": {
    "en": "Black Friday Savings"
  },
  "limit": 5,
  "available": {
    "start": "2021-11-24T00:00:00.000Z",
    "end": "2021-11-29T00:00:00.000Z"
  },
  "codes": [
    "BF21",
    "BL21"
  ],
  "products": [
    "saas-app-annual",
    "saas-app-monthly"
  ],
  "externalDownloadService": true,
  "shippingFee": true
}

For more information, including a full list of the body parameters you can use with the POST /coupons endpoint, see Create a coupon.

GET /coupons/{coupon_id}

Use this endpoint to retrieve the details of a specific coupon. To get the coupon, you'll only need to pass the coupon_id into the request path.

The following shows a sample request and response for GET /coupon/{coupon_id}:

GET https://api.fastspring.com/coupons/Black-Friday-2021
{
  "coupon": "Black-Friday-2021",
  "discount": {
    "hasMultipleDiscounts": true,
    "discounts": [
      {
        "type": "flat",
        "amount": {
          "USD": 10,
          "EUR": 10
        },
        "percent": 25,
        "products": [
          "saas-app-annual",
          "saas-app-monthly"
        ],
        "discountPeriodCount": 3,
        "applyDiscountImmediately": true
      }
    ]
  },
  "combine": false,
  "reason": {
    "en": "Black Friday Savings"
  },
  "limit": 5,
  "available": {
    "start": "2021-11-24T00:00:00.000Z",
    "end": "2021-11-29T00:00:00.000Z"
  },
  "codes": [
    "BF21",
    "BL21"
  ],
  "products": [
    "saas-app-annual",
    "saas-app-monthly"
  ],
  "externalDownloadService": true,
  "shippingFee": true
}

/product Endpoints

FastSpring has also added applyDiscountImmediately to a number of /products endpoints, giving you greater flexibility over discounts as well as greater insight into your products through detailed response bodies.

POST /products

You can include applyDiscountImmediately in your POST calls to /products. applyDiscountImmediately defaults to true and is only available if discountDuration isn't null.

The following shows a sample request and successful response for POST /products:

{
  "products": [
    {
      "product": "product-one",
      "display": {
        "en": "Product One"
      },
      "description": {
        "summary": {
          "en": "A great product."
        },
        "action": {
          "en": "Buy now!"
        },
        "full": {
          "en": "This product offers great features and benefits."
        }
      },
      "fulfillment": {
        "instructions": {
          "en": "Thank you for purchasing.",
          "es": "Gracias por su compra."
        }
      },
      "fulfillments": [
        {
          "type": "file",
          "url": "http://somedomain.net/files/8675309/filename.exe",
          "display": "filename.exe",
          "applicability": "ALWAYS",
          "behavior": "CURRENT"
        }
      ],
      "image": "http://somedomain.net/images/8675309/filename.jpg",
      "format": "digital",
      "sku": "string",
      "taxcode": "DC020502",
      "attributes": {
        "key1": "value1",
        "key2": "value2"
      },
      "pricing": {
        "trial": 2,
        "interval": "month",
        "intervalLength": 1,
        "quantityBehavior": "allow",
        "quantityDefault": 1,
        "price": {
          "USD": 14.95,
          "EUR": 10.99
        },
        "setupFee": {
          "title": {"en": "Setup fee title"},
          "price": {"USD": 10}
        },
        "quantityDiscounts": {
          "10": 25.00,
          "30": {"USD": 25.00, "EUR": 15}
        },
        "discountReason": {
          "en": "The Reason"
        },
        "discountDuration": 1,
        "applyDiscountImmediately": true,  // New field indicating immediate discount application.
        "dateLimitsEnabled": true,
        "dateLimits": {
          "start": "2020-06-05 12:00",
          "end": "2020-07-04 19:33"
        }
      }
    }
  ]
}
{
  "products": [
    {
      "product": "product-path",
      "action": "product.updated",
      "result": "success"
    }
  ]
}

For more information, including a full breakdown of the FastSpring response body you'll receive after calling POST /products endpoint, see Create and update products.

GET /products

The following GET endpoints now include the applyDiscountImmediately field in their response bodies:

  • GET /products/{product_path}
  • GET /products/price
  • GET /products/price/{id}
  • GET /products/price?country={country}
  • GET /products/price?country={country}&currency={currency}
  • GET /products/price/{id}?country={country}&currency={currency}
  • GET /products/price/{id}?country={country}

The following shows a sample request and successful response for GET /products/price?country={country}

GET https://api.fastspring.com/products/price?country=PR&country=DE
{
  "page": 1,
  "limit": 50,
  "nextPage": 2,
  "products": [
    {
      "action": "product.price.getall",
      "result": "success",
      "product": "example-subscription",
      "pricing": {
        "PR": {
          "2": {
            "discountPercent": 5,
            "discountValue": 5,
            "discountValueDisplay": "$5.00",
            "unitPrice": 95,
            "unitPriceDisplay": "$95.00"
          },
          "3": {
            "discountPercent": 10,
            "discountValue": 10,
            "discountValueDisplay": "$10.00",
            "unitPrice": 90,
            "unitPriceDisplay": "$90.00"
          },
          "4": {
            "discountPercent": 15,
            "discountValue": 15,
            "discountValueDisplay": "$15.00",
            "unitPrice": 85,
            "unitPriceDisplay": "$85.00"
          },
          "5": {
            "discountPercent": 25,
            "discountValue": 25,
            "discountValueDisplay": "$25.00",
            "unitPrice": 75,
            "unitPriceDisplay": "$75.00"
          },
          "currency": "USD",
          "price": 100,
          "display": "$100.00",
          "quantityDiscount": null,
          "discountReason": {
            "en": "2023 Yearly Sale"
          },
          "discountPeriodCount": 3,  // Example value for discount duration
          "applyDiscountImmediately": true,  // Indicates if the discount is applied immediately
          "available": {
            "start": "2023-01-01 00:00",
            "end": "2023-12-31 23:30"
          },
          "setupFeePrice": "10.0",
          "setupFeePriceDisplay": "$10.00",
          "setupFeeReason": {
            "en": "Setup Fee"
          }
        },
        "DE": {
          "2": {
            "discountPercent": 5,
            "discountValue": 4.5,
            "discountValueDisplay": "4,50 €",
            "unitPrice": 85,
            "unitPriceDisplay": "85,50 €"
          },
          "3": {
            "discountPercent": 10,
            "discountValue": 9,
            "discountValueDisplay": "9,00 €",
            "unitPrice": 81,
            "unitPriceDisplay": "81,00 €"
          },
          "4": {
            "discountPercent": 15,
            "discountValue": 13.5,
            "discountValueDisplay": "13,50 €",
            "unitPrice": 76.5,
            "unitPriceDisplay": "76,50 €"
          },
          "5": {
            "discountPercent": 25,
            "discountValue": 22.5,
            "discountValueDisplay": "22,50 €",
            "unitPrice": 67.5,
            "unitPriceDisplay": "67,50 €"
          },
          "currency": "EUR",
          "price": 90,
          "display": "90,00 €",
          "quantityDiscount": null,
          "discountReason": {
            "en": "2023 Yearly Sale"
          },
          "discountPeriodCount": 3,  // Example value for discount duration.
          "applyDiscountImmediately": true,  // Indicates if the discount is applied immediately.
          "available": {
            "start": "2023-01-01 00:00",
            "end": "2023-12-31 23:30"
          },
          "setupFeePrice": "11.0",
          "setupFeePriceDisplay": "12,00 €",
          "setupFeeReason": {
            "en": "Setup Fee"
          }
        }
      }
    }
  ]
}

For more information on these endpoints, see the Products API documentation.