#eze-sub-product
1 messages ยท Page 1 of 1 (latest)
๐ do you have any examples I can take a look at?
Also, are you using Stripe Checkout to create subscriptions or are you using the API?
Im using the API.
{
id: 'txn_1LQDWGRRNGyVGJzsWIsqpUhH',
object: 'balance_transaction',
amount: 60000,
available_on: 1659484800,
created: 1658940936,
currency: 'usd',
description: null,
exchange_rate: null,
fee: 0,
fee_details: [],
net: 60000,
reporting_category: 'charge',
source: 'py_1LQDWGRRNGyVGJzsg2x3AB6g',
status: 'pending',
type: 'payment'
}
from this txn, I need to know the product originated this movement
how are you getting to balance transaction?
Can you explain a little bit more about the flow you're integrating?
const balanceTransactions = await stripe.balanceTransactions.list(
{
payout: payoutId
},
{
stripeAccount: accId,
},
);
from the payout.paid hook
ok, and can I will go to the product?
the charge should have a customer if its for a subscription
https://stripe.com/docs/api/charges/object#charge_object-customer
after that, you can list the subscription by the customer
https://stripe.com/docs/api/subscriptions/list
just curious, what's your uscase here?
yes, but I need the subscription id or product asociated. A customer can have a lot subscriptions
in my App the users can create groups and another users can subscribe it.
another option is to look at the invoice on the charge
https://stripe.com/docs/api/charges/object#charge_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I receive the payouts hooks and I need know from what group cames
The invoice will have the subscription ID
https://stripe.com/docs/api/invoices/object#invoice_object-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
NP! ๐ Good luck