skip to Main Content

As an EU based seller I need to charge tax based on customer country tax rates and rules. That means that when I create subscription I need to specify either tax rate (percentage or amount) or have the ability to override subscription price. When using Stripe one just needs to specify tax_percent beside plan_id when creating subscription.

So far I wasn’t able to do the same using PayPal Subscriptions API and their smart buttons. Tax rate can be set when creating plan but I need to be able to set tax percentage per subscription.

Sample smart button JS code:

paypal.Buttons({
  createSubscription: function(data, actions) {
    return actions.subscription.create({
      'plan_id': 'P-2UF78835G6983425GLSM44MA',
      // I'd like to be able to set tax rate here somehow
    });
  }
}).render('#paypal-button-container');

No luck setting up tax directly using Subscriptions API either:

curl -v -k -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions 
   -H "Accept: application/json" 
   -H "Authorization: Bearer Access-Token" 
   -H "Content-Type: application/json" 
   -d '{
      "plan_id": "P-2UF78835G6983425GLSM44MA",
      "application_context": {
        "brand_name": "example",
        "user_action": "SUBSCRIBE_NOW",
        "payment_method": {
          "payer_selected": "PAYPAL",
          "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
        },
        "return_url": "https://example.com/returnUrl",
        "cancel_url": "https://example.com/cancelUrl"
      }
    }'

Am I missing something, thinking about this incorrectly or did PayPal “forgot” to implement basic thing like tax rate and therefore make their new subscriptions API unusable for VAT MOSS scenarios?

4

Answers


  1. Chosen as BEST ANSWER

    Recently I found out that this is possible. Not sure if this is something added fairly recently or was this option there all along.

    While creating a subscription you can override a plan and set the tax percentage inline.

    curl -v -k -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions 
       -H "Accept: application/json" 
       -H "Authorization: Bearer Access-Token" 
       -H "Content-Type: application/json" 
       -d '{
            "plan_id": "#PLANID",
            ...
            "plan": {
                "taxes": {
                    "percentage": "19",
                    "inclusive": false
                }
            }
        }'
    

  2. It’s an old topic and still not possible. PayPal doesn’t support taxes with subscriptions. You can price your subscription so it has the VAT included in it. Mention that the price includes VAT before a user is redirected to payment.

    I highly recommend not to implement the tax rules yourself. Better let a 3rd party API handle correct calculations.

    Login or Signup to reply.
  3. Taxes seem to be included in the Plan entity.

    https://developer.paypal.com/docs/subscriptions/full-integration/plan-management/#show-plan-details

    curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA 
      -H "Content-Type: application/json" 
      -H "Authorization: Bearer <Access-Token>
    
    {
          "id": "P-2UF78835G6983425GLSM44MA",
          "product_id": "PROD-6XB24663H4094933M",
          "name": "Basic Plan",
          "status": "ACTIVE",
          "description": "Basic plan",
          "billing_cycles": [
            {
              "frequency": {
                "interval_unit": "MONTH",
                "interval_count": 1
              },
              "tenure_type": "TRIAL",
              "sequence": 1,
              "total_cycles": 1
            },
            {
              "pricing_scheme": {
                "fixed_price": {
                  "currency_code": "USD",
                  "value": "10.0"
                }
              },
              "frequency": {
                "interval_unit": "MONTH",
                "interval_count": 1
              },
              "tenure_type": "REGULAR",
              "sequence": 2,
              "total_cycles": 12
            }
          ],
          "payment_preferences": {
            "auto_bill_outstanding": true,
            "setup_fee": {
              "currency_code": "USD",
              "value": "10.0"
            },
            "setup_fee_failure_action": "CONTINUE",
            "payment_failure_threshold": 3
          },
    ----------------------------------------
          "taxes": {
            "percentage": "10.0",
            "inclusive": false
          },
    ----------------------------------------
          "quantity_supported": false,
          "create_time": "2020-02-26T07:01:04Z",
          "update_time": "2020-02-26T07:01:04Z",
          "links": [
            {
              "href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA",
              "rel": "self",
              "method": "GET"
            },
            {
              "href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA",
              "rel": "edit",
              "method": "PATCH"
            },
            {
              "href": "https://api-m.sandbox.paypal.com/v1/billing/plans/P-2UF78835G6983425GLSM44MA/deactivate",
              "rel": "self",
              "method": "POST"
          }
        ]
      }
    
    Login or Signup to reply.
  4. You can add the tax override to the plan node as shown below

        <script>
    
          paypal.Buttons({
            createSubscription: function(data, actions) {
              return actions.subscription.create({
                'plan_id': 'YOUR_PLAN_ID_HERE', // Creates the subscription
                
                'plan': {
                   'taxes': {
                       'percentage': '2.9',
                       'inclusive': false
                   }}
    
    
              });
            },
            onApprove: function(data, actions) {
              alert('You have successfully created subscription ' + data.subscriptionID); // Optional message given to subscriber
            }
          }).render('#paypal-button-container'); // Renders the PayPal button
        </script>
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search