Sync your stores
Your stores are the physical locations where sales happen. Mirror them into Noticia so every sale, segment and dashboard is attributed to the right place. Stores are also a prerequisite for pushing sales events: a sale references a store, and the store must already exist.
Upsert a store
Section titled “Upsert a store”POST /v1/stores creates or updates a store, keyed on your own external_id. Re-sending the same external_id updates the same store.
curl https://api.sms.noticia.ai/v1/stores \ -X POST \ -H "x-api-key: ntca_REPLACE_ME" \ -H "Content-Type: application/json" \ -d '{ "external_id": "paris-rivoli-01", "name": "Paris Rivoli", "address": { "address_line1": "1 Rue de Rivoli", "postal_code": "75001", "locality": "Paris", "country_code": "FR" } }'await fetch('https://api.sms.noticia.ai/v1/stores', { method: 'POST', headers: { 'x-api-key': 'ntca_REPLACE_ME', 'Content-Type': 'application/json', }, body: JSON.stringify({ external_id: 'paris-rivoli-01', name: 'Paris Rivoli', address: { address_line1: '1 Rue de Rivoli', postal_code: '75001', locality: 'Paris', country_code: 'FR', }, }),});import requests
requests.post( "https://api.sms.noticia.ai/v1/stores", headers={"x-api-key": "ntca_REPLACE_ME"}, json={ "external_id": "paris-rivoli-01", "name": "Paris Rivoli", "address": { "address_line1": "1 Rue de Rivoli", "postal_code": "75001", "locality": "Paris", "country_code": "FR", }, },)A 201 Created (or 200 OK when the store already existed) returns the store with its prefixed store_ id.
Address fields
Section titled “Address fields”The address object requires address_line1, postal_code, locality, and country_code (ISO 3166-1 alpha-2). The rest are optional:
address_line2: building, floor, or suite.administrative_area1/administrative_area2: region and department or county, where relevant.
Keeping stores in sync
Section titled “Keeping stores in sync”Push a store on opening and whenever its details change (a rename, a move). Because the call is an upsert, it is safe to re-send the full list on a schedule. List your stores with GET /v1/stores and fetch one with GET /v1/stores/{store_id}.