Not sure if what I am trying is possible or not, so asking here.
I have a monthly recurring service that will be launched within 1 - 2 months. I would like users to register for the service and connect their PayPal account, so we know they are serious about getting the service once launched.
I am trying to use the REST API to create a billing agreement and, once we launch the service, add the subscription to the billing agreement. So far I managed to create a billing agreement and charge $0.01 one time when created.
What I can't seem to do is to add a subscription plan later to this agreement, or manually collect payments.
When trying to add a subscription, I call
PATCH /v1/payments/billing-agreements/I-HD5N7C15L8E0
with this payload:
{
"path": "/",
"value": {
"plan": {
"id": "P-70R54842DB762764NJEVCS7Y"
},
},
"op": "replace"
}
and receive
Incoming JSON request does not map to API request","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST
When trying to collect the amount, I call
POST /v1/payments/billing-agreements/I-HD5N7C15L8E0/set-balance
with this payload
{
"value": "50",
"currency": "USD"
}
and receive
Outstanding balance must be > 0","information_link":"https://developer.paypal.com/webapps/developer/docs/api/#RP_INVALID_OUTSTANDING_BALANCE
At this point, I am about to give up using the REST API and use instead Express Checkout and Reference Transactions, which I understand is an alternative method to collect these payments.
Do you know if what I am trying to achieve works with the REST API?
Thanks