#vanith-api-versions
1 messages · Page 1 of 1 (latest)
hi
when try to fetch customer source, subscription object not showing in the response
When you retrieve the Customer you have to expand subscriptions to see all their subscriptions
source?
{
"id": "cus_PDFDK1wjjJVGqO",
"object": "customer",
"address": null,
"balance": 0,
"created": 1702936296,
"currency": null,
"default_source": null,
"delinquent": false,
"description": "Customer for test data43",
"discount": null,
"email": "testdat43@gmail.com",
"invoice_prefix": "BC1C219A",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null,
"rendering_options": null
},
"livemode": false,
"metadata": { "platform_customer": "cus_PDFDJOvFhy4dCs" },
"name": "test data43",
"next_invoice_sequence": 1,
"phone": null,
"preferred_locales": [],
"shipping": null,
"tax_exempt": "none",
"test_clock": null
}
sample
response
source & subscription key is not thr
That customer doesn't have a subscription at all so I'm not sure why you're expecting one
If you want to see their sources you have to expand it
Notie how it says "expandable" -> https://stripe.com/docs/api/customers/object#customer_object-sources
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
if i set api verison
stripe::setApiVersion('2019-03-14');
response getting source,subscription
if i try to change stripe::setApiVersion( '2023-10-16' ); that time source,subscription not showing
Yeah, that's expected when changing API versions - we make a lot of breaking changes in each version so the set of params you get back will change with each version