Issue an upcoming invoice for early pay

Issues an upcoming invoice, for a subscription order with a specified ID, for early pay.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json
required

InvoiceIssue resource.

issuedTime
string or null <date-time>

Date and time when the invoice is issued. If this field is null or omitted, the invoice is issued immediately.

dueTime
string or null <date-time>

Date and time when the invoice is due for payment. If this field is null or omitted, this value is set to the issuedTime value.

Responses
201

Upcoming invoice issued.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
id
string <= 50 characters

ID of the upcoming invoice, which is persisted in the future renewal invoice.

websiteId
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.

subscriptionId
string <= 50 characters

ID of the related subscription order.

currency
string = 3 characters

Currency code in ISO 4217 format.

customerId
string <= 50 characters

ID of the customer resource.

revision
integer

Number of times the upcoming invoice data has changed.

Use the revision number when analyzing webhook data to determine if a change should take precedence over the current representation.

organizationId
string <= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Array of objects (UpcomingInvoiceItem)

Upcoming invoice items array.

Array
id
string <= 50 characters

ID of the upcoming invoice item.

isInterim
boolean

Specifies if the line item is added to an interim invoice.

description
string <= 1000 characters

Description of the upcoming invoice item.

unitPrice
number <double>

Unit price of the upcoming invoice item.

quantity
integer

Quantity of the upcoming invoice item.

price
number <double>

Total price of the upcoming invoice item.

productId
string or null <= 50 characters

ID of the product.

planId
string or null <= 50 characters

ID of the plan.

subscriptionId
string <= 50 characters

ID of the order.

discountAmount
number <double>

Discount amount applied to the upcoming 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.

periodNumber
integer

Billing period number that is associated with the invoice item. For example, an invoice item for a service is included in billing period number 3. The invoice item is only applied to billing period number 3.

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 (InvoiceTaxItem)

Invoice item tax.

Array of objects

Related links.

object

Embedded objects that are requested by the expand query parameter.

amount
number <double>

Amount of the invoice.

amountDue
number <double>

Amount that is due on the invoice.

subtotalAmount
number <double>

Subtotal amount of the invoice.

discountAmount
number <double>

Discount amount that is applied to the invoice.

object (Shipping)

Shipping settings.

amount
required
number <double>

Shipping amount.

calculator
required
string

Shipping calculator.

object (InvoiceTax)

Invoice taxes.

calculator
required
string

Type of tax calculator.

required
Array of objects (InvoiceTaxItem)

Taxes applied to this invoice.

Array
amount
required
number <double>

Amount of the tax.

description
required
string

Description of the tax.

rate
number or null <double>

Overall sales tax rate which includes state, county, city and district tax.

stateAmount
number or null <double>

Amount of sales tax to collect for the state.

countyAmount
number or null <double>

Amount of sales tax to collect for the county.

cityAmount
number or null <double>

Amount of sales tax to collect for the city.

specialDistrictAmount
number or null <double>

Amount of sales tax to collect for the special district.

stateRate
number or null <double>

State sales tax rate for given location.

countyRate
number or null <double>

County sales tax rate for given location.

cityRate
number or null <double>

City sales tax rate for given location.

specialDistrictRate
number or null <double>

Special district sales tax rate for given location.

object or null

Jurisdiction names for the invoice.

amount
integer

Total amount of all invoice taxes.

object or null

Organization tax ID number that is displayed on the invoice.

type
required
string

Type of the tax ID number.

Enum: "eu-vat" "other"
value
required
string

Value of the tax ID number.

object or null

Customer tax ID number that is displayed on the invoice.

type
required
string

Type of the tax ID number.

Enum: "eu-vat" "other"
value
required
string

Value of the tax ID number.

object

Billing address of the invoice.

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

Delivery address of the invoice.

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.

poNumber
string or null

Purchase order number that is displayed on the invoice.

notes
string

Notes for the customer that are displayed on the invoice.

Array of objects

Discounts applied.

Array
couponId
string <= 50 characters

ID of the coupon.

redemptionId
string <= 50 characters

ID of the redemption.

amount
number <double>

Total amount discounted by this coupon.

description
string

Description of the discount.

context
string (DiscountContext)
Default: "items"

Context in which the discount applies.

Enum: Description
items

items (less discounts)

shipping

shipping (less discounts)

items-and-shipping

items and shipping (less discounts)

dueTime
string <date-time>

Date and time when the invoice is due for payment.

issuedTime
string <date-time>

Date and time when the invoice is issued.

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.

Array of objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "website" "customer" "organization" "subscription" "attachments" "transactionAllocations" "recalculateInvoice"
object

Embedded objects that are requested by the expand query parameter.

customer
object
website
object
organization
object
leadSource
object
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

409

Conflict.

post/subscriptions/{id}/upcoming-invoice/issue
Request samples
application/json
{
  • "issuedTime": "2019-08-24T14:15:22Z",
  • "dueTime": "2019-08-24T14:15:22Z"
}
Response samples
application/json
{
  • "id": "in_0YVF9605RKC62BP14NE2R7V2XT",
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "subscriptionId": "ord_01GYJPRKHBD6ZYHH897QCJMBS4",
  • "currency": "USD",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "revision": 0,
  • "organizationId": "org_0YVDM8RC7GDADADSBSMW124JA8",
  • "items": [
    ],
  • "amount": 0,
  • "amountDue": 0,
  • "subtotalAmount": 0,
  • "discountAmount": 0,
  • "shipping": {
    },
  • "tax": {
    },
  • "organizationTaxIdNumber": {
    },
  • "customerTaxIdNumber": {
    },
  • "billingAddress": {
    },
  • "deliveryAddress": {
    },
  • "poNumber": "PO123456",
  • "notes": "string",
  • "discounts": [
    ],
  • "dueTime": "2019-08-24T14:15:22Z",
  • "issuedTime": "2019-08-24T14:15:22Z",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ],
  • "_embedded": {
    }
}