Shops API
POST /v1/shops: send a shop's profile and install source.
Tell Apps Patrol about a shop: its profile and where the install came from. Call it once after install or sign-in; calling it again updates the profile.
Request
POST https://www.apps-patrol.com/v1/shops
Authorization: Bearer <ingest key>
Content-Type: application/json
{
"shop": "example.myshopify.com",
"name": "Example Store",
"country": "DE",
"shopify_plan": "basic",
"email": "owner@example.com",
"source": "app_store",
"utm": {
"utm_source": "newsletter",
"utm_medium": "email",
"utm_campaign": "launch"
}
}
Fields
| Field | Required | Description |
|---|---|---|
shop | Yes | The shop's *.myshopify.com domain. |
name | No | Store name. |
country | No | Two-letter country code. |
shopify_plan | No | The merchant's Shopify plan. |
email | No | Store contact email. Sending it does not subscribe anyone to email; see Emails. |
source | No | Where the install came from. Only the first value is kept. |
utm | No | Object with any of utm_source, utm_medium, utm_campaign, utm_content, utm_term. Other keys are dropped. |
What it does
- Creates the shop if it is new and updates the profile fields you send. Empty fields are ignored.
- Creates an installation for your app if there is none, as active with the current time.
- If another organization also has this shop installed, only fields that are still empty are filled in.
Responses
| Status | Body | Meaning |
|---|---|---|
202 | {"shop": "example.myshopify.com"} | Stored. |
422 | invalid_shop | Missing or invalid shop. |
401 | unauthorized | Missing, wrong or rotated ingest key. |
429 | rate_limited | Too many requests this minute. The limit is shared with the Events API. |
Text fields are cut at 255 characters. With the header X-Apps-Patrol-Test: true the request is validated and nothing is stored; the response is {"shop": "…", "test": true}.
Example
curl -X POST https://www.apps-patrol.com/v1/shops \
-H "Authorization: Bearer $APPS_PATROL_KEY" \
-H "Content-Type: application/json" \
-d '{"shop":"example.myshopify.com","name":"Example Store","country":"DE","source":"app_store"}'