Require and record phone number for subscriptions

dsdrake
Contributor
Contributor

Hi,

 

I am looking to offer subscriptions to customers but I need to record their phone number (with their consent) as part of the process, and access this via API.

 

In the subscription itself I see there is a subscriber object that includes a phone object, and it is documented that I must enable this option in the Merchant PayPal account. I have done so, setting the phone number to required, however this option simply seems to have no effect. I am testing in the sandbox here.

 

With or without this option set to require the phone number, the behaviour seems to be the same, when creating a Smart Button for subscriptions:

* Guest purchases always require the user to enter a phone number, along with the card number

* Account-based purchases never present the option to enter a phone number, even if adding a new card or shipping address.

 

And if I go through and create the subscriptions, both as guest or account-based, with the Merchant set to require the phone number, the Show Subscription Details API does not include the "phone" object.

 

I also tried using the Subscriptions API to create a subscription with the phone number recorded. That also does not seem to work.

 

I create a subscription with this data:

 

 

{
      "plan_id": "P-9F874971V0502862PMEUILVI",
      "subscriber": {
        "name": {
          "given_name": "Test",
          "surname": "User"
        },
        "phone": {
            "phone_type": "MOBILE",
            "phone_number": {
                "national_number": ...
            }
        },
        "email_address": ...
      },
      "application_context": {
        "brand_name": "example",
        "locale": "en-US",
        "shipping_preference": "SET_PROVIDED_ADDRESS",
        "user_action": "SUBSCRIBE_NOW",
        "payment_method": {
          "payer_selected": "PAYPAL",
          "payee_preferred": "IMMEDIATE_PAYMENT_REQUIRED"
        },
        "return_url": "https://example.com/returnUrl",
        "cancel_url": "https://example.com/cancelUrl"
      }
    }

 

 

(please note that I have removed the phone number and email address from the above snippet - this forum will not let me post phone numbers or email addresses. By copying examples included in PayPal API docs, I am confident I am submitting this data in the correct format.)

 

This creates a subscription which is pending payment.

But if I call Show Subscription Details for that subscription, it has already lost the phone number 😞

 

 

{
    "status": "APPROVAL_PENDING",
    "id": "I-TDKF6FLKDL8J",
    "plan_id": "P-9F874971V0502862PMEUILVI",
    "start_time": "2021-08-31T00:21:12Z",
    "quantity": "1",
    "subscriber": {
        "email_address": ...,
        "name": {
            "given_name": "Test",
            "surname": "User"
        }
    },
    "create_time": "2021-08-31T00:21:12Z",
    "plan_overridden": false,
    "links": [
        {
            "href": "https://api.sandbox.paypal.com/v1/billing/subscriptions/I-TDKF6FLKDL8J",
            "rel": "edit",
            "method": "PATCH"
        },
        {
            "href": "https://api.sandbox.paypal.com/v1/billing/subscriptions/I-TDKF6FLKDL8J",
            "rel": "self",
            "method": "GET"
        },
        {
            "href": "https://www.sandbox.paypal.com/webapps/billing/subscriptions?ba_token=BA-9R346053EF6334834",
            "rel": "approve",
            "method": "GET"
        }
    ]
}

 

 

Any suggestions? How can I get paypal to request and record the phone number of subscribers?

 

Thanks

Daniel

 

Login to Me Too
1 REPLY 1

MTS-Aaron
PayPal Employee
PayPal Employee

Hi @dsdrake 

 

I would recommend reaching out to Customer Service using the "Contact Us" link at the bottom of the page. They may be able to change a setting in your account to enable the Phone Number as an Information Request. If I remember right, that settings change should show it for Subscriptions like it does for the Checkout product.

 

Hope that helps!

-Aaron

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.