cancel
Showing results for 
Search instead for 
Did you mean: 

Get list of subscriptions based on CustomerProfileId

 

I'm trying to get the list of subscription based on CustomerProfileId.

 

Is there a way to get the list based on customerProfileId?

 

My Case Description:

I've list of plans and customers can subscribe to multiple plans.

 

The way I'm trying to impelment this is my making a customer profile and creating ARB subscription using their customer profile.

 

Now, I need to make sure customer does not subscribe to same plan twice.

 

 

 

 

asimneupane0089
Contributor
1 ACCEPTED SOLUTION

Accepted Solutions

That's a good question, Asim.

You can get the same information by using the following APIs:-

  1. GetCustomerProfile API - Returns the list of subscriptions for this customerProfileId as subscriptionIds field in the response.
  2. GetCustomerPaymentProfile API - Also returns the list of subscriptions for a particular payment profile of a customer. A payment profile include the customer profile id, and one method of payment used by that customer profile.
  3. GetCustomerShippingAddress API - Similar to payment profiles, a shipping addresses includes the customer profile id, and one shipping address used by that customer profile.

    In all the cases above, the name of this field in response is subscriptionIds, as you can see in the Response tab for these APIs

    GetCustomerProfile API response fields

    One sample code you can refer for case 1 is : GetCustomerProfile C# sample code

    Other sample codes:

    Get Customer Payment Profile sample code

    Get Customer Shippping Address sample code

View solution in original post

2 REPLIES 2

I know I can get this list by doing something like this:

 

    var subsrcriptions =  GetListOfSubcriptioins.Run(ApiLoginId, ApiTransactionId);
    var data = (ARBGetSubscriptionListResponse)subsrcriptions;

 

And query data to get a list of subscription for given profile Id.

 

I was wondering if there is a better way to do this.

asimneupane0089
Contributor

That's a good question, Asim.

You can get the same information by using the following APIs:-

  1. GetCustomerProfile API - Returns the list of subscriptions for this customerProfileId as subscriptionIds field in the response.
  2. GetCustomerPaymentProfile API - Also returns the list of subscriptions for a particular payment profile of a customer. A payment profile include the customer profile id, and one method of payment used by that customer profile.
  3. GetCustomerShippingAddress API - Similar to payment profiles, a shipping addresses includes the customer profile id, and one shipping address used by that customer profile.

    In all the cases above, the name of this field in response is subscriptionIds, as you can see in the Response tab for these APIs

    GetCustomerProfile API response fields

    One sample code you can refer for case 1 is : GetCustomerProfile C# sample code

    Other sample codes:

    Get Customer Payment Profile sample code

    Get Customer Shippping Address sample code