How to disable shipping details input in the checkout form when using orders API

samebenezer
Contributor
Contributor

I would like to store shipping details on my server and keep the payment process simple by just accepting payment through PayPal...

How can I disable shipping details input in the BASIC INTEGRATION?? 

 

Any help Appreciated🙃....

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

Frigidman
Contributor
Contributor

In the REST API v2 for Orders, you could pass "application_context.shipping_preference = NO_SHIPPING" when you POST to "/v2/checkout/orders".

https://developer.paypal.com/docs/api/orders/v2/#definition-order_application_context

 

In the REST API v1, you would first have to create an Experience Profile, and then pass that profile ID with the create payment on "experience_profile_id" (set after "intent").

https://developer.paypal.com/docs/integration/direct/payment-experience/?mark=experience_profile_id#...

View solution in original post

Login to Me Too
7 REPLIES 7
Solved

Frigidman
Contributor
Contributor

In the REST API v2 for Orders, you could pass "application_context.shipping_preference = NO_SHIPPING" when you POST to "/v2/checkout/orders".

https://developer.paypal.com/docs/api/orders/v2/#definition-order_application_context

 

In the REST API v1, you would first have to create an Experience Profile, and then pass that profile ID with the create payment on "experience_profile_id" (set after "intent").

https://developer.paypal.com/docs/integration/direct/payment-experience/?mark=experience_profile_id#...

Login to Me Too

samebenezer
Contributor
Contributor

Thanks for your answer...🤗

Is there an example code snippet that i can refer to with respect to the above said problem

using the script tag on the client side??

Login to Me Too

Frigidman
Contributor
Contributor

@samebenezer wrote:

Thanks for your answer...🤗

Is there an example code snippet that i can refer to with respect to the above said problem

using the script tag on the client side??


I assume you mean the v2 javascript sdk method like described here: (?)

https://developer.paypal.com/docs/checkout/integrate/#4-set-up-the-transaction

 

If so, it would go outside of the `purchase_units` section like so:

 

return actions.order.create({
    purchase_units: [{
      amount: {
        value: '0.01'
      }
    }],
    application_context: {
      shipping_preference: 'NO_SHIPPING'
    }
  });

 

 

Login to Me Too

samebenezer
Contributor
Contributor

That was really helpful. Thank you🤗💛

Login to Me Too

palictomas
New Community Member

This worked for me. Thanks a lot!!!

Login to Me Too

JackieDaytona
Contributor
Contributor

Gee DID YOU EVER THINK (AND i USE THAT LOOSELY) THAT YOU MIGHT, JUST MIGHT WANT TO PUT THIS IN YOUR DOCUMENTATION.  i SPENT TWO DAYS LOOKING FOR THIS ANSWER.... 

Login to Me Too

JohnAckison35
Contributor
Contributor
I have tried to find it seems that I have found it thanks to your and thanks again for helping hope everybody figures it out
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.