openapi: 3.0.3
info:
title: Paypal Subscriptions Authorizations Plans API
description: You can use billing plans and subscriptions to create subscriptions that process recurring PayPal payments for physical or digital goods, or services. A plan includes pricing and billing cycle information that defines the amount and frequency of charge for a subscription. You can also define a fixed plan, such as a $5 basic plan or a volume- or graduated-based plan with pricing tiers based on the quantity purchased. For more information, see Subscriptions Overview.
version: '1.6'
contact: {}
servers:
- url: https://api-m.sandbox.paypal.com
description: PayPal Sandbox Environment
- url: https://api-m.paypal.com
description: PayPal Live Environment
tags:
- name: Plans
paths:
/v1/billing/plans:
post:
summary: Create plan
description: Creates a plan that defines pricing and billing cycle details for subscriptions.
operationId: plans.create
responses:
'200':
description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows billing plan details.
content:
application/json:
schema:
$ref: '#/components/schemas/plan'
examples:
plan:
value:
id: P-5ML4271244454362WXNWU5NQ
product_id: PROD-XXCD1234QWER65782
name: Video Streaming Service Plan
description: Video Streaming Service basic plan
status: ACTIVE
billing_cycles:
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: TRIAL
sequence: 1
total_cycles: 2
pricing_scheme:
fixed_price:
value: '3'
currency_code: USD
version: 1
create_time: '2020-05-27T12:13:51Z'
update_time: '2020-05-27T12:13:51Z'
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: TRIAL
sequence: 2
total_cycles: 3
pricing_scheme:
fixed_price:
currency_code: USD
value: '6'
version: 1
create_time: '2020-05-27T12:13:51Z'
update_time: '2020-05-27T12:13:51Z'
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: REGULAR
sequence: 3
total_cycles: 12
pricing_scheme:
fixed_price:
currency_code: USD
value: '10'
version: 1
create_time: '2020-05-27T12:13:51Z'
update_time: '2020-05-27T12:13:51Z'
payment_preferences:
auto_bill_outstanding: true
setup_fee:
value: '10'
currency_code: USD
setup_fee_failure_action: CONTINUE
payment_failure_threshold: 3
taxes:
percentage: '10'
inclusive: false
create_time: '2020-05-27T12:13:51Z'
update_time: '2020-05-27T12:13:51Z'
links:
- href: https://api-m.paypal.com/v1/billing/plans/P-5ML4271244454362WXNWU5NQ
rel: self
method: GET
- href: https://api-m.paypal.com/v1/billing/plans/P-5ML4271244454362WXNWU5NQ
rel: edit
method: PATCH
- href: https://api-m.paypal.com/v1/billing/plans/P-5ML4271244454362WXNWU5NQ/deactivate
rel: deactivate
method: POST
- href: https://api-m.paypal.com/v1/billing/plans/P-5ML4271244454362WXNWU5NQ/update-pricing-schemes
rel: edit
method: POST
'201':
description: A successful request returns the HTTP `201 Created` status code and a JSON response body that shows billing plan details.
content:
application/json:
schema:
$ref: '#/components/schemas/plan'
'400':
description: Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_400'
- $ref: '#/components/schemas/plans.create-400'
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'422':
description: The requested action could not be performed, semantically incorrect, or failed business validation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/422'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/prefer'
- $ref: '#/components/parameters/paypal_request_id'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/plan_request_POST'
examples:
plan_request_post:
value:
product_id: PROD-XXCD1234QWER65782
name: Video Streaming Service Plan
description: Video Streaming Service basic plan
status: ACTIVE
billing_cycles:
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: TRIAL
sequence: 1
total_cycles: 2
pricing_scheme:
fixed_price:
value: '3'
currency_code: USD
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: TRIAL
sequence: 2
total_cycles: 3
pricing_scheme:
fixed_price:
value: '6'
currency_code: USD
- frequency:
interval_unit: MONTH
interval_count: 1
tenure_type: REGULAR
sequence: 3
total_cycles: 12
pricing_scheme:
fixed_price:
value: '10'
currency_code: USD
payment_preferences:
auto_bill_outstanding: true
setup_fee:
value: '10'
currency_code: USD
setup_fee_failure_action: CONTINUE
payment_failure_threshold: 3
taxes:
percentage: '10'
inclusive: false
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
get:
summary: List plans
description: Lists billing plans.
operationId: plans.list
responses:
'200':
description: A successful request returns the HTTP `200 OK` status code and a JSON response body that lists billing plans.
content:
application/json:
schema:
$ref: '#/components/schemas/plan_collection'
'400':
description: Request is not well-formed, syntactically incorrect, or violates schema.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_400'
- $ref: '#/components/schemas/400'
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/error_404'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/prefer'
- $ref: '#/components/parameters/product_id'
- $ref: '#/components/parameters/plan_ids'
- $ref: '#/components/parameters/page_size'
- $ref: '#/components/parameters/page'
- $ref: '#/components/parameters/total_required'
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
/v1/billing/plans/{id}:
get:
summary: Show plan details
description: Shows details for a plan, by ID.
operationId: plans.get
responses:
'200':
description: A successful request returns the HTTP `200 OK` status code and a JSON response body that shows plan details.
content:
application/json:
schema:
$ref: '#/components/schemas/plan'
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/404'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/id'
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
patch:
summary: Update plan
description: 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 |
operationId: plans.patch
responses:
'204':
description: A successful request returns the HTTP `204 No Content` status code with no JSON response body.
'400':
description: Request is not well-formed, syntactically incorrect, or violates schema.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_400'
- $ref: '#/components/schemas/plans.patch-400'
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/404'
'422':
description: The requested action could not be performed, semantically incorrect, or failed business validation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/plans.patch-422'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/id'
requestBody:
$ref: '#/components/requestBodies/patch_request'
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
/v1/billing/plans/{id}/activate:
post:
summary: Activate plan
description: Activates a plan, by ID.
operationId: plans.activate
responses:
'204':
description: A successful request returns the HTTP `204 No Content` status code with no JSON response body.
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/404'
'422':
description: The requested action could not be performed, semantically incorrect, or failed business validation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/plans.activate-422'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/id'
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
/v1/billing/plans/{id}/deactivate:
post:
summary: Deactivate plan
description: Deactivates a plan, by ID.
operationId: plans.deactivate
responses:
'204':
description: A successful request returns the HTTP `204 No Content` status code with no JSON response body.
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/404'
'422':
description: The requested action could not be performed, semantically incorrect, or failed business validation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/plans.deactivate-422'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/id'
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
/v1/billing/plans/{id}/update-pricing-schemes:
post:
summary: Update pricing
description: Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month.
operationId: plans.update-pricing-schemes
responses:
'204':
description: A successful request returns the HTTP `204 No Content` status code with no JSON response body.
'400':
description: Bad Request. Request is not well-formed, syntactically incorrect, or violates schema.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_400'
- $ref: '#/components/schemas/plans.update-pricing-schemes-400'
'401':
description: Authentication failed due to missing authorization header, or invalid authentication credentials.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/401'
'403':
description: Authorization failed due to insufficient permissions.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/403'
'404':
description: The specified resource does not exist.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/404'
'422':
description: The requested action could not be performed, semantically incorrect, or failed business validation.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/plans.update-pricing-schemes-422'
'500':
description: An internal server error has occurred.
content:
application/json:
schema:
$ref: '#/components/schemas/error_500'
default:
$ref: '#/components/responses/default'
parameters:
- $ref: '#/components/parameters/id'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/update_pricing_schemes_list_request'
examples:
update_pricing_schemes_list_request:
value:
pricing_schemes:
- billing_cycle_sequence: 1
pricing_scheme:
fixed_price:
value: '50'
currency_code: USD
- billing_cycle_sequence: 2
pricing_scheme:
fixed_price:
value: '100'
currency_code: USD
pricing_model: VOLUME
tiers:
- starting_quantity: '1'
ending_quantity: '1000'
amount:
value: '150'
currency_code: USD
- starting_quantity: '1001'
amount:
value: '250'
currency_code: USD
security:
- Oauth2:
- https://uri.paypal.com/services/subscriptions
tags:
- Plans
components:
schemas:
plan_request_POST:
title: Create Plan Request
description: The create plan request details.
type: object
properties:
product_id:
type: string
description: The ID of the product created through Catalog Products API.
minLength: 6
maxLength: 50
name:
type: string
description: The plan name.
minLength: 1
maxLength: 127
status:
type: string
description: The initial state of the plan. Allowed input values are CREATED and ACTIVE.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
default: ACTIVE
enum:
- CREATED
- INACTIVE
- ACTIVE
description:
type: string
description: The detailed description of the plan.
minLength: 1
maxLength: 127
billing_cycles:
type: array
description: An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.
minItems: 1
maxItems: 12
items:
$ref: '#/components/schemas/billing_cycle'
payment_preferences:
$ref: '#/components/schemas/payment_preferences'
taxes:
$ref: '#/components/schemas/taxes'
quantity_supported:
type: boolean
description: Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.
default: false
required:
- name
- billing_cycles
- payment_preferences
- product_id
plans.create-400:
properties:
details:
type: array
items:
anyOf:
- title: INVALID_PARAMETER_SYNTAX
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_SYNTAX
description:
type: string
enum:
- The value of a field does not conform to the expected format.
- title: INVALID_PARAMETER_VALUE
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_VALUE
description:
type: string
enum:
- The value of a field is invalid.
- title: MISSING_REQUIRED_PARAMETER
properties:
issue:
type: string
enum:
- MISSING_REQUIRED_PARAMETER
description:
type: string
enum:
- A required field is missing.
- title: INVALID_STRING_MIN_LENGTH
properties:
issue:
type: string
enum:
- INVALID_STRING_MIN_LENGTH
description:
type: string
enum:
- The value of a field is too short.
- title: INVALID_STRING_MAX_LENGTH
properties:
issue:
type: string
enum:
- INVALID_STRING_MAX_LENGTH
description:
type: string
enum:
- The value of a field is too long.
- title: INVALID_INTEGER_MIN_VALUE
properties:
issue:
type: string
enum:
- INVALID_INTEGER_MIN_VALUE
description:
type: string
enum:
- The integer value of a field is too small.
- title: INVALID_INTEGER_MAX_VALUE
properties:
issue:
type: string
enum:
- INVALID_INTEGER_MAX_VALUE
description:
type: string
enum:
- The integer value of a field is too large.
error_404:
type: object
title: Not found Error
description: The server has not found anything matching the request URI. This either means that the URI is incorrect or the resource is not available.
properties:
name:
type: string
enum:
- RESOURCE_NOT_FOUND
message:
type: string
enum:
- The specified resource does not exist.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
billing_cycle:
title: Billing Cycle
description: The billing cycle details.
type: object
properties:
pricing_scheme:
description: The active pricing scheme for this billing cycle. A free trial billing cycle does not require a pricing scheme.
$ref: '#/components/schemas/pricing_scheme'
frequency:
description: The frequency details for this billing cycle.
$ref: '#/components/schemas/frequency'
tenure_type:
type: string
description: The tenure type of the billing cycle. In case of a plan having trial cycle, only 2 trial cycles are allowed per plan.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
enum:
- REGULAR
- TRIAL
sequence:
type: integer
description: The order in which this cycle is to run among other billing cycles. For example, a trial billing cycle has a `sequence` of `1` while a regular billing cycle has a `sequence` of `2`, so that trial cycle runs before the regular cycle.
minimum: 1
maximum: 99
total_cycles:
type: integer
description: The number of times this billing cycle gets executed. Trial billing cycles can only be executed a finite number of times (value between 1 and 999 for total_cycles). Regular billing cycles can be executed infinite times (value of 0 for total_cycles) or a finite number of times (value between 1 and 999 for total_cycles).
minimum: 0
maximum: 999
default: 1
required:
- frequency
- tenure_type
- sequence
error_409:
type: object
title: Resource Conflict Error
description: The server has detected a conflict while processing this request.
properties:
name:
type: string
enum:
- RESOURCE_CONFLICT
message:
type: string
enum:
- The server has detected a conflict while processing this request.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
'403':
properties:
details:
type: array
items:
anyOf:
- title: PERMISSION_DENIED
properties:
issue:
type: string
enum:
- PERMISSION_DENIED
description:
type: string
enum:
- You do not have permission to access or perform operations on this resource.
payment_preferences:
title: Payment Preferences
description: The payment preferences for a subscription.
type: object
properties:
auto_bill_outstanding:
type: boolean
description: Indicates whether to automatically bill the outstanding amount in the next billing cycle.
default: true
setup_fee:
description: The initial set-up fee for the service.
$ref: '#/components/schemas/money'
setup_fee_failure_action:
type: string
description: The action to take on the subscription if the initial payment for the setup fails.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
default: CANCEL
enum:
- CONTINUE
- CANCEL
payment_failure_threshold:
type: integer
description: The maximum number of payment failures before a subscription is suspended. For example, if `payment_failure_threshold` is `2`, the subscription automatically updates to the `SUSPEND` state if two consecutive payments fail.
minimum: 0
maximum: 999
default: 0
link_description:
type: object
title: Link Description
description: The request-related [HATEOAS link](/docs/api/reference/api-responses/#hateoas-links) information.
required:
- href
- rel
properties:
href:
type: string
description: The complete target URL. To make the related call, combine the method with this [URI Template-formatted](https://tools.ietf.org/html/rfc6570) link. For pre-processing, include the `$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.
rel:
type: string
description: The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml).
method:
type: string
description: The HTTP method required to make the related call.
enum:
- GET
- POST
- PUT
- DELETE
- HEAD
- CONNECT
- OPTIONS
- PATCH
plans.patch-422:
properties:
details:
type: array
items:
anyOf:
- title: USER_ACCOUNT_CLOSED
properties:
issue:
type: string
enum:
- USER_ACCOUNT_CLOSED
description:
type: string
enum:
- User account locked or closed.
- title: PLAN_STATUS_INACTIVE
properties:
issue:
type: string
enum:
- PLAN_STATUS_INACTIVE
description:
type: string
enum:
- Status update is the only patchable filed on an inactive plan.
patch:
type: object
title: Patch
description: The JSON patch object to apply partial updates to resources.
properties:
op:
type: string
description: The operation.
enum:
- add
- remove
- replace
- move
- copy
- test
path:
type: string
description: The JSON Pointer to the target document location at which to complete the operation.
value:
title: Patch Value
description: The value to apply. The remove operation does not require a value.
from:
type: string
description: The JSON Pointer to the target document location from which to move the value. Required for the move operation.
required:
- op
error_403:
type: object
title: Not Authorized Error
description: 'The client is not authorized to access this resource, although it may have valid credentials. '
properties:
name:
type: string
enum:
- NOT_AUTHORIZED
message:
type: string
enum:
- Authorization failed due to insufficient permissions.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
error_422:
type: object
title: Unprocessable Entity Error
description: The requested action cannot be performed and may require interaction with APIs or processes outside of the current request. This is distinct from a 500 response in that there are no systemic problems limiting the API from performing the request.
properties:
name:
type: string
enum:
- UNPROCESSABLE_ENTITY
message:
type: string
enum:
- The requested action could not be performed, semantically incorrect, or failed business validation.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
plans.update-pricing-schemes-400:
properties:
details:
type: array
items:
anyOf:
- title: INVALID_PARAMETER_VALUE
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_VALUE
description:
type: string
enum:
- The value of a field is invalid.
- title: MISSING_REQUIRED_PARAMETER
properties:
issue:
type: string
enum:
- MISSING_REQUIRED_PARAMETER
description:
type: string
enum:
- A required field is missing.
update_pricing_scheme_request:
title: Update Pricing Scheme
description: The update pricing scheme request details.
type: object
properties:
billing_cycle_sequence:
type: integer
description: The billing cycle sequence.
minimum: 1
maximum: 99
pricing_scheme:
$ref: '#/components/schemas/pricing_scheme'
required:
- billing_cycle_sequence
- pricing_scheme
error_details:
title: Error Details
type: object
description: The error details. Required for client-side `4XX` errors.
properties:
field:
type: string
description: The field that caused the error. If this field is in the body, set this value to the field's JSON pointer value. Required for client-side errors.
value:
type: string
description: The value of the field that caused the error.
location:
$ref: '#/components/schemas/error_location'
issue:
type: string
description: The unique, fine-grained application-level error code.
description:
type: string
description: The human-readable description for an issue. The description can change over the lifetime of an API, so clients must not depend on this value.
required:
- issue
error_link_description:
title: Link Description
description: The request-related [HATEOAS link](/api/rest/responses/#hateoas-links) information.
type: object
required:
- href
- rel
properties:
href:
description: The complete target URL. To make the related call, combine the method with this [URI Template-formatted](https://tools.ietf.org/html/rfc6570) link. For pre-processing, include the `$`, `(`, and `)` characters. The `href` is the key HATEOAS component that links a completed call with a subsequent call.
type: string
minLength: 0
maxLength: 20000
pattern: ^.*$
rel:
description: The [link relation type](https://tools.ietf.org/html/rfc5988#section-4), which serves as an ID for a link that unambiguously describes the semantics of the link. See [Link Relations](https://www.iana.org/assignments/link-relations/link-relations.xhtml).
type: string
minLength: 0
maxLength: 100
pattern: ^.*$
method:
description: The HTTP method required to make the related call.
type: string
minLength: 3
maxLength: 6
pattern: ^[A-Z]*$
enum:
- GET
- POST
- PUT
- DELETE
- PATCH
plans.deactivate-422:
properties:
details:
type: array
items:
anyOf:
- title: USER_ACCOUNT_CLOSED
properties:
issue:
type: string
enum:
- USER_ACCOUNT_CLOSED
description:
type: string
enum:
- User account locked or closed.
- title: PLAN_STATUS_INVALID
properties:
issue:
type: string
enum:
- PLAN_STATUS_INVALID
description:
type: string
enum:
- Invalid plan status for deactivate action; plan status should be active.
plan:
title: Plan
description: The plan details.
type: object
properties:
id:
type: string
description: The unique PayPal-generated ID for the plan.
minLength: 3
maxLength: 50
readOnly: true
product_id:
type: string
description: The ID for the product.
minLength: 6
maxLength: 50
name:
type: string
description: The plan name.
minLength: 1
maxLength: 127
status:
type: string
description: The plan status.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
enum:
- CREATED
- INACTIVE
- ACTIVE
description:
type: string
description: The detailed description of the plan.
minLength: 1
maxLength: 127
billing_cycles:
type: array
description: An array of billing cycles for trial billing and regular billing. A plan can have at most two trial cycles and only one regular cycle.
minItems: 1
maxItems: 12
items:
$ref: '#/components/schemas/billing_cycle'
payment_preferences:
$ref: '#/components/schemas/payment_preferences'
taxes:
$ref: '#/components/schemas/taxes'
quantity_supported:
type: boolean
description: Indicates whether you can subscribe to this plan by providing a quantity for the goods or service.
default: false
create_time:
description: The date and time when the plan was created, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
readOnly: true
$ref: '#/components/schemas/date_time'
update_time:
description: The date and time when the plan was last updated, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
readOnly: true
$ref: '#/components/schemas/date_time'
links:
type: array
description: An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
readOnly: true
minItems: 1
maxItems: 10
items:
$ref: '#/components/schemas/link_description'
readOnly: true
error_default:
description: The default error response.
oneOf:
- $ref: '#/components/schemas/error_400'
- $ref: '#/components/schemas/error_401'
- $ref: '#/components/schemas/error_403'
- $ref: '#/components/schemas/error_404'
- $ref: '#/components/schemas/error_409'
- $ref: '#/components/schemas/error_415'
- $ref: '#/components/schemas/error_422'
- $ref: '#/components/schemas/error_500'
- $ref: '#/components/schemas/error_503'
'400':
properties:
details:
type: array
items:
anyOf:
- title: INVALID_PARAMETER_VALUE
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_VALUE
description:
type: string
enum:
- The value of a field is invalid.
error_location:
type: string
description: The location of the field that caused the error. Value is `body`, `path`, or `query`.
enum:
- body
- path
- query
default: body
plan_collection:
title: Plan Collection
description: The list of plans with details.
type: object
properties:
plans:
type: array
minItems: 0
maxItems: 32767
description: An array of plans.
items:
$ref: '#/components/schemas/plan'
total_items:
type: integer
description: The total number of items.
minimum: 0
maximum: 500000000
total_pages:
type: integer
description: The total number of pages.
minimum: 0
maximum: 100000000
links:
type: array
description: An array of request-related [HATEOAS links](/docs/api/reference/api-responses/#hateoas-links).
readOnly: true
minItems: 1
maxItems: 10
items:
readOnly: true
$ref: '#/components/schemas/link_description'
patch_request:
type: array
title: Patch Request
description: An array of JSON patch objects to apply partial updates to resources.
items:
$ref: '#/components/schemas/patch'
money:
type: object
title: Money
description: The currency and amount for a financial transaction, such as a balance or payment due.
properties:
currency_code:
$ref: '#/components/schemas/currency_code'
value:
type: string
description: The value, which might be:- An integer for currencies like `JPY` that are not typically fractional.
- A decimal fraction for currencies like `TND` that are subdivided into thousandths.
For the required number of decimal places for a currency code, see [Currency Codes](/docs/integration/direct/rest/currency-codes/).
maxLength: 32
pattern: ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
required:
- currency_code
- value
pricing_tier:
title: Pricing Tier
description: The pricing tier details.
type: object
properties:
starting_quantity:
type: string
description: The starting quantity for the tier.
pattern: ^([0-9]+|([0-9]+)?[.][0-9]+)$
minLength: 1
maxLength: 32
ending_quantity:
type: string
description: The ending quantity for the tier. Optional for the last tier.
pattern: ^([0-9]+|([0-9]+)?[.][0-9]+)$
minLength: 1
maxLength: 32
amount:
description: The pricing amount for the tier.
$ref: '#/components/schemas/money'
required:
- starting_quantity
- amount
'401':
properties:
details:
type: array
items:
anyOf:
- title: INVALID_ACCOUNT_STATUS
properties:
issue:
type: string
enum:
- INVALID_ACCOUNT_STATUS
description:
type: string
enum:
- Account validations failed for the user.
'422':
properties:
details:
type: array
items:
anyOf:
- title: USER_ACCOUNT_CLOSED
properties:
issue:
type: string
enum:
- USER_ACCOUNT_CLOSED
description:
type: string
enum:
- User account locked or closed.
- title: CURRENCY_MISMATCH
properties:
issue:
type: string
enum:
- CURRENCY_MISMATCH
description:
type: string
enum:
- All currency codes in the request should be of similar value.
- title: MULTIPLE_FREE_TRIAL_BILLING_CYCLES_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MULTIPLE_FREE_TRIAL_BILLING_CYCLES_NOT_SUPPORTED
description:
type: string
enum:
- Only one free trial billing cycle is allowed.
- title: MORE_THAN_TWO_TRIAL_BILLING_CYCLE_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MORE_THAN_TWO_TRIAL_BILLING_CYCLE_NOT_SUPPORTED
description:
type: string
enum:
- Only two trial billing cycles are allowed.
- title: MISSING_REGULAR_BILLING_CYCLE
properties:
issue:
type: string
enum:
- MISSING_REGULAR_BILLING_CYCLE
description:
type: string
enum:
- Plan should have at least one regular billing cycle.
- title: MULTIPLE_REGULAR_BILLING_CYCLES_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MULTIPLE_REGULAR_BILLING_CYCLES_NOT_SUPPORTED
description:
type: string
enum:
- Only one regular billing cycle is allowed.
- title: INVALID_BILLING_CYCLE_SEQUENCE
properties:
issue:
type: string
enum:
- INVALID_BILLING_CYCLE_SEQUENCE
description:
type: string
enum:
- Billing cycle sequence should start with `1` and be consecutive.
- title: INVALID_BILLING_CYCLE_SEQUENCE
properties:
issue:
type: string
enum:
- INVALID_BILLING_CYCLE_SEQUENCE
description:
type: string
enum:
- Trial Billing cycle should precede regular billing cycle.
- title: INVALID_TRIAL_BILLING_TOTAL_CYCLES
properties:
issue:
type: string
enum:
- INVALID_TRIAL_BILLING_TOTAL_CYCLES
description:
type: string
enum:
- Total cycles for trial billing must be greater than '0'.
- title: INVALID_PRICING_TIER_AMOUNT
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_AMOUNT
description:
type: string
enum:
- Free tiers are not supported.
- title: MISSING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- MISSING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- Tier(s) are missing for some quantities.
- title: OVERLAPPING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- OVERLAPPING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- The specified quantity overlaps with multiple pricing tiers.
- title: INVALID_PRICING_MODEL
properties:
issue:
type: string
enum:
- INVALID_PRICING_MODEL
description:
type: string
enum:
- The specified pricing model is not supported for trial billing cycle.
- title: FIXED_PRICE_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- FIXED_PRICE_NOT_SUPPORTED
description:
type: string
enum:
- Fixed price is not supported for tiered pricing schemes.
- title: INVALID_PRICING_TIER_QUANTITY
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_QUANTITY
description:
type: string
enum:
- Tier starting quantity must be less than ending quantity.
- title: INVALID_QUANTITY_SUPPORTED
properties:
issue:
type: string
enum:
- INVALID_QUANTITY_SUPPORTED
description:
type: string
enum:
- Quantity is always supported for volume and tiered plans.
- title: CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
properties:
issue:
type: string
enum:
- CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
description:
type: string
enum:
- This currency cannot be accepted for this recipients account.
- title: INVALID_METADATA_CUSTOM_NOTE
properties:
issue:
type: string
enum:
- INVALID_METADATA_CUSTOM_NOTE
description:
type: string
enum:
- Merchant custom note cannot exceed 255 characters.
- title: INVALID_METADATA_INVOICE_ID
properties:
issue:
type: string
enum:
- INVALID_METADATA_INVOICE_ID
description:
type: string
enum:
- Invoice id cannot exceed 127 characters.
plans.update-pricing-schemes-422:
properties:
details:
type: array
items:
anyOf:
- title: CURRENCY_MISMATCH
properties:
issue:
type: string
enum:
- CURRENCY_MISMATCH
description:
type: string
enum:
- The currency code is different from the plan's currency code.
- title: INVALID_BILLING_CYCLE_SEQUENCE
properties:
issue:
type: string
enum:
- INVALID_BILLING_CYCLE_SEQUENCE
description:
type: string
enum:
- The provided billing cycle sequence is not available.
- title: INVALID_PRICING_SCHEME
properties:
issue:
type: string
enum:
- INVALID_PRICING_SCHEME
description:
type: string
enum:
- The new pricing scheme should be of the same type as that of the old one.
- title: INVALID_PRICING_TIER_AMOUNT
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_AMOUNT
description:
type: string
enum:
- Free tiers are not supported.
- title: MISSING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- MISSING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- Tier(s) are missing for some quantities.
- title: OVERLAPPING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- OVERLAPPING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- The specified quantity overlaps with multiple pricing tiers.
- title: INVALID_PRICING_MODEL
properties:
issue:
type: string
enum:
- INVALID_PRICING_MODEL
description:
type: string
enum:
- The specified pricing model is not supported for trial billing cycle.
- title: FIXED_PRICE_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- FIXED_PRICE_NOT_SUPPORTED
description:
type: string
enum:
- Fixed price is not supported for tiered pricing schemes.
- title: INVALID_PRICING_TIER_QUANTITY
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_QUANTITY
description:
type: string
enum:
- Tier starting quantity must be less than ending quantity.
- title: PRICING_SCHEME_UPDATE_NOT_ALLOWED
properties:
issue:
type: string
enum:
- PRICING_SCHEME_UPDATE_NOT_ALLOWED
description:
type: string
enum:
- Pricing scheme update is not allowed for the plan.
taxes:
title: Taxes
description: The tax details.
type: object
properties:
percentage:
description: The tax percentage on the billing amount.
$ref: '#/components/schemas/percentage'
inclusive:
type: boolean
description: Indicates whether the tax was already included in the billing amount.
default: true
required:
- percentage
error_503:
type: object
title: Service Unavailable Error
description: The server is temporarily unable to handle the request, for example, because of planned maintenance or downtime.
properties:
name:
type: string
enum:
- SERVICE_UNAVAILABLE
message:
type: string
enum:
- Service Unavailable.
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
example:
name: SERVICE_UNAVAILABLE
message: Service Unavailable.
debug_id: 90957fca61718
information_link: https://developer.paypal.com/docs/api/orders/v2/#error-SERVICE_UNAVAILABLE
error_400:
type: object
title: Bad Request Error
description: Request is not well-formed, syntactically incorrect, or violates schema.
properties:
name:
type: string
enum:
- INVALID_REQUEST
message:
type: string
enum:
- Request is not well-formed, syntactically incorrect, or violates schema.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
pricing_scheme:
title: Pricing Scheme
description: The pricing scheme details.
type: object
properties:
version:
type: integer
description: The version of the pricing scheme.
minimum: 0
maximum: 999
readOnly: true
fixed_price:
description: The fixed amount to charge for the subscription. The changes to fixed amount are applicable to both existing and future subscriptions. For existing subscriptions, payments within 10 days of price change are not affected.
$ref: '#/components/schemas/money'
pricing_model:
type: string
description: The pricing model for tiered plan. The `tiers` parameter is required.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
enum:
- VOLUME
- TIERED
tiers:
type: array
description: An array of pricing tiers which are used for billing volume/tiered plans. pricing_model field has to be specified.
minItems: 1
maxItems: 32
items:
$ref: '#/components/schemas/pricing_tier'
create_time:
description: The date and time when this pricing scheme was created, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
readOnly: true
$ref: '#/components/schemas/date_time'
update_time:
description: The date and time when this pricing scheme was last updated, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6).
readOnly: true
$ref: '#/components/schemas/date_time'
currency_code:
description: The [three-character ISO-4217 currency code](/docs/integration/direct/rest/currency-codes/) that identifies the currency.
type: string
format: ppaas_common_currency_code_v2
minLength: 3
maxLength: 3
error_401:
type: object
title: Unauthorized Error
description: Authentication failed due to missing Authorization header, or invalid authentication credentials.
properties:
name:
type: string
enum:
- AUTHENTICATION_FAILURE
message:
type: string
enum:
- Authentication failed due to missing authorization header, or invalid authentication credentials.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
'404':
properties:
details:
type: array
items:
anyOf:
- title: INVALID_RESOURCE_ID
properties:
issue:
type: string
enum:
- INVALID_RESOURCE_ID
description:
type: string
enum:
- Specified resource ID does not exist. Please check the resource ID and try again.
error_415:
type: object
title: Unsupported Media Type Error
description: The server does not support the request payload's media type.
properties:
name:
type: string
enum:
- UNSUPPORTED_MEDIA_TYPE
message:
type: string
enum:
- The server does not support the request payload's media type.
details:
type: array
items:
$ref: '#/components/schemas/error_details'
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
plans.patch-400:
properties:
details:
type: array
items:
anyOf:
- title: UNSUPPORTED_PATCH_OPERATION
properties:
issue:
type: string
enum:
- UNSUPPORTED_PATCH_OPERATION
description:
type: string
enum:
- The specified patch operation not supported for this field.
- title: INVALID_PATCH_PATH
properties:
issue:
type: string
enum:
- INVALID_PATCH_PATH
description:
type: string
enum:
- The specified field cannot be patched.
- title: INVALID_PATCH_PATH
properties:
issue:
type: string
enum:
- INVALID_PATCH_PATH
description:
type: string
enum:
- Multiple operations on the same field are not allowed.
- title: INVALID_PARAMETER_SYNTAX
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_SYNTAX
description:
type: string
enum:
- The value of a field does not conform to the expected format.
- title: INVALID_PARAMETER_VALUE
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_VALUE
description:
type: string
enum:
- The value of a field is invalid.
- title: INVALID_PARAMETER_VALUE
properties:
issue:
type: string
enum:
- INVALID_PARAMETER_VALUE
description:
type: string
enum:
- The field is not eligible for '$value' patch operation.
plans.activate-422:
properties:
details:
type: array
items:
anyOf:
- title: USER_ACCOUNT_CLOSED
properties:
issue:
type: string
enum:
- USER_ACCOUNT_CLOSED
description:
type: string
enum:
- User account locked or closed.
- title: PLAN_STATUS_INVALID
properties:
issue:
type: string
enum:
- PLAN_STATUS_INVALID
description:
type: string
enum:
- Invalid plan status for activate action; plan status should be either created or inactive.
update_pricing_schemes_list_request:
title: Update Pricing Scheme Request
description: The update pricing scheme request details.
type: object
properties:
pricing_schemes:
type: array
description: An array of pricing schemes.
minItems: 1
maxItems: 99
items:
$ref: '#/components/schemas/update_pricing_scheme_request'
required:
- pricing_schemes
error_500:
type: object
title: Internal Server Error
description: This is either a system or application error, and generally indicates that although the client appeared to provide a correct request, something unexpected has gone wrong on the server.
properties:
name:
type: string
enum:
- INTERNAL_SERVER_ERROR
message:
type: string
enum:
- An internal server error occurred.
debug_id:
type: string
description: The PayPal internal ID. Used for correlation purposes.
links:
description: An array of request-related [HATEOAS links](https://en.wikipedia.org/wiki/HATEOAS).
type: array
minItems: 0
maxItems: 10000
items:
$ref: '#/components/schemas/error_link_description'
example:
name: INTERNAL_SERVER_ERROR
message: An internal server error occurred.
debug_id: 90957fca61718
links:
- href: https://developer.paypal.com/api/orders/v2/#error-INTERNAL_SERVER_ERROR
rel: information_link
percentage:
type: string
description: The percentage, as a fixed-point, signed decimal number. For example, define a 19.99% interest rate as `19.99`.
format: ppaas_common_percentage_v2
pattern: ^((-?[0-9]+)|(-?([0-9]+)?[.][0-9]+))$
date_time:
type: string
description: The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional.Note: The regular expression provides guidance but does not reject all invalid dates.
format: ppaas_date_time_v3
minLength: 20
maxLength: 64
pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T,t]([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]+)?([Zz]|[+-][0-9]{2}:[0-9]{2})$
frequency:
title: Billing Cycle Frequency
description: The frequency of the billing cycle.
type: object
properties:
interval_unit:
type: string
description: The interval at which the subscription is charged or billed.
minLength: 1
maxLength: 24
pattern: ^[A-Z_]+$
enum:
- DAY
- WEEK
- MONTH
- YEAR
interval_count:
type: integer
description: The number of intervals after which a subscriber is billed. For example, if the `interval_unit` is `DAY` with an `interval_count` of `2`, the subscription is billed once every two days. The following table lists the maximum allowed values for the `interval_count` for each `interval_unit`:Interval unit | Maximum interval count |
|---|
DAY | 365 |
WEEK | 52 |
MONTH | 12 |
YEAR | 1 |
minimum: 1
maximum: 365
default: 1
required:
- interval_unit
'422_2':
properties:
details:
type: array
items:
anyOf:
- title: USER_ACCOUNT_CLOSED
properties:
issue:
type: string
enum:
- USER_ACCOUNT_CLOSED
description:
type: string
enum:
- User account locked or closed.
- title: CURRENCY_MISMATCH
properties:
issue:
type: string
enum:
- CURRENCY_MISMATCH
description:
type: string
enum:
- All currency codes in the request should be of similar value.
- title: MULTIPLE_FREE_TRIAL_BILLING_CYCLES_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MULTIPLE_FREE_TRIAL_BILLING_CYCLES_NOT_SUPPORTED
description:
type: string
enum:
- Only one free trial billing cycle is allowed.
- title: MORE_THAN_TWO_TRIAL_BILLING_CYCLE_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MORE_THAN_TWO_TRIAL_BILLING_CYCLE_NOT_SUPPORTED
description:
type: string
enum:
- Only two trial billing cycles are allowed.
- title: MISSING_REGULAR_BILLING_CYCLE
properties:
issue:
type: string
enum:
- MISSING_REGULAR_BILLING_CYCLE
description:
type: string
enum:
- Plan should have at least one regular billing cycle.
- title: MULTIPLE_REGULAR_BILLING_CYCLES_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- MULTIPLE_REGULAR_BILLING_CYCLES_NOT_SUPPORTED
description:
type: string
enum:
- Only one regular billing cycle is allowed.
- title: INVALID_BILLING_CYCLE_SEQUENCE
properties:
issue:
type: string
enum:
- INVALID_BILLING_CYCLE_SEQUENCE
description:
type: string
enum:
- Billing cycle sequence should start with `1` and be consecutive.
- title: INVALID_BILLING_CYCLE_SEQUENCE
properties:
issue:
type: string
enum:
- INVALID_BILLING_CYCLE_SEQUENCE
description:
type: string
enum:
- Trial Billing cycle should precede regular billing cycle.
- title: INVALID_TRIAL_BILLING_TOTAL_CYCLES
properties:
issue:
type: string
enum:
- INVALID_TRIAL_BILLING_TOTAL_CYCLES
description:
type: string
enum:
- Total cycles for trial billing must be greater than '0'.
- title: INVALID_PRICING_TIER_AMOUNT
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_AMOUNT
description:
type: string
enum:
- Free tiers are not supported.
- title: MISSING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- MISSING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- Tier(s) are missing for some quantities.
- title: OVERLAPPING_PRICING_SCHEME_TIERS
properties:
issue:
type: string
enum:
- OVERLAPPING_PRICING_SCHEME_TIERS
description:
type: string
enum:
- The specified quantity overlaps with multiple pricing tiers.
- title: INVALID_PRICING_MODEL
properties:
issue:
type: string
enum:
- INVALID_PRICING_MODEL
description:
type: string
enum:
- The specified pricing model is not supported for trial billing cycle.
- title: FIXED_PRICE_NOT_SUPPORTED
properties:
issue:
type: string
enum:
- FIXED_PRICE_NOT_SUPPORTED
description:
type: string
enum:
- Fixed price is not supported for tiered pricing schemes.
- title: INVALID_PRICING_TIER_QUANTITY
properties:
issue:
type: string
enum:
- INVALID_PRICING_TIER_QUANTITY
description:
type: string
enum:
- Tier starting quantity must be less than ending quantity.
- title: INVALID_QUANTITY_SUPPORTED
properties:
issue:
type: string
enum:
- INVALID_QUANTITY_SUPPORTED
description:
type: string
enum:
- Quantity is always supported for volume and tiered plans.
- title: CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
properties:
issue:
type: string
enum:
- CURRENCY_NOT_SUPPORTED_FOR_RECEIVER
description:
type: string
enum:
- This currency cannot be accepted for this recipient’s account.
- title: INVALID_METADATA_CUSTOM_NOTE
properties:
issue:
type: string
enum:
- INVALID_METADATA_CUSTOM_NOTE
description:
type: string
enum:
- Merchant custom note cannot exceed 255 characters.
- title: INVALID_METADATA_INVOICE_ID
properties:
issue:
type: string
enum:
- INVALID_METADATA_INVOICE_ID
description:
type: string
enum:
- Invoice id cannot exceed 127 characters.
parameters:
page_size:
name: page_size
in: query
description: The number of items to return in the response.
schema:
type: integer
minimum: 1
maximum: 20
default: 10
prefer:
name: Prefer
in: header
description: 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.
required: false
schema:
type: string
default: return=minimal
product_id:
name: product_id
in: query
description: Filters the response by a Product ID.
required: false
schema:
type: string
minLength: 6
maxLength: 50
page:
name: page
in: query
description: 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.
schema:
type: integer
minimum: 1
maximum: 100000
default: 1
id:
name: id
in: path
required: true
description: The ID of the subscription.
schema:
type: string
paypal_request_id:
name: PayPal-Request-Id
in: header
description: The server stores keys for 72 hours.
required: false
schema:
type: string
total_required:
name: total_required
in: query
description: Indicates whether to show the total count in the response.
schema:
type: boolean
default: false
plan_ids:
name: plan_ids
in: query
description: Filters the response by list of plan IDs. Filter supports upto 10 plan IDs.
required: false
schema:
type: string
minimum: 3
maximum: 270
requestBodies:
patch_request:
content:
application/json:
schema:
$ref: '#/components/schemas/patch_request'
responses:
default:
description: The default response.
content:
application/json:
schema:
$ref: '#/components/schemas/error_default'
securitySchemes:
Oauth2:
type: oauth2
description: Oauth 2.0 authentication
flows:
clientCredentials:
tokenUrl: /v1/oauth2/token
scopes:
https://uri.paypal.com/services/subscriptions: Manage plan & subscription
externalDocs:
url: https://developer.paypal.com/docs/api/subscriptions/v1/