Giter Site home page Giter Site logo

Comments (2)

jofftiquez avatar jofftiquez commented on June 12, 2024

Hello, unfortunately, what you pass in the lineItems array is beyond my control. This error seems to be an API error, meaning the the lineItems.0.invoice_item is no longer available in the latest API. It must be because the docs for vue stripe vue 2 is outdated. But you can try to pass the latest object format from the docs to the lineItems array. Let me know if it works

from vue-stripe.

Benoit1980 avatar Benoit1980 commented on June 12, 2024

Thank you for the fast reply.

I was checking the latest API:
https://docs.stripe.com/api/invoices/line_item

Based on the doc, this should have worked:

 lineItems: [
                {
                    price: "price_xxxxxxxxxxxx",
                    quantity: 1,
                    invoice_item: "ii_1Nzo1ZGgdF1VjufLzD1UUn9R",
                },
            ],

This is the object of the latest API:

{
  "id": "il_tmp_1Nzo1ZGgdF1VjufLzD1UUn9R",
  "object": "line_item",
  "amount": 1000,
  "amount_excluding_tax": 1000,
  "currency": "usd",
  "description": "My First Invoice Item (created for API docs)",
  "discount_amounts": [],
  "discountable": true,
  "discounts": [],
  "invoice_item": "ii_1Nzo1ZGgdF1VjufLzD1UUn9R",  <----------Here
  "livemode": false,
  "metadata": {},
  "period": {
    "end": 1696975413,
    "start": 1696975413
  },
  "price": {
    "id": "price_1NzlYfGgdF1VjufL0cVjLJVI",
    "object": "price",
    "active": true,
    "billing_scheme": "per_unit",
    "created": 1696965933,
    "currency": "usd",
    "custom_unit_amount": null,
    "livemode": false,
    "lookup_key": null,
    "metadata": {},
    "nickname": null,
    "product": "prod_OnMHDH6VBmYlTr",
    "recurring": null,
    "tax_behavior": "unspecified",
    "tiers_mode": null,
    "transform_quantity": null,
    "type": "one_time",
    "unit_amount": 1000,
    "unit_amount_decimal": "1000"
  },
  "proration": false,
  "proration_details": {
    "credited_items": null
  },
  "quantity": 1,
  "subscription": null,
  "tax_amounts": [],
  "tax_rates": [],
  "type": "invoiceitem",
  "unit_amount_excluding_tax": "1000"
}

I also tried to pass metadata to it but it fails too(with the same error as to "lineItems.0.metadata"):

  metadata: {
    product_id: "6735"
  },

Thanks

Ben

from vue-stripe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.