Missing Payer Address with Orders API V2 / Sandbox

tiefstapler
Contributor
Contributor

Hi,

 

I am setting up a payment integration with PayPal Checkout Button and orders API v2, which I test in the sandbox environment.

When an order is completed, the API (/v2/checkout/orders) returns a valid order, but I do  not completely receive the payer address.

Payer address look like this:

 

 

 

 

 "payer": {
        "name": {
            "given_name": "Peter",
            "surname": "<removed>"
        },
        "email_address": "<removed>",
        "payer_id": "HEU6X43KU231",
        "address": {
            "country_code": "DE"
        }
    },

 

 

 

 

but the https://developer.paypal.com/docs/api/orders/v2/#definition-payer says that the payer should also contain:

  • address_line_1,
  • address_line_2,
  • admin_area_1,
  • postal code.

I would like to use this information to send an invoice to the customer after payment.

As a workaround I could also ask for the information in the dialog in our part of the order process (in our GUI, before checkout), but as we use paypal plus to enable other payment methods it would be a very bad user experience to enter the same data twice.

 

Maybe it only occurs in the Sandbox environment and not in production? My Sandbox Accounts (which are configured for buying stuff in the sandbox) only do have a country Code and no other address information when I take a look at via my paypal dashboard/sandbox. Maybe that is the reason why the information is empty, but I could not identify where to add the address information in the sandbox account. In my opinion it is essential to be able to test this feature in the  test environment / sandbox.

 

Do you have a clue how to fix this?

 

Thanks a lot in advance

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Justin
Moderator
Moderator
Hello,

As above, I can do this for a sandbox account if you share the merchant id for the sandbox account in which you want it enabled. You can retrieve the merchant id for a sandbox account by following the instructions provided in the thread pinned to the top of this forum titled "how to report a sandbox issue".

If you wanted this returned for a live / production account, you would need to request the same from our customer service / business support or account management teams.

Customer Service : https://www.paypal.com/smarthelp/contact-us

Thanks !

Was my post helpful? If so, please give me a kudos!

View solution in original post

Login to Me Too
24 REPLIES 24

MTS_Justin
Moderator
Moderator
Hello,

"My Sandbox Accounts (which are configured for buying stuff in the sandbox) only do have a country Code and no other address information"

If your sandbox accounts do not have any address information, you're not going to receive any additional information back when you query a transaction.

Add an address to the sandbox account which is making the payments (buyer account) and then re-attempt the same query action as before.

For adding a street address to your account, go to this direct URL to add an address - https://www.sandbox.paypal.com/businessprofile/settings/address

Thanks !


Was my post helpful? If so, please give me a kudos!
Login to Me Too

tiefstapler
Contributor
Contributor

Hi Justin,

 

thanks for your explanation and your link.

In opposite to https://developer.paypal.com/developer/accounts/ and the respective details, when following your link, I can see that a standard address and invoice address is set.

Nevertheless, after a payment, the orders API do not send this information. I can only see 

'address': {'country_code': 'DE'},
  'email_address': '<email>',
  'name': {'given_name': '<name1>', 'surname': '<name2>'},
  'payer_id': '<ID>'},

Is there something I have overlooked or are there other requirements that need to be met in order to receive the complete address information?

 

Login to Me Too

tiefstapler
Contributor
Contributor

@MTS_Justin :Any update on this?

Thanks in advance

Login to Me Too

pkelly1
Contributor
Contributor

@MTS_Justin @tiefstapler 

 

I'm seeing the exact same issue, did you guys manage to find a solution?

 

Thanks

Login to Me Too

jriley9000
Contributor
Contributor

This is still broken you guys come on

Login to Me Too

dforchel
Contributor
Contributor

Hi,
does anybody has a solution how to fix this problem? I have the same problem. Only the payer's country code is sent. I need the street, postal code etc too.

Login to Me Too

iamdcj
Member
Member

It'd be great if Paypal would respond.

 

I am currently wrestling with the V2 API, and the reported issue is just one of the many gripes I have when creating advanced credit/debt card payments. I want to add customer information and general details to the transaction to make it easier for payouts and tracking, however the API doesn't allow you to attach metadata(minus the miserly `description` field) as per Stripe, meaning I now have to store an object in a separate DB in order to capture all the necessary details. 

 

If you can't add the address to a transaction then remove it from the API documentation, or provide better examples in the documentation. It is alway best practice to present all options when providing code snippets, which seems to be the case for `v1` documentation.

 

Thanks

Login to Me Too

Wirone
New Community Member

Yeah, lack of metadata in API v2 is what caused me problems recently. I've implemented some simple flow for passing additional data through Stripe payment and wanted to port it to Paypal but unfortunately it's impossible to add metadata to the order... Why metadata support was removed?

Login to Me Too

pzauner
Contributor
Contributor

Hello, I have still the same issue. How did you guys fix this?

I also found a thread on Stackoverflow. The guy answered "But to just answer your question, by default the address of the payer is not shared, just the country_code - to get the complete payer.address you will need to call your account manager or merchant support and they can enable it for your account if you meet their criteria."

 

kind regards

 

patrick

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.