Creating a subscription via the JS SDK, and sending customer-specific information to PayPal

itzadok
Contributor
Contributor

Where in the SDK documentation can I find information about sending application_context data when subscriptions are created? I want to be able to identify the person that signed up for the subscription, so I can update his/her record in my database.

 

Thanks

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

eLiosh
Contributor
Contributor

I use this code with JS SDK:

 

            let create_obj = {
              'plan_id': selector.dataset.plan_id,
              'custom_id': selector.dataset.user_id,
              'application_context':{
                'brand_name': 'MY_BRAND',
                'shipping_preference': 'NO_SHIPPING',
              }
            };
            return actions.subscription.create(create_obj);

where create_obj.custom_id is the user_id

 

 

View solution in original post

Login to Me Too
1 REPLY 1
Solved

eLiosh
Contributor
Contributor

I use this code with JS SDK:

 

            let create_obj = {
              'plan_id': selector.dataset.plan_id,
              'custom_id': selector.dataset.user_id,
              'application_context':{
                'brand_name': 'MY_BRAND',
                'shipping_preference': 'NO_SHIPPING',
              }
            };
            return actions.subscription.create(create_obj);

where create_obj.custom_id is the user_id

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.