{"openapi":"3.1.0","info":{"title":"Loyaltey REST API","version":"1.0.0","description":"Read and write loyalty data: customers, programs, cards, stamps, redemptions and POS lookup.\n\nAPI access is included on the Pro and Enterprise plans.\n\nRate limit: 100 requests per hour per API key; over the limit the API answers 429 with Retry-After.\n\nWebhook events: customer.created, card.created, stamp.added, card.completed, redemption.created, order.paid, order.shipped, order.delivered, order.cancelled.\n\nHuman-readable reference: https://loyaltey.com/developers","contact":{"name":"Loyaltey support","email":"support@loyaltey.com","url":"https://loyaltey.com/developers"}},"servers":[{"url":"https://loyaltey.com/api/v1"}],"tags":[{"name":"Customers","description":"Loyalty members of your business."},{"name":"Programs","description":"Stamp and points programs."},{"name":"Cards and stamps","description":"A customer’s card in a program, and the stamps on it."},{"name":"Redemptions","description":"Rewards customers have claimed."},{"name":"POS lookup","description":"For point-of-sale integrations that identify members at checkout."}],"paths":{"/customers":{"get":{"tags":["Customers"],"summary":"List customers, with search, sorting and pagination.","description":"Requires scope `customers:read`.","security":[{"ApiKeyAuth":["customers:read"]}],"x-required-scope":"customers:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"tags":["Customers"],"summary":"Create a customer.","description":"Requires scope `customers:write`.","security":[{"ApiKeyAuth":["customers:write"]}],"x-required-scope":"customers:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/customers/{id}":{"get":{"tags":["Customers"],"summary":"Get one customer.","description":"Requires scope `customers:read`.","security":[{"ApiKeyAuth":["customers:read"]}],"x-required-scope":"customers:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"tags":["Customers"],"summary":"Update your business’s display name, notes and tags for a customer. Email, phone and name belong to the customer.","description":"Requires scope `customers:write`.","security":[{"ApiKeyAuth":["customers:write"]}],"x-required-scope":"customers:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}},"delete":{"tags":["Customers"],"summary":"Erase a customer’s data at your business.","description":"Requires scope `customers:write`.","security":[{"ApiKeyAuth":["customers:write"]}],"x-required-scope":"customers:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]}},"/programs":{"get":{"tags":["Programs"],"summary":"List programs.","description":"Requires scope `programs:read`.","security":[{"ApiKeyAuth":["programs:read"]}],"x-required-scope":"programs:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"tags":["Programs"],"summary":"Create a program.","description":"Requires scope `programs:write`.","security":[{"ApiKeyAuth":["programs:write"]}],"x-required-scope":"programs:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/cards":{"get":{"tags":["Cards and stamps"],"summary":"List loyalty cards.","description":"Requires scope `cards:read`.","security":[{"ApiKeyAuth":["cards:read"]}],"x-required-scope":"cards:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"tags":["Cards and stamps"],"summary":"Enroll a customer in a program.","description":"Requires scope `cards:write`.","security":[{"ApiKeyAuth":["cards:write"]}],"x-required-scope":"cards:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/cards/{id}":{"get":{"tags":["Cards and stamps"],"summary":"Get one card with its balance.","description":"Requires scope `cards:read`.","security":[{"ApiKeyAuth":["cards:read"]}],"x-required-scope":"cards:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}]},"put":{"tags":["Cards and stamps"],"summary":"Update a card.","description":"Requires scope `cards:write`.","security":[{"ApiKeyAuth":["cards:write"]}],"x-required-scope":"cards:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/cards/{id}/stamps":{"post":{"tags":["Cards and stamps"],"summary":"Award stamps or points to a card.","description":"Requires scope `stamps:write`.","security":[{"ApiKeyAuth":["stamps:write"]}],"x-required-scope":"stamps:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/redemptions":{"get":{"tags":["Redemptions"],"summary":"List redemptions.","description":"Requires scope `redemptions:read`.","security":[{"ApiKeyAuth":["redemptions:read"]}],"x-required-scope":"redemptions:read","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1}}]},"post":{"tags":["Redemptions"],"summary":"Redeem a completed card.","description":"Requires scope `redemptions:write`.","security":[{"ApiKeyAuth":["redemptions:write"]}],"x-required-scope":"redemptions:write","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/pos/lookup":{"get":{"tags":["POS lookup"],"summary":"Look up a member by identifier.","description":"Requires scope `pos:lookup`.","security":[{"ApiKeyAuth":["pos:lookup"]}],"x-required-scope":"pos:lookup","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"http","scheme":"bearer","description":"Business API key (lp_live_… or lp_test_…) created under Integrations → API. Each key carries scopes.","x-scopes":{"customers:read":"Scope customers:read","customers:write":"Scope customers:write","programs:read":"Scope programs:read","programs:write":"Scope programs:write","cards:read":"Scope cards:read","cards:write":"Scope cards:write","stamps:write":"Scope stamps:write","redemptions:read":"Scope redemptions:read","redemptions:write":"Scope redemptions:write","pos:lookup":"Scope pos:lookup"}}},"responses":{"Error":{"description":"Missing or invalid API key, or a scope the key does not have","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"RateLimited":{"description":"Rate limit exceeded","headers":{"Retry-After":{"schema":{"type":"integer"},"description":"Seconds until the next request is allowed"},"X-RateLimit-Limit":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}},"X-RateLimit-Reset":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}