Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.winBack.buyer("BUYER_ID");<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->winBack->buyer('BUYER_ID');
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.winBack.buyer("BUYER_ID")
curl --request GET \
--url https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "ba7dde28-5c97-407e-beb8-009cee5397bf",
"email": "mira@example.com",
"customerId": "aa69d001-1621-42a1-823a-6d654e5d49cb",
"orders": 1,
"spent": 89,
"tags": [],
"state": "due",
"stopped": null,
"lastOrderId": "091f818e-ac4c-4244-982b-a03d345f0b1a",
"lastOrderAt": "2026-09-24T16:20:19Z",
"what": "Northwind Pro",
"nextStep": "first",
"dueAt": "2026-10-24T16:20:19Z",
"emailedAt": null,
"secondEmailAt": null,
"clickedAt": null,
"couponCode": null,
"couponExpiresAt": null,
"wonOrderId": null,
"wonAt": null,
"wonAfter": null,
"quietDays": null,
"unsubscribedAt": null
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Email Marketing
Get a Win-Back buyer
One buyer as “List Win-Back buyers” has them. What the winback. webhooks send.
Needs the marketing.read permission (Read Email Marketing).
GET
/
stores
/
{storeId}
/
win-back
/
buyers
/
{buyerId}
Node.js
import Shoply from "@shoplygg/node";
const shoply = new Shoply({ apiKey: process.env.SHOPLY_API_KEY });
const result = await shoply.winBack.buyer("BUYER_ID");<?php
require 'vendor/autoload.php';
$shoply = new Shoply\Client(['apiKey' => getenv('SHOPLY_API_KEY')]);
$result = $shoply->winBack->buyer('BUYER_ID');
import shoply
client = shoply.Client() # reads SHOPLY_API_KEY
result = client.winBack.buyer("BUYER_ID")
curl --request GET \
--url https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/win-back/buyers/{buyerId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"id": "ba7dde28-5c97-407e-beb8-009cee5397bf",
"email": "mira@example.com",
"customerId": "aa69d001-1621-42a1-823a-6d654e5d49cb",
"orders": 1,
"spent": 89,
"tags": [],
"state": "due",
"stopped": null,
"lastOrderId": "091f818e-ac4c-4244-982b-a03d345f0b1a",
"lastOrderAt": "2026-09-24T16:20:19Z",
"what": "Northwind Pro",
"nextStep": "first",
"dueAt": "2026-10-24T16:20:19Z",
"emailedAt": null,
"secondEmailAt": null,
"clickedAt": null,
"couponCode": null,
"couponExpiresAt": null,
"wonOrderId": null,
"wonAt": null,
"wonAfter": null,
"quietDays": null,
"unsubscribedAt": null
}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A secret API key, made under Developers in the dashboard: Authorization: Bearer shoply_sk_...
Path Parameters
The store's ID. A key reaches the store it was made in: GET /key answers which.
The buyer's row, its id in the list.

