openapi: 3.2.0 info: title: LeafLink Product Promotion API version: '2022-10-31' description: 'This reference specification outlines all the available HTTP operations of the LeafLink API. See the [LeafLink Developer Hub](/api) for guides, how-to, and general information of the API. ' termsOfService: https://www.leaflink.com/terms-and-conditions/ contact: email: support@leaflink.com servers: - url: https://api.leaflink.com description: LeafLink API production URL. - url: https://staging-api.leaflink.com description: LeafLink API staging URL. security: - bearerAuth: [] tags: - name: Product Promotion paths: /product_promotions: get: operationId: product_promotions_list description: List multiple product promotions. summary: List Product Promotions parameters: - name: ordering required: false in: query description: Which field to use when ordering the results. schema: type: string - name: page required: false in: query description: A page number within the paginated result set. schema: type: integer - name: page_size required: false in: query description: Number of results to return per page. schema: type: integer - name: search required: false in: query description: A search term. schema: type: string - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Product Promotion security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginatedProductPromotionList' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. post: operationId: product_promotions_create description: Create a product promotion. summary: Create a Product Promotion tags: - Product Promotion requestBody: content: application/json: schema: $ref: '#/components/schemas/ProductPromotionRequest' required: true security: - bearerAuth: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/ProductPromotion' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. /product_promotions/{id}: get: operationId: product_promotions_retrieve description: Get a single product promotion. summary: Get a Product Promotion parameters: - in: path name: id schema: type: integer description: A unique integer value identifying this product promotion. required: true - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Product Promotion security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ProductPromotion' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. patch: operationId: product_promotions_partial_update description: Update a product promotion. summary: Update a Product Promotion parameters: - in: path name: id schema: type: integer description: A unique integer value identifying this product promotion. required: true - name: LeafLink-Version description: '[API version docs](/api/getting-started/#versioning)' required: false in: header schema: type: string format: date tags: - Product Promotion requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedProductPromotionRequest' security: - bearerAuth: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/ProductPromotion' description: '' headers: RateLimit-Limit: schema: type: integer description: The requests quota in the time window. RateLimit-Remaining: schema: type: integer description: The remaining requests quota in the current window. RateLimit-Reset: schema: type: integer description: The time remaining in the current window, specified in seconds. RateLimit-Policy: schema: type: string description: The quota policy information. '429': description: Rate Limit Error headers: Retry-After: schema: type: integer description: The time remaining before the rejected request can be tried again, specified in seconds. components: schemas: ProductPromotionRequest: type: object properties: moloco_id: type: string minLength: 1 status: $ref: '#/components/schemas/PromotionStatusEnum' period: allOf: - $ref: '#/components/schemas/PeriodEnum' default: Weekly start_date: type: string format: date end_date: type: - string - 'null' format: date max_cpc: type: object properties: amount: type: number currency: type: string max_budget: type: object properties: amount: type: number currency: type: string budget_per_period: type: object properties: amount: type: number currency: type: string approver_email: type: - string - 'null' format: email minLength: 1 brand_id: type: integer writeOnly: true company_id: type: integer writeOnly: true billing_company_id: type: integer writeOnly: true products: type: array items: type: integer required: - brand_id - budget_per_period - company_id - max_budget - max_cpc - products - start_date - status PatchedProductPromotionRequest: type: object properties: moloco_id: type: string minLength: 1 status: $ref: '#/components/schemas/PromotionStatusEnum' period: allOf: - $ref: '#/components/schemas/PeriodEnum' default: Weekly start_date: type: string format: date end_date: type: - string - 'null' format: date max_cpc: type: object properties: amount: type: number currency: type: string max_budget: type: object properties: amount: type: number currency: type: string budget_per_period: type: object properties: amount: type: number currency: type: string approver_email: type: - string - 'null' format: email minLength: 1 brand_id: type: integer writeOnly: true company_id: type: integer writeOnly: true billing_company_id: type: integer writeOnly: true products: type: array items: type: integer ProductPromotion: type: object properties: id: type: integer readOnly: true moloco_id: type: string status: $ref: '#/components/schemas/PromotionStatusEnum' period: allOf: - $ref: '#/components/schemas/PeriodEnum' default: Weekly start_date: type: string format: date end_date: type: - string - 'null' format: date max_cpc: type: object properties: amount: type: number currency: type: string max_budget: type: object properties: amount: type: number currency: type: string budget_per_period: type: object properties: amount: type: number currency: type: string approver_email: type: - string - 'null' format: email brand: allOf: - $ref: '#/components/schemas/UnifiedBrand' readOnly: true company: allOf: - $ref: '#/components/schemas/UnifiedCompany' readOnly: true billing_company: allOf: - $ref: '#/components/schemas/UnifiedCompany' readOnly: true products: type: array items: type: integer required: - billing_company - brand - budget_per_period - company - id - max_budget - max_cpc - products - start_date - status UnifiedBrand: type: object properties: id: type: integer readOnly: true name: type: string title: Brand Name description: Name of the Brand maxLength: 400 required: - id - name PromotionStatusEnum: enum: - Pending - Approved - Completed type: string PeriodEnum: enum: - Daily - Weekly - Monthly type: string PaginatedProductPromotionList: type: object required: - count - results properties: count: type: integer example: 123 next: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=4 previous: type: - string - 'null' format: uri example: http://api.example.org/accounts/?page=2 results: type: array items: $ref: '#/components/schemas/ProductPromotion' UnifiedCompany: type: object properties: id: type: integer readOnly: true name: type: string description: Name of Company (Note this is not the same as Brand) maxLength: 400 required: - id - name securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT description: 'Authentication is done via access tokens (JWTs). See the [API authentication doc](/api/getting-started/#authentication) for more information. ' tokenAuth: type: apiKey in: header name: Authorization description: Token-based authentication with required prefix "Token"