Collapse Menu
Documentation
FastSpring App
Contact Support

POST /quotes - Create a Quote

Overview

How to create a quote using the POST /quotes API endpoint, and the corresponding responses

The POST /quotes endpoint creates a new quote in the Open status. It cannot be used to update a status.

Required Attributes

AttributeTypeDescriptionConstraints
itemitem[]An array of items for the quote, including quantity and unitListPriceMinumum Length: 1
namestringA descriptive name for the quoteMinimum length: 3
Maximum length: 500
recipientcontactThe first name, last name and email address of the quote recipient 
recipientAddressaddressThe recipient’s address information, including: city, country, postal code, and region 

Example Request - Required Attributes

The example below creates a quote utilizing only the required attributes. This does not override any default values.

  • {
        "items": [
            {
                "product": "example-product"
            }
        ],
        "name": "Create Quote with Required Attributes",
        "recipient": {
            "email": "fastspring@example.com",
            "first": "Test",
            "last": "Customer"
        },
        "recipientAddress": {
            "city": "Santa Barbara",
            "country": "US",
            "region": "CA",
            "postalCode": "93103"
        }
    }
 

Optional Attributes

AttributeTypeDescriptionConstraints
couponstringA coupon code for the quote. This is not a coupon IDMaximum length: 255 
Minimum length: 0
currencystringThe three-letter ISO code of the currency of the quote. By default, it is the store-level currency. If you override the default currency, it must be with a currency that is enabled in your store 
fulfillmentTermstringThe fulfillment term for the quote. ON_PAYMENT - default fulfillment; fulfilled when payment is completed

ON_QUOTE_ACCEPTANCE - Fulfilled when quote is accepted.
notesstringProspect-facing notes that will appear on the quote
DefaultValue: Invoicing Settings: Notes / Terms
Maximum length: 5000
netTermDaysintegerThe net terms days for the quote. 
When value is 0, payment is required immediately, prior to order acceptance. 
Must be one of: 0, 1, 7, 14, 30, 45, 60, 90
expirationDateDaysintegerNumber of days after quote creation that it expires.
Default Value: Invoicing Settings: Expiration (Number of Days)
Minimum: 1
Maximum: 90
tagsobjectKey-value pairs for your internal tracking. Tags are invisible to your prospect. FastSpring does not utilize your tags.  
taxIdstringA Tax ID for the quote. Only EUR VAT IDs are supported at this time 

Example Request - Custom Tags and EU VAT ID

The example response below creates a quote with custom tags and a European Union VAT ID.

  • {
       "items": [
        {
          "product": "sample-product-from-catalog"
        }
       ]
       "name": "Quote with Custom Tags and EU VAT ID",
       "recipient": {
         "email": "euvatid@example.com",
         "first": "Test",
         "last": "Customer"
       },
       "recipientAddress": {
         "addressLine1": "Strawinskylaan 4117"
         "city": "Amsterdam",
         "country": "NL", 
         "postalCode": "1077 ZX",
         "region": "North Holland"
       },
       "tags": [{
         "key": "key1",
         "value": "value1"
       }],
       "taxId": "NL000000000B00" 
    }

Example Request - Coupons and Overrides

The example below applies a coupon to the quote, and overrides the product quantity, product price, netTermDays, and expirationDateDays.

  • {
       "coupon": "exampleCouponCode",
       "items": [
        {
          "product": "sample-product-from-catalog",
          "quantity": 8, // will override Product Catalog Default Quantity
          "unitListPrice": 9.95 // will override Product Catalog Price
        }
       ]
       "name": "Quote with a coupon, and override product quantity and price, net terms days, and expiration date days",
       "netTermsDays": 7, // will override store-level Default Net D Terms (Number of Days)
       "expirationDateDays": 45, // will override store-level Default Expiration (Number of Days)
       "recipient": {
         "email": "example@fastspring.com",
         "first": "Test",
         "last": "Customer",
         "company": "FastSpring",
         "phone": "(805)123-4567"
       },
       "recipientAddress": {
         "city": "Santa Barbara",
         "country": "US",
         "postalCode": "93101",
         "region": "CA",
         "streetLine1": "801 Garden Street",
         "streetLine2": "Ste. 201"
       }
    }

CreateQuote Responses

Successful Responses

  • 201 Created: A unique id is assigned to the Quote, the status is set to OPEN, and a customer-facing view of the quote can be found at the url provided in the quoteUrl attribute of the QuoteResponse. 

Error Responses

  • 400 Bad Request: Returned when Required attributes are missing in the request body, or attribute values do not follow type or constraints
  • 409 Conflict: Returned when the currency provided is not supported by the Store. 
  • 404 Not Found: Returned when a product path is not found
  • 500 Server Error: An error occurred on FastSpring’s end.