Customers

Campaigns

A Campaign is a targeted email marketing message sent to the members of a CustomerSegment. Campaigns can be scheduled in advance and track when they were sent. Campaign contents (localised subject and body) and send records (per-recipient delivery tracking) are managed as sub-resources of a campaign.

The Campaign object

Attributes

  • iduuidrequired

    The unique identifier of the campaign.

  • namestringrequired

    The display name of the campaign.

  • progressfloatrequirednullable

    The send progress of the campaign as a percentage (0–100). Only populated when status is in_progress; null otherwise.

  • scheduled_atdate-timerequirednullable

    The datetime at which this campaign is scheduled to be sent, or null if not yet scheduled.

  • segmentobjectrequirednullable

    A summary of the CustomerSegment this campaign is targeting, or null if no segment has been assigned.

  • sent_atdate-timerequirednullable

    The datetime at which this campaign was sent, or null if it has not yet been sent.

  • site_iduuidrequired
  • statusstringrequired

    The current send status of the campaign.

    • unsent — no send records exist yet.
    • in_progress — sends have been created but at least one has not yet been sent.
    • sent — all send records have been sent.
    Possible values:unsentin_progresssent
{
  "id": "00000000-0000-0000-0000-000000000000",
  "name": "Summer Promotion 2024",
  "progress": 42.5,
  "scheduled_at": "2026-01-15T09:30:00+00:00",
  "segment": {
    "id": "00000000-0000-0000-0000-000000000000",
    "name": "Premium Members"
  },
  "sent_at": "2026-01-15T09:30:00+00:00",
  "site_id": "00000000-0000-0000-0000-000000000000",
  "status": "unsent"
}
get/shop/customers/campaigns

List Campaigns

listCampaigns

Returns a paginated list of Campaigns for the given site.

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • site_iduuidrequired

    Filters campaigns that belong to the given site ID.

  • querystringoptional

    Filters campaigns whose name contains the given value.

  • sortstringoptional

    The field to sort results by. Prefix with - for descending order. Defaults to -created_at.

    Possible values:created_at-created_atupdated_at-updated_atscheduled_at-scheduled_atsent_at-sent_at
  • scheduled_at_fromdate-timeoptional

    Filters campaigns with a scheduled_at on or after the given datetime.

  • scheduled_at_todate-timeoptional

    Filters campaigns with a scheduled_at on or before the given datetime.

  • sent_at_fromdate-timeoptional

    Filters campaigns with a sent_at on or after the given datetime.

  • sent_at_todate-timeoptional

    Filters campaigns with a sent_at on or before the given datetime.

Responses

  • 200

    The campaigns were successfully retrieved.

  • 401

    The user is unauthenticated

post/shop/customers/campaigns

Create Campaign

createCampaign

Creates a new Campaign for the given site.

Request body

  • site_iduuidrequired

    The ID of the site this campaign belongs to.

  • namestringrequired

    The display name of the campaign.

  • segment_iduuidoptional

    The ID of the CustomerSegment to send this campaign to. Required when provided.

Responses

  • 201

    The campaign was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/shop/customers/campaigns/{campaignId}

Get Campaign

getCampaign

Returns the Campaign with the given ID.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Responses

  • 200

    The campaign was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/shop/customers/campaigns/{campaignId}

Update Campaign

updateCampaign

Updates the given Campaign.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Request body

  • namestringoptional

    The display name of the campaign.

  • segment_iduuidoptionalnullable

    The ID of the CustomerSegment to send this campaign to. Pass null to remove the assigned segment.

  • scheduled_atdate-timeoptionalnullable

    The datetime at which this campaign should be sent. Pass null to unschedule the campaign.

Responses

  • 200

    The campaign was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/shop/customers/campaigns/{campaignId}

Delete Campaign

deleteCampaign

Soft-deletes the given Campaign. Use the companion restoreCampaign endpoint to undo.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Responses

  • 204

    The Campaign was successfully soft-deleted.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/customers/campaigns/{campaignId}/copy

Copy Campaign

copyCampaign

Creates a copy of the given Campaign, duplicating its segment and content records. The copy is created in an unsent state with no scheduled_at or sent_at values. Optionally provide a name for the copy; defaults to the original campaign's name if omitted.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Request body

  • namestringoptional

    The display name for the copied campaign. Defaults to the original campaign's name if not provided.

Responses

  • 201

    The campaign was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

post/shop/customers/campaigns/{campaignId}/send

Send Campaign

actionSendCampaign

Queues the given Campaign for sending to all subscribed members of its associated CustomerSegment. Members with a non-null unsubscribed_at are excluded. Individual CampaignSend records are created for each recipient and processed asynchronously.

The CampaignContent used for each recipient's CampaignSend is selected based on the customer's preferred_locale, falling back to the site's locale if no CampaignContent exists for the customer's preferred locale.

Returns 202 Accepted immediately; use the listCampaignSends endpoint to track delivery progress.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Responses

  • 202

    The campaign has been queued for sending.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/customers/campaigns/{campaignId}/restore

Restore Campaign

restoreCampaign

Restores a soft-deleted Campaign. Partner to deleteCampaign.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Responses

  • 200

    The campaign was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/shop/customers/campaigns/{campaignId}/contents

List CampaignContents

listCampaignContents

Returns a paginated list of content records for the given Campaign.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • localestringoptional

    Filters content records for the given locale code.

  • querystringoptional

    Filters content records whose subject or body contains the given value.

Responses

  • 200

    The campaign contents were successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/customers/campaigns/{campaignId}/contents

Create CampaignContent

createCampaignContent

Creates a new content record for the given Campaign.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Request body

  • localestringrequired

    The BCP 47 locale code for this content variant.

  • subjectstringoptional

    The email subject line for this content variant.

  • contentstringoptional

    The email body content in markdown.

Responses

  • 201

    The campaign content was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

get/shop/customers/campaigns/{campaignId}/contents/{contentId}

Get CampaignContent

getCampaignContent

Returns the CampaignContent with the given ID.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

  • contentIduuidrequired

    The unique identifier of the campaign content.

Responses

  • 200

    The campaign content was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

put/shop/customers/campaigns/{campaignId}/contents/{contentId}

Update CampaignContent

updateCampaignContent

Updates the given CampaignContent.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

  • contentIduuidrequired

    The unique identifier of the campaign content.

Request body

  • subjectstringoptional

    The email subject line for this content variant.

  • contentstringoptional

    The email body content in markdown.

Responses

  • 200

    The campaign content was successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/shop/customers/campaigns/{campaignId}/contents/{contentId}

Delete CampaignContent

deleteCampaignContent

Permanently deletes the given CampaignContent.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

  • contentIduuidrequired

    The unique identifier of the campaign content.

Responses

  • 204

    The CampaignContent was successfully deleted.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/customers/campaigns/{campaignId}/contents/{contentId}/preview

Preview CampaignContent

actionPreviewCampaignContent

Renders a preview of the given CampaignContent, substituting the content body with the value supplied in the request body. Returns the rendered HTML as a plain string response.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

  • contentIduuidrequired

    The unique identifier of the campaign content.

Request body

  • contentstringrequired

    The Markdown email body content to render.

  • subjectstringoptional

    The email subject line to use in the preview.

Responses

  • 200

    The rendered HTML preview of the campaign content.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

get/shop/customers/campaigns/{campaignId}/sends

List CampaignSends

listCampaignSends

Returns a paginated list of send records for the given Campaign.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

Query parameters

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • querystringoptional

    Filters sends whose recipient customer name or email contains the given value.

  • sentbooleanoptional

    When true, only sends that have been sent are returned. When false, only unsent sends are returned.

  • failedbooleanoptional

    When true, only sends that have failed are returned. When false, only non-failed sends are returned.

  • bouncedbooleanoptional

    When true, only sends that have bounced are returned. When false, only non-bounced sends are returned.

Responses

  • 200

    The campaign sends were successfully retrieved.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

get/shop/customers/campaigns/{campaignId}/sends/{sendId}

Get CampaignSend

getCampaignSend

Returns the CampaignSend with the given ID. Requesting with an Accept: text/html header returns the rendered HTML body of the sent email instead, and responds with 404 if the send has no stored content to render.

Path parameters

  • campaignIduuidrequired

    The unique identifier of the campaign.

  • sendIduuidrequired

    The unique identifier of the campaign send.

Responses

  • 200

    The campaign send was successfully retrieved. Requesting with an Accept: text/html header returns the rendered email body as HTML instead of the CampaignSend record.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found