# SMS shipping notifications

Our bird shop already confirms orders by email — in part two it learns to text. When an order moves to shipped, the customer gets an SMS from "BirdShop" with their order number and delivery estimate. One prompt to the coding agent, one new function next to the email one, and a look at the two things SMS needs that email didn't: destination enablement and a funded wallet.

Video: https://www.youtube.com/watch?v=1cw8lzOPDco (7:37)

## What we cover

- Sending an SMS the moment a shipment updates
- Reusing the contact you created in part one
- Handling a reply from the customer

## Transcript

_Auto-generated from the video._

Hi there. Welcome back to the integration series. Uh part two. Last time, our bird shop uh learned how to send order confirmation emails. And today we're going to be focusing on the shipping state. Um instead of integrating a shipping confirmation via email, we're going to focus on setting up a shipping SMS.

Our shop already has order tracking in place. And when order moves to shipped, at the moment nothing happens. So, we want to go and change that. So, when we start focusing on SMS, there's a few things that we need to do um be cautious of that are going to be different than what we've done with email. So, when we navigate to SMS, the first thing that we're going to head to is the destination step. So, the destination step is a pre-listed or basically a white list uh destination overview for countries that you do and do not want to send to. This is deliberate. Um it's basically set up to protect you against possible fraud or for any messages getting out to countries where you don't even ship, just to make sure that you don't have any surprise bills. Because the price per country does vary quite um quite drastically.

Um so, we already integrated both the Netherlands and Belgium or we activated them cuz those are the two countries that um I've got customers for with my uh bird shop. Then second, it's also important to make sure that your account is already topped up. Um SMS is a pay-as-you-go service, meaning that your messages get deducted from your balance right away. So, you need to have balance in order to get started. And then lastly, we need to set up an API key. So, I've already gone and created an SMS API key um with the scopes SMS.

We do always recommend to create an API key per service um really to spread out the scopes as much as possible. That in the event that a case um or key does get leaked, that it doesn't immediately grant access to your entire account. Uh, especially with the CLI and all of the capabilities that exist there, creating a master key should be done only when really needed to prevent, um, yeah, any issues when it comes to, uh, security hazards. But, of course, you just always need to make sure that your key is kept secret.

Now, we're going to do the same thing as what we did last time. Um, I'm going to open up a, uh, Claude session. Today, we need to integrate SMS into our order flow. I want a shipping confirmation set up, uh, once we ship the products.

I need it to contain the, uh, shipping details, the tracking link, and the order ID. We also want to send it from a sender ID for our shop specifically. Now, the sender ID is an important component when sending SMS. Um, we've got a separate video highlighting exactly all of the rules and regulations for sender ID, the different types, and what to do. Um, but the TLDR is that we're going to be using an alpha alpha numeric, uh, sender ID, basically a name, which is, um, allowed in the Netherlands. So, I can just set up from Bird Shop or from Aviary Shop, um, to make sure that the, uh, the customers can immediately see where the message is coming from.

Uh, that is something again that is country specific, so we always recommend you to go through the regulations on the destinations page. Um, but now it's going to start building, and I'll be right back when it's, uh, when it's completed. Already, and welcome back. So, it's just completed. Took around 4 minutes in total for everything to integrate. Um we just have a quick look at everything that it did. Um so, it started brainstorming first. So, it used the API key to actually see what the current status of SMS. So, it identified that Netherlands and the Belgium uh were indeed enabled for this workspace. And that both actually permit an alphanumeric sender ID, so that Aviary Shop um actually works.

Um it actually double-checked with me first during the brainstorming session what exactly I wanted to do. So, we were going to keep it minimal. So, no shipping address, carrier, or tracking number, just the ID. And then uh once shipped, so it just wanted to confirm exactly at which stage it wanted the um SMS to get fired.

Then it started creating out um the actual routes. Decided on the messaging body. So, we're going to have Aviary Shop and the order has shipped with an estimated delivery time plus the tracking token. Um then it needed to create the trigger. And it identified a gap where currently the phone collection for us was just free text, but it wants it to be in a specific format. So, this is indeed very important when sending SMS messages is that the message needs to follow um international formats. So, for the Netherlands, that means that we need to start with plus 31, um which is the country code. Um we always use the first digits to actually direct to the country. So, in the event that a customer or you don't necessarily feel set it up correctly, it might mean that you attempt to send a message to a different country, which might not be enabled and thus the message not actually getting um getting delivered.

Now, then it started actually building. So, it created um the actual routes. So, here we can actually see uh the snippet. So, here we can see the text and the actual send that is quite simple. So, it's sending the SMS from a specific user to a specific user with a specific text. And then we've got the category set as transactional so that we can use that at later stage as well.

All right. Um now that everything is integrated, let's actually start uh purchasing some food for our previously purchased bird. I'm going to go some tropical food pellets. Proceed to checkout. My name and our phone number. I'm going to place the order. Our order confirmed. So, we're first going to receive the confirmation email.

Same for brand new order, but we care about the shipped state cuz this is the moment. And right there, within a second, we can actually see that the SMS was received. Uh it came from Aviary Shop as sender ID. Again, this is a country-specific rule or regulation. So, for the Netherlands, that isn't an issue.

Um but it's simple as that. Now, we can also just go into our logs and into our messaging logs. So, here we see some of the tests that I've done. And this is the latest message that came in. So, we can see the accepted state. We can see sent. And we can see delivered within 1.5 seconds.

And then underneath the details, we can actually see the messaging ID, the direction, uh what it was sent to, from, different segments, the pricing, um and all of the information required to see exactly how your messages are delivered. That's it. Um setting up SMS. For the next video, we're actually going to be focusing on verification. So, we're going to be combining both email and SMS together to verify users who are creating an account. And uh well, I look forward to the next one.

## More Bird Integration series

- [Order confirmation emails](/en-it/learn/series/integration-order-emails) — 7:42
- [Verify phone numbers at signup](/en-it/learn/series/verify-signup) — 7:36

## Resources

- [Documentation](/en-it/docs)
- [Learn more about SMS](/en-it/products/sms)
