Paypal Reference Transaction (Billing Agreement)
1. Create an order using endpoint POST api/orders/{webkey}
2. Send the field "PaymentProcessorId" the value 31 (PayPalRefTrans)
3. If it's the first time that the user is buying through PayPalRefTrans, the response will contain a PayPal URL in the "CallbackUrl".
a. This URL will redirect the user to PayPal's website so the user can sign the billing agreement for Reference Transactions
b. After the user has agreed with the billing agreement, the user will be redirected for the "Success landing page" of the campaign.
i. Once the user is redirected to the successful URL (Upsell or Order Confirmation page), the website must call the Websales API's update function sending the "PaymentProcessorId" as 31 (PayPalRefTrans) using the endpoint PUT api/orders/{webkey}?trackingNumber=<paypaltoken>
ii. Websales API will register the billing agreement for that user and pay the original order.
4. If the user already has a PayPal Billing Agreement (recurring users or for the upsell pages), the order will be paid without any other user interaction, and the websales API will be able to handle everything in the backend. In that case, when you use the method POST api/orders/{webkey} the field "CallbackUrl" will be empty.