Skip to content

invoice.upcoming failed: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string. #616

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

Open
joelc0193 opened this issue Mar 17, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@joelc0193
Copy link

Bug report

firestore-stripe-payments

Describe the bug

This was the error:

Stripe event of type [invoice.upcoming] failed: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string."

This is the request:

{
  "id": ["evt_1OuHWvGLpWnCiB3YultsM9NG"](https://dashboard.stripe.com/events/evt_1OuHWvGLpWnCiB3YultsM9NG),
  "object": "event",
  "api_version": "2022-11-15",
  "created": 1710435201,
  "data": {
    "object": {
      "object": "invoice",
      "account_country": "US",
      "account_name": "Poster Fans LLC",
      "account_tax_ids": null,
      "amount_due": 1000,
      "amount_paid": 0,
      "amount_remaining": 1000,
      "amount_shipping": 0,
      "application": null,
      "application_fee_amount": null,
      "attempt_count": 0,
      "attempted": false,
      "automatic_tax": {
        "enabled": false,
        "liability": null,
        "status": null
      },
      "billing_reason": "upcoming",
      "charge": null,
      "collection_method": "charge_automatically",
      "created": 1711039978,
      "currency": "usd",
      "custom_fields": null,
      "customer": ["cus_PPWc0hdWkEmlzD"](https://dashboard.stripe.com/customers/cus_PPWc0hdWkEmlzD),
      "customer_address": null,
      "customer_email": "[email protected]",
      "customer_name": null,
      "customer_phone": null,
      "customer_shipping": null,
      "customer_tax_exempt": "none",
      "customer_tax_ids": [
      ],
      "default_payment_method": null,
      "default_source": null,
      "default_tax_rates": [
      ],
      "description": null,
      "discount": null,
      "discounts": [
      ],
      "due_date": null,
      "effective_at": null,
      "ending_balance": 0,
      "footer": null,
      "from_invoice": null,
      "issuer": {
        "type": "self"
      },
      "last_finalization_error": null,
      "latest_revision": null,
      "lines": {
        "object": "list",
        "data": [
          {
            "id": ["il_tmp_125151GLpWnCiB3Y1403fe62"](https://dashboard.stripe.com/subscriptions/il_tmp_125151GLpWnCiB3Y1403fe62),
            "object": "line_item",
            "amount": 1000,
            "amount_excluding_tax": 1000,
            "currency": "usd",
            "description": "1 × Dealer Membership (at $10.00 / month)",
            "discount_amounts": [
            ],
            "discountable": true,
            "discounts": [
            ],
            "invoice": null,
            "livemode": true,
            "metadata": {
            },
            "period": {
              "end": 1713718378,
              "start": 1711039978
            },
            "plan": {
              "id": ["price_1OFdYZGLpWnCiB3YAWTsq1R6"](https://dashboard.stripe.com/prices/price_1OFdYZGLpWnCiB3YAWTsq1R6),
              "object": "plan",
              "active": true,
              "aggregate_usage": null,
              "amount": 1000,
              "amount_decimal": "1000",
              "billing_scheme": "per_unit",
              "created": 1700748423,
              "currency": "usd",
              "interval": "month",
              "interval_count": 1,
              "livemode": true,
              "metadata": {
              },
              "nickname": null,
              "product": ["prod_P3l46ip1uGjUaM"](https://dashboard.stripe.com/products/prod_P3l46ip1uGjUaM),
              "tiers_mode": null,
              "transform_usage": null,
              "trial_period_days": null,
              "usage_type": "licensed"
            },
            "price": {
              "id": ["price_1OFdYZGLpWnCiB3YAWTsq1R6"](https://dashboard.stripe.com/prices/price_1OFdYZGLpWnCiB3YAWTsq1R6),
              "object": "price",
              "active": true,
              "billing_scheme": "per_unit",
              "created": 1700748423,
              "currency": "usd",
              "custom_unit_amount": null,
              "livemode": true,
              "lookup_key": null,
              "metadata": {
              },
              "nickname": null,
              "product": ["prod_P3l46ip1uGjUaM"](https://dashboard.stripe.com/products/prod_P3l46ip1uGjUaM),
              "recurring": {
                "aggregate_usage": null,
                "interval": "month",
                "interval_count": 1,
                "trial_period_days": null,
                "usage_type": "licensed"
              },
              "tax_behavior": "unspecified",
              "tiers_mode": null,
              "transform_quantity": null,
              "type": "recurring",
              "unit_amount": 1000,
              "unit_amount_decimal": "1000"
            },
            "proration": false,
            "proration_details": {
              "credited_items": null
            },
            "quantity": 1,
            "subscription": ["sub_1Ob4GUGLpWnCiB3YyYFwnBqd"](https://dashboard.stripe.com/subscriptions/sub_1Ob4GUGLpWnCiB3YyYFwnBqd),
            "subscription_item": "si_PPu4h18lzBJHnq",
            "tax_amounts": [
            ],
            "tax_rates": [
            ],
            "type": "subscription",
            "unit_amount_excluding_tax": "1000"
          }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/invoices/upcoming/lines?customer=cus_PPWc0hdWkEmlzD&subscription=sub_1Ob4GUGLpWnCiB3YyYFwnBqd"
      },
      "livemode": true,
      "metadata": {
      },
      "next_payment_attempt": 1711043578,
      "number": null,
      "on_behalf_of": null,
      "paid": false,
      "paid_out_of_band": false,
      "payment_intent": null,
      "payment_settings": {
        "default_mandate": null,
        "payment_method_options": null,
        "payment_method_types": null
      },
      "period_end": 1711039978,
      "period_start": 1708534378,
      "post_payment_credit_notes_amount": 0,
      "pre_payment_credit_notes_amount": 0,
      "quote": null,
      "receipt_number": null,
      "rendering": null,
      "rendering_options": null,
      "shipping_cost": null,
      "shipping_details": null,
      "starting_balance": 0,
      "statement_descriptor": null,
      "status": "draft",
      "status_transitions": {
        "finalized_at": null,
        "marked_uncollectible_at": null,
        "paid_at": null,
        "voided_at": null
      },
      "subscription": ["sub_1Ob4GUGLpWnCiB3YyYFwnBqd"](https://dashboard.stripe.com/subscriptions/sub_1Ob4GUGLpWnCiB3YyYFwnBqd),
      "subscription_details": {
        "metadata": {
        }
      },
      "subtotal": 1000,
      "subtotal_excluding_tax": 1000,
      "tax": null,
      "test_clock": null,
      "total": 1000,
      "total_discount_amounts": [
      ],
      "total_excluding_tax": 1000,
      "total_tax_amounts": [
      ],
      "transfer_data": null,
      "webhooks_delivered_at": null
    }
  },
  "livemode": true,
  "pending_webhooks": 1,
  "request": {
    "id": null,
    "idempotency_key": null
  },
  "type": "invoice.upcoming"
}

## To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

1. Go to '…'
2. Click on '…'
3. Scroll down to '…'
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## System information

- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. Chrome, Safari]

## Additional context

Add any other context about the problem here.

@aar-stripe
Copy link

The problem is basically related to the fact that upcoming invoices don't have an id nor a payment intent which either is used as the record ID (code). This is the same behavior as the retrieve an upcoming invoice functionality.

@jsteele-stripe
Copy link
Contributor

cc @dackers86

@hasan-abul
Copy link

hasan-abul commented Mar 26, 2024

@aar-stripe By default stripe don't have an id or payment intent for invoice.upcoming event.

Do we have a solution here? Thanks

@aar-stripe
Copy link

unfortunately until the maintainers fix the issue you can't really do much.

@SohelIslamImran
Copy link

Same issue

@maztak
Copy link

maztak commented Apr 26, 2025

Same here. Is there any updates?

@maztak
Copy link

maztak commented Apr 27, 2025

I didn't install Send Invoices using Stripe extension.
https://extensions.dev/extensions/invertase/firestore-stripe-invoices

@celso0
Copy link

celso0 commented May 16, 2025

I have the same issue with [invoice.paid] events. The Google Cloud logs for the extension show this:

{
"textPayload": "❗️[Error]: Webhook handler for Stripe event [evt_1RPVrhFfOYKHacY1o2nSubao] of type [invoice.paid] failed: Value for argument "documentPath" is not a valid resource path. Path must be a non-empty string.",
"insertId": "6827aeeb000eb5e71a817e23",
"resource": {
"type": "cloud_function",
"labels": {
"region": "us-central1",
"function_name": "ext-firestore-stripe-payments-handleWebhookEvents",
"project_id": "xxx-xxxx"
}
},
"timestamp": "2025-05-16T21:32:27.964071Z",
"severity": "ERROR",
"labels": {
"instance_id": "007f65c6d2364355dd3e92ac0b4d6ab7dbc02f0bf23d5a544c218f8d4ef9e08145d820bf03028f84536369ea4477898279c7ffee3f73ba05c257254b9613f8659bd2d4e9e16df20da3545b74d87229",
"execution_id": "5o0ou5ktj00p",
"runtime_version": "nodejs20_20250503_20_19_1_RC00"
},
"logName": "projects/xxx-xxxx/logs/cloudfunctions.googleapis.com%2Fcloud-functions",
"trace": "projects/xxx-xxxx/traces/d4bd5337c0c1dffec7e8e8b66dfab989",
"receiveTimestamp": "2025-05-16T21:32:28.014006117Z"
}

@github-project-automation github-project-automation bot moved this to Needs Acknowledgment in [Cloud] Open Source P0 May 22, 2025
@cabljac cabljac moved this from Needs Acknowledgment to Ready for Development in [Cloud] Open Source P0 May 22, 2025
@cabljac cabljac added the bug Something isn't working label May 22, 2025
@cabljac cabljac self-assigned this May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Ready for Development
Development

No branches or pull requests

8 participants