Subscription with different quantity

bao4
Contributor
Contributor

Hi,

 

I'm running an SaaS. I would like to implement a billing plan that charges per user. For example

- A monthly plan cost $1. A company subscribes for 10 users, we would like to charge $10/month. Other company subscribes for 20 users, we would like to charge $20/month

 

Does Paypal support that kind of recurring subscription? If yes, does it also support Pro-rate. For example, a company subscribes for 10 users. In the middle of the month, they 5 more employee and increase quantity to 15. For the next billing, we would charge $15 for the next month plus $0.5*5=$2.5 for 5 users in the last month.

 

Thank you,

Bao

Login to Me Too
1 REPLY 1

daryna_b
Contributor
Contributor

It's possible to do it. Check out this https://developer.paypal.com/docs/api/subscriptions/v1/#subscriptions_revise

curl -v -X POST https://api.sandbox.paypal.com/v1/billing/subscriptions/I-BW452GLLEP1G/revise \ -H "Content-Type: application/json" \ -H "Authorization: Bearer Access-Token" \ -d '

{

"plan_id": "P-5ML4271244454362WXNWU5NQ",

"quantity": "15"

}

As a response you have something like:

{
    "plan_id""P-5ML4271244454362WXNWU5NQ",
    "links": [
        {
            "rel""approve",
            "method""GET"
        },
        {
            "rel""edit",
            "method""PATCH"
        },
        {
            "rel""self",
            "method""GET"
        }
    ]
}

 

You need to use the first link in the list (from here

{
            "rel""approve",
            "method""GET"
        }
)
and make an approvement.

 

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.