Create a market
How to create a market via API
To create a new market, send a POST request to the /api/markets endpoint, passing the resource arguments in the request body.
Request
POST https://yourdomain.commercelayer.io/api/markets
Arguments
type
string
Required
attributes.name
string
Required
attributes.code
string
Optional
attributes.facebook_pixel_id
string
Optional
attributes.checkout_url
string
Optional
attributes.external_prices_url
string
Optional
attributes.external_order_validation_url
string
Optional
attributes.shipping_cost_cutoff
integer
Optional, default is null
attributes._disable
boolean
Optional
attributes._enable
boolean
Optional
attributes.external_includes
array
Optional, default to resource specific list
attributes.reference
string
Optional
attributes.reference_origin
string
Optional
attributes.metadata
object
Optional
relationships.merchant
object
Required
relationships.price_list
object
Required
relationships.inventory_model
object
Required
relationships.subscription_model
object
Optional
relationships.discount_engine
object
Optional
relationships.tax_calculator
object
Optional
relationships.customer_group
object
Optional
relationships.geocoder
object
Optional
relationships.default_shipping_method
object
Optional
relationships.default_payment_method
object
Optional
Example
The following request creates a new market:
On success, the API responds with a 201 Created status code, returning the created resource object:
Last updated