username:password
Authorization: Basic *****************
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.{
"product_id": "{{product_id}}",
"name": "Fresh Clean Tees Plan",
"description": "Each shirt they send out to subscribers is designed with lots of attention to detail",
"status": "ACTIVE",
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "TRIAL",
"sequence": 1,
"total_cycles": 1,
"pricing_scheme": {
"fixed_price": {
"value": "1",
"currency_code": "USD"
}
}
},
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "REGULAR",
"sequence": 2,
"total_cycles": 12,
"pricing_scheme": {
"fixed_price": {
"value": "44",
"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
}
}
curl --location --request POST 'https://api-m.sandbox.paypal.com/v1/billing/plans' \
--header 'PayPal-Request-Id: ' \
--header 'Prefer: ' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"product_id": "{{product_id}}",
"name": "Fresh Clean Tees Plan",
"description": "Each shirt they send out to subscribers is designed with lots of attention to detail",
"status": "ACTIVE",
"billing_cycles": [
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "TRIAL",
"sequence": 1,
"total_cycles": 1,
"pricing_scheme": {
"fixed_price": {
"value": "1",
"currency_code": "USD"
}
}
},
{
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "REGULAR",
"sequence": 2,
"total_cycles": 12,
"pricing_scheme": {
"fixed_price": {
"value": "44",
"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
}
}'
{
"id": "P-9VG97050CC249134MMIBO43A",
"product_id": "1644357377",
"name": "Monthly Plan",
"status": "ACTIVE",
"usage_type": "LICENSED",
"billing_cycles": [
{
"pricing_scheme": {
"version": 1,
"fixed_price": {
"currency_code": "USD",
"value": "12.99"
},
"create_time": "2022-02-08T22:27:56Z",
"update_time": "2022-02-08T22:27:56Z"
},
"frequency": {
"interval_unit": "MONTH",
"interval_count": 1
},
"tenure_type": "REGULAR",
"sequence": 1,
"total_cycles": 1
}
],
"payment_preferences": {
"service_type": "PREPAID",
"auto_bill_outstanding": true,
"setup_fee": {
"currency_code": "USD",
"value": "0.0"
},
"setup_fee_failure_action": "CANCEL",
"payment_failure_threshold": 0
},
"quantity_supported": false,
"create_time": "2022-02-08T22:27:56Z",
"update_time": "2022-02-08T22:27:56Z",
"links": [
{
"href": "https://api.sandbox.paypal.com/v1/billing/plans/P-9VG97050CC249134MMIBO43A",
"rel": "self",
"method": "GET",
"encType": "application/json"
},
{
"href": "https://api.sandbox.paypal.com/v1/billing/plans/P-9VG97050CC249134MMIBO43A",
"rel": "edit",
"method": "PATCH",
"encType": "application/json"
},
{
"href": "https://api.sandbox.paypal.com/v1/billing/plans/P-9VG97050CC249134MMIBO43A/deactivate",
"rel": "self",
"method": "POST",
"encType": "application/json"
}
]
}