# customerSmsMarketingSubscribe - storefront - MUTATION Version: unstable ## Description Subscribes a customer to the newsletter with a phone number. ### Access Scopes `unauthenticated_write_customers` access scope. ## Arguments * [phoneNumber](/docs/api/storefront/unstable/scalars/String): String! - The customer's phone number. ## Returns * [customer](/docs/api/storefront/unstable/objects/CustomerMarketingSubscribe): CustomerMarketingSubscribe The created customer object. * [customerUserErrors](/docs/api/storefront/unstable/objects/CustomerUserError): CustomerUserError! The list of errors that occurred from executing the mutation. ## Examples ### Subscribe a customer to your newsletter with a phone number Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/api/unstable/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Storefront-Access-Token: {storefront_access_token}' \\\n-d '{\n\"query\": \"mutation customerSmsMarketingSubscribe($phoneNumber: String!) { customerSmsMarketingSubscribe(phoneNumber: $phoneNumber) { customer { phone } customerUserErrors { field message code } } }\",\n \"variables\": {\n \"phoneNumber\": \"+16475555555\"\n }\n}'\n" Node example: "const client = new shopify.clients.Storefront({\n domain: 'your-development-store.myshopify.com',\n storefrontAccessToken,\n});\nconst data = await client.query({\n data: {\n \"query\": `mutation customerSmsMarketingSubscribe($phoneNumber: String!) {\n customerSmsMarketingSubscribe(phoneNumber: $phoneNumber) {\n customer {\n phone\n }\n customerUserErrors {\n field\n message\n code\n }\n }\n }`,\n \"variables\": {\n \"phoneNumber\": \"+16475555555\"\n },\n },\n});\n" Ruby example: null Remix example: "const { storefront } = await unauthenticated.storefront(\n 'your-development-store.myshopify.com'\n);\n\nconst response = await storefront.graphql(\n `#graphql\n mutation customerSmsMarketingSubscribe($phoneNumber: String!) {\n customerSmsMarketingSubscribe(phoneNumber: $phoneNumber) {\n customer {\n phone\n }\n customerUserErrors {\n field\n message\n code\n }\n }\n }`,\n {\n variables: {\n \"phoneNumber\": \"+16475555555\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation customerSmsMarketingSubscribe($phoneNumber: String!) {\n customerSmsMarketingSubscribe(phoneNumber: $phoneNumber) {\n customer {\n phone\n }\n customerUserErrors {\n field\n message\n code\n }\n }\n}" #### Graphql Input { "phoneNumber": "+16475555555" } #### Graphql Response { "data": { "customerSmsMarketingSubscribe": { "customer": { "phone": "+16475555555" }, "customerUserErrors": [] } } }