I have managed to get the access token, and use that access token to create a “partner-referrals”. Then managed to get the “action_url” and add this “action_url” to the button as shown below. The @(Model) is where the “action_url” is added”:
<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="@(Model)&displayMode=minibrowser" target="PPFrame">Sign up for PayPal</a>
</div>
When I use a sandbox account to sign in, I was shown on YouTube that from the payload that was sent before displaying the “action_url” the “tracking_id” can be used to get back the “merchant_id” which would be stored in the database. But I cant find in the documentation what API to use to get back the sellers data and store the sellers data when onboarding.
I don’t understand what I need to use, it says in the partner referrals documentaion is that you need to use the “partner_referral_id” and the only way to get this as i noticed before i got the “action_url”, this was the response:
{
"links": [
{
"href": "https://uri.paypal.com/v2/customer/partner-referrals/ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=",
"rel": "self",
"method": "GET"
},
{
"href": "https://www.paypal.com/bizsignup/partner/entry?referralToken=Y2M1ZGYxNTktNjI1Yi00MjIyLTkyNGEtMjc5OTYwODhhMzVhM3docmVUUHhBSVplekx2VE1qL1Q3NHFvYUVBbTdlSzNHRnJBOEMzNzRrQT12Mg==",
"rel": "action_url",
"method": "GET"
}
]
}
As you can see the referral id is in the link:
https://uri.paypal.com/v2/customer/partner-referrals/**ZjcyODU4ZWYtYTA1OC00ODIwLTk2M2EtOTZkZWQ4NmQwYzI3RU12cE5xa0xMRmk1NWxFSVJIT1JlTFdSbElCbFU1Q3lhdGhESzVQcU9iRT0=**
So I’m a bit confused, if someone could tell me what do I need to store in the database for the seller onboarding so that I can use that id when buyers buy from sellers?
This was the payload or json request I sent when getting the “action_url”:
{
"email": "[email protected]",
"tracking_id": "TRACKING-ID",
"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
}]
}