Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update paypal billing plan (payment_definitions)

I want to change amount of a Billing Plan but I'm getting an error when trying to do that. It's possible to change the terms of the Plan (payment_definitions) if the Plan has already Agreements associated with it?

Request:

curl -v -k -X PATCH 'https://api.sandbox.paypal.com/v1/payments/billing-plans/[plan id]' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Access-Token>" \
-d '[
    {
        "path": "/payment_definitions/[payment_definitions_id]/amount",
        "value": {
            "currency": "EUR",
            "value" : "10"
        },
        "op": "replace"
    }
]'

Response:

{
   "name":"BUSINESS_VALIDATION_ERROR",
   "details":[
      {
         "field":"validation_error",
         "issue":"Invalid Path provided."
      }
   ],
   "message":"Validation Error.",
   "information_link":"https://developer.paypal.com/webapps/developer/docs/api/#BUSINESS_VALIDATION_ERROR",
   "debug_id":"183e87c07085e"
}
like image 416
Valon Lushaj Avatar asked Oct 30 '22 13:10

Valon Lushaj


1 Answers

I have been through the same situation right now!

So far i researched, it is not possible to alter the amount and amount related constraints for a billing plan, because the service may not be provided by the paypal.

For instance, let's say, there is a plan P1 which is in active state. So, there may be some agreements , lets say A1, which are subscribed to P1.

So, problem is clear, if A1 is subscribed to P1 plan with some amount, lets say USD 200, the subscriber is charged 200 in each payments, but in case, if you alter it to USD 210, You simply cannot charge the subscriber with USD 210. :)

But in your case, i think the path is invalid, and the response clearly indicates the error.

like image 97
Suresh Thapa Magar Avatar answered Nov 15 '22 19:11

Suresh Thapa Magar