Skip to content

REST API

You can use the Storelayer API directly with any HTTP client. No SDK required.

https://api.storelayer.io/v1

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY
import requests
BASE_URL = "https://api.storelayer.io/v1"
HEADERS = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
}
# Create a customer
response = requests.post(
f"{BASE_URL}/customers",
headers=HEADERS,
json={"email": "[email protected]", "name": "Jane Doe"},
)
customer = response.json()["data"]
# Credit points
requests.post(
f"{BASE_URL}/wallets/{customer['id']}/credit",
headers=HEADERS,
json={"amount": 500, "reason": "Welcome bonus"},
)
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"email": "[email protected]",
"name": "Jane Doe",
})
req, _ := http.NewRequest("POST",
"https://api.storelayer.io/v1/customers",
bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
}