REST API - Remove shipping address

FJUK
Contributor
Contributor

Hello

 

I have a working PayPal REST API server side (php) express checkout.

BUT.... We are selling a service, so the shipping address needs to be removed.

 

I cannot find this info anywhere.

 

API token (/v1/oauth2/token)

API authorize (/v1/payments/payment)

User clicks PayPal checkout (express checkout js) <------ shows shipping address here (don't need this)

API execute (/v1/payments/payment/".$payment_ID."/execute)

Payment done

 

I have looked at "no_shipping": "1" but does not seem to work.

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Andre
Moderator
Moderator

Hi, in this case you can try to pass something like this on your experience profile:

 

"input_fields": {
   "no_shipping": 1,
   "address_override": 0
}

View solution in original post

Login to Me Too
4 REPLIES 4
Solved

MTS_Andre
Moderator
Moderator

Hi, in this case you can try to pass something like this on your experience profile:

 

"input_fields": {
   "no_shipping": 1,
   "address_override": 0
}

Login to Me Too

FJUK
Contributor
Contributor

How many days does a "Web Experience Profile" last?
Do I need to call a new one each time, and then delete it. Or can I use the same experience profile ID if I don't need to change the profile?

Login to Me Too

xilinx
Member
Member

It also works by adding only this after Value and currency:

application_context: {
shipping_preference: 'NO_SHIPPING'
}

Login to Me Too

Faantoha
Contributor
Contributor

Thank you, it worked for me very well!

I use Ruby, here is the part of my code for PayPal subscribe button that also includes other useful parts I collected from few places to make business flow work (mix ruby and js):

 

 

 createSubscription: function(data, actions) {
      return actions.subscription.create({
        plan_id: "<%= .paypal_id %>",
        <% if  and  > 0 %>
          start_time: "<%= (@time_to_charge).strftime("%FT%TZ") %>",
        <% end %>
        application_context: {
          brand_name: "My Brand name",
          shipping_preference: 'NO_SHIPPING'
        },
        plan: {
            taxes: {
                percentage: $("#total_costs")[0].dataset.tax,
                inclusive: false
            }
        },
      });
    },

 

 

 

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.