cancel
Showing results for 
Search instead for 
Did you mean: 

REST API - List plans

Contributor

REST API - List plans

Hi,

I'm trying to get my billing plans list using REST API. 

I'm making a GET call to this url: https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=3&status=ACTIVE&page_size=2&page=..., but the response is empty. 

 

What's the problem? If I fill a param with a wrong value (i.e. status=FOO) I get the right json error.

 

Thanks a lot,

Davide

3 REPLIES 3
Highlighted
Moderator

Re: REST API - List plans

Do you mean the response doesnt contain any billing plans or that you don't get any info at all in the response?

 

Is it possible that you are using the wrong client ID, as in you're using a client ID for a sandbox account that doesnt have any billing plans?

 

Can you post the API response you get, including debug ID's?

Contributor

Re: REST API - List plans

Hi, 

thanks for the answer. 

 

The response in empty, an empty string.  If I force an error, for example using "ACTIVEEE" as "status" param, I get the json error I expect:

 

{

  "debug_id" : "e21c448a72218",

  "details" : [

    {

      "field" : "status",

      "issue" : "Invalid status, valid values are CREATED, ACTIVE, INACTIVE"

    }

  ],

  "information_link" : "https://developer.paypal.com/docs/api/payments.billing-plans#errors",

  "message" : "Invalid request. See details.",

  "name" : "VALIDATION_ERROR"

}

 

But if I use the correct value for the params I get an empty string.

 

Thanks,

Davide

 

Contributor

Re: REST API - List plans

Hi,

I found the problem. The sample request posted in the documentation is: 

 

curl -v -X GET https://api.sandbox.paypal.com/v1/payments/billing-plans?page_size=3&status=ALL&page_size=2&page=1&total_required=yes \
-H "Content-Type: application/json" \
-H "Authorization: Bearer Access-Token"

This call has 3 problem:

 

1. There are 2 "page_size" params 

2. The status "ALL" is not a valid value for the param

3. Pagination starts from page 0, not page 1. If I use "page=1" I get an empty string as response. If I use "page=0"  I get the correct json with billing plans list. 

 

Good afternoon,

Davide