javascriptstripe-paymentspayment-gateway

Stripe client-reference-id does not persist on Stripe Panel when using pricing table


I'm sending stripe pricing plan as follows:

<!DOCTYPE html>
<html lang="en" >
  <head>
    <meta charset="UTF-8">
    <title>Stripe test</title>

  </head>
  <body>
    <h1>We offer plans that help any business!</h1>



<script async src="https://js.stripe.com/v3/pricing-table.js"></script>
<stripe-pricing-table pricing-table-id="prctbl_1Lzz3iIG2cLiTx0jaBzzuu2n"
publishable-key="pk_test_51LzyrVIG2cLiTx0jTtSPJW5Iakij92jHOLV3yoFEXd0HkoFimTDJHGxk1CaF6rkqrFLjQqCqlAq3qFHrdVHqnZYQ00f4U3vt1U"
client-reference-id="cus_Mjrmqd6bfD8gA9">
</stripe-pricing-table>

</body>
</html>

We can see that client-reference-id is actually cus_Mjrmqd6bfD8gA9; but on the stripe panel it shows up as something entirely different as in the image below which is cus_Mjs18ntyjh4qKA:

enter image description here

This is a weird behavior and I followed everything that the documentation said. Have I missed something in the documentation?


Solution

  • The pricing table will always create a brand new customer object. So the dashboard screenshot you shared shows the new customer ID created.

    If you want to find the client-reference-id you passed, it will be in the Checkout Session object, as mentioned here.

    When the property is set, the pricing table passes it to the Checkout Session’s client_reference_id attribute to help you reconcile the Checkout Session with your internal system.