Plans

Use the /billing/plans resource to create and manage plans.

List plans

get
/v1/billing/plans

Lists billing plans.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Query parameters
product_idstring · min: 6 · max: 50Optional

Filters the response by a Product ID.

plan_idsstring · min: 3 · max: 270Optional

Filters the response by list of plan IDs. Filter supports upto 10 plan IDs.

page_sizeinteger · min: 1 · max: 20Optional

The number of items to return in the response.

Default: 10
pageinteger · min: 1 · max: 100000Optional

A non-zero integer which is the start index of the entire list of items to return in the response. The combination of page=1 and page_size=20 returns the first 20 items. The combination of page=2 and page_size=20 returns the next 20 items.

Default: 1
total_requiredbooleanOptional

Indicates whether to show the total count in the response.

Default: false
Header parameters
PreferstringOptional

The preferred server response upon successful completion of the request. Value is:return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.return=representation. The server returns a complete resource representation, including the current state of the resource.

Default: return=minimal
Responses
get
/v1/billing/plans

Create plan

post
/v1/billing/plans

Creates a plan that defines pricing and billing cycle details for subscriptions.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Header parameters
PreferstringOptional

The preferred server response upon successful completion of the request. Value is:return=minimal. The server returns a minimal response to optimize communication between the API caller and the server. A minimal response includes the id, status and HATEOAS links.return=representation. The server returns a complete resource representation, including the current state of the resource.

Default: return=minimal
PayPal-Request-IdstringOptional

The server stores keys for 72 hours.

Body

The create plan request details.

product_idstring · min: 6 · max: 50Required

The ID of the product created through Catalog Products API.

namestring · min: 1 · max: 127Required

The plan name.

statusstring · enum · min: 1 · max: 24Optional

The initial state of the plan. Allowed input values are CREATED and ACTIVE.

Default: ACTIVEPattern: ^[A-Z_]+$Possible values:
descriptionstring · min: 1 · max: 127Optional

The detailed description of the plan.

quantity_supportedbooleanOptional

Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.

Default: false
Responses
chevron-right
201

A successful request returns the HTTP 201 Created status code and a JSON response body that shows billing plan details.

application/json
post
/v1/billing/plans

Show plan details

get
/v1/billing/plans/{id}

Shows details for a plan, by ID.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
idstringRequired

The ID of the subscription.

Responses
get
/v1/billing/plans/{id}

Update plan

patch
/v1/billing/plans/{id}

Updates a plan with the CREATED or ACTIVE status. For an INACTIVE plan, you can make only status updates. You can patch these attributes and objects:

Attribute or object
Operations

description

replace

payment_preferences.auto_bill_outstanding

replace

taxes.percentage

replace

payment_preferences.payment_failure_threshold

replace

payment_preferences.setup_fee

replace

payment_preferences.setup_fee_failure_action

replace

name

replace

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
idstringRequired

The ID of the subscription.

Bodyobject · Patch[]

An array of JSON patch objects to apply partial updates to resources.

opstring · enumRequired

The operation.

Possible values:
pathstringOptional

The JSON Pointer to the target document location at which to complete the operation.

valueanyOptional

The value to apply. The remove operation does not require a value.

fromstringOptional

The JSON Pointer to the target document location from which to move the value. Required for the move operation.

Responses
patch
/v1/billing/plans/{id}

No content

Activate plan

post
/v1/billing/plans/{id}/activate

Activates a plan, by ID.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
idstringRequired

The ID of the subscription.

Responses
post
/v1/billing/plans/{id}/activate

No content

Deactivate plan

post
/v1/billing/plans/{id}/deactivate

Deactivates a plan, by ID.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
idstringRequired

The ID of the subscription.

Responses
post
/v1/billing/plans/{id}/deactivate

No content

Update pricing

post
/v1/billing/plans/{id}/update-pricing-schemes

Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month.

chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : Manage plan & subscription
Authorizations
OAuth2clientCredentialsRequired

Oauth 2.0 authentication

Token URL:
Path parameters
idstringRequired

The ID of the subscription.

Body

The update pricing scheme request details.

Responses
post
/v1/billing/plans/{id}/update-pricing-schemes

No content

Last updated

Was this helpful?