Create a quote

Creates a quote.

SecuritySecretApiKey or JWT
Request
Request Body schema: application/json
websiteId
required
string (WebsiteId) <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

customerId
required
string (CustomerId) <= 50 characters

ID of the customer resource.

required
Array of objects (QuoteItem) non-empty

Items included in the quote.

Array (non-empty)
required
OriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionOrderPlan (object) or TrialOnlyPlan (object)))

Plan details.

quantity
required
integer >= 1

Number of product units in the specified plan.

object or null

Delivery address of the order.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

Contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies if the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies if the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's job title.

object or null

Billing address of the order.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

Contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies if the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies if the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's job title.

paymentTerms
string

Payment terms for the customer which are displayed on the quote.

expirationTime
string or null <date-time>

Date and time when the quote expires. The default expiration time is one month from the time the quote is issued. In a draft state, this field may be null.

redirectUrl
string <uri>

URL to redirect the customer to when a quote is rejected. The default value is the website URL.

object (QuoteSignature)
showWrittenSignatureLines
boolean
Default: false

Specifies whether to show written signature lines.

organizationPrintedName
string or null
Default: null

Printed name of the organization.

object (Shipping)

Shipping settings.

amount
required
integer

Shipping amount.

calculator
required
string

Shipping calculator.

couponIds
Array of strings or null

List of coupons to redeem on the customer and apply to the order when the quote is accepted.

For more information, see Coupons.

Responses
201

Quote created.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
websiteId
required
string (WebsiteId) <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

customerId
required
string (CustomerId) <= 50 characters

ID of the customer resource.

required
Array of objects (QuoteItem) non-empty

Items included in the quote.

Array (non-empty)
required
OriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionOrderPlan (object) or TrialOnlyPlan (object)))

Plan details.

quantity
required
integer >= 1

Number of product units in the specified plan.

id
string

ID of the quote item.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

object

Embedded objects that are requested by the expand query parameter.

id
string <= 50 characters

ID of the quote.

type
string

Specifies the type of quote. A quote can be a subscription or a one-time purchase.

Enum: "subscription-order" "one-time-order"
status
string

Status of the quote.

Enum: Description
draft

Quote can be edited. This quote cannot be sent to a customer.

issued

Quote cannot be edited. This quote can be sent to a customer.

accepted

Customer accepted the quote and created an order.

rejected

Customer rejected the quote.

canceled

Organization canceled the quote.

expired

Expired before customer or organization interaction.

orderId
string or null <= 50 characters

ID of the order.

object or null

Delivery address of the order.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

Contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies if the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies if the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's job title.

hash
string <= 40 characters

Use this value to compare contacts for identical attribute values.

object or null

Billing address of the order.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

Contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies if the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies if the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's job title.

hash
string <= 40 characters

Use this value to compare contacts for identical attribute values.

object (QuoteInvoicePreview)

Preview of initial quote invoice.

currency
string = 3 characters

Currency of the invoice.

amount
number <double>

Amount of the invoice.

subtotalAmount
number <double>

Subtotal amount of the invoice.

discountAmount
number <double>

Discount amount that is applied to the invoice.

shippingAmount
number <double>

Shipping amount that is applied to the invoice.

taxAmount
number <double>

Tax amount that is applied to the invoice.

Array of objects (QuoteInvoicePreviewItem)

Invoice items.

Array
type
string

Type of invoice item.

Enum: "debit" "credit"
description
string <= 1000 characters

Description of the invoice item.

unitPrice
number <double>

Unit price of the invoice item.

quantity
integer

Quantity of the invoice item.

price
number <double>

Total price of the invoice item.

periodStartTime
string <date-time>

Date and time when the billing period starts.

periodEndTime
string <date-time>

Date and time when the billing period ends.

object (InvoiceTaxItem)

Invoice item tax.

paymentTerms
string

Payment terms for the customer which are displayed on the quote.

expirationTime
string or null <date-time>

Date and time when the quote expires. The default expiration time is one month from the time the quote is issued. In a draft state, this field may be null.

issuedTime
string or null <date-time>

Date and time when the quote is issued.

acceptedTime
string or null <date-time>

Date and time when the quote is accepted.

rejectedTime
string or null <date-time>

Date and time when the quote is rejected.

canceledTime
string or null <date-time>

Date and time when the quote is canceled.

redirectUrl
string <uri>

URL to redirect the customer to when a quote is rejected. The default value is the website URL.

object (QuoteSignature)
showWrittenSignatureLines
boolean
Default: false

Specifies whether to show written signature lines.

organizationPrintedName
string or null
Default: null

Printed name of the organization.

object (Shipping)

Shipping settings.

amount
required
integer

Shipping amount.

calculator
required
string

Shipping calculator.

couponIds
Array of strings or null

List of coupons to redeem on the customer and apply to the order when the quote is accepted.

For more information, see Coupons.

Array of objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "quoteAcceptanceFormUrl"
object

Embedded objects that are requested by the expand query parameter.

customer
object
website
object
order
object
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

422

Invalid data sent.

post/quotes
Request samples
application/json
{
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "paymentTerms": "string",
  • "expirationTime": "2019-08-24T14:15:22Z",
  • "redirectUrl": "http://example.com",
  • "signature": {
    },
  • "shipping": {
    },
  • "couponIds": [
    ]
}
Response samples
application/json
{
  • "id": "qt_0YV7DES3WPC5J8JD8QTVNZBZNZ",
  • "type": "subscription-order",
  • "status": "draft",
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "orderId": "ord_0YV7DES3WPC5J8JD8QTVNZBZNZ",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "invoicePreview": {
    },
  • "paymentTerms": "string",
  • "expirationTime": "2019-08-24T14:15:22Z",
  • "issuedTime": "2019-08-24T14:15:22Z",
  • "acceptedTime": "2019-08-24T14:15:22Z",
  • "rejectedTime": "2019-08-24T14:15:22Z",
  • "canceledTime": "2019-08-24T14:15:22Z",
  • "redirectUrl": "http://example.com",
  • "signature": {
    },
  • "shipping": {
    },
  • "couponIds": [
    ],
  • "_links": [
    ],
  • "_embedded": {
    }
}