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.
Creates a plan that defines pricing and billing cycle details for subscriptions.
A successful request returns the HTTP 201 Created
status code and a JSON response body that shows billing plan details.
{- "product_id": "PROD-XXCD1234QWER65782",
- "name": "Video Streaming Service Plan",
- "billing_cycles": [
- {
- "tenure_type": "TRIAL",
- "sequence": 1,
- "frequency": {
- "interval_unit": "MONTH",
- "interval_count": 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
}, - "description": "Video Streaming Service basic plan",
- "status": "ACTIVE",
- "taxes": {
- "percentage": "10",
- "inclusive": false
}
}
{- "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": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "edit",
- "method": "PATCH"
}, - {
- "rel": "deactivate",
- "method": "POST"
}, - {
- "rel": "edit",
- "method": "POST"
}
]
}
Lists billing plans.
product_id | string [ 6 .. 50 ] characters Filters the response by a Product ID. |
page_size | integer [ 1 .. 20 ] Default: 10 The number of items to return in the response. |
page | integer [ 1 .. 100000 ] Default: 1 A non-zero integer which is the start index of the entire list of items to return in the response. The combination of |
total_required | boolean Default: false Indicates whether to show the total count in the response. |
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
Prefer | string Default: return=minimal The preferred server response upon successful completion of the request. Value is:
|
A successful request returns the HTTP 200 OK
status code and a JSON response body that lists billing plans.
curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans?sort_by=create_time&sort_order=desc \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Prefer: return=representation'
{- "plans": [
- {
- "id": "P-9CT60829WM695623HL7QGYOI",
- "name": "Netflix Plan 17012019",
- "status": "ACTIVE",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-23T07:08:40Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}, - {
- "id": "P-7CE83846EJ264184CL7QHL3I",
- "name": "Netflix Plan 17012019",
- "status": "CREATED",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-23T07:06:08Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}, - {
- "id": "P-1HG35083DU289225LL7QIDKA",
- "name": "Netflix Plan 17012019",
- "status": "ACTIVE",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-22T06:41:26Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}, - {
- "id": "P-5V279629EP569145RL7QZKFQ",
- "name": "Netflix Plan 17012019",
- "status": "CREATED",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-21T11:06:16Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}, - {
- "id": "P-69D48725TK8139022L7ROYYA",
- "name": "Netflix Plan 17012019",
- "status": "ACTIVE",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-21T10:16:13Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}, - {
- "id": "P-87R81207W88552156L7ROZ6A",
- "name": "Netflix Plan 17012019",
- "status": "ACTIVE",
- "description": "Netflix basic plan",
- "usage_type": "LICENSED",
- "create_time": "2020-12-21T09:34:49Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}
], - "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}
Shows details for a plan, by ID.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows plan details.
curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/plans/P-5ML4271244454362WXNWU5NQ \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'
{- "id": "P-5ML4271244454362WXNWU5NQ",
- "product_id": "PROD-XXCD1234QWER65782",
- "name": "Basic Plan",
- "description": "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": {
- "currency_code": "USD",
- "value": "3"
}, - "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": {
- "value": "10",
- "currency_code": "USD"
}, - "status": "ACTIVE",
- "version": 1,
- "create_time": "2020-05-27T12:13:51Z",
- "update_time": "2020-05-27T12:13:51Z"
}
}
], - "taxes": {
- "percentage": "10",
- "inclusive": false
}, - "create_time": "2020-05-27T12:13:51Z",
- "update_time": "2020-05-27T12:13:51Z",
- "links": [
- {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "edit",
- "method": "PATCH"
}, - {
- "rel": "deactivate",
- "method": "POST"
}, - {
- "rel": "edit",
- "method": "POST"
}
]
}
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 |
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
op required | string The operation.
| ||||||||||||||||||||||||||
path | string The JSON Pointer to the target document location at which to complete the operation. | ||||||||||||||||||||||||||
value | object (Patch Value) The value to apply. The | ||||||||||||||||||||||||||
from | string The JSON Pointer to the target document location from which to move the value. Required for the |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
[- {
- "op": "replace",
- "path": "/payment_preferences/payment_failure_threshold",
- "value": 7
}, - {
- "op": "replace",
- "path": "/name",
- "value": "Updated Video Streaming Service Plan"
}
]
Activates a plan, by ID.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
curl -v -X POST https://api-m.sandbox.paypal.com/v1/billing/plans/P-7GL4271244454362WXNWU5NQ/activate \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'
Deactivates a plan, by ID.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
curl -v -X POST https://api-m.sandbox.paypal.com/v1/billing/plans/P-7GL4271244454362WXNWU5NQ/deactivate \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'
Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to $7 per month.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
required | Array of objects (update_pricing_scheme_request) [ 1 .. 99 ] items An array of pricing schemes. |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "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"
}
}
]
}
}
]
}
Creates a subscription.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
Prefer | string Default: return=minimal The preferred server response upon successful completion of the request. Value is:
|
PayPal-Request-Id | string The server stores keys for 72 hours. |
plan_id required | string = 26 characters ^P-[A-Z0-9]*$ The ID of the plan. |
quantity | string [ 1 .. 32 ] characters ^([0-9]+|([0-9]+)?[.][0-9]+)$ The quantity of the product in the subscription. |
auto_renewal | boolean Default: false DEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete. |
custom_id | string [ 1 .. 127 ] characters ^[\x20-\x7E]+ The custom id for the subscription. Can be invoice id. |
start_time | string <ppaas_date_time_v3> (date_time) [ 20 .. 64 ] characters ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|... Default: "Current time" The date and time when the subscription started, in Internet date and time format. |
object (Money) The shipping charges. | |
object <payer_v1> (subscriber_request) The subscriber request information . | |
object (application_context) The application context, which customizes the payer experience during the subscription approval process with PayPal. | |
object (plan_override) An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. |
A successful request returns the HTTP 201 Created
status code and a JSON response body that shows subscription details.
{- "plan_id": "P-5ML4271244454362WXNWU5NQ",
- "start_time": "2018-11-01T00:00:00Z",
- "quantity": "20",
- "shipping_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "subscriber": {
- "name": {
- "given_name": "John",
- "surname": "Doe"
}, - "email_address": "customer@example.com",
- "shipping_address": {
- "name": {
- "full_name": "John Doe"
}, - "address": {
- "address_line_1": "2211 N First Street",
- "address_line_2": "Building 17",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95131",
- "country_code": "US"
}
}
}, - "application_context": {
- "brand_name": "walmart",
- "locale": "en-US",
- "shipping_preference": "SET_PROVIDED_ADDRESS",
- "user_action": "SUBSCRIBE_NOW",
- "payment_method": {
- "payer_selected": "PAYPAL",
- "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
},
}
}
{- "id": "I-BW452GLLEP1G",
- "status": "APPROVAL_PENDING",
- "status_update_time": "2018-12-10T21:20:49Z",
- "plan_id": "P-5ML4271244454362WXNWU5NQ",
- "plan_overridden": false,
- "start_time": "2018-11-01T00:00:00Z",
- "quantity": "20",
- "shipping_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "subscriber": {
- "name": {
- "given_name": "John",
- "surname": "Doe"
}, - "email_address": "customer@example.com",
- "payer_id": "2BBBB8YJQSCCC",
- "shipping_address": {
- "name": {
- "full_name": "John Doe"
}, - "address": {
- "address_line_1": "2211 N First Street",
- "address_line_2": "Building 17",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95131",
- "country_code": "US"
}
}
}, - "create_time": "2018-12-10T21:20:49Z",
- "links": [
- {
- "rel": "approve",
- "method": "GET"
}, - {
- "rel": "edit",
- "method": "PATCH"
}, - {
- "rel": "self",
- "method": "GET"
}
]
}
Shows details for a subscription, by ID.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows subscription details.
curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-BW452GLLEP1G \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'
{- "id": "I-BW452GLLEP1G",
- "plan_id": "P-5ML4271244454362WXNWU5NQ",
- "start_time": "2019-04-10T07:00:00Z",
- "quantity": "20",
- "shipping_amount": {
- "currency_code": "USD",
- "value": "10.0"
}, - "subscriber": {
- "shipping_address": {
- "name": {
- "full_name": "John Doe"
}, - "address": {
- "address_line_1": "2211 N First Street",
- "address_line_2": "Building 17",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95131",
- "country_code": "US"
}
}, - "name": {
- "given_name": "John",
- "surname": "Doe"
}, - "email_address": "customer@example.com",
- "payer_id": "2BBBB8YJQSCCC"
}, - "billing_info": {
- "outstanding_balance": {
- "currency_code": "USD",
- "value": "1.0"
}, - "cycle_executions": [
- {
- "tenure_type": "TRIAL",
- "sequence": 1,
- "cycles_completed": 0,
- "cycles_remaining": 2,
- "total_cycles": 2
}, - {
- "tenure_type": "TRIAL",
- "sequence": 2,
- "cycles_completed": 0,
- "cycles_remaining": 3,
- "total_cycles": 3
}, - {
- "tenure_type": "REGULAR",
- "sequence": 3,
- "cycles_completed": 0,
- "cycles_remaining": 12,
- "total_cycles": 12
}
], - "last_payment": {
- "amount": {
- "currency_code": "USD",
- "value": "1.15"
}, - "time": "2019-04-09T10:27:20Z"
}, - "next_billing_time": "2019-04-10T10:00:00Z",
- "failed_payments_count": 0
}, - "create_time": "2019-04-09T10:26:04Z",
- "update_time": "2019-04-09T10:27:27Z",
- "links": [
- {
- "rel": "cancel",
- "method": "POST"
}, - {
- "rel": "edit",
- "method": "PATCH"
}, - {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "suspend",
- "method": "POST"
}, - {
- "rel": "capture",
- "method": "POST"
}
], - "status": "ACTIVE",
- "status_update_time": "2019-04-09T10:27:27Z"
}
Updates a subscription which could be in ACTIVE
or SUSPENDED
status. You can override plan level default attributes by providing customised values for plan path in the patch request.
Attribute or object | Operations |
---|---|
billing_info.outstanding_balance | replace |
custom_id | add,replace |
plan.billing_cycles[@sequence==n]. | add,replace |
plan.billing_cycles[@sequence==n]. | replace |
plan.billing_cycles[@sequence==n]. | replace |
plan.payment_preferences. | replace |
plan.payment_preferences. | replace |
plan.taxes.inclusive | add,replace |
plan.taxes.percentage | add,replace |
shipping_amount | add,replace |
start_time | replace |
subscriber.shipping_address | add,replace |
subscriber.payment_source (for subscriptions funded | replace |
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
op required | string The operation.
| ||||||||||||||||||||||||||
path | string The JSON Pointer to the target document location at which to complete the operation. | ||||||||||||||||||||||||||
value | object (Patch Value) The value to apply. The | ||||||||||||||||||||||||||
from | string The JSON Pointer to the target document location from which to move the value. Required for the |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
[- {
- "op": "replace",
- "path": "/plan/billing_cycles/@sequence==1/pricing_scheme/fixed_price",
- "value": {
- "currency_code": "USD",
- "value": "50.00"
}
}, - {
- "op": "replace",
- "path": "/plan/billing_cycles/@sequence==2/pricing_scheme/tiers",
- "value": [
- {
- "starting_quantity": "1",
- "ending_quantity": "1000",
- "amount": {
- "value": "500",
- "currency_code": "USD"
}
}, - {
- "starting_quantity": "1001",
- "amount": {
- "value": "2000",
- "currency_code": "USD"
}
}
]
}, - {
- "op": "replace",
- "path": "/plan/payment_preferences/auto_bill_outstanding",
- "value": true
}, - {
- "op": "replace",
- "path": "/plan/payment_preferences/payment_failure_threshold",
- "value": 1
}, - {
- "op": "replace",
- "path": "/plan/taxes/percentage",
- "value": "10"
}
]
Updates the quantity of the product or service in a subscription. You can also use this method to switch the plan and update the shipping_amount
, shipping_address
values for the subscription. This type of update requires the buyer's consent.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
plan_id | string = 26 characters ^P-[A-Z0-9]*$ The unique PayPal-generated ID for the plan. |
quantity | string [ 1 .. 32 ] characters ^([0-9]+|([0-9]+)?[.][0-9]+)$ The quantity of the product or service in the subscription. |
object (Money) The shipping charges. | |
object (shipping_detail) The shipping address of the subscriber. | |
object (application_context) The application context, which customizes the payer experience during the subscription approval process with PayPal. | |
object (plan_override) An inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object. Any existing overrides will not be carried forward during subscription revise. |
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows subscription details.
{- "plan_id": "P-5ML4271244454362WXNWU5NQ",
- "shipping_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "shipping_address": {
- "name": {
- "full_name": "John Doe"
}, - "address": {
- "address_line_1": "2211 N First Street",
- "address_line_2": "Building 17",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95131",
- "country_code": "US"
}
}, - "application_context": {
- "brand_name": "walmart",
- "locale": "en-US",
- "shipping_preference": "SET_PROVIDED_ADDRESS",
- "payment_method": {
- "payer_selected": "PAYPAL",
- "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
},
}
}
{- "plan_id": "P-5ML4271244454362WXNWU5NQ",
- "plan_overridden": false,
- "shipping_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "shipping_address": {
- "name": {
- "full_name": "John Doe"
}, - "address": {
- "address_line_1": "2211 N First Street",
- "address_line_2": "Building 17",
- "admin_area_2": "San Jose",
- "admin_area_1": "CA",
- "postal_code": "95131",
- "country_code": "US"
}
}, - "links": [
- {
- "rel": "approve",
- "method": "GET"
}, - {
- "rel": "edit",
- "method": "PATCH"
}, - {
- "rel": "self",
- "method": "GET"
}, - {
- "rel": "cancel",
- "method": "POST"
}, - {
- "rel": "suspend",
- "method": "POST"
}, - {
- "rel": "capture",
- "method": "POST"
}
]
}
Suspends the subscription.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "reason": "Item out of stock"
}
Cancels the subscription.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "reason": "Not satisfied with the service"
}
Activates the subscription.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 204 No Content
status code with no JSON response body.
{- "reason": "Reactivating the subscription"
}
Captures an authorized payment from the subscriber on the subscription.
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
PayPal-Request-Id | string The server stores keys for 72 hours. |
note required | string [ 1 .. 128 ] characters ^.*$ The reason or note for the subscription charge. | ||||
capture_type required | string [ 1 .. 24 ] characters ^[A-Z_]+$ The type of capture.
| ||||
required | object (Money) The currency and amount for a financial transaction, such as a balance or payment due. |
Request Accepted.
{- "note": "Charging as the balance reached the limit",
- "capture_type": "OUTSTANDING_BALANCE",
- "amount": {
- "currency_code": "USD",
- "value": "100"
}
}
Lists transactions for a subscription.
start_time required | string <ppaas_date_time_v3> [ 20 .. 64 ] characters ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|... The start time of the range of transactions to list. |
end_time required | string <ppaas_date_time_v3> [ 20 .. 64 ] characters ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|... The end time of the range of transactions to list. |
Authorization required | string To make REST API calls, include the bearer token in the |
Content-Type required | string The media type. Required for operations with a request body. The value is |
A successful request returns the HTTP 200 OK
status code and a JSON response body that shows subscription details.
curl -v -X GET https://api-m.sandbox.paypal.com/v1/billing/subscriptions/I-BW452GLLEP1G/transactions?start_time=2018-01-21T07:50:20.940Z&end_time=2018-08-21T07:50:20.940Z \ -H 'Authorization: Bearer access_token6V7rbVwmlM1gFZKW_8QtzWXqpcwQ6T5vhEGYNJDAAdn3paCgRpdeMdVYmWzgbKSsECednupJ3Zx5Xd-g' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json'
{- "transactions": [
- {
- "id": "TRFGHNJKOIIOJKL",
- "status": "COMPLETED",
- "payer_email": "customer@example.com",
- "payer_name": {
- "given_name": "John",
- "surname": "Doe"
}, - "amount_with_breakdown": {
- "gross_amount": {
- "currency_code": "USD",
- "value": "10.00"
}, - "fee_amount": {
- "currency_code": "USD",
- "value": "1.00"
}, - "net_amount": {
- "currency_code": "USD",
- "value": "9.00"
}
}, - "time": "2018-03-16T07:40:20.940Z"
}, - {
- "id": "VDFG45345FFGS",
- "status": "COMPLETED",
- "payer_email": "customer2@example.com",
- "payer_name": {
- "given_name": "Jhonny",
- "surname": "Cat"
}, - "amount_with_breakdown": {
- "gross_amount": {
- "currency_code": "USD",
- "value": "15.00"
}, - "fee_amount": {
- "currency_code": "USD",
- "value": "1.00"
}, - "net_amount": {
- "currency_code": "USD",
- "value": "14.00"
}
}, - "time": "2018-08-21T07:50:20.940Z"
}
], - "links": [
- {
- "rel": "self",
- "method": "GET"
}
]
}
The breakdown details for the amount. Includes the gross, tax, fee, and shipping amounts.
required | object (Money) The amount for this transaction. |
object (Money) The item total for the transaction. | |
object (Money) The fee details for the transaction. | |
object (Money) The shipping amount for the transaction. | |
object (Money) The tax amount for the transaction. | |
object (Money) The net amount that the payee receives for this transaction in their PayPal account. The net amount is computed as |
{- "gross_amount": {
- "currency_code": "str",
- "value": "string"
}, - "total_item_amount": {
- "currency_code": "str",
- "value": "string"
}, - "fee_amount": {
- "currency_code": "str",
- "value": "string"
}, - "shipping_amount": {
- "currency_code": "str",
- "value": "string"
}, - "tax_amount": {
- "currency_code": "str",
- "value": "string"
}, - "net_amount": {
- "currency_code": "str",
- "value": "string"
}
}
The application context, which customizes the payer experience during the subscription approval process with PayPal.
brand_name | string [ 1 .. 127 ] characters ^.*$ The label that overrides the business name in the PayPal account on the PayPal site. | ||||||||
shipping_preference | string [ 1 .. 24 ] characters ^[A-Z_]+$ Default: "GET_FROM_FILE" The location from which the shipping address is derived.
| ||||||||
user_action | string [ 1 .. 24 ] characters ^[A-Z_]+$ Default: "SUBSCRIBE_NOW" Configures the label name to
| ||||||||
return_url required | string <uri> [ 10 .. 4000 ] characters The URL where the customer is redirected after the customer approves the payment. | ||||||||
cancel_url required | string <uri> [ 10 .. 4000 ] characters The URL where the customer is redirected after the customer cancels the payment. | ||||||||
locale | string <ppaas_common_language_v3> (language) [ 2 .. 10 ] characters ^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}))... The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, | ||||||||
object (payment_method) The customer and merchant payment preferences. Currently only PAYPAL payment method is supported. |
{- "brand_name": "string",
- "shipping_preference": "GET_FROM_FILE",
- "user_action": "CONTINUE",
- "locale": "string",
- "payment_method": {
- "payer_selected": "PAYPAL",
- "payee_preferred": "UNRESTRICTED"
}
}
The application context, which customizes the payer experience during the subscription approval process with PayPal.
brand_name | string [ 1 .. 127 ] characters ^.*$ The label that overrides the business name in the PayPal account on the PayPal site. | ||||||||
shipping_preference | string [ 1 .. 24 ] characters ^[A-Z_]+$ Default: "GET_FROM_FILE" The location from which the shipping address is derived.
| ||||||||
return_url required | string <uri> [ 10 .. 4000 ] characters The URL where the customer is redirected after the customer approves the payment. | ||||||||
cancel_url required | string <uri> [ 10 .. 4000 ] characters The URL where the customer is redirected after the customer cancels the payment. | ||||||||
locale | string <ppaas_common_language_v3> (language) [ 2 .. 10 ] characters ^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}))... The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, | ||||||||
object (payment_method) The customer and merchant payment preferences. Currently only PAYPAL payment method is supported. |