Skip to main content

Pay invoice

POST 

https://apis.<domain>/invoices/:id/pay

Authorization: http

name: bearerTokentype: httpscheme: bearerin: headerdescription: Authorization Header: `Authorization: Bearer <user_token>`

Pay invoice.

Authorization Action:

pay:invoices:pay

Request

Path Parameters

    id stringrequired

Body

required
    payment_method stringrequired

    A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.

    off_session boolean

    Default value: false

    Indicates if a customer is on or off-session while an invoice payment is attempted.

    expand string[]

    Specifies which fields in the response should be expanded.

Responses

Schema
    account_name string

    The public name of the business associated with this invoice, most often the business creating the invoice.

    amount_due numberrequired

    Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.

    amount_paid numberrequired

    The amount, in %s, that was paid.

    amount_remaining numberrequired

    The difference between amount_due and amount_paid, in %s.

    billing_reason string

    Possible values: [automatic_pending_invoice_item_invoice, manual, quote_accept, subscription, subscription_create, subscription_cycle, subscription_threshold, subscription_update, upcoming]

    Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached.

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    customer object
    address objectrequired

    The customer's address.

    city string
    country string

    Two-letter country code (ISO 3166-1 alpha-2).

    line1 string

    Address line 1 (e.g., street, block, PO Box, or company name).

    line2 string

    Address line 2 (e.g., apartment, suite, unit, or building).

    postal_code string

    ZIP or postal code.

    state string

    State, county, province, prefecture, or region.

    delinquent booleanrequired

    When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

    email string

    The customer's email address.

    name string

    The customer's full name or business name.

    phone string

    The customer's phone number.

    subscriptions object

    The customer's current subscriptions, if any.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    due_date number

    The date on which payment for this invoice is due.

    invoice_pdf string

    The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null.

    number string

    A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified.

    paid booleanrequired

    Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance.

    paid_out_of_band booleanrequired

    Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe.

    period_end numberrequired

    End of the usage period during which invoice items were added to this invoice.

    period_start numberrequired

    Start of the usage period during which invoice items were added to this invoice.

    status string

    Possible values: [draft, open, paid, uncollectible, void]

    The status of the invoice.

    subscription object
    cancel_at number

    A date in the future at which the subscription will automatically get canceled

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    current_period_end numberrequired

    End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

    current_period_start numberrequired

    Start of the current period that the subscription has been invoiced for.

    customer objectrequired

    The customer who owns the subscription.

    address objectrequired

    The customer's address.

    city string
    country string

    Two-letter country code (ISO 3166-1 alpha-2).

    line1 string

    Address line 1 (e.g., street, block, PO Box, or company name).

    line2 string

    Address line 2 (e.g., apartment, suite, unit, or building).

    postal_code string

    ZIP or postal code.

    state string

    State, county, province, prefecture, or region.

    delinquent booleanrequired

    When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

    email string

    The customer's email address.

    name string

    The customer's full name or business name.

    phone string

    The customer's phone number.

    subscriptions object

    The customer's current subscriptions, if any.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    days_until_due numberrequired

    Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically.

    ended_at number

    If the subscription has ended, the date the subscription ended.

    items object[]required

    List of subscription items, each with an attached price.

  • Array [
  • price objectrequired
    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    active boolean

    Whether the price can be used for new purchases. Defaults to true.

    currency stringrequired

    Three-letter ISO currency code, in lowercase. Must be a supported currency.

    currency_options object

    Prices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.

    recurring object

    The recurring components of a price such as interval.

    interval stringrequired

    Possible values: [day, week, month, year]

    Specifies billing frequency

    interval_count number

    Possible values: >= 1

    The number of intervals between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).

    trial_period_days number

    Default number of trial days when subscribing a customer to this price.

    usage_type string

    Possible values: [licensed]

    Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed.

    unit_amount_decimal stringrequired

    Decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.

    quantity number

    The quantity of the plan to which the customer should be subscribed.

    subscription stringrequired

    The subscription this subscription_item belongs to.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

  • ]
  • metadata object
    start_date numberrequired

    Date when the subscription was first created. The date might differ from the created date due to backdating.

    status stringrequired

    Possible values: [active, all, canceled, ended, incomplete, incomplete_expired, past_due, paused, trialing, unpaid]

    Status of the subscription.

    trial_end number

    If the subscription has a trial, the end of that trial.

    trial_start number

    If the subscription has a trial, the beginning of that trial.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

    subtotal numberrequired

    Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated

    tax number

    The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.

    total numberrequired

    Total after discounts and taxes.

    id stringrequired

    Unique identifier for the object.

    created numberrequired

    Time at which the object was created. Measured in seconds since the Unix epoch.

curl -L -X POST 'https://apis.<domain>/invoices/:id/pay' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"payment_method": "string",
"off_session": false,
"expand": [
"string"
]
}'
Request Collapse all
Base URL
https://apis.<domain>
Auth
Parameters
— pathrequired
Body required
{
"payment_method": "string",
"off_session": false,
"expand": [
"string"
]
}