Create a store
const url = 'https://api.loyx.se/partners/v1/stores';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"address":{"city":"example","country":"example","postal_code":"example","region":"example","street1":"example","street2":"example"},"contact":{"email":"hello@example.com","phone":"example","website":"https://example.com"},"external_ids":{},"external_store_id":"example","geo":{"latitude":1,"longitude":1},"icon":{"content_type":"image/png","url":"https://example.com"},"logo":{"content_type":"image/png","url":"https://example.com"},"name":"example","org_number":"example","status":"active","tags":["example"],"timezone":"example","type":"physical","vat_number":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.loyx.se/partners/v1/stores \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "address": { "city": "example", "country": "example", "postal_code": "example", "region": "example", "street1": "example", "street2": "example" }, "contact": { "email": "hello@example.com", "phone": "example", "website": "https://example.com" }, "external_ids": {}, "external_store_id": "example", "geo": { "latitude": 1, "longitude": 1 }, "icon": { "content_type": "image/png", "url": "https://example.com" }, "logo": { "content_type": "image/png", "url": "https://example.com" }, "name": "example", "org_number": "example", "status": "active", "tags": [ "example" ], "timezone": "example", "type": "physical", "vat_number": "example" }'Create a new store for the authenticated company.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Request schema for creating a store.
address and geo are required for physical/pop_up stores, optional for online/warehouse stores.
object
object
GPS coordinate input.
object
Logo/icon URL reference.
object
Logo/icon URL reference.
object
Responses
Section titled “Responses”The created store.
Full store response — excludes company_id.
object
object
Geo location in response.
object
Media reference in response.
object
Media reference in response.
object
Example generated
{ "_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "address": { "city": "example", "country": "example", "postal_code": "example", "region": "example", "street1": "example", "street2": "example" }, "contact": { "email": "example", "phone": "example", "website": "example" }, "created_at": "2026-04-15T12:00:00Z", "external_ids": { "additionalProperty": "example" }, "external_store_id": "example", "geo": { "latitude": 1, "longitude": 1 }, "icon": { "content_type": "example", "url": "example" }, "logo": { "content_type": "example", "url": "example" }, "name": "example", "org_number": "example", "status": "example", "tags": [ "example" ], "timezone": "example", "type": "example", "updated_at": "2026-04-15T12:00:00Z", "vat_number": "example"}missing_token, invalid_authorization_header or invalid_token: get a new access token and retry once.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}insufficient_scope: the API key lacks the scope this route needs.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}A store with this external ID already exists.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}Validation Error
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}rate_limit_exceeded: wait Retry-After seconds.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}internal_server_error or database_error (type internal_error): our fault. Retry with backoff; quote request_id.
Standard error response format.
object
Error detail structure (Stripe-like format).
object
Machine-readable error code
One failing field of a validation error.
object
Why the value was refused
Dotted path of the field, e.g. items.0.unit_price.value
Human-readable error message
Error type category
Example generated
{ "error": { "code": "example", "details": [ { "message": "example", "param": "example" } ], "doc_url": "example", "message": "example", "param": "example", "type": "example" }, "request_id": "example"}