From 3187bd7148d89e349cc5fd77a409ba7226d7bad9 Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 28 Apr 2026 09:54:42 -0500 Subject: [PATCH] feat: update order response schema to include discount, tax, and shipping lines with pagination --- _build/api.yaml | 313 ++++++++++++++++++++++++++---- schemas/orders/order_response.yml | 49 ++++- 2 files changed, 314 insertions(+), 48 deletions(-) diff --git a/_build/api.yaml b/_build/api.yaml index 9e0e3c7..7850f35 100644 --- a/_build/api.yaml +++ b/_build/api.yaml @@ -18966,45 +18966,245 @@ components: example: cus_23874283647 type: string title: customer_info_response - order_tax_response: + discount_lines_data_response: allOf: - - description: create new taxes for an existing order + - allOf: + - description: List of discounts that apply to the order. + properties: + amount: + description: "The amount to be deducted from the total sum of all payments,\ + \ in cents." + example: 500 + format: int64 + minimum: 0 + type: integer + code: + description: Discount code. + example: "123" + type: string + type: + description: "It can be 'loyalty', 'campaign', 'coupon' o 'sign'" + example: loyalty + type: string + required: + - amount + - code + - type + title: order_discount_lines_request + name: order_discount_lines_request + - properties: + id: + description: The discount line id + example: dis_lin_2tQQ58HPgPw7StE8z + type: string + object: + description: The object name + example: discount_line + type: string + parent_id: + description: The order id + example: ord_2tPAmKCEJqh8RE6nY + type: string + required: + - id + - object + - parent_id + title: discount_lines_response + title: discount_lines_data_response + order_discount_lines_response: + allOf: + - description: pagination metadata properties: - amount: - description: The amount to be collected for tax in cents - example: 100 - format: int64 - minimum: 0 - type: integer - description: - description: description or tax's name - example: testing - minLength: 2 + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean + object: + description: "Object type, in this case is list" + example: list type: string - metadata: - additionalProperties: true - example: - key: value - maxProperties: 100 - type: object required: - - amount - - description - title: order_tax_request + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 + type: string + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 + type: string + nullable: true + title: page metadata - properties: - id: - example: tax_lin_2tQ8dC5mg1UADmVPo + data: + items: + $ref: "#/components/schemas/discount_lines_data_response" + type: array + description: List of discounts that are applied to the order + title: order_discount_lines_response + nullable: true + tax_lines_data_response: + allOf: + - allOf: + - description: create new taxes for an existing order + properties: + amount: + description: The amount to be collected for tax in cents + example: 100 + format: int64 + minimum: 0 + type: integer + description: + description: description or tax's name + example: testing + minLength: 2 + type: string + metadata: + additionalProperties: true + example: + key: value + maxProperties: 100 + type: object + required: + - amount + - description + title: order_tax_request + - properties: + id: + example: tax_lin_2tQ8dC5mg1UADmVPo + type: string + object: + example: tax_line + type: string + parent_id: + example: ord_2tPAmKCEJqh8RE6nY + type: string + description: create new taxes for an existing order response + required: + - id + title: order_tax_response + title: tax_lines_data_response + order_tax_lines_response: + allOf: + - description: pagination metadata + properties: + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean + object: + description: "Object type, in this case is list" + example: list + type: string + required: + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 + type: string + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 type: string + nullable: true + title: page metadata + - properties: + data: + items: + $ref: "#/components/schemas/tax_lines_data_response" + type: array + description: List of taxes that are applied to the order + title: order_tax_lines_response + nullable: true + shipping_lines_data_response: + allOf: + - allOf: + - properties: + amount: + description: Shipping amount in cents + example: 100 + format: int64 + minimum: 0 + type: integer + carrier: + description: Carrier name for the shipment + example: FEDEX + type: string + tracking_number: + description: Tracking number can be used to track the shipment + example: TRACK123 + type: string + method: + description: Method of shipment + example: Same day + type: string + metadata: + additionalProperties: true + description: Hash where the user can send additional information for + each 'shipping'. + example: + key: value + maxProperties: 100 + type: object + required: + - amount + title: shipping_request + - properties: + id: + type: string + object: + type: string + parent_id: + type: string + title: shipping_order_response + title: shipping_lines_data_response + order_shipping_lines_response: + allOf: + - description: pagination metadata + properties: + has_more: + description: Indicates if there are more pages to be requested + example: false + type: boolean object: - example: tax_line + description: "Object type, in this case is list" + example: list type: string - parent_id: - example: ord_2tPAmKCEJqh8RE6nY + required: + - has_more + - object + title: pagination metadata + - description: page metadata + properties: + next_page_url: + description: URL of the next page. + example: https://api.conekta.io/resources?limit=10&next=chrg_1 type: string - description: create new taxes for an existing order response - required: - - id - title: order_tax_response + nullable: true + previous_page_url: + description: Url of the previous page. + example: https://api.conekta.io/resources?limit=10&previous=chrg_1 + type: string + nullable: true + title: page metadata + - properties: + data: + items: + $ref: "#/components/schemas/shipping_lines_data_response" + type: array + description: List of shipping costs applied to the order + title: order_shipping_lines_response + nullable: true order_fiscal_entity_address_response: allOf: - description: Address of the fiscal entity @@ -19341,17 +19541,11 @@ components: customer_info: $ref: "#/components/schemas/order_response_customer_info" discount_lines: - description: List of discounts that are applied to the order - items: - $ref: "#/components/schemas/discount_lines_response" - title: order_discount_lines_response - type: array + $ref: "#/components/schemas/order_discount_lines_response" tax_lines: - description: List of taxes that are applied to the order - items: - $ref: "#/components/schemas/order_tax_response" - title: order_tax_lines_response - type: array + $ref: "#/components/schemas/order_tax_lines_response" + shipping_lines: + $ref: "#/components/schemas/order_shipping_lines_response" fiscal_entity: $ref: "#/components/schemas/order_fiscal_entity_response" id: @@ -21342,6 +21536,45 @@ components: format: uri type: string title: customer_portal_response + order_tax_response: + allOf: + - description: create new taxes for an existing order + properties: + amount: + description: The amount to be collected for tax in cents + example: 100 + format: int64 + minimum: 0 + type: integer + description: + description: description or tax's name + example: testing + minLength: 2 + type: string + metadata: + additionalProperties: true + example: + key: value + maxProperties: 100 + type: object + required: + - amount + - description + title: order_tax_request + - properties: + id: + example: tax_lin_2tQ8dC5mg1UADmVPo + type: string + object: + example: tax_line + type: string + parent_id: + example: ord_2tPAmKCEJqh8RE6nY + type: string + description: create new taxes for an existing order response + required: + - id + title: order_tax_response ordersUpdateTaxes_request: description: create new taxes for an existing order properties: diff --git a/schemas/orders/order_response.yml b/schemas/orders/order_response.yml index 7586727..5566518 100644 --- a/schemas/orders/order_response.yml +++ b/schemas/orders/order_response.yml @@ -172,17 +172,50 @@ properties: - $ref: order_customer_info_response.yml - $ref: ../customers/customer_info_just_customer_id_response.yml discount_lines: - type: array - title: order_discount_lines_response description: "List of discounts that are applied to the order" - items: - $ref: ../../schemas/orders/discount_lines_response.yml + title: order_discount_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: discount_lines_data_response + allOf: + - $ref: ../../schemas/orders/discount_lines_response.yml tax_lines: - type: array - title: order_tax_lines_response description: "List of taxes that are applied to the order" - items: - $ref: ../../schemas/orders/update_order_tax_response.yml + title: order_tax_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: tax_lines_data_response + allOf: + - $ref: ../../schemas/orders/update_order_tax_response.yml + shipping_lines: + description: "List of shipping costs applied to the order" + title: order_shipping_lines_response + nullable: true + allOf: + - $ref: ../pagination/pagination.yml + - $ref: ../pagination/page.yml + - type: object + properties: + data: + type: array + items: + title: shipping_lines_data_response + allOf: + - $ref: ../../schemas/charges/shipping_order_response.yml fiscal_entity: type: object title: order_fiscal_entity_response