On this page
No Headings
Oauth 2.0 authentication
Client CredentialsToken URLhttps://api-m.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/subscriptionsapplication/json
TypeScript Definitions
Use the request body type in TypeScript.
application/json
application/json
curl -X POST "https://api-m.paypal.com/v1/payments/billing-plans" \ -H "Content-Type: application/json" \ -d '{ "name": "Simple Plan", "description": "Plan with one regular payment definition, minimal merchant preferences, and no shipping fees or tax.", "type": "FIXED", "payment_definitions": [ { "name": "Regular payment definition", "type": "REGULAR", "frequency": "MONTH", "frequency_interval": "2", "amount": { "value": "100", "currency": "USD" }, "cycles": "12" } ], "merchant_preferences": { "return_url": "https://example.com", "cancel_url": "https://example.com/cancel" } }'{
"id": "string",
"name": "string",
"description": "string",
"type": "FIXED",
"state": "CREATED",
"create_time": "string",
"update_time": "string",
"payment_definitions": [
{
"id": "string",
"name": "string",
"type": "TRIAL",
"frequency_interval": "string",
"frequency": "WEEK",
"cycles": "string",
"charge_models": [
{
"id": "string",
"type": "TAX",
"amount": {
"currency": "string",
"value": "string"
}
}
],
"amount": {
"currency": "string",
"value": "string"
}
}
],
"terms": [
{
"id": "string",
"type": "MONTHLY",
"occurrences": "string",
"buyer_editable": "string",
"max_billing_amount": {
"currency": "string",
"value": "string"
},
"amount_range": {
"currency": "string",
"value": "string"
}
}
],
"merchant_preferences": {
"cancel_url": "http://example.com",
"return_url": "http://example.com",
"notify_url": "http://example.com",
"max_fail_attempts": "0",
"auto_bill_amount": "YES",
"initial_fail_amount_action": "CONTINUE",
"accepted_payment_type": "string",
"char_set": "string",
"setup_fee": {
"currency": "string",
"value": "string"
}
},
"links": [
{
"href": "string",
"rel": "string",
"method": "GET"
}
]
}{
"name": "string",
"debug_id": "string",
"message": "string",
"information_link": "string",
"details": [
{
"field": "string",
"issue": "string"
}
]
}The plan name.
length <= 128The plan description. Maximum length is 127 single-byte alphanumeric characters.
length <= 127The plan type. Indicates whether the payment definitions in the plan have a fixed number of or infinite payment cycles. Value is:FIXED. The plan has a fixed number of payment cycles.INFINITE. The plan has infinite, or 0, payment cycles.
length <= 20"FIXED" | "INFINITE"A payment definition, which determines how often and for how long the customer is charged. Includes the interval at which the customer is charged, the charge amount, and optional shipping fees and taxes.
The merchant preferences for a plan, which define how much it costs to set up the agreement, the URLs where the customer can approve or cancel the agreement, the maximum number of allowed failed payment attempts, whether PayPal automatically bills the outstanding balance in the next billing cycle, and the action if the customer's initial payment fails.