diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCart.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCart.yaml index 9ec4dc1c9f..6cd3dc8a0d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreCart.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCart.yaml @@ -2,6 +2,7 @@ type: object description: The cart's details. x-schemaName: StoreCart required: + - promotions - currency_code - id - original_item_total @@ -175,3 +176,8 @@ properties: type: number title: original_shipping_tax_total description: The total taxes applied on the cart's shipping amount. + promotions: + type: array + description: The cart's promotions. + items: + $ref: ./StoreCartPromotion.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartAddPromotion.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartAddPromotion.yaml new file mode 100644 index 0000000000..596cef4cfc --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartAddPromotion.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion's details. +required: + - promo_codes +properties: + promo_codes: + type: array + description: Promotion codes to add to the cart. + items: + type: string + title: promo_codes + description: A promotion code. +x-schemaName: StoreCartAddPromotion diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartPromotion.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartPromotion.yaml new file mode 100644 index 0000000000..76413abea2 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartPromotion.yaml @@ -0,0 +1,40 @@ +type: object +description: The promotion's promotions. +x-schemaName: StoreCartPromotion +required: + - id +properties: + id: + type: string + title: id + description: The promotion's ID. + code: + type: string + title: code + description: The promotion's code. + is_automatic: + type: boolean + title: is_automatic + description: The promotion's is automatic. + application_method: + type: object + description: The promotion's application method. + required: + - value + - type + - currency_code + properties: + value: + type: string + title: value + description: The application method's value. + type: + type: string + description: The application method's type. + enum: + - fixed + - percentage + currency_code: + type: string + title: currency_code + description: The application method's currency code. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 8b6e370ae6..b6964e792c 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -60815,6 +60815,7 @@ components: description: The cart's details. x-schemaName: StoreCart required: + - promotions - currency_code - id - original_item_total @@ -60985,6 +60986,25 @@ components: type: number title: original_shipping_tax_total description: The total taxes applied on the cart's shipping amount. + promotions: + type: array + description: The cart's promotions. + items: + $ref: '#/components/schemas/StoreCartPromotion' + StoreCartAddPromotion: + type: object + description: The promotion's details. + required: + - promo_codes + properties: + promo_codes: + type: array + description: Promotion codes to add to the cart. + items: + type: string + title: promo_codes + description: A promotion code. + x-schemaName: StoreCartAddPromotion StoreCartAddress: type: object description: The address's details. @@ -61395,6 +61415,47 @@ components: type: number title: discount_tax_total description: The total taxes applied on the discounted amount. + StoreCartPromotion: + type: object + description: The promotion's promotions. + x-schemaName: StoreCartPromotion + required: + - id + properties: + id: + type: string + title: id + description: The promotion's ID. + code: + type: string + title: code + description: The promotion's code. + is_automatic: + type: boolean + title: is_automatic + description: The promotion's is automatic. + application_method: + type: object + description: The promotion's application method. + required: + - value + - type + - currency_code + properties: + value: + type: string + title: value + description: The application method's value. + type: + type: string + description: The application method's type. + enum: + - fixed + - percentage + currency_code: + type: string + title: currency_code + description: The application method's currency code. StoreCartResponse: type: object description: The cart's details. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCart.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCart.yaml index 9ec4dc1c9f..6cd3dc8a0d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreCart.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCart.yaml @@ -2,6 +2,7 @@ type: object description: The cart's details. x-schemaName: StoreCart required: + - promotions - currency_code - id - original_item_total @@ -175,3 +176,8 @@ properties: type: number title: original_shipping_tax_total description: The total taxes applied on the cart's shipping amount. + promotions: + type: array + description: The cart's promotions. + items: + $ref: ./StoreCartPromotion.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartAddPromotion.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartAddPromotion.yaml new file mode 100644 index 0000000000..596cef4cfc --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartAddPromotion.yaml @@ -0,0 +1,13 @@ +type: object +description: The promotion's details. +required: + - promo_codes +properties: + promo_codes: + type: array + description: Promotion codes to add to the cart. + items: + type: string + title: promo_codes + description: A promotion code. +x-schemaName: StoreCartAddPromotion diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartPromotion.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartPromotion.yaml new file mode 100644 index 0000000000..76413abea2 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartPromotion.yaml @@ -0,0 +1,40 @@ +type: object +description: The promotion's promotions. +x-schemaName: StoreCartPromotion +required: + - id +properties: + id: + type: string + title: id + description: The promotion's ID. + code: + type: string + title: code + description: The promotion's code. + is_automatic: + type: boolean + title: is_automatic + description: The promotion's is automatic. + application_method: + type: object + description: The promotion's application method. + required: + - value + - type + - currency_code + properties: + value: + type: string + title: value + description: The application method's value. + type: + type: string + description: The application method's type. + enum: + - fixed + - percentage + currency_code: + type: string + title: currency_code + description: The application method's currency code. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index c2302ca6c8..1f0945d779 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -1228,18 +1228,7 @@ paths: content: application/json: schema: - type: object - description: The promotion's details. - required: - - promo_codes - properties: - promo_codes: - type: array - description: Promotion codes to add to the cart. - items: - type: string - title: promo_codes - description: A promotion code. + $ref: '#/components/schemas/StoreCartAddPromotion' x-codeSamples: - lang: Shell label: cURL @@ -24762,6 +24751,7 @@ components: description: The cart's details. x-schemaName: StoreCart required: + - promotions - currency_code - id - original_item_total @@ -24932,6 +24922,25 @@ components: type: number title: original_shipping_tax_total description: The total taxes applied on the cart's shipping amount. + promotions: + type: array + description: The cart's promotions. + items: + $ref: '#/components/schemas/StoreCartPromotion' + StoreCartAddPromotion: + type: object + description: The promotion's details. + required: + - promo_codes + properties: + promo_codes: + type: array + description: Promotion codes to add to the cart. + items: + type: string + title: promo_codes + description: A promotion code. + x-schemaName: StoreCartAddPromotion StoreCartAddress: type: object description: The address's details. @@ -25342,6 +25351,47 @@ components: type: number title: discount_tax_total description: The total taxes applied on the discounted amount. + StoreCartPromotion: + type: object + description: The promotion's promotions. + x-schemaName: StoreCartPromotion + required: + - id + properties: + id: + type: string + title: id + description: The promotion's ID. + code: + type: string + title: code + description: The promotion's code. + is_automatic: + type: boolean + title: is_automatic + description: The promotion's is automatic. + application_method: + type: object + description: The promotion's application method. + required: + - value + - type + - currency_code + properties: + value: + type: string + title: value + description: The application method's value. + type: + type: string + description: The application method's type. + enum: + - fixed + - percentage + currency_code: + type: string + title: currency_code + description: The application method's currency code. StoreCartResponse: type: object description: The cart's details. diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml index 5fedae058c..6c49306c91 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_promotions.yaml @@ -41,18 +41,7 @@ post: content: application/json: schema: - type: object - description: The promotion's details. - required: - - promo_codes - properties: - promo_codes: - type: array - description: Promotion codes to add to the cart. - items: - type: string - title: promo_codes - description: A promotion code. + $ref: ../components/schemas/StoreCartAddPromotion.yaml x-codeSamples: - lang: Shell label: cURL diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts index ca50f4f6de..0a1bc2499f 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id].ts @@ -2,7 +2,9 @@ * @oas [post] /store/carts/{id} * operationId: PostCartsId * summary: Update a Cart - * description: Update a cart's details. This unsets the payment methods chosen before, and the customer would have to choose them again. Also, if the customer has chosen a shipping method whose option isn't valid for the cart's shipping address anymore, the shipping method will be unset. For example, if the shipping option is valid only in the US geo zone, and the shipping address's country code is `DE`, the shipping method will be unset. + * description: Update a cart's details. This unsets the payment methods chosen before, and the customer would have to choose them again. Also, if the customer has chosen a shipping method whose option + * isn't valid for the cart's shipping address anymore, the shipping method will be unset. For example, if the shipping option is valid only in the US geo zone, and the shipping address's country code + * is `DE`, the shipping method will be unset. * x-authenticated: false * parameters: * - name: id diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_promotions.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_promotions.ts index 8ca8a79620..9c53a52b63 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_promotions.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_promotions.ts @@ -36,18 +36,7 @@ * content: * application/json: * schema: - * type: object - * description: The promotion's details. - * required: - * - promo_codes - * properties: - * promo_codes: - * type: array - * description: Promotion codes to add to the cart. - * items: - * type: string - * title: promo_codes - * description: A promotion code. + * $ref: "#/components/schemas/StoreCartAddPromotion" * x-codeSamples: * - lang: Shell * label: cURL diff --git a/www/utils/generated/oas-output/schemas/StoreCart.ts b/www/utils/generated/oas-output/schemas/StoreCart.ts index 61aae0b093..2a0b21610e 100644 --- a/www/utils/generated/oas-output/schemas/StoreCart.ts +++ b/www/utils/generated/oas-output/schemas/StoreCart.ts @@ -4,6 +4,7 @@ * description: The cart's details. * x-schemaName: StoreCart * required: + * - promotions * - currency_code * - id * - original_item_total @@ -174,6 +175,11 @@ * type: number * title: original_shipping_tax_total * description: The total taxes applied on the cart's shipping amount. + * promotions: + * type: array + * description: The cart's promotions. + * items: + * $ref: "#/components/schemas/StoreCartPromotion" * */ diff --git a/www/utils/generated/oas-output/schemas/StoreCartAddPromotion.ts b/www/utils/generated/oas-output/schemas/StoreCartAddPromotion.ts new file mode 100644 index 0000000000..240033cac8 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCartAddPromotion.ts @@ -0,0 +1,18 @@ +/** + * @schema StoreCartAddPromotion + * type: object + * description: The promotion's details. + * required: + * - promo_codes + * properties: + * promo_codes: + * type: array + * description: Promotion codes to add to the cart. + * items: + * type: string + * title: promo_codes + * description: A promotion code. + * x-schemaName: StoreCartAddPromotion + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreCartPromotion.ts b/www/utils/generated/oas-output/schemas/StoreCartPromotion.ts new file mode 100644 index 0000000000..7f276680d3 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreCartPromotion.ts @@ -0,0 +1,45 @@ +/** + * @schema StoreCartPromotion + * type: object + * description: The promotion's promotions. + * x-schemaName: StoreCartPromotion + * required: + * - id + * properties: + * id: + * type: string + * title: id + * description: The promotion's ID. + * code: + * type: string + * title: code + * description: The promotion's code. + * is_automatic: + * type: boolean + * title: is_automatic + * description: The promotion's is automatic. + * application_method: + * type: object + * description: The promotion's application method. + * required: + * - value + * - type + * - currency_code + * properties: + * value: + * type: string + * title: value + * description: The application method's value. + * type: + * type: string + * description: The application method's type. + * enum: + * - fixed + * - percentage + * currency_code: + * type: string + * title: currency_code + * description: The application method's currency code. + * +*/ +