openapi: 3.1.0 info: title: Commerce Layer addresses returns API version: 7.10.1 contact: name: API Support url: https://commercelayer.io email: support@commercelayer.io description: Headless Commerce for Global Brands. servers: - url: https://{your_organization_slug}.commercelayer.io/api description: API - url: https://core.commercelayer.io/users/sign_in description: Sign in - url: https://docs.commercelayer.io/api description: API reference security: - bearerAuth: [] tags: - name: returns description: resource type paths: /captures/{captureId}/return: get: operationId: GET/captureId/return summary: Retrieve the return associated to the capture description: Retrieve the return associated to the capture tags: - returns parameters: - name: captureId in: path schema: type: string required: true description: The resource's id responses: '200': description: The return associated to the capture /customers/{customerId}/returns: get: operationId: GET/customerId/returns summary: Retrieve the returns associated to the customer description: Retrieve the returns associated to the customer tags: - returns parameters: - name: customerId in: path schema: type: string required: true description: The resource's id responses: '200': description: The returns associated to the customer /orders/{orderId}/returns: get: operationId: GET/orderId/returns summary: Retrieve the returns associated to the order description: Retrieve the returns associated to the order tags: - returns parameters: - name: orderId in: path schema: type: string required: true description: The resource's id responses: '200': description: The returns associated to the order /refunds/{refundId}/return: get: operationId: GET/refundId/return summary: Retrieve the return associated to the refund description: Retrieve the return associated to the refund tags: - returns parameters: - name: refundId in: path schema: type: string required: true description: The resource's id responses: '200': description: The return associated to the refund /return_line_items/{returnLineItemId}/return: get: operationId: GET/returnLineItemId/return summary: Retrieve the return associated to the return line item description: Retrieve the return associated to the return line item tags: - returns parameters: - name: returnLineItemId in: path schema: type: string required: true description: The resource's id responses: '200': description: The return associated to the return line item /returns: get: operationId: GET/returns summary: List all returns description: List all returns tags: - returns responses: '200': description: A list of return objects content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnResponseList' post: operationId: POST/returns summary: Create a return description: Create a return tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnCreate' responses: '201': description: The created return object content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnResponse' /returns/{returnId}: get: operationId: GET/returns/returnId summary: Retrieve a return description: Retrieve a return tags: - returns parameters: - name: returnId in: path schema: type: string required: true description: The resource's id responses: '200': description: The return object content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnResponse' patch: operationId: PATCH/returns/returnId summary: Update a return description: Update a return tags: - returns parameters: - name: returnId in: path schema: type: string required: true description: The resource's id requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnUpdate' responses: '200': description: The updated return object content: application/vnd.api+json: schema: $ref: '#/components/schemas/returnResponse' delete: operationId: DELETE/returns/returnId summary: Delete a return description: Delete a return tags: - returns parameters: - name: returnId in: path schema: type: string required: true description: The resource's id responses: '204': description: No content /returns/breakdown: post: operationId: POST/returns/breakdown summary: Query breakdown on returns description: "Breakdowns are aggregations that summarize your data as metrics (based on specific operators) or statistics, computed on field values. When performing a breakdown query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator) on the selected field, aggregated by another field.\r\n\r\n### Nesting breakdowns\r\nBreakdowns can be nested recursively one into the other, up to one level (see example). The valid values allowed for the by key of the nested breakdown are strictly dependent on the value you specified in the by key of the parent breakdown. Hence, they are different for each resource you’re doing statistics on (see orders, returns, and carts for the related lists).You cannot group the nested breakdown by the same field by which you’re already grouping the parent breakdown.\r\n\r\nSingle breakdown request\r\n\r\n`{\r\n\t\"breakdown\": {\r\n\t \"by\": \"organization.id\",\r\n \"field\": \"order.id\",\r\n \"operator\": \"value_count\",\r\n \"sort\": \"desc\",\r\n \"limit\": 5\r\n\t}\r\n}`\r\n \r\n \r\n Nested breakdown request\r\n \r\n` {\r\n\t\"breakdown\": {\r\n \"by\": \"organization.id\",\r\n \"field\": \"order.id\",\r\n \"operator\": \"value_count\",\r\n \"sort\": \"desc\",\r\n \"limit\": 5,\r\n \"breakdown\": {\r\n \"by\": \"line_items.name\",\r\n \"field\": \"line_items.id\",\r\n \"operator\": \"value_count\",\r\n \"sort\": \"desc\",\r\n \"limit\": 20\r\n }\r\n }\r\n }`" tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returns_breakdown_request' responses: '200': description: The breakdown result from returns content: application/vnd.api+json: schema: type: object properties: data: oneOf: - type: object properties: customer.email: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: customer.group_name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.business: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.city: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.country_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.geocoded: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.localized: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.state_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: destination_address.zip_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.business: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.city: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.country_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.geocoded: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.localized: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.state_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: origin_address.zip_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: market.id: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: market.name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: market.number: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: organization.id: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: organization.name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: organization.slug: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return.reference: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return.reference_origin: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return.status: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return.mode: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return.currency_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return_line_items.line_item_name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return_line_items.line_item_code: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: return_line_items.line_item_item_type: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: stock_location.name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: stock_location.reference: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: stock_location.reference_origin: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: tags.id: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 - type: object properties: tags.name: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 meta: type: object properties: type: type: string description: Action name trace_id: type: string description: Request ID mode: type: string description: Filter mode organization_id: type: string description: Organization ID from request market_ids: type: array items: type: string description: Markets IDs from the organization payload: type: object properties: filter: $ref: '#/components/schemas/returns_filter' breakdown: $ref: '#/components/schemas/returns_breakdown_request/properties/breakdown' /returns/date_breakdown: post: operationId: POST/returns/date_breakdown summary: Query date_breakdown on returns description: "Date breakdowns summarizes metrics data grouped by time intervals on a defined time range. They also support support breakdowns over the main date breakdown query and also supports all breakdown queries capabilities through the \"breakdown\" key, this also includes the possibility of nesting the breakdown over the main breakdown. \r\n\r\n\r\nSingle date breakdown request (no breakdown)\r\n\r\n`{\r\n\t\"date_breakdown\": {\r\n \"by\": \"return.created_at\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"stats\",\r\n \"interval\": \"month\"\r\n }\r\n}`\r\n \r\n \r\nSingle date breakdown request with one breakdown\r\n \r\n` \r\n{\r\n\t\"date_breakdown\": {\r\n \"by\": \"return.created_at\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"stats\",\r\n \"interval\": \"month\",\r\n \"breakdown\": {\r\n \"by\": \"return.reference\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"sum\",\r\n \"sort\": \"desc\",\r\n \"limit\": 20\r\n }\r\n }\r\n }`\r\n \r\n \r\nSingle date breakdown request with breakdown with a nested breakdown\r\n\r\n` \r\n\"date_breakdown\": {\r\n \"by\": \"return.created_at\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"stats\",\r\n \"interval\": \"month\",\r\n \"breakdown\": {\r\n \"by\": \"return.reference\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"sum\",\r\n \"sort\": \"desc\",\r\n \"limit\": 20,\r\n \"breakdown\": {\r\n \"by\": \"return.status\",\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"sum\",\r\n \"sort\": \"desc\",\r\n \"limit\": 21\r\n }\r\n }\r\n }\r\n }`\r\n " tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returns_date_breakdown_request' responses: '200': description: The date_breakdown result from returns content: application/vnd.api+json: schema: type: object properties: data: type: array items: type: object properties: date: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 additionalProperties: type: array items: type: object properties: label: type: string value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 meta: type: object properties: type: type: string description: Action name trace_id: type: string description: Request ID mode: type: string description: Filter mode organization_id: type: string description: Organization ID from request market_ids: type: array items: type: string description: Markets IDs from the organization payload: type: object properties: filter: $ref: '#/components/schemas/returns_filter' date_breakdown: $ref: '#/components/schemas/returns_date_breakdown_request/properties/date_breakdown' /returns/stats: post: operationId: POST/returns/stats summary: Query stats on returns description: "Stats are aggregations that summarize your data within an operator (depending of the field, some of them could not be available), such as: value_count, cardinality, avg, min, max, sum or stats (which returns avg, min, max, sum) computed on the field specificed. When performing a stats query on the Metrics API endpoint you get in the response the value of the computation (based on the selected operator) on the selected field.\r\n\r\nStats request\r\n\r\n`{\r\n\t \"stats\": {\r\n \"field\": \"return_line_items.line_item_total_amount\",\r\n \"operator\": \"stats\"\r\n }\r\n}`" tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returns_stats_request' responses: '200': description: The stats result from returns content: application/vnd.api+json: schema: type: object properties: data: type: object properties: customer.id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 customer.email: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 customer.group_name: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.business: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.city: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.country_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.geocoded: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.localized: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.state_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 destination_address.zip_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.business: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.city: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.country_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.geocoded: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.localized: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.state_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 origin_address.zip_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 market.id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 market.number: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.number: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.reference: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.reference_origin: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.status: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.mode: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.order_id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return.skus_count: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.quantity: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_name: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_code: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_item_type: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_total_amount: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_tax_amount: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 return_line_items.line_item_tax_rate: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 stock_location.id: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 stock_location.name: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 stock_location.reference: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 stock_location.reference_origin: type: object properties: value: oneOf: - type: number example: 8 - type: string - type: object properties: count: type: number example: 8 min: type: number example: 8 max: type: number example: 8 avg: type: number example: 8 sum: type: number example: 8 meta: type: object properties: type: type: string description: Action name trace_id: type: string description: Request ID mode: type: string description: Filter mode organization_id: type: string description: Organization ID from request market_ids: type: array items: type: string description: Markets IDs from the organization payload: type: object properties: filter: $ref: '#/components/schemas/returns_filter' stats: $ref: '#/components/schemas/returns_stats_request/properties/stats' /returns/search: post: operationId: POST/returns/search summary: Query search on returns description: Get search results from returns tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returns_search_request' responses: '200': description: The search result from returns content: application/vnd.api+json: schema: type: object properties: data: type: array items: type: object properties: date_from: type: string description: The lower limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' date_to: type: string description: The upper limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' date_field: type: string description: The date field (e.g. `requested_at`, `rejected_at`, etc.) where to apply the date and time range filter. enum: - current_date - approved_at - archived_at - cancelled_at - created_at - received_at - rejected_at - shipped_at - updated_at - restocked_at default: current_date aggregated_details: type: string description: Searchable field containing all returns data. approved_at: type: string description: The date and time at which the return was approved (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' archived_at: type: string description: The date and time at which the return was archived (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' archived: type: boolean description: Indicates if the return has been archived. cancelled_at: type: string description: The date and time at which the return was cancelled (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' created_at: type: string description: The date and time at which the return was created (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' numbers: type: string description: The numeric unique identifier for the return. received_at: type: string description: The date and time at which the return was received (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' references: type: string description: Any external identifier that might be useful to link the return resource to other systems through the Commerce Layer core API. reference_origins: type: string description: Any identifier of the 3rd-party system that defines the reference code. rejected_at: type: string description: The date and time at which the return was rejected (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' shipped_at: type: string description: The date and time at which the return was shipped (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' statuses: type: string description: The return status. One of `draft`, `requested`, `approved`, `cancelled`, `shipped`, `rejected` or `received`. mode: type: string description: The return's environment (can be one of `test` or `live`). enum: - live - test updated_at: type: string description: The date and time at which the return was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' current_date: type: string description: The date and time of the return's latest status change, regardless of the return's status (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' ids: type: string description: The ID of the return. order_ids: type: string description: The ID of the order associated with the return. skus_count: type: integer description: The total number of SKUs in the return's line items. example: 8 currency_codes: type: string description: The international 3-letter currency code (as defined by the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) standard), automatically inherited from the order associated market. customer: type: object properties: id: type: string description: The ID of the customer. email: type: string description: The email address of the customer. group_name: type: string description: The name of the customer group the customer belongs to (if any). destination_address: type: object properties: business: type: boolean description: Indicates if the address is a business or a personal one. city: type: string description: The city specified in the address. country_code: type: string description: The international 2-letter country code (as defined by the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard) specified in the address. geocoded: type: boolean description: Indicates if the address has been successfully geocoded. localized: type: boolean description: Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. state_code: type: string description: The state, province or region code specified in the address. zip_code: type: string description: The ZIP or postal code specified in the address. origin_address: type: object properties: business: type: boolean description: Indicates if the address is a business or a personal one. city: type: string description: The city specified in the address. country_code: type: string description: The international 2-letter country code (as defined by the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard) specified in the address. geocoded: type: boolean description: Indicates if the address has been successfully geocoded. localized: type: boolean description: Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. state_code: type: string description: The state, province or region code specified in the address. zip_code: type: string description: The ZIP or postal code specified in the address. market: type: object properties: id: type: string description: The ID of the market. name: type: string description: The name of the market. number: type: integer description: The numeric unique identifier for the market. example: 8 organization: type: object properties: id: type: string description: The ID of the organization. name: type: string description: The name of the organization. slug: type: string description: The name of the organization, parsed and converted into a URL-friendly slug. return_line_items: type: object properties: created_at: type: string description: The date and time at which the return line item was created (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' quantity: type: integer description: The return line item quantity. example: 8 restocked_at: type: string description: The date and time at which the return line item was restocked (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' updated_at: type: string description: The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' line_item_id: type: string description: The ID of the return line item. line_item_name: type: string description: The name of the associated SKU or bundle. line_item_code: type: string description: The code of the associated SKU or bundle. line_item_item_type: type: string description: The type of the associated item. One of `sku`, or `bundle`. line_item_total_amount: type: number description: The total amount of the return line item (float). example: 121 line_item_tax_amount: type: number description: The collected tax amount for the return line item (float). example: 121 line_item_tax_rate: type: number description: The tax rate for the return line item (if calculated). example: 121 line_item_updated_at: type: string description: The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' stock_location: type: object properties: id: type: string description: The ID of the stock location. name: type: string description: The name of the stock location. reference: type: string description: Any external identifier that might be useful to link the stock location resource to other systems through the Commerce Layer core API. reference_origin: type: string description: Any identifier of the 3rd-party system that defines the reference code. tags: type: object properties: id: type: string description: The tag ID. name: type: string description: The tag name. meta: type: object properties: type: type: string description: Action name trace_id: type: string description: Request ID mode: type: string description: Filter mode organization_id: type: string description: Organization ID from request market_ids: type: array items: type: string description: Markets IDs from the organization payload: type: object properties: filter: $ref: '#/components/schemas/returns_filter' search: $ref: '#/components/schemas/returns_search_request/properties/search' pagination: type: object properties: record_count: type: integer example: 8 cursor: type: string example: LS0tCi0gJzIwMjEtMTEtMD /returns/export: post: operationId: POST/returns/export summary: Query export on returns description: Get export results from returns tags: - returns requestBody: required: true content: application/vnd.api+json: schema: $ref: '#/components/schemas/returns_export_request' responses: '200': description: The export result from returns content: text/csv: schema: type: string format: binary description: CSV file with exported records (text/csv) components: schemas: returns_stats_request: type: object properties: filter: $ref: '#/components/schemas/returns_filter' stats: type: object description: Check available [fields](#/components/schemas/returns_stats_request/properties/stats/properties/field/description) required: - field properties: field: type: string description: "These are the valid values you can specify for the field key of the stats query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats meta: type: object properties: payload: type: boolean description: Set to true if you want to receive how the payload has been made returns_date_breakdown_request: type: object properties: filter: $ref: '#/components/schemas/returns_filter' date_breakdown: type: object description: Check available [fields](#/components/schemas/returns_date_breakdown_request/properties/date_breakdown/properties/field/description) required: - by - field - operator properties: by: type: string description: Field to base your date breakdown query enum: - return.approved_at - return.archived_at - return.cancelled_at - return.created_at - return.received_at - return.rejected_at - return.shipped_at - return.updated_at - return.current_date field: type: string description: "These are the valid values you can specify for the field key of the date_breakdown query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats interval: type: string description: Interval to base the date breakdown enum: - day - hour - month - week - year breakdown: type: object description: Check available [fields](#/components/schemas/returns_breakdown_request/properties/breakdown/properties/field/description) required: - by - field - operator properties: by: type: string description: "Field to base your breakdown query.\n\nForbidden nesting\n\n These are the valid values you can specify for the by key of the breakdown query and the related forbidden values for the by key of the nested breakdown, based on the by key of the parent breakdown (i.e. for each row of the table below the full list of the valid values for the by key of the nested breakdown is given by all the values in the \"Value\" column except the values in the row's \"Forbidden nesting\" cell):\n\n\n \n| Value | Forbidden nesting |\n| --- | ------ |\n|**`customer.email`** | |\n|**`customer.group_name`** | |\n|**`destination_address.business`** |

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`destination_address.city`** |

`destination_address.country_code`

`destination_address.state_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.country_code`** |

`customer.*`

`origin_address.*`

|\n|**`destination_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.state_code`** |

`destination_address.country_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.zip_code`** |

`destination_address.country_code`

`destination_address.city`

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`origin_address.business`** |

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`origin_address.city`** |

`origin_address.country_code`

`origin_address.state_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.country_code`** |

`customer.*`

`destrintation_address.*`

|\n|**`origin_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.state_code`** |

`origin_address.country_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.zip_code`** |

`origin_address.country_code`

`origin_address.city`

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`market.id`** | |\n|**`market.name`** | |\n|**`market.number`** | |\n|**`return.reference`** | |\n|**`return.reference_origin`** | |\n|**`return.status`** | |\n|**`return.currency_code`** | |\n|**`return_line_items.line_item_name`** | |\n|**`return_line_items.line_item_code`** | |\n|**`return_line_items.line_item_item_type`** | |\n|**`stock_location.name`** | |\n|**`stock_location.reference`** | |\n|**`stock_location.reference_origin`** | |\n|**`tags.id`** | |\n|**`tags.name`** | |\n" enum: - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.reference - return.reference_origin - return.status - return.mode - return.currency_code - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name field: type: string description: "These are the valid values you can specify for the field key of the breakdown query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats sort: type: string description: Result sorting enum: - asc - desc limit: type: integer description: Results limit default: 10 maximum: 100 condition: description: Condition to filter the data over the breakdown result, value of the operator must be a Number or Array of numbers if operator is a range oneOf: - type: object properties: eq: type: number - type: object properties: ne: type: number - type: object properties: gt: type: number - type: object properties: gte: type: number - type: object properties: lt: type: number - type: object properties: lte: type: number - type: object properties: gt_lt: type: array items: type: number - type: object properties: gte_lte: type: array items: type: number - type: object properties: gte_lt: type: array items: type: number - type: object properties: gt_lte: type: array items: type: number additionalProperties: false breakdown: type: object properties: by: type: string description: "Field to base your breakdown query.\n\nForbidden nesting\n\n These are the valid values you can specify for the by key of the breakdown query and the related forbidden values for the by key of the nested breakdown, based on the by key of the parent breakdown (i.e. for each row of the table below the full list of the valid values for the by key of the nested breakdown is given by all the values in the \"Value\" column except the values in the row's \"Forbidden nesting\" cell):\n\n\n \n| Value | Forbidden nesting |\n| --- | ------ |\n|**`customer.email`** | |\n|**`customer.group_name`** | |\n|**`destination_address.business`** |

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`destination_address.city`** |

`destination_address.country_code`

`destination_address.state_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.country_code`** |

`customer.*`

`origin_address.*`

|\n|**`destination_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.state_code`** |

`destination_address.country_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.zip_code`** |

`destination_address.country_code`

`destination_address.city`

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`origin_address.business`** |

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`origin_address.city`** |

`origin_address.country_code`

`origin_address.state_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.country_code`** |

`customer.*`

`destrintation_address.*`

|\n|**`origin_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.state_code`** |

`origin_address.country_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.zip_code`** |

`origin_address.country_code`

`origin_address.city`

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`market.id`** | |\n|**`market.name`** | |\n|**`market.number`** | |\n|**`return.reference`** | |\n|**`return.reference_origin`** | |\n|**`return.status`** | |\n|**`return.currency_code`** | |\n|**`return_line_items.line_item_name`** | |\n|**`return_line_items.line_item_code`** | |\n|**`return_line_items.line_item_item_type`** | |\n|**`stock_location.name`** | |\n|**`stock_location.reference`** | |\n|**`stock_location.reference_origin`** | |\n|**`tags.id`** | |\n|**`tags.name`** | |\n" enum: - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.reference - return.reference_origin - return.status - return.mode - return.currency_code - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name field: type: string description: "These are the valid values you can specify for the field key of the breakdown query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats sort: type: string description: Result sorting enum: - asc - desc limit: type: integer description: Results limit default: 10 maximum: 100 condition: description: Condition to filter the data over the breakdown result, value of the operator must be a Number or Array of numbers if operator is a range oneOf: - type: object properties: eq: type: number - type: object properties: ne: type: number - type: object properties: gt: type: number - type: object properties: gte: type: number - type: object properties: lt: type: number - type: object properties: lte: type: number - type: object properties: gt_lt: type: array items: type: number - type: object properties: gte_lte: type: array items: type: number - type: object properties: gte_lt: type: array items: type: number - type: object properties: gt_lte: type: array items: type: number additionalProperties: false required: - by - field - operator meta: type: object properties: payload: type: boolean description: Set to true if you want to receive how the payload has been made returns_filter: type: object properties: customer: type: object properties: ids: description: The ID of the customer. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids emails: description: The email address of the customer. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of emails - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of emails group_names: description: The name of the customer group the customer belongs to (if any). oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of group_names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of group_names destination_address: type: object properties: business: type: boolean description: Indicates if the address is a business or a personal one. cities: description: The city specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of cities - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of cities country_codes: description: The international 2-letter country code (as defined by the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard) specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of country_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of country_codes geocoded: type: boolean description: Indicates if the address has been successfully geocoded. localized: type: boolean description: Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. state_codes: description: The state, province or region code specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of state_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of state_codes zip_codes: description: The ZIP or postal code specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of zip_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of zip_codes origin_address: type: object properties: business: type: boolean description: Indicates if the address is a business or a personal one. cities: description: The city specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of cities - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of cities country_codes: description: The international 2-letter country code (as defined by the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard) specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of country_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of country_codes geocoded: type: boolean description: Indicates if the address has been successfully geocoded. localized: type: boolean description: Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. state_codes: description: The state, province or region code specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of state_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of state_codes zip_codes: description: The ZIP or postal code specified in the address. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of zip_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of zip_codes market: type: object properties: ids: description: The ID of the market. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids names: description: The name of the market. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of names numbers: description: The numeric unique identifier for the market. oneOf: - type: object properties: in: type: array minItems: 1 items: type: integer example: 8 description: To include, array of numbers - type: object properties: not_in: type: array minItems: 1 items: type: integer example: 8 description: To exclude, array of numbers organization: type: object properties: ids: description: The ID of the organization. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids names: description: The name of the organization. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of names slugs: description: The name of the organization, parsed and converted into a URL-friendly slug. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of slugs - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of slugs return: type: object properties: date_from: type: string description: The lower limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' date_to: type: string description: The upper limit of the date and time range used to filter the collected returns (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' date_field: type: string description: The date field (e.g. `requested_at`, `rejected_at`, etc.) where to apply the date and time range filter. enum: - current_date - approved_at - archived_at - cancelled_at - created_at - received_at - rejected_at - shipped_at - updated_at - restocked_at default: current_date aggregated_details: description: Searchable field containing all returns data. type: object properties: query: type: string description: Returns documents based on a provided query string aggregated_details approved_at: description: The date and time at which the return was approved (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to approved_at type: string - type: object properties: ne: description: Not equal approved_at type: string - type: object properties: gt: type: string description: Greater than approved_at - type: object properties: gte: type: string description: Greater than equal approved_at - type: object properties: lt: type: string description: Less than approved_at - type: object properties: lte: type: string description: Less than equal approved_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than approved_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal approved_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than approved_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal approved_at archived_at: description: The date and time at which the return was archived (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to archived_at type: string - type: object properties: ne: description: Not equal archived_at type: string - type: object properties: gt: type: string description: Greater than archived_at - type: object properties: gte: type: string description: Greater than equal archived_at - type: object properties: lt: type: string description: Less than archived_at - type: object properties: lte: type: string description: Less than equal archived_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than archived_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal archived_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than archived_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal archived_at archived: type: boolean description: Indicates if the return has been archived. cancelled_at: description: The date and time at which the return was cancelled (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to cancelled_at type: string - type: object properties: ne: description: Not equal cancelled_at type: string - type: object properties: gt: type: string description: Greater than cancelled_at - type: object properties: gte: type: string description: Greater than equal cancelled_at - type: object properties: lt: type: string description: Less than cancelled_at - type: object properties: lte: type: string description: Less than equal cancelled_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than cancelled_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal cancelled_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than cancelled_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal cancelled_at created_at: description: The date and time at which the return was created (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to created_at type: string - type: object properties: ne: description: Not equal created_at type: string - type: object properties: gt: type: string description: Greater than created_at - type: object properties: gte: type: string description: Greater than equal created_at - type: object properties: lt: type: string description: Less than created_at - type: object properties: lte: type: string description: Less than equal created_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than created_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal created_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than created_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal created_at numbers: description: The numeric unique identifier for the return. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of numbers - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of numbers received_at: description: The date and time at which the return was received (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to received_at type: string - type: object properties: ne: description: Not equal received_at type: string - type: object properties: gt: type: string description: Greater than received_at - type: object properties: gte: type: string description: Greater than equal received_at - type: object properties: lt: type: string description: Less than received_at - type: object properties: lte: type: string description: Less than equal received_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than received_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal received_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than received_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal received_at references: description: Any external identifier that might be useful to link the return resource to other systems through the Commerce Layer core API. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of references - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of references reference_origins: description: Any identifier of the 3rd-party system that defines the reference code. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of reference_origins - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of reference_origins rejected_at: description: The date and time at which the return was rejected (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to rejected_at type: string - type: object properties: ne: description: Not equal rejected_at type: string - type: object properties: gt: type: string description: Greater than rejected_at - type: object properties: gte: type: string description: Greater than equal rejected_at - type: object properties: lt: type: string description: Less than rejected_at - type: object properties: lte: type: string description: Less than equal rejected_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than rejected_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal rejected_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than rejected_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal rejected_at shipped_at: description: The date and time at which the return was shipped (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to shipped_at type: string - type: object properties: ne: description: Not equal shipped_at type: string - type: object properties: gt: type: string description: Greater than shipped_at - type: object properties: gte: type: string description: Greater than equal shipped_at - type: object properties: lt: type: string description: Less than shipped_at - type: object properties: lte: type: string description: Less than equal shipped_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than shipped_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal shipped_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than shipped_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal shipped_at statuses: description: The return status. One of `draft`, `requested`, `approved`, `cancelled`, `shipped`, `rejected` or `received`. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of statuses - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of statuses mode: type: string description: The return's environment (can be one of `test` or `live`). enum: - live - test updated_at: description: The date and time at which the return was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to updated_at type: string - type: object properties: ne: description: Not equal updated_at type: string - type: object properties: gt: type: string description: Greater than updated_at - type: object properties: gte: type: string description: Greater than equal updated_at - type: object properties: lt: type: string description: Less than updated_at - type: object properties: lte: type: string description: Less than equal updated_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than updated_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal updated_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than updated_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal updated_at current_date: description: The date and time of the return's latest status change, regardless of the return's status (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to current_date type: string - type: object properties: ne: description: Not equal current_date type: string - type: object properties: gt: type: string description: Greater than current_date - type: object properties: gte: type: string description: Greater than equal current_date - type: object properties: lt: type: string description: Less than current_date - type: object properties: lte: type: string description: Less than equal current_date - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than current_date - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal current_date - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than current_date - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal current_date ids: description: The ID of the return. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids order_ids: description: The ID of the order associated with the return. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of order_ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of order_ids skus_count: description: The total number of SKUs in the return's line items. oneOf: - type: object properties: eq: description: Equals to skus_count type: integer - type: object properties: ne: description: Not equal skus_count type: integer - type: object properties: gt: type: integer description: Greater than skus_count - type: object properties: gte: type: integer description: Greater than equal skus_count - type: object properties: lt: type: integer description: Less than skus_count - type: object properties: lte: type: integer description: Less than equal skus_count - type: object properties: gt_lt: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than, less than skus_count - type: object properties: gte_lte: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than equal, less than equal skus_count - type: object properties: gte_lt: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than equal, less than skus_count - type: object properties: gt_lte: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than, less than equal skus_count currency_codes: description: The international 3-letter currency code (as defined by the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) standard), automatically inherited from the order associated market. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of currency_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of currency_codes return_line_items: type: object properties: created_at: description: The date and time at which the return line item was created (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to created_at type: string - type: object properties: ne: description: Not equal created_at type: string - type: object properties: gt: type: string description: Greater than created_at - type: object properties: gte: type: string description: Greater than equal created_at - type: object properties: lt: type: string description: Less than created_at - type: object properties: lte: type: string description: Less than equal created_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than created_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal created_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than created_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal created_at quantity: description: The return line item quantity. oneOf: - type: object properties: eq: description: Equals to quantity type: integer - type: object properties: ne: description: Not equal quantity type: integer - type: object properties: gt: type: integer description: Greater than quantity - type: object properties: gte: type: integer description: Greater than equal quantity - type: object properties: lt: type: integer description: Less than quantity - type: object properties: lte: type: integer description: Less than equal quantity - type: object properties: gt_lt: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than, less than quantity - type: object properties: gte_lte: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than equal, less than equal quantity - type: object properties: gte_lt: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than equal, less than quantity - type: object properties: gt_lte: type: array items: type: integer example: 8 minItems: 2 maxItems: 2 description: Greater than, less than equal quantity restocked_at: description: The date and time at which the return line item was restocked (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to restocked_at type: string - type: object properties: ne: description: Not equal restocked_at type: string - type: object properties: gt: type: string description: Greater than restocked_at - type: object properties: gte: type: string description: Greater than equal restocked_at - type: object properties: lt: type: string description: Less than restocked_at - type: object properties: lte: type: string description: Less than equal restocked_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than restocked_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal restocked_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than restocked_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal restocked_at updated_at: description: The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to updated_at type: string - type: object properties: ne: description: Not equal updated_at type: string - type: object properties: gt: type: string description: Greater than updated_at - type: object properties: gte: type: string description: Greater than equal updated_at - type: object properties: lt: type: string description: Less than updated_at - type: object properties: lte: type: string description: Less than equal updated_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than updated_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal updated_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than updated_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal updated_at line_item_ids: description: The ID of the return line item. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of line_item_ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of line_item_ids line_item_names: description: The name of the associated SKU or bundle. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of line_item_names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of line_item_names line_item_codes: description: The code of the associated SKU or bundle. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of line_item_codes - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of line_item_codes line_item_item_types: description: The type of the associated item. One of `sku`, or `bundle`. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of line_item_item_types - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of line_item_item_types line_item_total_amount: description: The total amount of the return line item (float). oneOf: - type: object properties: eq: description: Equals to line_item_total_amount type: number - type: object properties: ne: description: Not equal line_item_total_amount type: number - type: object properties: gt: type: number description: Greater than line_item_total_amount - type: object properties: gte: type: number description: Greater than equal line_item_total_amount - type: object properties: lt: type: number description: Less than line_item_total_amount - type: object properties: lte: type: number description: Less than equal line_item_total_amount - type: object properties: gt_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than line_item_total_amount - type: object properties: gte_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than equal line_item_total_amount - type: object properties: gte_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than line_item_total_amount - type: object properties: gt_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than equal line_item_total_amount line_item_tax_amount: description: The collected tax amount for the return line item (float). oneOf: - type: object properties: eq: description: Equals to line_item_tax_amount type: number - type: object properties: ne: description: Not equal line_item_tax_amount type: number - type: object properties: gt: type: number description: Greater than line_item_tax_amount - type: object properties: gte: type: number description: Greater than equal line_item_tax_amount - type: object properties: lt: type: number description: Less than line_item_tax_amount - type: object properties: lte: type: number description: Less than equal line_item_tax_amount - type: object properties: gt_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than line_item_tax_amount - type: object properties: gte_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than equal line_item_tax_amount - type: object properties: gte_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than line_item_tax_amount - type: object properties: gt_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than equal line_item_tax_amount line_item_tax_rate: description: The tax rate for the return line item (if calculated). oneOf: - type: object properties: eq: description: Equals to line_item_tax_rate type: number - type: object properties: ne: description: Not equal line_item_tax_rate type: number - type: object properties: gt: type: number description: Greater than line_item_tax_rate - type: object properties: gte: type: number description: Greater than equal line_item_tax_rate - type: object properties: lt: type: number description: Less than line_item_tax_rate - type: object properties: lte: type: number description: Less than equal line_item_tax_rate - type: object properties: gt_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than line_item_tax_rate - type: object properties: gte_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than equal line_item_tax_rate - type: object properties: gte_lt: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than equal, less than line_item_tax_rate - type: object properties: gt_lte: type: array items: type: number example: 121 minItems: 2 maxItems: 2 description: Greater than, less than equal line_item_tax_rate line_item_updated_at: description: The date and time at which the return line item was last updated (complete date plus hours, minutes and seconds — according to the [ISO 8601](https://www.w3.org/TR/NOTE-datetime) standard). oneOf: - type: object properties: eq: description: Equals to line_item_updated_at type: string - type: object properties: ne: description: Not equal line_item_updated_at type: string - type: object properties: gt: type: string description: Greater than line_item_updated_at - type: object properties: gte: type: string description: Greater than equal line_item_updated_at - type: object properties: lt: type: string description: Less than line_item_updated_at - type: object properties: lte: type: string description: Less than equal line_item_updated_at - type: object properties: gt_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than line_item_updated_at - type: object properties: gte_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than equal line_item_updated_at - type: object properties: gte_lt: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than equal, less than line_item_updated_at - type: object properties: gt_lte: type: array items: type: string format: '%Y-%m-%dT%H:%M:%SZ' example: '2022-07-06T21:41:03Z' minItems: 2 maxItems: 2 description: Greater than, less than equal line_item_updated_at stock_location: type: object properties: ids: description: The ID of the stock location. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids names: description: The name of the stock location. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of names references: description: Any external identifier that might be useful to link the stock location resource to other systems through the Commerce Layer core API. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of references - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of references reference_origins: description: Any identifier of the 3rd-party system that defines the reference code. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of reference_origins - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of reference_origins tags: type: object properties: ids: description: The tag ID. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of ids - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of ids names: description: The tag name. oneOf: - type: object properties: in: type: array minItems: 1 items: type: string description: To include, array of names - type: object properties: not_in: type: array minItems: 1 items: type: string description: To exclude, array of names returns_export_fields: type: string enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.aggregated_details - return.approved_at - return.archived_at - return.archived - return.cancelled_at - return.created_at - return.number - return.received_at - return.reference - return.reference_origin - return.rejected_at - return.shipped_at - return.status - return.mode - return.updated_at - return.current_date - return.id - return.order_id - return.skus_count - return.currency_code - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name returns_search_request: type: object properties: filter: $ref: '#/components/schemas/returns_filter' search: type: object required: - fields properties: sort: type: string description: Result sorting enum: - asc - desc limit: type: integer description: Results limit default: 50 maximum: 100 sort_by: $ref: '#/components/schemas/returns_search_fields' fields: type: array items: $ref: '#/components/schemas/returns_search_fields' meta: type: object properties: payload: type: boolean description: Set to true if you want to receive how the payload has been made returnResponse: type: object properties: data: type: object properties: id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN type: type: string description: The resource's type enum: - returns links: type: object properties: self: type: string description: URL attributes: $ref: '#/components/schemas/return/properties/data/properties/attributes' relationships: type: object properties: order: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - order id: type: string description: The resource ID customer: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - customer id: type: string description: The resource ID stock_location: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - stock_location id: type: string description: The resource ID origin_address: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - origin_address id: type: string description: The resource ID destination_address: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - destination_address id: type: string description: The resource ID reference_capture: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - reference_capture id: type: string description: The resource ID reference_refund: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - reference_refund id: type: string description: The resource ID return_line_items: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - return_line_items id: type: string description: The resource ID attachments: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - attachments id: type: string description: The resource ID resource_errors: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - resource_errors id: type: string description: The resource ID events: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - events id: type: string description: The resource ID tags: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - tags id: type: string description: The resource ID event_stores: type: object properties: links: type: object properties: self: type: string description: URL related: type: string description: URL data: type: object properties: type: type: string description: The resource's type enum: - event_stores id: type: string description: The resource ID returnResponseList: type: object properties: data: type: array items: $ref: '#/components/schemas/returnResponse/properties/data' returnCreate: required: - data type: object properties: data: type: object required: - type - attributes properties: type: type: string description: The resource's type enum: - returns attributes: type: object properties: reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar relationships: type: object properties: order: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - orders id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN stock_location: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - stock_locations id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN reference_capture: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - captures id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN tags: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - tags id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN required: - order returnUpdate: required: - data type: object properties: data: type: object required: - type - id - attributes properties: type: type: string description: The resource's type enum: - returns id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN attributes: type: object properties: _request: type: boolean description: Send this attribute if you want to activate this return. example: true nullable: false _approve: type: boolean description: Send this attribute if you want to mark this return as approved. example: true nullable: false _cancel: type: boolean description: Send this attribute if you want to mark this return as cancelled. example: true nullable: false _ship: type: boolean description: Send this attribute if you want to mark this return as shipped. example: true nullable: false _reject: type: boolean description: Send this attribute if you want to mark this return as rejected. example: true nullable: false _receive: type: boolean description: Send this attribute if you want to mark this return as received. example: true nullable: false _restock: type: boolean description: Send this attribute if you want to restock all of the return line items. example: true nullable: false _archive: type: boolean description: Send this attribute if you want to archive the return. example: true nullable: false _unarchive: type: boolean description: Send this attribute if you want to unarchive the return. example: true nullable: false _refund: type: boolean description: Send this attribute if you want to create a refund for this return. example: true nullable: false _refund_amount_cents: type: integer description: Send this attribute as a value in cents to specify the amount to be refunded. example: 500 _add_tags: type: string description: Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels. _remove_tags: type: string description: Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels. reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true relationships: type: object properties: stock_location: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - stock_locations id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN reference_capture: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - captures id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN tags: required: - data type: object properties: data: type: object properties: type: type: string description: The resource's type enum: - tags id: type: string description: Unique identifier for the resource (hash). example: XAyRWNUzyN returns_search_fields: type: string enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.aggregated_details - return.approved_at - return.archived_at - return.archived - return.cancelled_at - return.created_at - return.number - return.received_at - return.reference - return.reference_origin - return.rejected_at - return.shipped_at - return.status - return.mode - return.updated_at - return.current_date - return.id - return.order_id - return.skus_count - return.currency_code - return_line_items.created_at - return_line_items.quantity - return_line_items.restocked_at - return_line_items.updated_at - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - return_line_items.line_item_updated_at - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name return: properties: data: properties: attributes: type: object properties: number: type: string description: Unique identifier for the return. example: '#1234/R/001' nullable: true status: type: string description: The return status. One of 'draft' (default), 'requested', 'approved', 'cancelled', 'shipped', 'rejected', 'received', or 'refunded'. example: draft nullable: false enum: - draft - requested - approved - cancelled - shipped - rejected - received - refunded customer_email: type: string description: The email address of the associated customer. example: john@example.com nullable: true skus_count: type: integer description: The total number of SKUs in the return's line items. This can be useful to display a preview of the return content. example: 2 nullable: true approved_at: type: string description: Time at which the return was approved. example: '2018-01-01T12:00:00.000Z' nullable: true cancelled_at: type: string description: Time at which the return was cancelled. example: '2018-01-01T12:00:00.000Z' nullable: true shipped_at: type: string description: Time at which the return was shipped. example: '2018-01-01T12:00:00.000Z' nullable: true rejected_at: type: string description: Time at which the return was rejected. example: '2018-01-01T12:00:00.000Z' nullable: true received_at: type: string description: Time at which the return was received. example: '2018-01-01T12:00:00.000Z' nullable: true refunded_at: type: string description: Time at which the return was refunded. example: '2018-01-01T12:00:00.000Z' nullable: true archived_at: type: string description: Time at which the resource has been archived. example: '2018-01-01T12:00:00.000Z' nullable: true estimated_refund_amount_cents: type: integer description: The amount to be refunded, estimated by associated return line items, in cents. example: 500 nullable: true estimated_refund_amount_float: type: number description: The amount to be refunded, estimated by associated return line items, float. example: 5.0 nullable: true formatted_estimated_refund_amount: type: string description: The amount to be refunded, estimated by associated return line items, formatted. example: €5,00 nullable: true created_at: type: string description: Time at which the resource was created. example: '2018-01-01T12:00:00.000Z' nullable: false updated_at: type: string description: Time at which the resource was last updated. example: '2018-01-01T12:00:00.000Z' nullable: false reference: type: string description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. example: ANY-EXTERNAL-REFEFERNCE nullable: true reference_origin: type: string description: Any identifier of the third party system that defines the reference code. example: ANY-EXTERNAL-REFEFERNCE-ORIGIN nullable: true metadata: type: object description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format. example: foo: bar nullable: true returns_breakdown_request: type: object properties: filter: $ref: '#/components/schemas/returns_filter' breakdown: type: object description: Check available [fields](#/components/schemas/returns_breakdown_request/properties/breakdown/properties/field/description) required: - by - field - operator properties: by: type: string description: "Field to base your breakdown query.\n\nForbidden nesting\n\n These are the valid values you can specify for the by key of the breakdown query and the related forbidden values for the by key of the nested breakdown, based on the by key of the parent breakdown (i.e. for each row of the table below the full list of the valid values for the by key of the nested breakdown is given by all the values in the \"Value\" column except the values in the row's \"Forbidden nesting\" cell):\n\n\n \n| Value | Forbidden nesting |\n| --- | ------ |\n|**`customer.email`** | |\n|**`customer.group_name`** | |\n|**`destination_address.business`** |

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`destination_address.city`** |

`destination_address.country_code`

`destination_address.state_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.country_code`** |

`customer.*`

`origin_address.*`

|\n|**`destination_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.state_code`** |

`destination_address.country_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.zip_code`** |

`destination_address.country_code`

`destination_address.city`

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`origin_address.business`** |

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`origin_address.city`** |

`origin_address.country_code`

`origin_address.state_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.country_code`** |

`customer.*`

`destrintation_address.*`

|\n|**`origin_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.state_code`** |

`origin_address.country_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.zip_code`** |

`origin_address.country_code`

`origin_address.city`

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`market.id`** | |\n|**`market.name`** | |\n|**`market.number`** | |\n|**`return.reference`** | |\n|**`return.reference_origin`** | |\n|**`return.status`** | |\n|**`return.currency_code`** | |\n|**`return_line_items.line_item_name`** | |\n|**`return_line_items.line_item_code`** | |\n|**`return_line_items.line_item_item_type`** | |\n|**`stock_location.name`** | |\n|**`stock_location.reference`** | |\n|**`stock_location.reference_origin`** | |\n|**`tags.id`** | |\n|**`tags.name`** | |\n" enum: - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.reference - return.reference_origin - return.status - return.mode - return.currency_code - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name field: type: string description: "These are the valid values you can specify for the field key of the breakdown query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats sort: type: string description: Result sorting enum: - asc - desc limit: type: integer description: Results limit default: 10 maximum: 100 condition: description: Condition to filter the data over the breakdown result, value of the operator must be a Number or Array of numbers if operator is a range oneOf: - type: object properties: eq: type: number - type: object properties: ne: type: number - type: object properties: gt: type: number - type: object properties: gte: type: number - type: object properties: lt: type: number - type: object properties: lte: type: number - type: object properties: gt_lt: type: array items: type: number - type: object properties: gte_lte: type: array items: type: number - type: object properties: gte_lt: type: array items: type: number - type: object properties: gt_lte: type: array items: type: number additionalProperties: false breakdown: type: object properties: by: type: string description: "Field to base your breakdown query.\n\nForbidden nesting\n\n These are the valid values you can specify for the by key of the breakdown query and the related forbidden values for the by key of the nested breakdown, based on the by key of the parent breakdown (i.e. for each row of the table below the full list of the valid values for the by key of the nested breakdown is given by all the values in the \"Value\" column except the values in the row's \"Forbidden nesting\" cell):\n\n\n \n| Value | Forbidden nesting |\n| --- | ------ |\n|**`customer.email`** | |\n|**`customer.group_name`** | |\n|**`destination_address.business`** |

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`destination_address.city`** |

`destination_address.country_code`

`destination_address.state_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.country_code`** |

`customer.*`

`origin_address.*`

|\n|**`destination_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`destination_address.state_code`** |

`destination_address.country_code`

`customer.*`

`origin_address.*`

|\n|**`destination_address.zip_code`** |

`destination_address.country_code`

`destination_address.city`

`destination_address.geocoded`

`destination_address.localized`

`customer.*`

`origin_address.*`

|\n|**`origin_address.business`** |

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`origin_address.city`** |

`origin_address.country_code`

`origin_address.state_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.country_code`** |

`customer.*`

`destrintation_address.*`

|\n|**`origin_address.geocoded`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.localized`** |

`destination_address.*`

`customer.*`

`origin_address.*`

|\n|**`origin_address.state_code`** |

`origin_address.country_code`

`customer.*`

`destination_address.*`

|\n|**`origin_address.zip_code`** |

`origin_address.country_code`

`origin_address.city`

`origin_address.geocoded`

`origin_address.localized`

`customer.*`

`destination_address.*`

|\n|**`market.id`** | |\n|**`market.name`** | |\n|**`market.number`** | |\n|**`return.reference`** | |\n|**`return.reference_origin`** | |\n|**`return.status`** | |\n|**`return.currency_code`** | |\n|**`return_line_items.line_item_name`** | |\n|**`return_line_items.line_item_code`** | |\n|**`return_line_items.line_item_item_type`** | |\n|**`stock_location.name`** | |\n|**`stock_location.reference`** | |\n|**`stock_location.reference_origin`** | |\n|**`tags.id`** | |\n|**`tags.name`** | |\n" enum: - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.name - market.number - organization.id - organization.name - organization.slug - return.reference - return.reference_origin - return.status - return.mode - return.currency_code - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - stock_location.name - stock_location.reference - stock_location.reference_origin - tags.id - tags.name field: type: string description: "These are the valid values you can specify for the field key of the breakdown query and the related valid operators, based on that key:\n\n\n \n| Value | Operators |\n| --- | --------- |\n|**`customer.id`** |

`value_count`

|\n|**`customer.email`** |

`value_count`

|\n|**`customer.group_name`** |

`value_count`

|\n|**`destination_address.business`** |

`value_count`

|\n|**`destination_address.city`** |

`value_count`

|\n|**`destination_address.country_code`** |

`value_count`

|\n|**`destination_address.geocoded`** |

`value_count`

|\n|**`destination_address.localized`** |

`value_count`

|\n|**`destination_address.state_code`** |

`value_count`

|\n|**`destination_address.zip_code`** |

`value_count`

|\n|**`origin_address.business`** |

`value_count`

|\n|**`origin_address.city`** |

`value_count`

|\n|**`origin_address.country_code`** |

`value_count`

|\n|**`origin_address.geocoded`** |

`value_count`

|\n|**`origin_address.localized`** |

`value_count`

|\n|**`origin_address.state_code`** |

`value_count`

|\n|**`origin_address.zip_code`** |

`value_count`

|\n|**`market.id`** |

`cardinality`

`value_count`

|\n|**`market.number`** |

`cardinality`

`value_count`

|\n|**`return.number`** |

`value_count`

|\n|**`return.reference`** |

`value_count`

|\n|**`return.reference_origin`** |

`value_count`

|\n|**`return.status`** |

`value_count`

|\n|**`return.id`** |

`cardinality`

`value_count`

|\n|**`return.order_id`** |

`value_count`

|\n|**`return.skus_count`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.quantity`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_id`** |

`value_count`

|\n|**`return_line_items.line_item_name`** |

`value_count`

|\n|**`return_line_items.line_item_code`** |

`value_count`

|\n|**`return_line_items.line_item_item_type`** |

`value_count`

|\n|**`return_line_items.line_item_total_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_amount`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`return_line_items.line_item_tax_rate`** |

`avg`

`max`

`min`

`sum`

`stats`

|\n|**`stock_location.id`** |

`value_count`

|\n|**`stock_location.name`** |

`value_count`

|\n|**`stock_location.reference`** |

`value_count`

|\n|**`stock_location.reference_origin`** |

`value_count`

|\n" enum: - customer.id - customer.email - customer.group_name - destination_address.business - destination_address.city - destination_address.country_code - destination_address.geocoded - destination_address.localized - destination_address.state_code - destination_address.zip_code - origin_address.business - origin_address.city - origin_address.country_code - origin_address.geocoded - origin_address.localized - origin_address.state_code - origin_address.zip_code - market.id - market.number - return.number - return.reference - return.reference_origin - return.status - return.mode - return.id - return.order_id - return.skus_count - return_line_items.quantity - return_line_items.line_item_id - return_line_items.line_item_name - return_line_items.line_item_code - return_line_items.line_item_item_type - return_line_items.line_item_total_amount - return_line_items.line_item_tax_amount - return_line_items.line_item_tax_rate - stock_location.id - stock_location.name - stock_location.reference - stock_location.reference_origin operator: type: string description: Operator to apply enum: - value_count - cardinality - avg - max - min - sum - stats sort: type: string description: Result sorting enum: - asc - desc limit: type: integer description: Results limit default: 10 maximum: 100 condition: description: Condition to filter the data over the breakdown result, value of the operator must be a Number or Array of numbers if operator is a range oneOf: - type: object properties: eq: type: number - type: object properties: ne: type: number - type: object properties: gt: type: number - type: object properties: gte: type: number - type: object properties: lt: type: number - type: object properties: lte: type: number - type: object properties: gt_lt: type: array items: type: number - type: object properties: gte_lte: type: array items: type: number - type: object properties: gte_lt: type: array items: type: number - type: object properties: gt_lte: type: array items: type: number additionalProperties: false required: - by - field - operator meta: type: object properties: payload: type: boolean description: Set to true if you want to receive how the payload has been made returns_export_request: type: object properties: filter: $ref: '#/components/schemas/returns_filter' search: type: object required: - fields properties: sort: type: string description: Result sorting enum: - asc - desc default: desc sort_by: $ref: '#/components/schemas/returns_export_fields' fields: type: array items: $ref: '#/components/schemas/returns_export_fields' description: Fields to export (order/return and single-level references only, no line_items). tags.name and tags.id return joined values. meta: type: object properties: payload: type: boolean description: Set to true if you want to receive how the payload has been made securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT