Create subscription
documentedCreate a PayPal subscription.
POST /v1/billing/subscriptionsSubscriptionsno implementation yet0 runsNo implementation yet. Run it to have the agent write one, or open a pull request with your own.
Seed example (keychains curl)
npx -y keychains@latest curl "https://api.paypal.com/v1/billing/subscriptions" \
-X POST \
-H "Authorization: Bearer {{OAUTH2_ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"plan_id": "{{$plan_id}}",
"start_time": "{{$start_time}}",
"quantity": "{{$quantity}}",
"custom_id": "{{$custom_id}}",
"shipping_amount": {
"currency_code": "USD",
"value": "{{$shipping_value}}"
},
"subscriber": {
"name": {
"given_name": "{{$subscriber_given_name}}",
"surname": "{{$subscriber_surname}}"
},
"email_address": "{{$subscriber_email}}",
"shipping_address": {
"address_line_1": "{{$address_line1}}",
"admin_area_2": "{{$city}}",
"admin_area_1": "{{$state}}",
"postal_code": "{{$postal_code}}",
"country_code": "{{$country_code}}"
}
},
"application_context": {
"brand_name": "{{$brand_name}}",
"locale": "{{$locale}}",
"shipping_preference": "SET_PROVIDED_ADDRESS",
"return_url": "{{$return_url}}",
"cancel_url": "{{$cancel_url}}",
"user_action": "SUBSCRIBE_NOW",
"payment_method": {
"payer_selected": "PAYPAL",
"payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
}
}
}'