Skip to content

Instantly share code, notes, and snippets.

@xcommerce-gists
Created August 28, 2012 20:59
Show Gist options
  • Select an option

  • Save xcommerce-gists/3504306 to your computer and use it in GitHub Desktop.

Select an option

Save xcommerce-gists/3504306 to your computer and use it in GitHub Desktop.
How to Create a Recurring Payments Profile with Express Checkout.curl
Request
-------
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=insert_merchant_user_name_here
&PWD=insert_merchant_password_here
&SIGNATURE=insert_merchant_signature_value_here
&METHOD=CreateRecurringPaymentsProfile
&VERSION=86
&TOKEN=insert_token_value_here
&PAYERID=payer_id_value #Identifies the customer's account
&PROFILESTARTDATE=2012-05-11T00:00:00Z #Billing date start, in UTC/GMT format
&DESC=FitnessMembership #Profile description - same as billing agreement description
&BILLINGPERIOD=Month #Period of time between billings
&BILLINGFREQUENCY=1 #Frequency of charges
&AMT=10 #The amount the buyer will pay in a payment period
&CURRENCYCODE=USD #The currency, e.g. US dollars
&COUNTRYCODE=US #The country code, e.g. US
&MAXFAILEDPAYMENTS=3 #Maximum failed payments before suspension of the profile
Response
--------
PROFILEID=I%2d6D5UGCVX1234
&PROFILESTATUS=ActiveProfile
&ACK=Success
...
Request
-------
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=insert_merchant_user_name_here
&PWD=insert_merchant_password_here
&SIGNATURE=insert_merchant_signature_value_here
&METHOD=GetExpressCheckoutDetails
&VERSION=86
&TOKEN=insert_token_value_here
Response
--------
TOKEN=token_value
&BILLINGAGREEMENTACCEPTEDSTATUS=1
&ACK=Success
&PAYERID=3TXTXECKF1234
...
Request
-------
Endpoint URL: https://api-3t.sandbox.paypal.com/nvp
HTTP method: POST
POST data:
USER=insert_merchant_user_name_here
&PWD=insert_merchant_password_here
&SIGNATURE=insert_merchant_signature_value_here
&METHOD=SetExpressCheckout
&VERSION=86
&L_BILLINGTYPE0=RecurringPayments #The type of billing agreement
&L_BILLINGAGREEMENTDESCRIPTION0=FitnessMembership #The description of the billing agreement
&cancelUrl=http://www.yourdomain.com/cancel.html #For use if the consumer decides not to proceed with payment
&returnUrl=http://www.yourdomain.com/success.html #For use if the consumer proceeds with payment
Response
--------
TOKEN=EC%2d2B984685J43051234
&ACK=Success
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment