Country Code missing after createCustomerLoyalty

I am using the Node JS SDK and am calling the createLoyaltyAccount API, passing in the body with a phone number that includes the country code. But when I call the api to get that customer, the country code is missing. For example, if I send the following body:

const body: CreateLoyaltyAccountRequest = {
loyaltyAccount: {
programId: ‘d619f755-2d17-41f3-990d-c04ecedd64dd’,
mapping: {
phoneNumber: ‘+14155551234’,
idempotencyKey: ‘ec78c477-b1c3-4899-a209-a4e71337c996’,

what gets returned when calling customers/bulk-retrieve is 4155551234, so the + sign and country code are both missing.

I’m not sure if I’m doing something wrong. Any help would be greatly appreciated.


This is the expected behavior. The country code of the phone number doesn’t automatically determine the country code for the customer profile. If you want to set the country you’ll need to do so with the Customers API. :slightly_smiling_face:

Thanks Bryan. I guess I’m a little confused though, cause when I create an account using the Square Customer Directory on the web, those customers are returned with +14155551234 for example. So I guess I’m not really understanding what the difference it.

What’s your application ID? :slightly_smiling_face: