Send Save for Later email

Send an email containing a Save for Later link.

Request Parameters

🏷️ header · unmarked parameters are query params

ParameterTypeRequiredDescription
Locally-Api-Token 🏷️stringYesLocally API token must be passed in the header to authenticate the API consumer.
emailstringYesThe email address to send the product details to.
linkstringYesThe link to the product details page.

Example Request

curl --get 'https://www.locally.com/headless/api/1.0/sfl/email/send' \
--header 'Locally-Api-Token: {{API_TOKEN}}' \
--data-urlencode '[email protected]' \
--data-urlencode 'link=https://www.locally.com/product/12345/acme-trail-jacket'
const link = encodeURIComponent('https://www.locally.com/product/12345/acme-trail-jacket');

const response = await fetch(
  `https://www.locally.com/headless/api/1.0/sfl/email/[email protected]&link=${link}`,
  {
    headers: {
      'Locally-Api-Token': '{{API_TOKEN}}'
    }
  }
);
const data = await response.json();
import requests

response = requests.get(
    "https://www.locally.com/headless/api/1.0/sfl/email/send",
    headers={"Locally-Api-Token": "{{API_TOKEN}}"},
    params={
        "email": "[email protected]",
        "link": "https://www.locally.com/product/12345/acme-trail-jacket",
    },
)
data = response.json()

The link value must be URL-encoded and must point to a locally.com URL. Links on other domains fail validation and no email is sent (see the Validation Failed response example).

Example Response

{
  "success": true,
  "data": {
    "success": 1,
    "session": {
      "id": "abc999"
    }
  },
  "msg": ""
}
{
  "success": true,
  "data": {
    "success": 0,
    "error": "Invalid Domain URL",
    "session": {
      "id": "abc999"
    }
  },
  "msg": ""
}

Response Explanation

  • successtrue means the request was processed and stays true even when the email is rejected — check data.success for the send outcome; auth and server errors return false with an error_code.
  • data.success1 when the email was queued, 0 when the address or link failed validation; booleans inside data serialize as 1/0.
  • data.error — Reason the email was rejected; present only when data.success is 0 — one of Invalid email address, Invalid URL, Invalid Domain URL (link not on locally.com), Multiple links detected, or Unauthorized Redirect URL.
  • data.session.id — Session ID returned on every response. Pass it as the Locally-Api-Session-Id header on later calls to persist location and cart state; expired or missing IDs are replaced with fresh ones.
  • msg — Human-readable envelope message: an empty string on success, the error text when success is false (which also adds an error_code field).
Query Params
string
required

The email address to send the product details to.

string
required
Headers
string
required

Locally API token must be passed in the header to authenticate the API consumer

Responses
200

Successful

400

Bad Request

401

Unauthorized

402

Request Failed

403

Forbidden

404

Not Found

429

Too Many Requests

500

Server Error

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!