Skip to main content

Create a one-off invoice

This endpoint is used to create a one-off invoice for a customer.

Request Body required
    metadata object nullable

    User-specified key/value pairs for the resource. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

    property name* string nullable
    customer_id string nullable

    The id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.

    external_customer_id string nullable

    The external_customer_id of the Customer to create this invoice for. One of customer_id and external_customer_id are required.

    currency string required

    An ISO 4217 currency string. Must be the same as the customer's currency if it is set.

    memo string nullable

    An optional memo to attach to the invoice.

    will_auto_issue boolean

    Default value: false

    When true, this invoice will automatically be issued upon creation. When false, the resulting invoice will require manual review to issue. Defaulted to false.

    invoice_date object required

    Optional invoice date to set. Must be in the past, if not set, invoice_date is set to the current time in the customer's timezone.

    oneOf

    string

    Optional invoice date to set. Must be in the past, if not set, invoice_date is set to the current time in the customer's timezone.

    net_terms integer required

    Determines the difference between the invoice issue date for subscription invoices as the date that they are due. A value of '0' here represents that the invoice is due on issue, whereas a value of 30 represents that the customer has 30 days to pay the invoice.

    line_items object[] required

    Possible values: >= 1

  • Array [
  • start_date date required

    A date string to specify the line item's start date in the customer's timezone.

    end_date date required

    A date string to specify the line item's end date in the customer's timezone.

    quantity number required

    The number of units on the line item

    name string required

    The name of the line item.

    item_id string required
    model_type string required

    Possible values: [unit]

    unit_config object required
    unit_amount string required

    Rate per unit of usage

  • ]
  • discount object nullable
    oneOf

    discount_type string required

    Possible values: [percentage]

    applies_to_price_ids string[] required

    List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices.

    reason string nullable
    percentage_discount number required

    Possible values: <= 1

    Only available if discount_type is percentage. This is a number between 0 and 1.

Responses

Created

Response Headers

    Schema
      metadata object required

      User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

      property name* string
      voided_at date-time nullable required

      If the invoice has a status of void, this gives a timestamp when the invoice was voided.

      paid_at date-time nullable required

      If the invoice has a status of paid, this gives a timestamp when the invoice was paid.

      issued_at date-time nullable required

      If the invoice has been issued, this will be the time it transitioned to issued (even if it is now in a different state.)

      scheduled_issue_at date-time nullable required

      If the invoice is in draft, this timestamp will reflect when the invoice is scheduled to be issued.

      auto_collection object required
      next_attempt_at date-time nullable required

      If the invoice is scheduled for auto-collection, this field will reflect when the next attempt will occur. If dunning has been exhausted, or auto-collection is not enabled for this invoice, this field will be null.

      previously_attempted_at date-time nullable required

      If Orb has ever attempted payment auto-collection for this invoice, this field will reflect when that attempt occurred. In conjunction with next_attempt_at, this can be used to tell whether the invoice is currently in dunning (that is, previously_attempted_at is non-null, and next_attempt_time is non-null), or if dunning has been exhausted (previously_attempted_at is non-null, but next_attempt_time is null).

      enabled boolean nullable required

      True only if auto-collection is enabled for this invoice.

      num_attempts integer nullable required

      Number of auto-collection payment attempts.

      issue_failed_at date-time nullable required

      If the invoice failed to issue, this will be the last time it failed to issue (even if it is now in a different state.)

      sync_failed_at date-time nullable required

      If the invoice failed to sync, this will be the last time an external invoicing provider sync was attempted. This field will always be null for invoices using Orb Invoicing.

      payment_failed_at date-time nullable required

      If payment was attempted on this invoice but failed, this will be the time of the most recent attempt.

      payment_started_at date-time nullable required

      If payment was attempted on this invoice, this will be the start time of the most recent attempt. This field is especially useful for delayed-notification payment mechanisms (like bank transfers), where payment can take 3 days or more.

      amount_due string required

      This is the final amount required to be charged to the customer and reflects the application of the customer balance to the total of the invoice.

      created_at date-time required

      The creation time of the resource in Orb.

      currency string required

      An ISO 4217 currency string or credits

      customer object required
      id string required
      external_customer_id string nullable required
      discount object deprecated
      discounts object[] required
    • Array [
    • oneOf

      discount_type string required

      Possible values: [percentage]

      applies_to_price_ids string[] required

      List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices.

      reason string nullable
      percentage_discount number required

      Possible values: <= 1

      Only available if discount_type is percentage. This is a number between 0 and 1.

    • ]
    • due_date date-time required

      When the invoice payment is due.

      id string required
      invoice_pdf string nullable required

      The link to download the PDF representation of the Invoice.

      invoice_number string required

      Automatically generated invoice number to help track and reconcile invoices. Invoice numbers have a prefix such as RFOBWG. These can be sequential per account or customer.

      minimum object nullable
      minimum_amount string required

      Minimum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this minimum amount applies to. For plan/plan phase minimums, this can be a subset of prices.

      minimum_amount string nullable required
      maximum object nullable
      maximum_amount string required

      Maximum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this maximum amount applies to. For plan/plan phase maximums, this can be a subset of prices.

      maximum_amount string nullable required
      line_items object[] required

      The breakdown of prices in this invoice.

    • Array [
    • amount string required

      The final amount after any discounts or minimums.

      discount object nullable
      oneOf

      discount_type string required

      Possible values: [percentage]

      applies_to_price_ids string[] required

      List of price_ids that this discount applies to. For plan/plan phase discounts, this can be a subset of prices.

      reason string nullable
      percentage_discount number required

      Possible values: <= 1

      Only available if discount_type is percentage. This is a number between 0 and 1.

      end_date date-time required

      The end date of the range of time applied for this line item's price.

      grouping string nullable required

      [DEPRECATED] For configured prices that are split by a grouping key, this will be populated with the key and a value. The amount and subtotal will be the values for this particular grouping.

      minimum object nullable
      minimum_amount string required

      Minimum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this minimum amount applies to. For plan/plan phase minimums, this can be a subset of prices.

      minimum_amount string nullable required
      maximum object nullable
      maximum_amount string required

      Maximum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this maximum amount applies to. For plan/plan phase maximums, this can be a subset of prices.

      maximum_amount string nullable required
      name string required

      The name of the price associated with this line item.

      quantity number required
      start_date date-time required

      The start date of the range of time applied for this line item's price.

      subtotal string required

      The line amount before any line item-specific discounts or minimums.

      sub_line_items object[] required

      For complex pricing structures, the line item can be broken down further in sub_line_items.

    • Array [
    • oneOf

      amount string required

      The total amount for this sub line item.

      name string required
      quantity number required
      grouping object nullable
      key string required
      value string nullable required

      No value indicates the default group

      type string required

      Possible values: [matrix]

      matrix_config object required
      dimension_values string[] required

      The ordered dimension values for this line item.

    • ]
    • tax_amounts object[] required

      An array of tax rates and their incurred tax amounts. Empty if no tax integration is configured.

    • Array [
    • tax_rate_description string required

      The human-readable description of the applied tax rate.

      tax_rate_percentage string nullable required

      The tax rate percentage, out of 100.

      amount string required

      The amount of additional tax incurred by this tax rate.

    • ]
    • id string required

      A unique ID for this line item.

      price object nullable

      The Price resource represents a price that can be billed on a subscription, resulting in a charge on an invoice in the form of an invoice line item. Prices take a quantity and determine an amount to bill.

      Orb supports a few different pricing models out of the box. Each of these models is serialized differently in a given Price object. The model_type field determines the key for the configuration object that is present.

      Unit pricing

      With unit pricing, each unit costs a fixed amount.

      {
      ...
      "model_type": "unit",
      "unit_config": {
      "unit_amount": "0.50"
      }
      ...
      }

      Tiered pricing

      In tiered pricing, the cost of a given unit depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first ten units may cost $0.50 each and all units thereafter may cost $0.10 each.

      {
      ...
      "model_type": "tiered",
      "tiered_config": {
      "tiers": [
      {
      "first_unit": 1,
      "last_unit": 10,
      "unit_amount": "0.50"
      },
      {
      "first_unit": 11,
      "last_unit": null,
      "unit_amount": "0.10"
      }
      ]
      }
      ...

      Bulk pricing

      Bulk pricing applies when the number of units determine the cost of all units. For example, if you've bought less than 10 units, they may each be $0.50 for a total of $5.00. Once you've bought more than 10 units, all units may now be priced at $0.40 (i.e. 101 units total would be $40.40).

      {
      ...
      "model_type": "bulk",
      "bulk_config": {
      "tiers": [
      {
      "maximum_units": 10,
      "unit_amount": "0.50"
      },
      {
      "maximum_units": 1000,
      "unit_amount": "0.40"
      }
      ]
      }
      ...
      }

      Package pricing

      Package pricing defines the size or granularity of a unit for billing purposes. For example, if the package size is set to 5, then 4 units will be billed as 5 and 6 units will be billed at 10.

      {
      ...
      "model_type": "package",
      "package_config": {
      "package_amount": "0.80",
      "package_size": 10
      }
      ...
      }

      BPS pricing

      BPS pricing specifies a per-event (e.g. per-payment) rate in one hundredth of a percent (the number of basis points to charge), as well as a cap per event to assess. For example, this would allow you to assess a fee of 0.25% on every payment you process, with a maximum charge of $25 per payment.

      {
      ...
      "model_type": "bps",
      "bps_config": {
      "bps": 125,
      "per_unit_maximum": "11.00"
      }
      ...
      }

      Bulk BPS pricing

      Bulk BPS pricing specifies BPS parameters in a tiered manner, dependent on the total quantity across all events. Similar to bulk pricing, the BPS parameters of a given event depends on the tier range that the billing period falls into. Each tier range is defined by an upper bound. For example, after $1.5M of payment volume is reached, each individual payment may have a lower cap or a smaller take-rate.

          ...
      "model_type": "bulk_bps",
      "bulk_bps_config": {
      "tiers": [
      {
      "maximum_amount": "1000000.00",
      "bps": 125,
      "per_unit_maximum": "19.00"
      },
      {
      "maximum_amount": null,
      "bps": 115,
      "per_unit_maximum": "4.00"
      }
      ]
      }
      ...
      }

      Tiered BPS pricing

      Tiered BPS pricing specifies BPS parameters in a graduated manner, where an event's applicable parameter is a function of its marginal addition to the period total. Similar to tiered pricing, the BPS parameters of a given event depends on the tier range that it falls into, where each tier range is defined by an upper and lower bound. For example, the first few payments may have a 0.8 BPS take-rate and all payments after a specific volume may incur a take-rate of 0.5 BPS each.

          ...
      "model_type": "tiered_bps",
      "tiered_bps_config": {
      "tiers": [
      {
      "minimum_amount": "0",
      "maximum_amount": "1000000.00",
      "bps": 125,
      "per_unit_maximum": "19.00"
      },
      {
      "minimum_amount": "1000000.00",
      "maximum_amount": null,
      "bps": 115,
      "per_unit_maximum": "4.00"
      }
      ]
      }
      ...
      }

      Matrix pricing

      Matrix pricing defines a set of unit prices in a one or two-dimensional matrix. dimensions defines the two event property values evaluated in this pricing model. In a one-dimensional matrix, the second value is null. Every configuration has a list of matrix_values which give the unit prices for specified property values. In a one-dimensional matrix, the matrix values will have dimension_values where the second value of the pair is null. If an event does not match any of the dimension values in the matrix, it will resort to the default_unit_amount.

      {
      "model_type": "matrix"
      "matrix_config": {
      "default_unit_amount": "3.00",
      "dimensions": [
      "cluster_name",
      "region"
      ],
      "matrix_values": [
      {
      "dimension_values": [
      "alpha",
      "west"
      ],
      "unit_amount": "2.00"
      },
      ...
      ]
      }
      }

      Fixed fees

      Fixed fees are prices that are applied independent of usage quantities, and follow unit pricing. They also have an additional parameter fixed_price_quantity. If the Price represents a fixed cost, this represents the quantity of units applied.

      {
      ...
      "id": "price_id",
      "model_type": "unit",
      "unit_config": {
      "unit_amount": "2.00"
      },
      "fixed_price_quantity": 3.0
      ...
      }
      oneOf

      metadata object required

      User specified key-value pairs for the resource. If not present, this defaults to an empty dictionary. Individual keys can be removed by setting the value to null, and the entire metadata mapping can be cleared by setting metadata to null.

      property name* string
      id string required
      name string required
      external_price_id string nullable required
      price_type string required

      Possible values: [usage_price, fixed_price]

      model_type string required

      Possible values: [unit]

      created_at date-time required
      cadence string required

      Possible values: [one_time, monthly, quarterly, semi_annual, annual, custom]

      billing_cycle_configuration object required
      duration integer required
      duration_unit string required

      Possible values: [day, month]

      invoicing_cycle_configuration object nullable required
      duration integer required
      duration_unit string required

      Possible values: [day, month]

      billable_metric object nullable required
      id string required
      fixed_price_quantity number nullable required
      plan_phase_order integer nullable required
      currency string required
      conversion_rate number nullable required
      item object required
      id string required
      name string required
      credit_allocation object nullable required
      currency string required
      allows_rollover boolean required
      discount object nullable required
      oneOf

      object

      minimum object nullable required
      minimum_amount string required

      Minimum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this minimum amount applies to. For plan/plan phase minimums, this can be a subset of prices.

      minimum_amount string nullable required
      maximum object nullable required
      maximum_amount string required

      Maximum amount applied

      applies_to_price_ids string[] required

      List of price_ids that this maximum amount applies to. For plan/plan phase maximums, this can be a subset of prices.

      maximum_amount string nullable required
      unit_config object required
      unit_amount string required

      Rate per unit of usage

    • ]
    • subscription object nullable
      id string required
      subtotal string required

      The total before any discounts and minimums are applied.

      total string required

      The total after any minimums and discounts have been applied.

      customer_balance_transactions object[] required
    • Array [
    • id string required

      A unique id for this transaction.

      created_at date-time required

      The creation time of this transaction.

      starting_balance string required

      The original value of the customer's balance prior to the transaction, in the customer's currency.

      ending_balance string required

      The new value of the customer's balance prior to the transaction, in the customer's currency.

      amount string required

      The value of the amount changed in the transaction.

      action string required

      Possible values: [applied_to_invoice, manual_adjustment, prorated_refund, revert_prorated_refund, return_from_voiding, credit_note_applied, credit_note_voided, overpayment_refund]

      description string nullable required

      An optional description provided for manual customer balance adjustments.

      invoice object nullable
      id string required

      The Invoice id

      type string required

      Possible values: [increment, decrement]

      credit_note object nullable
      id string required

      The id of the Credit note

    • ]
    • status string required

      Possible values: [issued, paid, synced, void, draft]

      invoice_source string required

      Possible values: [subscription, partial, one_off]

      shipping_address object nullable
      line1 string nullable required
      line2 string nullable required
      city string nullable required
      state string nullable required
      postal_code string nullable required
      country string nullable required
      billing_address object nullable
      line1 string nullable required
      line2 string nullable required
      city string nullable required
      state string nullable required
      postal_code string nullable required
      country string nullable required
      hosted_invoice_url string nullable required

      A URL for the customer-facing invoice portal. This URL expires 30 days after the invoice's due date, or 60 days after being re-generated through the UI.

      will_auto_issue boolean required

      This is true if the invoice will be automatically issued in the future, and false otherwise.

      eligible_to_issue_at date-time nullable required

      If the invoice has a status of draft, this will be the time that the invoice will be eligible to be issued, otherwise it will be null. If auto-issue is true, the invoice will automatically begin issuing at this time.

      customer_tax_id object nullable

      Tax IDs are commonly required to be displayed on customer invoices, which are added to the headers of invoices.

      Supported Tax ID Countries and Types

      CountryTypeDescription
      Andorraad_nrtAndorran NRT Number
      Argentinaar_cuitArgentinian Tax ID Number
      Australiaau_abnAustralian Business Number (AU ABN)
      Australiaau_arnAustralian Taxation Office Reference Number
      Austriaeu_vatEuropean VAT Number
      Bahrainbh_vatBahraini VAT Number
      Belgiumeu_vatEuropean VAT Number
      Boliviabo_tinBolivian Tax ID
      Brazilbr_cnpjBrazilian CNPJ Number
      Brazilbr_cpfBrazilian CPF Number
      Bulgariabg_uicBulgaria Unified Identification Code
      Bulgariaeu_vatEuropean VAT Number
      Canadaca_bnCanadian BN
      Canadaca_gst_hstCanadian GST/HST Number
      Canadaca_pst_bcCanadian PST Number (British Columbia)
      Canadaca_pst_mbCanadian PST Number (Manitoba)
      Canadaca_pst_skCanadian PST Number (Saskatchewan)
      Canadaca_qstCanadian QST Number (Québec)
      Chilecl_tinChilean TIN
      Chinacn_tinChinese Tax ID
      Colombiaco_nitColombian NIT Number
      Costa Ricacr_tinCosta Rican Tax ID
      Croatiaeu_vatEuropean VAT Number
      Cypruseu_vatEuropean VAT Number
      Czech Republiceu_vatEuropean VAT Number
      Denmarkeu_vatEuropean VAT Number
      Dominican Republicdo_rcnDominican RCN Number
      Ecuadorec_rucEcuadorian RUC Number
      Egypteg_tinEgyptian Tax Identification Number
      El Salvadorsv_nitEl Salvadorian NIT Number
      Estoniaeu_vatEuropean VAT Number
      EUeu_oss_vatEuropean One Stop Shop VAT Number for non-Union scheme
      Finlandeu_vatEuropean VAT Number
      Franceeu_vatEuropean VAT Number
      Georgiage_vatGeorgian VAT
      Germanyeu_vatEuropean VAT Number
      Greeceeu_vatEuropean VAT Number
      Hong Konghk_brHong Kong BR Number
      Hungaryeu_vatEuropean VAT Number
      Hungaryhu_tinHungary Tax Number (adószám)
      Icelandis_vatIcelandic VAT
      Indiain_gstIndian GST Number
      Indonesiaid_npwpIndonesian NPWP Number
      Irelandeu_vatEuropean VAT Number
      Israelil_vatIsrael VAT
      Italyeu_vatEuropean VAT Number
      Japanjp_cnJapanese Corporate Number (Hōjin Bangō)
      Japanjp_rnJapanese Registered Foreign Businesses' Registration Number (Tōroku Kokugai Jigyōsha no Tōroku Bangō)
      Japanjp_trnJapanese Tax Registration Number (Tōroku Bangō)
      Kazakhstankz_binKazakhstani Business Identification Number
      Kenyake_pinKenya Revenue Authority Personal Identification Number
      Latviaeu_vatEuropean VAT Number
      Liechtensteinli_uidLiechtensteinian UID Number
      Lithuaniaeu_vatEuropean VAT Number
      Luxembourgeu_vatEuropean VAT Number
      Malaysiamy_frpMalaysian FRP Number
      Malaysiamy_itnMalaysian ITN
      Malaysiamy_sstMalaysian SST Number
      Maltaeu_vat European VAT Number
      Mexicomx_rfcMexican RFC Number
      Netherlandseu_vatEuropean VAT Number
      New Zealandnz_gstNew Zealand GST Number
      Nigeriang_tinNigerian Tax Identification Number
      Norwayno_vatNorwegian VAT Number
      Norwayno_voecNorwegian VAT on e-commerce Number
      Omanom_vatOmani VAT Number
      Perupe_rucPeruvian RUC Number
      Philippinesph_tin Philippines Tax Identification Number
      Polandeu_vatEuropean VAT Number
      Portugaleu_vatEuropean VAT Number
      Romaniaeu_vatEuropean VAT Number
      Romaniaro_tinRomanian Tax ID Number
      Russiaru_innRussian INN
      Russiaru_kppRussian KPP
      Saudi Arabiasa_vatSaudi Arabia VAT
      Serbiars_pibSerbian PIB Number
      Singaporesg_gstSingaporean GST
      Singaporesg_uenSingaporean UEN
      Slovakiaeu_vatEuropean VAT Number
      Sloveniaeu_vatEuropean VAT Number
      Sloveniasi_tinSlovenia Tax Number (davčna številka)
      South Africaza_vatSouth African VAT Number
      South Koreakr_brnKorean BRN
      Spaines_cifSpanish NIF Number (previously Spanish CIF Number)
      Spaineu_vatEuropean VAT Number
      Swedeneu_vatEuropean VAT Number
      Switzerlandch_vatSwitzerland VAT Number
      Taiwantw_vatTaiwanese VAT
      Thailandth_vatThai VAT
      Turkeytr_tinTurkish Tax Identification Number
      Ukraineua_vatUkrainian VAT
      United Arab Emiratesae_trnUnited Arab Emirates TRN
      United Kingdomeu_vatNorthern Ireland VAT Number
      United Kingdomgb_vatUnited Kingdom VAT Number
      United Statesus_einUnited States EIN
      Uruguayuy_rucUruguayan RUC Number
      Venezuelave_rifVenezuelan RIF Number
      Vietnamvn_tinVietnamese Tax ID Number
      country string required

      Possible values: [AD, AE, AR, AT, AU, BE, BG, BH, BO, BR, CA, CH, CL, CN, CO, CR, CY, CZ, DE, DK, EE, DO, EC, EG, ES, EU, FI, FR, GB, GE, GR, HK, HR, HU, ID, IE, IL, IN, IS, IT, JP, KE, KR, KZ, LI, LT, LU, LV, MT, MX, MY, NG, NL, NO, NZ, OM, PE, PH, PL, PT, RO, RS, RU, SA, SE, SG, SI, SK, SV, TH, TR, TW, UA, US, UY, VE, VN, ZA]

      type string required

      Possible values: [ad_nrt, ae_trn, ar_cuit, eu_vat, au_abn, au_arn, bg_uic, bh_vat, bo_tin, br_cnpj, br_cpf, ca_bn, ca_gst_hst, ca_pst_bc, ca_pst_mb, ca_pst_sk, ca_qst, ch_vat, cl_tin, cn_tin, co_nit, cr_tin, do_rcn, ec_ruc, eg_tin, es_cif, eu_oss_vat, gb_vat, ge_vat, hk_br, hu_tin, id_npwp, il_vat, in_gst, is_vat, jp_cn, jp_rn, jp_trn, ke_pin, kr_brn, kz_bin, li_uid, mx_rfc, my_frp, my_itn, my_sst, ng_tin, no_vat, no_voec, nz_gst, om_vat, pe_ruc, ph_tin, ro_tin, rs_pib, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, si_tin, sv_nit, th_vat, tr_tin, tw_vat, ua_vat, us_ein, uy_ruc, ve_rif, vn_tin, za_vat]

      value string required
      memo string nullable required

      Free-form text which is available on the invoice PDF and the Orb invoice portal.

      credit_notes object[] required

      A list of credit notes associated with the invoice

    • Array [
    • id string required
      credit_note_number string required
      reason string required
      total string required
      voided_at date-time nullable required

      If the credit note has a status of void, this gives a timestamp when the credit note was voided.

      type string required
      memo string nullable required

      An optional memo supplied on the credit note.

    • ]
    • payment_attempts object[] required

      A list of payment attempts associated with the invoice

    • Array [
    • id string required

      The ID of the payment attempt.

      payment_provider string nullable required

      Possible values: [stripe]

      The payment provider that attempted to collect the payment.

      payment_provider_id string nullable required

      The ID of the payment attempt in the payment provider.

      amount string required

      The amount of the payment attempt.

      succeeded boolean required

      Whether the payment attempt succeeded.

      created_at date-time required

      The time at which the payment attempt was created.

    • ]
    • invoice_date date-time required

      The scheduled date of the invoice

    Loading...