Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme intro - error with prices create commant #534

Open
SuperRoach opened this issue May 27, 2023 · 1 comment
Open

Readme intro - error with prices create commant #534

SuperRoach opened this issue May 27, 2023 · 1 comment

Comments

@SuperRoach
Copy link

Bug report

Describe the bug

The stock command in the readme.md gives an error:
Missing required param: Currency

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:
Follow the readme.md , Using Node although it would be the same for others.

When you are up to this part:

./stripe prices create
  -d "product=ID_OF_BASIC_PRODUCT"
  -d "unit_amount=1800"
  -d "currency=usd"
  -d "recurring[interval]=month"

After substituting in your ID, you'll get this error:

  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: currency.",
    "param": "currency",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_DizJci51DGcUB5?t=1685198228",
    "type": "invalid_request_error"
  }
}

Expected behavior

That the price is created, without you having to go in the GUI and do it.

@hideokamoto-stripe
Copy link
Contributor

I could reproduce this error by this command on the readme.md on https://github.com/stripe-samples/checkout-single-subscription/tree/main?tab=readme-ov-file#how-to-run-locally .

$ stripe prices create
  -d "product=ID_OF_BASIC_PRODUCT"
  -d "unit_amount=1800"
  -d "currency=usd"
  -d "recurring[interval]=month"

Error message;

{
  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: currency.",
    "param": "currency",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_TNSUukHrIH9fVP?t=1708499436",
    "type": "invalid_request_error"
  }
}

It appears that the issue is due to the command not containing a newline key (\).

$ stripe prices create \
  -d "product=ID_OF_BASIC_PRODUCT" \
  -d "unit_amount=1800" \
  -d "currency=usd" \
  -d "recurring[interval]=month"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@SuperRoach @hideokamoto-stripe and others