Badseller.net — знижки, промокоди та історія цін

Badseller.net — знижки, промокоди та історія цін · GPT Actions

Badseller API - Discounts by Shop

API for retrieving discounts from various shops.

  • GET /discounts/{shopSlug}Retrieve Discounts by Shop

    Fetches a list of active discounts available from the specified shop.

Original API schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "Badseller API - Discounts by Shop",
    "description": "API for retrieving discounts from various shops.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.badseller.net/api",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/discounts/{shopSlug}": {
      "get": {
        "operationId": "getDiscountsByShopSlug",
        "summary": "Retrieve Discounts by Shop",
        "description": "Fetches a list of active discounts available from the specified shop.",
        "parameters": [
          {
            "name": "shopSlug",
            "in": "path",
            "description": "The slug of the shop for which to retrieve discounts.",
            "required": true,
            "schema": {
              "type": "string",
              "example": "maudau"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of active discounts from the specified shop.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "shop": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "slug": {
                          "type": "string"
                        },
                        "description": {
                          "type": "string"
                        },
                        "logo": {
                          "type": "string",
                          "format": "uri"
                        },
                        "category": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "slug": {
                              "type": "string"
                            }
                          }
                        },
                        "rating": {
                          "type": "object",
                          "properties": {
                            "value": {
                              "type": "number"
                            },
                            "votesNumber": {
                              "type": "integer"
                            },
                            "userVote": {
                              "type": "integer",
                              "nullable": true
                            }
                          }
                        }
                      }
                    },
                    "discounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string",
                            "nullable": true
                          },
                          "code": {
                            "type": "string",
                            "nullable": true
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "percent",
                              "value",
                              "free_shipping",
                              "promotion"
                            ]
                          },
                          "discountPercent": {
                            "type": "integer",
                            "nullable": true
                          },
                          "discountValue": {
                            "type": "integer",
                            "nullable": true
                          },
                          "discountCurrency": {
                            "type": "string",
                            "nullable": true
                          },
                          "startAt": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "expireAt": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "isTopOffer": {
                            "type": "boolean"
                          },
                          "checkedAt": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true
                          },
                          "checkStatus": {
                            "type": "string",
                            "enum": [
                              "valid",
                              "invalid"
                            ]
                          }
                        }
                      }
                    },
                    "recommendedShops": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string",
                            "nullable": true
                          },
                          "logo": {
                            "type": "string",
                            "format": "uri"
                          },
                          "discountsCount": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The specified shop was not found."
          }
        }
      }
    }
  }
}