Skip to content

Cannot set price unit_amount to 0 #42

@adamstegman

Description

@adamstegman

When I try to create a price with a unit_amount of 0, or unit_amount_decimal of 0.0, I get the following error:

Error: {"status":400,"message":"If the billing scheme is set to per_unit, the amount parameter must be set.","param":"amount","request_id":"req_abcdefghijklmn","type":"invalid_request_error"}

When I look at Stripe logs, the field is left out of the request entirely:

{
  "active": "true",
  "billing_scheme": "per_unit",
  "currency": "usd",
  "product": "prod_abcdefghijklmn",
  "recurring": {
    "interval": "year",
    "interval_count": "1",
    "usage_type": "licensed"
  }
}

This is incorrect - an amount of 0 is valid and I can use the API directly to create the price.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions