View as Markdown
API Spec (JSON)
API Spec (YAML)
Compact modeHides field descriptions and other prose for a more compact, scannable view of the API reference.Client CredentialsToken URLhttps://api-m.sandbox.paypal.com/v1/oauth2/tokenInheaderScopes
https://uri.paypal.com/services/subscriptionsapplication/json
TypeScript Definitions
Use the request body type in TypeScript.
start_datestringRequiredagreement_detailsobject<agreement_details>Optionaloutstanding_balanceobject<currency>OptionalvaluestringRequiredcurrencyobject<currency_code>Requiredlast_payment_amountobject<currency>OptionalvaluestringRequiredcurrencyobject<currency_code>Requiredpayerobject<payer>Requiredfunding_instrumentsobject<funding_instrument>[]Optionalcredit_cardobject<credit_card>Optionalbilling_addressobject<address>OptionalstatestringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
payer_infoobject<payer_info>Optionalshipping_addressobject<shipping_address>OptionalstatestringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
billing_addressobject<address>OptionalstatestringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
override_merchant_preferencesobject<merchant_preferences>Optionalauto_bill_amountenumOptionalNO. PayPal does not automatically bill the customer the outstanding balance. Default is NO.YES. PayPal automatically bills the customer the outstanding balance.initial_fail_amount_actionenumOptionalCONTINUE. The agreement remains active and the failed payment amount is added to the outstanding balance. If auto-billing is enabled, PayPal automatically bills the outstanding balance in the next billing cycle.CANCEL. PayPal creates the agreement but sets its state to pending until the initial payment clears. When the initial payment clears, the pending agreement becomes active. If the initial payment fails, the pending agreement is cancelled.Note: Initial payment failures will not increment the max_fail_attempt counter as initial payments are not considered regularly recurring payments.setup_feeobject<currency>OptionalvaluestringRequiredcurrencyobject<currency_code>Requiredoverride_charge_modelsobject<override_charge_model>[]Optionalamountobject<currency>RequiredvaluestringRequiredcurrencyobject<currency_code>Requiredplanobject<plan>Requiredshipping_addressobject<shipping_address>OptionalstatestringOptionalcountry_codestring<country_code>RequiredNote: The country code for Great Britain isGBand notUKas used in the top-level domain names for that country. Use the `C2` country code for China worldwide for comparable uncontrolled price (CUP) method, bank card, and cross-border transactions.
application/json
application/json
curl -X POST "https://example.com/billing-agreements" \ -H "Content-Type: application/json" \ -d '{ "name": "Direct Payment Recurring Profile", "description": "Credit card payment", "start_date": "2016-12-23T08:00:00Z", "plan": { "id": "P-2PL786081D358645F6NWEKFQ" }, "payer": { "payment_method": "credit_card", "payer_info": { "email": "[email protected]" }, "funding_instruments": [ { "credit_card": { "type": "visa", "number": "4417119664863864", "expire_month": 12, "expire_year": 2021, "cvv2": 111, "billing_address": { "line1": "065769 Holcomb Bridge Road #141", "line2": "5713 E Dimond Boulevard #B9", "city": "Wichita", "state": "KS", "postal_code": "67202", "country_code": "US" } } } ] } }'{ "id": "string", "state": "Pending", "name": "string", "description": "string", "start_date": "2019-08-24T14:15:22Z", "agreement_details": { "cycles_remaining": "string", "cycles_completed": "string", "next_billing_date": "string", "last_payment_date": "string", "final_payment_date": "string", "failed_payment_count": "string", "outstanding_balance": { "value": "string", "currency": {} }, "last_payment_amount": { "value": "string", "currency": {} } }, "payer": { "payment_method": "bank", "funding_instruments": [ { "credit_card": { "id": "string", "number": "string", "type": "string", "expire_month": 0, "expire_year": 0, "cvv2": 0, "first_name": "string", "last_name": "string", "external_customer_id": "string", "state": "expired", "valid_until": "string", "links": [ { "href": "string", "rel": "string", "method": "GET" } ], "billing_address": { "line1": "string", "line2": "string", "city": "string", "state": "string", "country_code": "st", "postal_code": "string" } } } ], "funding_option_id": "string", "payer_info": { "email": "[email protected]", "first_name": "string", "last_name": "string", "payer_id": "string", "shipping_address": { "recipient_name": "string", "default_address": true, "line1": "string", "line2": "string", "city": "string", "state": "string", "country_code": "st", "postal_code": "string" }, "billing_address": { "line1": "string", "line2": "string", "city": "string", "state": "string", "country_code": "st", "postal_code": "string" } } }, "override_merchant_preferences": { "id": "string", "cancel_url": "http://example.com", "return_url": "http://example.com", "max_fail_attempts": "string", "auto_bill_amount": "YES", "initial_fail_amount_action": "CONTINUE", "accepted_payment_type": "string", "char_set": "string", "setup_fee": { "value": "string", "currency": {} } }, "override_charge_models": [ { "charge_id": "string", "amount": { "value": "string", "currency": {} } } ], "plan": { "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": "string", "cycles": "string", "charge_models": [ { "id": "string", "type": "TAX", "amount": { "value": "string", "currency": {} } } ], "amount": { "value": "string", "currency": {} } } ], "terms": [ { "id": "string", "type": "string", "occurrences": "string", "buyer_editable": "string", "max_billing_amount": { "value": "string", "currency": {} }, "amount_range": { "value": "string", "currency": {} } } ], "merchant_preferences": { "id": "string", "cancel_url": "http://example.com", "return_url": "http://example.com", "max_fail_attempts": "string", "auto_bill_amount": "YES", "initial_fail_amount_action": "CONTINUE", "accepted_payment_type": "string", "char_set": "string", "setup_fee": { "value": "string", "currency": {} } }, "links": [ { "href": "string", "rel": "string", "method": "GET" } ], "currency_code": {} }, "links": [ { "href": "string", "rel": "string", "method": "GET" } ], "shipping_address": { "line1": "string", "line2": "string", "city": "string", "state": "string", "country_code": "st", "postal_code": "string" }}