#danilabagroff

1 messages · Page 1 of 1 (latest)

shadow sphinxBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

feral vessel
#

Hello happy to help. Can you summarize where the last thread left off and what you have found since?

cosmic palm
#

Hi! I'm back with minimal example, please take a look:

#

`shop = "Stripe.Com"
guid = uuid.uuid1()
customer_id = "cus_PMYSZs7BbA42QW"
subscription_price_list = [
{
'price': "price_1NkL2KEPcSoIRKCHOZPUYFk9",
'quantity': 1
}
]

subscription = stripe.Subscription.create(
api_key = secret_key,
idempotency_key = "aerarium.stripe.Subscription.create({arg1},{arg2},{arg3})".format(arg1 = shop, arg2 = guid, arg3 = False),
metadata = {
'crn': "urn:cadabra:cloud :aerarium:subscription:{arg1}:{arg2}:{arg3}".format(arg1 = shop, arg2 = guid, arg3 = "no_tax")
},
automatic_tax = { 'enabled': False },
customer = customer_id,
items = subscription_price_list,
payment_behavior = 'default_incomplete',
expand = ['latest_invoice.payment_intent']
)`

#

please, pay attention on this: metadata = { 'crn': "urn:cadabra:cloud :aerarium:subscription:{arg1}:{arg2}:{arg3}".format(arg1 = shop, arg2 = guid, arg3 = "no_tax") }

#

Eventually, I have this metadata in the line which have no sense, what if we have several lines? all of them will have same metadata? what for?

#

In my opinion it should be used just in root metadata of subscription and invoice

#

recap

#
  1. subscription metadata is used in all lines - just confused
#
  1. unfortunately metadata is not used in the root metadata of an invoice - will be great if same metadata used twice and not just in the root of a subscription
feral vessel
#

Thanks for the info, I am still a bit unclear on the underlying issue. It looks like that metadata key and value are being properly set on the subscription for the code that you have. Are you looking to brea that up in to multiple metadata entries?

#

I will check if there is a way to set metadata on the invoices through the subscription but there may not be a parameter specifically for it

#

I think we have properties that show the metadata on the subscription at the time of the invoice creation, but I don't think we have a way to set that as the invoice's metadata automatically

cosmic palm
cosmic palm
#

Sorry for bothering you with this boring stuff, but we use a lot metadata as a glue between Stripe and our internal ERP system

feral vessel
#

As a general rule, metadata isn't automatically copied between our API objects, even related ones. For some common use cases like this one we built out functionality to share them in certain ways, but even then we keep the metadata from that separated from the actual object's metadata

cosmic palm
#

😦 sad