stripe-cli icon indicating copy to clipboard operation
stripe-cli copied to clipboard

`stripe trigger` returns "You cannot use (…) in this API version"

Open typeofweb opened this issue 3 years ago • 0 comments

Issue

When running stripe trigger "checkout.session.completed" or stripe trigger "checkout.session.async_payment_succeeded" I get the following error:

Setting up fixture for: checkout_session
Running fixture for: checkout_session
Trigger failed: Request failed, status=400, body={
  "error": {
    "message": "You cannot use `line_items.amount`, `line_items.currency`, `line_items.name`, `line_items.description`, or `line_items.images` in this API version. Please use `line_items.price` or `line_items.price_data`. Please see https://stripe.com/docs/payments/checkout/migrating-prices for more information.",
    "type": "invalid_request_error"
  }
}

Expected Behavior

The error should not occur 🙃

Steps to reproduce

My stripe client is initialized as follows:

const stripeClient = new Stripe(secretKey, { apiVersion: "2022-08-01" });

Env

stripe version 1.11.0

typeofweb avatar Aug 16 '22 09:08 typeofweb