Search code examples
djangoapipaypalpayment-gatewaypaypal-sandbox

INVALID_PATCH_PATH error while using patch/updating the interval unit in PayPal plan update API


I used the details in body as

[
  {
    "op": "replace",
    "path": "/billing_cycles/frequency/interval_unit",
    "value": "MONTH"
  }
]

I get the output as follows

{
    "name": "INVALID_REQUEST",
    "message": "Request is not well-formed, syntactically incorrect, or violates schema.",
    "debug_id": "7e77554e0bd6d",
    "details": [
        {
            "field": "/0/path",
            "value": "/billing_cycles/frequency/interval_unit",
            "location": "body",
            "issue": "INVALID_PATCH_PATH",
            "description": "The specified field cannot be patched."
        }
    ],
    "links": [
        {
            "href": "https://developer.paypal.com/docs/api/v1/billing/subscriptions#INVALID_REQUEST",
            "rel": "information_link",
            "method": "GET"
        }
    ]
}

what is the correct body data to pass to update the interval_unit of the PayPal plan data.


Solution

  •        "issue": "INVALID_PATCH_PATH",
           "description": "The specified field cannot be patched."
    

    The error message is correct, that field cannot be patched.

    See the update API call's documentation for fields that can patched.

    If you need a plan with different billing cycles, create a new plan.