# Make

> Confirm customers' numbers in Make scenarios with the built-in HTTP and Webhooks modules.

> **Status:** there is no OTP.ps app in Make yet. Everything below uses Make's built-in modules and works today. It follows Make's documented modules, but OTP.ps hasn't run these scenarios inside Make itself.

## Scenario 1: when an order comes in

1. **Shopify → Watch Orders** (or **WooCommerce → Watch Orders**), with a filter: payment is cash on delivery.
2. **HTTP → Make an API Key Auth request**. Put your OTP.ps key in a keychain: "In" = Header, name `Authorization`, key `Bearer otp_live_…` (keychains keep it out of the scenario).
   - URL: `https://otp.ps/api/v1/verify/links`, method POST, body type Raw, content type JSON:

   ```json
   { "phone": "{{1.phone}}", "purpose": "order", "reference": "{{1.name}}", "delivery": "sms" }
   ```

   - Header `Idempotency-Key`: the order id, so a retried run never texts twice.
3. **Shopify → Add tag** `awaiting-phone-confirmation`.

## Scenario 2: when the customer confirms

1. **Webhooks → Custom webhook**. Copy its address and add it on the OTP.ps dashboard (**Webhooks**, event `link.approved`, live links).
2. **HTTP → Make an API Key Auth request**, `GET https://otp.ps/api/v1/verify/links/{{1.data.id}}` with the same keychain. Continue only if `status` = `approved`. This checks the event really came from OTP.ps; anyone who learned the webhook address could post to it.
3. **Shopify → Search orders** by name = `{{1.data.reference}}`, then **Update order** / **Add tag** `phone-confirmed`.

## Notes

- With a test key, use the [sandbox numbers](/docs/sandbox); nothing is sent.
- Make retries failed operations: the `Idempotency-Key` header keeps a retry from texting the customer twice.
