I Have this in my payload:
payload = "{ "email": "[email protected]", "tracking_id": "testenterprices123122", "partner_config_override": { "return_url": "https://testenterprises.com/merchantonboarded", "return_url_description": "the url to return the merchant after the paypal onboarding process.", "show_add_credit_card": true }, "operations": [ { "operation": "API_INTEGRATION", "api_integration_preference": { "rest_api_integration": { "integration_method": "PAYPAL", "integration_type": "THIRD_PARTY", "third_party_details": { "features": [ "PAYMENT", "REFUND", "PARTNER_FEE" ] } } } } ], "products": [ "PAYMENT_METHODS" ], "capabilities": [ "APPLE_PAY" ], "legal_consents": [ { "type": "SHARE_DATA_CONSENT", "granted": true } ] }";
I’m receiving the token from:
https://api-m.sandbox.paypal.com/v1/oauth2/token
But passing the information I get Unauthorised:
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://api-m.sandbox.paypal.com");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Authorization", "Bearer access_token" + jsonResponseBody.access_token);
StringContent contentJson = new StringContent(payload, Encoding.UTF8, "application/json");
var response2 = await client.PostAsync("v2/customer/partner-referrals", contentJson);
//response2.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");
response2.EnsureSuccessStatusCode();
var responseBody2 = await response2.Content.ReadAsStringAsync();
var t = "";
}