POST/api/v1/shop

Create Shop

A shop is a set of specific parameters that form a request to extract fares. A shop will have parameters like route, source, horizon of days to extract, etc. The user gets to include the requirement details of “what” and “how” the shopping to be done.

This API method serves the purpose of adding a new flight shop to the user's system. It offers a convenient way to specify the required parameters. Upon a successful request, the system will create the new shop and provide a confirmation response with shops unique ID.
POST/api/v1/shop

Mandatory Fields

  • _OD: Origin-Destination pairs for the shop. Format: JFKLAX|LAXJFK. Multiple pairs separated by |.
  • _sources: Source IDs associated with the shop. Multiple sources separated by |.
  • _alternateSources: Alternate source IDs for the shop. Multiple sources separated by |.
  • _cabinClasses: Cabin class IDs associated with the shop. Multiple values separated by |.
  • _carriers: Carrier IDs associated with the shop. Multiple values separated by |.
  • isRoundTrip: Boolean value indicating round-trip (true/false).
  • los: Length of stay for the trip. Must be a number.
  • horizons: Time frame for fare extraction. Supports date, date range, or number range separated by |.
  • pax: Number of adult passengers. Must be a valid number.
  • noOfStops: Number of stops. Allowed values: 0, 1, 2, 3, 3+.
  • fareType: Fare type. Options: Regular, Defence, Doctors, Senior Citizen, Students.
  • duration_hour: Flight duration in hours.
  • duration_minute: Flight duration in minutes.
  • startDate: Shop activity start date in YYYY-MM-DD format.
  • _pos: Point of sale associated with the shop. Must be active.
  • _currency: Currency used for fare extraction. Must be active.
  • shopName: Unique name of the shop.
  • deliveryMode: Delivery mode. Options: Webhook, db. Multiple values separated by |.
  • isActiveStatus: Boolean value indicating whether the shop is active.

Optional Fields

  • _carriers: The ID of the carriers associated with the shop. Multiple carriers should be separated by a comma(,).

Note

When Brand (Direct) is selected as source, The carriers should not be provided.

Parameter Details

NameInTypeRequiredDescription
bodybodyRequirednone

Responses

StatusMeaningDescriptionSchema
200OKSuccess
400Bad RequestRequest data failed validation(s)None
401UnauthorizedAuthentication Failed!None
429Too Many RequestsToo Many Requests.None
500Internal Server ErrorInternal Server ErrorNone

Example Request

# You can also use wget
curl -X POST /api/v1/shop \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: API_KEY'

Body parameter

{
  "_OD": [
    {
      "_flyFrom": "62b943e4dd59913b61a6b15b",
      "_flyTo": "62b943e4dd59913b61a6b15c"
    }
  ],
  "_sources": [
    "6239aec26c3c588d8f64ecfc"
  ],
  "_alternateSources": [
    "61515e50b77f75890e8acbaf"
  ],
  "_cabinClasses": [
    "6013a6abf553c71d4dfbe92d"
  ],
  "_carriers": [
    "6013a6abf553c71d4dfbe92d"
  ],
  "isRoundTrip": false,
  "los": 1,
  "horizons": [
    "0",
    "3-10",
    "02/05/2025",
    "10/06/2025-10/08/2025"
  ],
  "pax": {
    "adults": 1,
    "infants": 0,
    "children": 0
  },
  "noOfStops": "1",
  "duration": {
    "hour": 40,
    "minute": 30
  },
  "fareType": "Doctors",
  "startDate": "2019-08-24",
  "_pos": "62a2e3ca581567e3cd67ce1a",
  "_currency": "5fa104806304832acf9c67f5",
  "shopName": "Flightshop name",
  "deliveryMode": [
    "db"
  ],
  "isActiveStatus": true
}

Example responses

200 Response
{
  "error": false,
  "shop": {
    "_OD": [
      {
        "OD": "MAKZIA",
        "_flyFrom": "62b943e4dd59913b61a6b15b",
        "_flyTo": "62b943e4dd59913b61a6b15c"
      }
    ],
    "_sources": [
      "6239aec26c3c588d8f64ecfc"
    ],
    "_alternateSources": [
      "61515e50b77f75890e8acbaf"
    ],
    "_cabinClasses": [
      "6013a6abf553c71d4dfbe92d"
    ],
    "_carriers": [
      "6013a6abf553c71d4dfbe92d"
    ],
    "isRoundTrip": true,
    "horizons": [
      "0",
      "3-10",
      "02/05/2025",
      "10/06/2025-10/08/2025"
    ],
    "pax": {
      "adults": 1,
      "children": 0,
      "infants": 0
    },
    "duration": {
      "hour": 30,
      "minute": 35
    },
    "fareType": "Doctors",
    "noOfStops": "1",
    "startDate": "2019-08-24",
    "_pos": "62a2e3ca581567e3cd67ce1a",
    "_currency": "5fa104806304832acf9c67f5",
    "shopName": "Flightshop name",
    "_user": "6411b27b79d2c995fc689c4b",
    "userName": "user@flightrates.com",
    "vertical": "flightrates",
    "posName": "POS/123",
    "los": 1,
    "deliveryMode": [
      "db"
    ],
    "isActiveStatus": true,
    "_id": "64b7c6c54c5f10de6f433ca6",
    "isCustomerCreated": true,
    "createdAt": "2023-03-10T06:30:25.288Z",
    "id": "640ace815353bdb6454e191b"
  }
}

Need Support?

Our team is here to help you integrate and make the most of our APIs. Get in touch for technical support, custom solutions, or any questions.