Collapse Menu
Documentation
FastSpring App
Contact Support

/quotes - Additional Attributes

Overview

Attributes associated with the /quote API endpoint, including: Address, Contact, and Items

Address

All attributes (required and optional) are returned in each response that contains an Address type.

Required Attributes

The attributes listed below must be included in the body of any request containing an address.

AttributeTypeDescriptionConstraints
citystringThe city of the address.Maximum length: 255
countrystringThe country of the address.Minimum length: 2
Maximum length: 2
postalCodestringThe postal code of the address.Maximum length: 255
regionstringThe state, county, province, or region of the address.Maximum length: 255

Optional Attributes

AttributeTypeDescriptionConstraints
addressLine1stringNumber and street of line 1 for the address. Maximum length: 255
addressLine2stringNumber and street of line 2 for the address. Maximum length: 255

Contact

All attributes (required and optional) are returned in each response that contains a Contact type.

Required Attributes

AttributeTypeDescriptionConstraints
emailstringThe email address of the contactMaximum length: 255
Valid email formatting
firststringThe first name of the contactMaximum length: 255
laststringThe last name of the contactMaximum length: 255

Optional Attributes

AttributeTypeDescriptionConstraints
companystringThe name of the company that the contact associates with, if applicableMaximum length: 255
phonestringThe phone number of the contact, if applicableMaximum length: 255

Items

All attributes (required and optional) are returned in each response that contains an Item type.

Required Attributes for Requests

The required Item attributes listed below must be included in the body of any request containing an address.

AttributeTypeDescriptionConstraints
productstringProduct path for the item; must match an existing product path in your StoreMaximum length: 255

Optional Attributes for Requests

AttributeTypeDescriptionConstraints
quantityintegerThe quantity of the item; quantity cannot be overridden for 

DefaultValue: Product Default Quantity 
Minimum: 1
unitListPricenumberThe unit list price of the item; The value provided will be used regardless of currency.

DefaultValue: Product Price 
Minimum: 0.0

Item Response

AttributeTypeDescription
customPricebooleanA flag to denote if this item is using a price other than defined catalog product price
displaystringThe customer-friendly name of the item to be displayed on the quote
imagestringThe image URL for the item
intervalCountintegerThe number of intervals for the item
pathstringThe product path for the item
periodstringThe period for the item
periodDaysintegerThe period days for the item
quantityintegerThe quantity for the item
taxesItemTaxTaxes for the item
trialDaysintegerThe number of free trial days
typeenum<string>The type for the item
unitCatalogPricenumberThe catalog-defined price for the item
unitCouponDiscountnumberThe unit discount from the coupon
unitDiscountnumberThe unit discount amount for the item
unitDiscountDisplaystringThe formatted display for unitDiscount
unitPricenumberThe unit price for the item
unitPriceDisplaystringThe formatted display for unitPrice

Example: Add a Subscription with a Setup Fee

The example below adds a subscription with a setup fee to the quote.

Request:

  • {
      ...
      "items": [
        {
           "product": "subscription-with-setup-fee" 
        },
        {
           "product": "subscription-with-setup-fee.setupFee"
        }
      ],
      ...
    }

Response:

  • ...
    "items": [
      {
        "id": "IT1234576789",
        "coupon": null,
        "couponDiscount": 0,
        "customPrice": false,
        "discountPercent": 0,
        "display": "Your Monthly Subscription"
        "image": "https://www.example-image.com/images/123",
        "intervalCount": 0,
        "period": "month",
        "periodDays": 0,
        "quantity": 5,
        "subtotal": 500.00,
        "subtotalDisplay": "$500.00",
        "subtotalInPayoutCurrency": 500.00,
        "subtotalInPayoutCurrencyDisplay": "$500.00",
        "taxes": [],
        "trialDays": 0,
        "type": "SUBSCRIPTION",
        "unitDiscount": 0,
        "unitPrice": 100.00
      }
      {
        "id": "IT234567890",
        "coupon": null,
        "couponDiscount": 0,
        "customPrice": false,
        "discountPercent": 0,
        "display": "One-Time setup fee",
        "driverItem": "IT1234576789",
        "image": "https://www.example-image.com/images/123",
        "intervalCount": 0,
        "period": "month",
        "periodDays": 0,
        "quantity": 1,
        "subtotal": 10.00,
        "subtotalDisplay": "$10.00",
        "subtotalInPayoutCurrency": 10.00,
        "subtotalInPayoutCurrencyDisplay": "$10.00",
        "taxes": [],
        "trialDays": 0,
        "type": "SETUP_FEE",
        "unitDiscount": 0,
        "unitPrice": 10.00
      }
    ]
    ...

Example: Include a Free Setup Fee

The example below provides a free setup fee. This will display as a line-item discount on the quote.

Request:

  • "items": [
      {
        "product": "subscription-with-setup-fee", 
        "defaultSessionBehavior": true
      }
    ]

Response:

  • ...
    "items": [
      {
         "product": "subscription-with-setup-fee",
         "quantity": 1,
         ...
      },
      {
         "product": "subscription-with-setup-fee.setupFee",
         "quantity": 1,
         "unitPrice": 0.0, 
         "unitDiscount": 10.0,
         "driver": {
           "display": "One-Time Setup Fee",
           "type": "one_time_fee",
           "product": "subscription-with-setup-fee"
         }
         ...
      }
    ]
    ...

Example: Remove a Setup Fee

The example below removes a setup fee from a subscription. This does not display as a line item on the quote.

Request: 

  • {
      ...
      "items": [
        {
           "product": "subscription-with-setup-fee",
           
        },
        {
           "product": "subscription-with-setup-fee.setupFee",
        }
      ],
      ...
    }

Response:

  • {
      ...
      "items": [
        {
          "product": "subscription-with-setup-fee",
          "quantity": 5
          "unitPrice": 100.00
          ...
        }
      ],
      ...
    }
 

Example: Remove a Selected Add-On from a Subscription

Request:

  •   {
      ...
      "items": [
        {
          "product": "subscription-with-preselected-addon"
        },
        {
          "product": "preselected-addon",
          "quantity": 0
        }
      ],
      ...
    }

Response:

  • ...
    "items": [
      {
         "product": "subscription-with-preselected-addon",
         "quantity": 1,
         ...
      }
    ]
    ...

Example: Add a Subscription with a Preselected Add-On

Request:

  • {
      ...
      "items": [
        {
          "product": "subscription-with-preselected-addon",
        },
       
      ],
      ...
    }

Response:

  • ...
    "items": [
      {
         "product": "subscription-with-preselected-addon",
         "quantity": 1,
         ...
      },
      {
         "product": "preselected-addon",
         "quantity": 1,
         "driver": {
           "type": "addon",
           "product": "subscription-with-preselected-addon"
         }
         ...
      }
    ]
    …

Example: Add a Subscription with No Preselected Add-Ons

The example below adds a subscription to the quote, however the subscription does not include preselected Add-Ons.

Request:

  • {
      ...
      "items": [
        {
          "product": "subscription-with-no-preselected-addons",
        },
      ],
      ...
    }

Response:

  • ...
    "items": [
      {
         "product": "subscription-with-no-preselected-addons",
         "quantity": 1,
         ...
      },
    ]
    ...