/

to search

#Storefront APIs

The Storefront resource defines geographic locations for inventory storage and operations—like, warehouses or customer facing stores—via which order fulfilment is done.

The Storefront APIs can be use to—

  1. Create a storefront for a seller
  2. Get details for a storefront
  3. Update details for a storefront
  4. Delete a storefront

#Create a storefront for a seller

This API creates a new storefront instance for a seller. Please note that a seller should already exist (using the Create seller API), as a storefront can only exist against a seller.

Sample Request

MethodPOST
Path/api/storefront

Sample Request Body

{
"storefront_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"setu_seller_id": "592",
"name": "Setu Infatry Road Branch",
"categories": ["F&B"],
"pickup_details": {
"pickup_name": "Pickup A",
"email": "ondc@setu.co",
"pickup_phone": "+919654198036",
"pickup_pincode": "122003",
"pickup_address": "House No. 12, Random Marg, Saket",
"pickup_city": "Delhi",
"pickup_state": "Delhi",
"pickup_country": "India",
"pickup_lat": null,
"pickup_long": null
},
"serviceability": {
"radius": 10,
"pincodes": [
0
]
},
"billing_details": {
"legal_details": {
"incorporation_name": "Broken Tusk Technologies Private Limited",
"incorporation_type": "PRLC",
"gstin": "24AAACC1206D1ZM",
"pan": "FBOPS2165C"
},
"registered_address": {
"address_line_1": "House No. 12, Random Marg, Saket",
"address_line_2": null,
"pincode": "122003",
"city": "Delhi",
"state": "Delhi"
},
"contact_detail": {
"phone": "+919654198036",
"email": "ondc@seut.co"
},
"bank_account": {
"account_number": "12482883913",
"ifsc_code": "HDFC00109202",
}
},
"business_hours": {
"monday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"tuesday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"wednesday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"thursday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"friday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"saturday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"sunday": null
},
"policies": {
"accept_orders_outside_business_hours": true
},
"fulfilment": "SELF_SHIP",
}

Few things to note while invoking this API -

  1. Only call this API with a valid setu_seller_id and a unique storefront_id
  2. The categories associated with the storefront can only be a subset of those mentioned for the associated seller. For e.g., if the associated seller operates in F&B and Grocery categories, then the storefront can specify F&B or Grocery or both.
  3. pickup_details signifies the geographic location of the storefront. These details are visible throughout the ONDC network.
    1. pickup_lat and pickup_long are optional, but can be used combination with radius to define serviceability for hyperlocal deliveries. If you choose to define serviceability in terms of radius then also specify the storefront’s pickup_lat and pickup_long .
  4. It is possible that a storefront has different billing details as compared to its associated seller. For e.g., franchises of a seller. So, we have allowed unique billing details per storefront. However, if your storefronts don’t have different billing details you can repeat the same details across all storefronts.
  5. business_hours is used to define the operational hours of the storefront. You can choose to have as many opening and closing slots for a day. However, do make sure your opening and closing time is logically consistent, say the opening time should always be before closing time.
  6. The accept_orders_outside_business_hours is used very closely with business_hours. Many eCommerce seller would like to accept 24/7 even though their storefront might not be operational 24/7. For such cases, set the "accept_orders_outside_business_hours": true
  7. fulfilment currently only accepts SELF_SHIP i.e. the seller app procures it’s own logistics.
  8. serviceability should either be defined using radius or a list of serviceable pincodes . serviceability cannot be defined on both radius and pincodes. Sellers operate in the hyperlocal context would typically like to define their serviceability using radius whereas sellers operating in the intercity context would like to define their serviceability using pincodes . Lastly, users will only be show the storefront’s catalogue if the storefront services their location.

Sample Response

{
"setu_storefront_id": 234
}

Make sure to store setu_storefront_id. The both the catalogue and orders resource is mapped to setu_storefront_id

#Get details for a storefront

Pass the storefront_id as a parameter in the URL, to get all information related to the storefront.

Sample Request

MethodGET
Path/api/storefront/<storefront_id>

Sample Response

{
"storefront_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"setu_seller_id": "592",
"name": "Setu Infatry Road Branch",
"categories": ["F&B"],
"pickup_details": {
"pickup_name": "Pickup A",
"email": "ondc@setu.co",
"pickup_phone": "+919654198036",
"pickup_pincode": "122003",
"pickup_address": "House No. 12, Random Marg, Saket",
"pickup_city": "Delhi",
"pickup_state": "Delhi",
"pickup_country": "India",
"pickup_lat": null,
"pickup_long": null
},
"serviceability": {
"radius": 10,
"pincodes": [
0
]
},
"billing_details": {
"legal_details": {
"incorporation_name": "Broken Tusk Technologies Private Limited",
"incorporation_type": "PRLC",
"gstin": "24AAACC1206D1ZM",
"pan": "FBOPS2165C"
},
"registered_address": {
"address_line_1": "House No. 12, Random Marg, Saket",
"address_line_2": null,
"pincode": "122003",
"city": "Delhi",
"state": "Delhi"
},
"contact_detail": {
"phone": "+919654198036",
"email": "ondc@seut.co"
},
"bank_account": {
"account_number": "12482883913",
"ifsc_code": "HDFC00109202",
}
},
"business_hours": {
"monday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"tuesday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"wednesday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"thursday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"friday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"saturday": [
{
"opening": "09:00:00",
"closing": "13:00:00"
}
],
"sunday": null
},
"policies": {
"accept_orders_outside_business_hours": true
},
"fulfilment": "SELF_SHIP",
}

#Update details for a storefront

Update information related to a storefront. Unlike the seller resource where all details cannot be updated, the storefront resource allows updates to any parameter.

You only to share the information that needs to be updated. i.e. if you’d like to update the categories details of the storefront, only include the categories parameter in the request body. The following example shows how categories and name can be updated at the same time.

Sample Request

MethodUPDATE
Path/api/storefront/<storefront_id>

Sample Request Body

{
"categories": "",
"name": "",
}

Sample Response

204 - EMPTY RESPONSE

#Delete a storefront

Pass the setu_storefront_id as part of the URL to permanently delete a storefront from our system.

Sample Request

MethodDELETE
Path/api/storefront/<storefront_id>

Sample Response

204 - EMPTY RESPONSE

Was this page helpful?