Skip to content

Create the storefront repository

POST
/stores/{storeRef}/storefront/repo
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/stores/example/storefront/repo \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "name": "my-store-storefront", "private": true, "store_theme_id": "42" }'

Queues the creation of a GitHub repository in the connected account, filled with the latest storefront template. The work runs in the background: read the status route to follow it. The store needs an active GitHub connection first; without one the route answers 412. A store has one repository: it answers 409 while one exists or is being created, and a failed request can be retried. Use store_theme_id to name the theme the repository’s code deploys to. Needs the admin:store scope.

Required scopes: admin:store

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
name
required
string

Example

my-store-storefront
private
boolean
default: true
store_theme_id

The code or external theme the repo is for: written as storeThemeId in .ecomweb.json

string

Example

42
Media typeapplication/json
object
status
required

Always queued. Read the status route to follow the work.

string
Allowed values: queued

Example

{
"status": "queued"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The request conflicts with the resource’s current state.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}