#cooad_unexpected

1 messages ยท Page 1 of 1 (latest)

mint lodgeBOT
#

๐Ÿ‘‹ 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/1222842505800716342

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

forest citrusBOT
full warren
#

Hi, let me help you with this.

dapper wedge
#

sure, it's req_A3YJlBDB9zuyRq

full warren
#

What value do you expect it to be set? It's 1 by default.

dapper wedge
#

When I fetch that customer, the value is "0". I tried setting it to both "1" and "2", but I still get "0" when I fetch the customer

#

req_vLHOvXpPh9MI2y - here's when I tried to set it to "2". It was using an older version of the SDK (43.9.0), but I don't think that SDK version matters

full warren
#

Does this Customer have any Invoices already?

#

Hmm, not sure how this works exactly, I don't seem to get this property on the Customer object at all.
Could you please paste here the GET response where you see it being set to 0?

dapper wedge
#

So, as I said I'm using the .NET SDK, so I can't see exactly what I get from the API.
Here's what I get when I invoke customer.ToJson()

{
"id": "cus_MyPIxYKAFHcrBK",
"object": "customer",
"address": {
"city": null,
"country": "AU",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"balance": 0,
"cash_balance": null,
"created": 1670914861,
"currency": "aud",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "invoices@georgiou.com.au",
"invoice_credit_balance": null,
"invoice_prefix": "75AA11F9",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": true,
"metadata": {},
"name": "Georgiou Group",
"next_invoice_sequence": 0,
"phone": null,
"preferred_locales": [],
"shipping": null,
"sources": null,
"subscriptions": null,
"tax": null,
"tax_exempt": "none",
"tax_ids": null,
"test_clock": null
}

#

this is what I get using Stripe CLI

{
"id": "cus_MyPIxYKAFHcrBK",
"object": "customer",
"address": {
"city": null,
"country": "AU",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"balance": 0,
"created": 1670914861,
"currency": "aud",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "invoices@georgiou.com.au",
"invoice_prefix": "75AA11F9",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": true,
"metadata": {},
"name": "Georgiou Group",
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}

the property is not even present here

full warren
#

Sorry for delay.
Still looking into it...

dapper wedge
#

sure

remote gull
#

are you actually assigning the result of UpdateAsync to a variable?

dapper wedge
#

I am, next_sequence_number is still equals 0

remote gull
#

just for context I'm doing this and it seems to work

#

I'll try .NET too

dapper wedge
#

Before update
{
"id": "cus_MyPIxYKAFHcrBK",
"object": "customer",
"address": {
"city": null,
"country": "AU",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"balance": 0,
"cash_balance": null,
"created": 1670914861,
"currency": "aud",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "invoices@georgiou.com.au",
"invoice_credit_balance": null,
"invoice_prefix": "75AA11F9",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": true,
"metadata": {},
"name": "Georgiou Group",
"next_invoice_sequence": 0,
"phone": null,
"preferred_locales": [],
"shipping": null,
"sources": null,
"subscriptions": null,
"tax": null,
"tax_exempt": "none",
"tax_ids": null,
"test_clock": null
}
After update
{
"id": "cus_MyPIxYKAFHcrBK",
"object": "customer",
"address": {
"city": null,
"country": "AU",
"line1": null,
"line2": null,
"postal_code": null,
"state": null
},
"balance": 0,
"cash_balance": null,
"created": 1670914861,
"currency": "aud",
"default_source": null,
"delinquent": false,
"description": null,
"discount": null,
"email": "invoices@georgiou.com.au",
"invoice_credit_balance": null,
"invoice_prefix": "75AA11F9",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": true,
"metadata": {},
"name": "Georgiou Group",
"next_invoice_sequence": 0,
"phone": null,
"preferred_locales": [],
"shipping": null,
"sources": null,
"subscriptions": null,
"tax": null,
"tax_exempt": "none",
"tax_ids": null,
"test_clock": null
}

#

here's a code snippet and what it prints to console

#

and the request id of running that snippet is: req_Z6xAdgsBeYtMPF

remote gull
#

why toJSON, why not access the field?

#

works for me , how about you?

static void InvoicePrefixTest(){
            var service = new CustomerService();
            var customer = service.Create(new CustomerCreateOptions{Email="test@example.com"});
            customer = service.Update(customer.Id, new CustomerUpdateOptions{NextInvoiceSequence=100});
            Console.WriteLine(customer.Id);
            Console.WriteLine(customer.NextInvoiceSequence);
        }
dapper wedge
#

doesn't matter, the value is still 0,

remote gull
#

hmm

dapper wedge
#

When I run this in test mode, I still get "0"

#

may I ask which version od the .NET SDK you used?

remote gull
#

so you have this in your settings

#

I feel like that is related. I think this feature only works when you're using customer-level numbering, but not sure(so don't change it)

dapper wedge
#

my company has 2 stripe accounts. I was pretty sure we have both accounts with exactly the same settings...
the other account has "sequentially for each customer" selected. I'll try that snipped on the other account

remote gull
#

On my account I don't even have this option but I believe it's because my account is from 2018 before https://docs.stripe.com/upgrades#2020-03-02 happened so I only have customer-level numbering, that rollout was super confusing

dapper wedge
#

yeah, it works on the other account. So this must be the issue.
Is it possible to fetch that setting and it's values throught the API?

remote gull
#

but yeah I feel like that's it, NextInvoiceSequence has no meaning when you're using account level numbering since it has be controlled across your entire account so setting it across customers would just break things

#

and no I don't think that's in the API, only the dashboard

dapper wedge
#

ok, thanks. That's all I needed to know ๐Ÿ™‚
You both have been increadibly helpful

remote gull
#

no worries. I guess we implemented it as silently ignoring the updates and returning a default value instead of explicit errors when trying to use this feature on an incompatible account setup

#

probably that was because otherwise your API integration would break and start returning errors if you change the setting on your Dashboard to enable account-level numbering