#jose-fernndez_docs

1 messages · Page 1 of 1 (latest)

manic mesaBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1264919978214293625

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

snow spruce
#

hi there!

#

what do you mean by "dynamic pricing"?

#

du you mean not use a price_xxx object when creating the Checkout Session?

warm mica
#

That is, the price can be created when the checkout session is created.

snow spruce
#

yep, then use price_data as explained just above

warm mica
#

ok, a moment

warm mica
#

I get the following error:

Received unknown parameter: line_items[0][interval]

code:

{
mode: "subscription",
customer: customerId,
line_items: [
// {
// price: priceId,
// quantity: 1,
// },
{
price_data: {
currency: currency,
unit_amount: amountCommissionInCents,
product: ${contentId},
},
quantity: 1,
},
{
interval: "day",
}
],

    /** keys and values required for the movement are sent */
    metadata: {
      contentId,
      movementId
    },
    
    /** URL to redirect in case of successful response */
    success_url: `${SUCCESS_URL}`,
    
    /** URL to redirect in case of canceled or failed response */
    cancel_url: `${CANCEL_URL}`,

    subscription_data: {
      metadata
    },
  }
snow spruce
#

that's normal, that code is wrong.

warm mica
#

wow, ok

snow spruce
#

you forgot the recurring part

warm mica
#

Ok, the error did not refer to it, I'll try it

snow spruce
#

make sure to read carefully the API reference I shared above.

manic mesaBOT
lavish eagle
#

👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

warm mica
#

Can a customer subscribe to different products with prices in different currencies?

lavish eagle
#

i'm not sure it's possible on the same subscription

#

but a customer can have multiple subscriptions that's not a problem

warm mica
lavish eagle
#

would you mind sharing the request ID?

warm mica
#

According to the error, I understand that it is not possible. However, the issue arises when a seller operates in USD and the buyer has subscribed to a first product in COP. If I work with the value in COP, the next invoice should reflect the fluctuating value. Is there any alternative for managing a customer with prices in a different currency?

#

Ok, let me try to recover the request id

lavish eagle
#

I just want to understand what's happening so I could better advise you here

warm mica
#

req_QVwojpbOt4jhqq

warm mica
#

👀

#

I have been working with subscriptions from a checkout session. Is it not possible to manage this from the checkout session?

lavish eagle
#

you can't have 2 active subscriptions with different currencies for the same customer

warm mica
#

ok