#akii-list-subscriptions

1 messages ยท Page 1 of 1 (latest)

strong marsh
#

Hi there ๐Ÿ‘‹ do you have a request ID from a request where you saw this behavior?

proven summit
#

okay sending

#

req_ivOBgFaxiuPY0a

strong marsh
#

Thanks, taking a closer look.

#

That looks like a request for creating a subscription rather than one to retrieve subscriptions.

proven summit
#

req_gtLIIGoxs6uqWQ

#

can u check this?

strong marsh
#

That looks like a request to update a customer object. Do you have the ID of the customer that you're trying to retrieve the subscriptions for?

proven summit
#

wait sending..

#

cus_LlA8IQftivHg6y

strong marsh
#

Alright, I am seeing one subscription for that customer, so I'd expect the list results to not be null. Have you tried retrieving the current list of subscriptions for this customer by using their ID as a filter for this method?
https://stripe.com/docs/api/subscriptions/list?lang=java#list_subscriptions-customer

proven summit
#

okay this is a different way to do this, i try this one

#

Will you wait and not close this thread???

proven summit
#

It worked !! I did this

#

Also, im doing this

#

Map<String, Object> params = new HashMap<>();
params.put("customer", customerId);

    SubscriptionCollection subscriptions =
        Subscription.list(params);
#

Is there any params class i can send instead of making a Map??

exotic reef
#

Nice!

#

What language is this?

proven summit
#

Java

exotic reef
#

I believe there is another way to set these params in Java, checking in to that...

proven summit
#

Like it has SubscriptionCreateParams for creating subscription

#

Okay thanks

exotic reef
#
          .builder()
          .setCustomer(customerId)
          .addItem(
            SubscriptionCreateParams
              .Item.builder()
              .setPrice(priceId)
              .build()
          )
          .setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.DEFAULT_INCOMPLETE)
          .addAllExpand(Arrays.asList("latest_invoice.payment_intent"))
          .build();```
proven summit
#

Okay

#

I think i found this

#

SubscriptionListParams

#

This will work i think..

exotic reef
#

Whoops got mixed up on what call you were using. Yes, that will work for that call

#

Good find!

proven summit
#

Yes that worked

#

Thanks for all the help