apps.patrol docs

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

FieldRequiredDescription
shopYesThe shop's *.myshopify.com domain.
nameNoStore name.
countryNoTwo-letter country code.
shopify_planNoThe merchant's Shopify plan.
emailNoStore contact email. Sending it does not subscribe anyone to email; see Emails.
sourceNoWhere the install came from. Only the first value is kept.
utmNoObject 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

StatusBodyMeaning
202{"shop": "example.myshopify.com"}Stored.
422invalid_shopMissing or invalid shop.
401unauthorizedMissing, wrong or rotated ingest key.
429rate_limitedToo 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"}'