At the moment I’m going through the onboarding process, call this API call, where i can get the action URL so that the onboarding starts. So I request this API Call:
https://api-m.sandbox.paypal.com/v2/customer/partner-referrals
with this payload:
{
"tracking_id": "868gkjhkhjlklj",
"operations": [{
"operation": "API_INTEGRATION",
"api_integration_preference": {
"rest_api_integration": {
"integration_method": "PAYPAL",
"integration_type": "THIRD_PARTY",
"third_party_details": {
"features": [
"PAYMENT",
"REFUND"
]
}
}
}
}],
"products": [
"EXPRESS_CHECKOUT"
],
"legal_consents": [{
"type": "SHARE_DATA_CONSENT",
"granted": true
}]
}
I get a response of this JSON:
{
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/customer/partner-referrals/M2FkMjQ2MjMtMmRkZC00MjYxLWE2NWQtMmVmMjJlZjU1OTE2MTk4SkhnOFViTHhORHh3cUM3Q1BqRWc2dHJzYXJMcGxLMzRKN1ZpR0Jldz12Mg==",
"rel": "self",
"method": "GET",
"description": "Read Referral Data shared by the Caller."
},
{
"href": "https://www.sandbox.paypal.com/bizsignup/partner/entry?referralToken=M2FkMjQ2MjMtMmRkZC00MjYxLWE2NWQtMmVmMjJlZjU1OTE2MTk4SkhnOFViTHhORHh3cUM3Q1BqRWc2dHJzYXJMcGxLMzRKN1ZpR0Jldz12Mg==",
"rel": "action_url",
"method": "GET",
"description": "Target WEB REDIRECT URL for the next action. Customer should be redirected to this URL in the browser."
}
]
}
And i add this action_url to the JavaScript or link button on the page:
<div dir="ltr" style="text-align: left;" trbidi="on">
<script>
(function (d, s, id) {
var js, ref = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.async = true;
js.src = "https://www.paypal.com/webapps/merchantboarding/js/lib/lightbox/partner.js";
ref.parentNode.insertBefore(js, ref);
}
}(document, "script", "paypal-js"));
</script>
<a data-paypal-button="true" href="<action_url>&displayMode=minibrowser" target="PPFrame">Sign up for PayPal</a>
</div>
This is the link on my screen where I go through the onboarding:
Then I’m in the onboarding process.
I don’t understand what to do next, there is no documentation that I can find to get the merchant_id and store this against my user in the database so that I can use this merchant_id and allow the merchant / seller to be paid for there goods. What do I do next?
I’m using Paypal Rest API V2, should I use V1? or continue to use V2 as its a new implementation?