Node.js
import { ShoplyCustomer } from "@shoplygg/node";
const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token });
const result = await buyer.affiliate.payouts.create({
amount: 25,
details: "PayPal: ada@example.com",
});
<?php
require 'vendor/autoload.php';
$buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token' => $token]);
$result = $buyer->affiliate->payouts->create([
'amount' => 25,
'details' => 'PayPal: ada@example.com',
]);
import shoply
buyer = shoply.Customer("YOUR_STORE_ID", token=token)
result = buyer.affiliate.payouts.create(amount=25, details="PayPal: ada@example.com")
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25,
"details": "PayPal: ada@example.com"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts"
payload := strings.NewReader("{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"member": true,
"canJoin": false,
"offered": {
"commission": 10,
"discount": 5
},
"active": true,
"code": "ada-keys",
"link": "https://northwind.myshoply.gg/?ref=ada-keys",
"linkStart": "https://northwind.myshoply.gg/?ref=",
"commission": 20,
"discount": 5,
"clicks": 0,
"orders": 0,
"earned": {
"amount": 0,
"currencyCode": "USD"
},
"balance": {
"amount": 7.5,
"currencyCode": "USD"
},
"paidOut": {
"amount": 0,
"currencyCode": "USD"
},
"can": {
"editLink": true,
"toStore": true,
"payouts": true
},
"payout": {
"id": "76868d15-1286-4aa1-9181-1034971e5bf9",
"amount": 5,
"currencyCode": "USD",
"details": "PayPal: ada@example.com",
"status": "requested",
"note": "",
"dateRequested": "2026-10-22T16:20:19Z",
"dateResolved": null
},
"payouts": [
{
"id": "76868d15-1286-4aa1-9181-1034971e5bf9",
"amount": 5,
"currencyCode": "USD",
"details": "PayPal: ada@example.com",
"status": "requested",
"note": "",
"dateRequested": "2026-10-22T16:20:19Z",
"dateResolved": null
}
],
"changes": [
{
"id": "22405d5e-68b8-45a2-88c7-87cd881975c1",
"kind": "payout",
"amount": -5,
"balanceAfter": 7.5,
"currencyCode": "USD",
"dateCreated": "2026-10-22T16:20:19Z"
},
{
"id": "6b4221ce-60ee-4856-99c2-8efe0af9321b",
"kind": "add",
"amount": 12.5,
"balanceAfter": 12.5,
"currencyCode": "USD",
"dateCreated": "2026-10-22T16:20:19Z"
}
],
"limits": {
"codeMin": 2,
"codeMax": 40,
"details": 300
}
}
}{
"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": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Customer API
Ask for a payout
Asks the seller to pay the affiliate, where the store allows payouts. The amount comes off their affiliate balance now and goes back if the seller declines or the request is taken back. One at a time. Shoply moves no money: the seller pays it and marks it paid.
Needs the buyer’s token: Authorization: Bearer shoply_ct_..., from Sign in with the code.
It is counted for the buyer’s token: 30 changes in ten minutes.
POST
/
stores
/
{storeId}
/
customer
/
affiliate
/
payouts
Node.js
import { ShoplyCustomer } from "@shoplygg/node";
const buyer = new ShoplyCustomer({ storeId: "YOUR_STORE_ID", token });
const result = await buyer.affiliate.payouts.create({
amount: 25,
details: "PayPal: ada@example.com",
});
<?php
require 'vendor/autoload.php';
$buyer = new Shoply\Customer(['storeId' => 'YOUR_STORE_ID', 'token' => $token]);
$result = $buyer->affiliate->payouts->create([
'amount' => 25,
'details' => 'PayPal: ada@example.com',
]);
import shoply
buyer = shoply.Customer("YOUR_STORE_ID", token=token)
result = buyer.affiliate.payouts.create(amount=25, details="PayPal: ada@example.com")
curl --request POST \
--url https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 25,
"details": "PayPal: ada@example.com"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts"
payload := strings.NewReader("{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.shoply.gg/v1/stores/{storeId}/customer/affiliate/payouts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 25,\n \"details\": \"PayPal: ada@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": null,
"code": null,
"data": {
"member": true,
"canJoin": false,
"offered": {
"commission": 10,
"discount": 5
},
"active": true,
"code": "ada-keys",
"link": "https://northwind.myshoply.gg/?ref=ada-keys",
"linkStart": "https://northwind.myshoply.gg/?ref=",
"commission": 20,
"discount": 5,
"clicks": 0,
"orders": 0,
"earned": {
"amount": 0,
"currencyCode": "USD"
},
"balance": {
"amount": 7.5,
"currencyCode": "USD"
},
"paidOut": {
"amount": 0,
"currencyCode": "USD"
},
"can": {
"editLink": true,
"toStore": true,
"payouts": true
},
"payout": {
"id": "76868d15-1286-4aa1-9181-1034971e5bf9",
"amount": 5,
"currencyCode": "USD",
"details": "PayPal: ada@example.com",
"status": "requested",
"note": "",
"dateRequested": "2026-10-22T16:20:19Z",
"dateResolved": null
},
"payouts": [
{
"id": "76868d15-1286-4aa1-9181-1034971e5bf9",
"amount": 5,
"currencyCode": "USD",
"details": "PayPal: ada@example.com",
"status": "requested",
"note": "",
"dateRequested": "2026-10-22T16:20:19Z",
"dateResolved": null
}
],
"changes": [
{
"id": "22405d5e-68b8-45a2-88c7-87cd881975c1",
"kind": "payout",
"amount": -5,
"balanceAfter": 7.5,
"currencyCode": "USD",
"dateCreated": "2026-10-22T16:20:19Z"
},
{
"id": "6b4221ce-60ee-4856-99c2-8efe0af9321b",
"kind": "add",
"amount": 12.5,
"balanceAfter": 12.5,
"currencyCode": "USD",
"dateCreated": "2026-10-22T16:20:19Z"
}
],
"limits": {
"codeMin": 2,
"codeMax": 40,
"details": 300
}
}
}{
"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": {}
}{
"success": false,
"message": "<string>",
"code": "<string>",
"data": null,
"errors": {}
}Authorizations
A buyer's token, from Sign in with the code: Authorization: Bearer shoply_ct_.... It reaches that buyer's own orders at one store, and no route that takes a key.
Path Parameters
The store's ID, from Settings, General in its dashboard. It is not a secret: a page may show it.
Body
application/json

