For the complete documentation index, see llms.txt. This page is also available as Markdown.

Billing Agreements

Billing Agreements enable recurring payments by creating a stored PayPal payment method on behalf of a payer. Once a billing agreement is in place, it can be referenced in future transactions without requiring the payer to authenticate each time.

The billing agreement lifecycle follows a two-step initiation flow: first generate a token, then convert it to a live agreement after the payer approves.

How It Works

1

Initiate the agreement

Call POST /billingAgreement/initiate with the PayPal contract details. You receive an approval token and a redirect URL.

2

Redirect the payer

Send the payer to the PayPal approval URL so they can consent to the recurring billing arrangement.

3

Create the agreement

After the payer approves, call POST /billingAgreement/create with the token to convert approval into a live billing agreement. Store the returned agreementId for future use.

Initiate Billing Agreement

Initiates a new billing agreement by generating a PayPal approval token and redirect URL. The payer must visit the redirect URL to consent before the agreement can be created.

Initiate billing agreement

post
/billingAgreement/initiate
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body
paymentProviderContractstringRequired

PayPal Payment Provider Contract UUID

descriptionstringOptional

Agreement description

enableAddressChangebooleanOptional

Indicates whether to show the shipping address but prevent the customer from editing it.

collectShippingAddressbooleanOptional

Indicates whether to skip the collection of the shipping address from the customer during the agreement sign-up phase.

allowedCountriesstring[]Optional

An array of legally accepted customer country codes

experienceIdstringOptional

The ID of the experience profile to apply during the agreement approval UI flow.

externalSelectedFundingInstrumentTypestring · enumOptional

The type of financial instrument (FI) that the merchant wants to promote.

Possible values:
returnUrlstringOptional

The URL where the customer is redirected after the customer approves the payment

cancelUrlstringOptional

The URL where the customer is redirected after the customer cancels the payment

Responses
200

Successful

application/json
approvalUrlstringRequired

PayPal approval URL

billingTokenstringRequired

Billing token

post
/billingAgreement/initiate

Show Token Details

Retrieves details about a billing agreement token before it is converted to a live agreement. Use this to inspect the token state or payer information after redirect.

Show token details

get
/billingAgreement/token/{tokenId}
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
tokenIdstringRequired

The ID of the agreement token for which to show details.

Query parameters
paymentProviderContractstringRequired

PayPal Payment Provider Contract UUID

Responses
200

Successful

application/json
tokenIdstringRequired

The state of the agreement.

statusstringOptional

The description of the agreement.

descriptionstringOptional

The description of the agreement.

collectShippingAddressbooleanOptional

Indicates whether to skip the collection of the shipping address from the customer during the agreement sign-up phase.

enableAddressChangebooleanOptional

Indicates whether to show the shipping address but prevent the customer from editing it.

experienceIdstringOptional

The ID of the experience profile to apply during the agreement approval UI flow.

externalSelectedFundingInstrumentTypestring · enumOptional

The type of financial instrument (FI) that the merchant wants to promote.

Possible values:
get
/billingAgreement/token/{tokenId}

Create Billing Agreement

Converts an approved billing agreement token into a live PayPal billing agreement. Call this after the payer has completed the PayPal approval flow.

Create billing agreement using token

post
/billingAgreement/create
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Header parameters
x-vfi-api-idempotencyKeystringOptional

A value you specify that uniquely identifies the transaction. If you're unsure whether a particular transaction succeeded, you can reattempt it with the same idempotency key without worrying about duplicating the transaction.

Body
billingTokenstringRequired

PayPal agreement token

paymentProviderContractstringRequired

PayPal Payment Provider Contract UUID

Responses
200

Successful

application/json
idstringRequired

The ID of the agreement.

statestringRequired

The state of the agreement.

descriptionstringOptional

The description of the agreement.

createTimestringRequired

The date and time when the agreement was created.

updateTimestringOptional

The date and time when the agreement was updated.

post
/billingAgreement/create

Get Agreement Details

Retrieves the full details of an existing billing agreement, including status, payer information, and shipping details.

Get agreement details

get
/billingAgreement/{agreementId}
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
agreementIdstringRequired

PayPal billing agreement id

Query parameters
paymentProviderContractstringRequired

PayPal Payment Provider Contract UUID

Responses
200

Successful

application/json
idstringRequired

The ID of the agreement.

statestringRequired

The state of the agreement.

descriptionstringOptional

The description of the agreement.

createTimestringRequired

The date and time when the agreement was created.

updateTimestringOptional

The date and time when the agreement was updated.

get
/billingAgreement/{agreementId}

Cancel Billing Agreement

Cancels an active billing agreement. Once cancelled, the agreement can no longer be used to process payments.

Cancel agreement details

post
/billingAgreement/{agreementId}/cancel
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
agreementIdstringRequired

PayPal billing agreement id

Body
paymentProviderContractstringRequired

PayPal Payment Provider Contract UUID

Responses
200

Successful

application/json
stringOptional
post
/billingAgreement/{agreementId}/cancel

Was this helpful?