ZRPL
  • Welcome!
  • Quick Start
  • Reference
    • API Reference
      • Categories List
      • Category Details by ID
      • Create Simple Product
      • Config Product Creation
      • Product List
      • Update Existing Product
      • Product Details by SKU
      • Product Details by ID
      • Products in Category
      • Create Order
      • Order Details
      • Order History
      • Create Customer
      • Customer Token
      • Create Customer Cart
      • Add Item to Cart
      • View Cart
      • Update Cart
      • Delete Cart
      • Country Code
      • Set Shipping and Billing
      • Place Order
      • Customer Details
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Order History

This API is offering to get list of Orders placed by respective Customer.

GET {{Base_url}}/rest/V1/orders?searchCriteria[filterGroups][][filters][][field]=customer_email&searchCriteria[filterGroups][0][filters][0][value]=qa@zrpl.co.in&searchCriteria[pageSize]=1&searchCriteria[currentPage]=1

Endpoint URL

{{Base_url}}/rest/V1/orders

This is the base endpoint for retrieving orders in Magento. It allows filtering and pagination via the searchCriteria query parameters.


Query Parameters

  1. searchCriteria[filterGroups][][filters][][field]=customer_email

    • Specifies that the filtering will be based on the customer_email field in the orders database.

    • This means the search is looking for orders associated with a specific customer email.

  2. searchCriteria[filterGroups][0][filters][0][value]=qa@zrpl.co.in

    • Provides the value for the customer_email filter.

    • In this case, it is looking for orders linked to the email qa@zrpl.co.in.

  3. searchCriteria[pageSize]=1

    • Sets the number of results to be displayed per page.

    • Here, only 2 orders will be retrieved per page.

  4. searchCriteria[currentPage]=1

    • Specifies the current page of results to retrieve.

    • Here, it retrieves the first page of results.

curl --location --globoff '{{Base_url}}/rest/V1/orders?searchCriteria[filterGroups][][filters][][field]=customer_email&searchCriteria[filterGroups][0][filters][0][value]=qa%40zrpl.co.in&searchCriteria[pageSize]=1&searchCriteria[currentPage]=1' \
--header 'Authorization: Bearer eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjU1LCJ1dHlwaWQiOjIsImlhdCI6MTczNzcyMDg3NiwiZXhwIjoxNzM3NzI0NDc2fQ.Bu80d5d39qw91uBqf4r9X1TU9upa7x-eSNl8ENslm_E' \
--header 'Cookie: PHPSESSID=6t4unirh1unu87ef0stp2sv3kv; private_content_version=5ab80b7def0c212f723edead3c971a19'

Response

{
    "items": [
        {
            "applied_rule_ids": "101",
            "base_currency_code": "INR",
            "base_discount_amount": -76,
            "base_grand_total": 3876,
            "base_discount_tax_compensation_amount": 0,
            "base_shipping_amount": 0,
            "base_shipping_discount_amount": 0,
            "base_shipping_discount_tax_compensation_amnt": 0,
            "base_shipping_incl_tax": 0,
            "base_shipping_tax_amount": 0,
            "base_subtotal": 3800,
            "base_subtotal_incl_tax": 3800,
            "base_tax_amount": 0,
            "base_total_due": 3876,
            "base_to_global_rate": 1,
            "base_to_order_rate": 1,
            "billing_address_id": 350158,
            "coupon_code": "DISCOUNT2UPI",
            "created_at": "2024-03-06 07:49:05",
            "customer_email": "qa@zrpl.co.in",
            "customer_firstname": "qa",
            "customer_group_id": 1,
            "customer_is_guest": 0,
            "customer_lastname": "qa",
            "customer_note_notify": 1,
            "discount_amount": -76,
            "discount_description": "UPI 2%",
            "entity_id": 178786,
            "global_currency_code": "INR",
            "grand_total": 3876,
            "discount_tax_compensation_amount": 0,
            "increment_id": "14000001973",
            "is_virtual": 0,
            "order_currency_code": "INR",
            "protect_code": "5734e86159040e611731aae4144e3a3b",
            "quote_id": 555332,
            "remote_ip": "10.1.0.163",
            "shipping_amount": 0,
            "shipping_description": "Included in Price - Free",
            "shipping_discount_amount": 0,
            "shipping_discount_tax_compensation_amount": 0,
            "shipping_incl_tax": 0,
            "shipping_tax_amount": 0,
            "state": "canceled",
            "status": "canceled",
            "store_currency_code": "INR",
            "store_id": 14,
            "store_name": "ZEPP SPP\nZEPP-SPP\nZEPP Store view",
            "store_to_base_rate": 0,
            "store_to_order_rate": 0,
            "subtotal": 3800,
            "subtotal_incl_tax": 3800,
            "tax_amount": 0,
            "total_due": 3876,
            "total_item_count": 1,
            "total_qty_ordered": 1,
            "updated_at": "2024-03-06 07:59:30",
            "weight": 0,
            "x_forwarded_for": "122.166.57.220",
            "items": [
                {
                    "amount_refunded": 0,
                    "applied_rule_ids": "101",
                    "base_amount_refunded": 0,
                    "base_discount_amount": 76,
                    "base_discount_invoiced": 0,
                    "base_discount_tax_compensation_amount": 0,
                    "base_original_price": 7999,
                    "base_price": 3800,
                    "base_price_incl_tax": 3800,
                    "base_row_invoiced": 0,
                    "base_row_total": 3724,
                    "base_row_total_incl_tax": 3724,
                    "base_tax_amount": 0,
                    "base_tax_invoiced": 0,
                    "created_at": "2024-03-06 07:49:05",
                    "discount_amount": 76,
                    "discount_invoiced": 0,
                    "discount_percent": 2,
                    "free_shipping": 0,
                    "discount_tax_compensation_amount": 0,
                    "is_qty_decimal": 0,
                    "is_virtual": 0,
                    "item_id": 180027,
                    "name": "JBL Tune 230NC TWS Active Noise Cancellation Earbuds with Mic",
                    "no_discount": 0,
                    "order_id": 178786,
                    "original_price": 7999,
                    "price": 3800,
                    "price_incl_tax": 3800,
                    "product_id": 3866,
                    "product_type": "simple",
                    "qty_canceled": 0,
                    "qty_invoiced": 0,
                    "qty_ordered": 1,
                    "qty_refunded": 0,
                    "qty_shipped": 0,
                    "quote_item_id": 80405,
                    "row_invoiced": 0,
                    "row_total": 3724,
                    "row_total_incl_tax": 3724,
                    "row_weight": 0,
                    "sku": "JBLTUNE230NCTWS",
                    "store_id": 14,
                    "tax_amount": 0,
                    "tax_invoiced": 0,
                    "tax_percent": 0,
                    "updated_at": "2024-03-06 07:49:05",
                    "extension_attributes": {
                        "itemized_taxes": []
                    }
                }
            ],
            "billing_address": {
                "address_type": "billing",
                "city": "hyderabad",
                "country_id": "IN",
                "customer_address_id": 13874,
                "email": "qa@zrpl.co.in",
                "entity_id": 350158,
                "firstname": "qa",
                "lastname": "qa",
                "parent_id": 178786,
                "postcode": "500084",
                "region": "Telangana",
                "region_code": "TG",
                "region_id": 564,
                "street": [
                    "Hyderabad"
                ],
                "telephone": "1234567890"
            },
            "payment": {
                "account_status": null,
                "additional_information": [
                    "Cashfree"
                ],
                "amount_authorized": 3876,
                "amount_ordered": 3876,
                "base_amount_authorized": 3876,
                "base_amount_ordered": 3876,
                "base_shipping_amount": 0,
                "cc_exp_year": "0",
                "cc_last4": null,
                "cc_ss_start_month": "0",
                "cc_ss_start_year": "0",
                "entity_id": 178721,
                "method": "cashfree",
                "parent_id": 178786,
                "shipping_amount": 0
            },
            "status_histories": [
                {
                    "comment": "Authorized amount of ₹3,876.00.",
                    "created_at": "2024-03-06 07:49:05",
                    "entity_id": 375946,
                    "entity_name": "order",
                    "is_customer_notified": null,
                    "is_visible_on_front": 0,
                    "parent_id": 178786,
                    "status": "processing"
                }
            ],
            "extension_attributes": {
                "shipping_assignments": [
                    {
                        "shipping": {
                            "address": {
                                "address_type": "shipping",
                                "city": "hyderabad",
                                "country_id": "IN",
                                "customer_address_id": 13874,
                                "email": "qa@zrpl.co.in",
                                "entity_id": 350157,
                                "firstname": "qa",
                                "lastname": "qa",
                                "parent_id": 178786,
                                "postcode": "500084",
                                "region": "Telangana",
                                "region_code": "TG",
                                "region_id": 564,
                                "street": [
                                    "Hyderabad"
                                ],
                                "telephone": "1234567890"
                            },
                            "method": "flatrate_flatrate",
                            "total": {
                                "base_shipping_amount": 0,
                                "base_shipping_discount_amount": 0,
                                "base_shipping_discount_tax_compensation_amnt": 0,
                                "base_shipping_incl_tax": 0,
                                "base_shipping_tax_amount": 0,
                                "shipping_amount": 0,
                                "shipping_discount_amount": 0,
                                "shipping_discount_tax_compensation_amount": 0,
                                "shipping_incl_tax": 0,
                                "shipping_tax_amount": 0
                            }
                        },
                        "items": [
                            {
                                "amount_refunded": 0,
                                "applied_rule_ids": "101",
                                "base_amount_refunded": 0,
                                "base_discount_amount": 76,
                                "base_discount_invoiced": 0,
                                "base_discount_tax_compensation_amount": 0,
                                "base_original_price": 7999,
                                "base_price": 3800,
                                "base_price_incl_tax": 3800,
                                "base_row_invoiced": 0,
                                "base_row_total": 3724,
                                "base_row_total_incl_tax": 3724,
                                "base_tax_amount": 0,
                                "base_tax_invoiced": 0,
                                "created_at": "2024-03-06 07:49:05",
                                "discount_amount": 76,
                                "discount_invoiced": 0,
                                "discount_percent": 2,
                                "free_shipping": 0,
                                "discount_tax_compensation_amount": 0,
                                "is_qty_decimal": 0,
                                "is_virtual": 0,
                                "item_id": 180027,
                                "name": "JBL Tune 230NC TWS Active Noise Cancellation Earbuds with Mic",
                                "no_discount": 0,
                                "order_id": 178786,
                                "original_price": 7999,
                                "price": 3800,
                                "price_incl_tax": 3800,
                                "product_id": 3866,
                                "product_type": "simple",
                                "qty_canceled": 0,
                                "qty_invoiced": 0,
                                "qty_ordered": 1,
                                "qty_refunded": 0,
                                "qty_shipped": 0,
                                "quote_item_id": 80405,
                                "row_invoiced": 0,
                                "row_total": 3724,
                                "row_total_incl_tax": 3724,
                                "row_weight": 0,
                                "sku": "JBLTUNE230NCTWS",
                                "store_id": 14,
                                "tax_amount": 0,
                                "tax_invoiced": 0,
                                "tax_percent": 0,
                                "updated_at": "2024-03-06 07:49:05",
                                "extension_attributes": {
                                    "itemized_taxes": []
                                }
                            }
                        ]
                    }
                ],
                "payment_additional_info": [
                    {
                        "key": "method_title",
                        "value": "Cashfree"
                    }
                ],
                "applied_taxes": [],
                "item_applied_taxes": [],
                "converting_from_quote": false,
                "taxes": [],
                "additional_itemized_taxes": [],
                "mw_earn_points_data": "{\"1\":37.24}"
            }
        }
    ],
    "search_criteria": {
        "filter_groups": [
            {
                "filters": [
                    {
                        "field": "customer_email",
                        "value": "qa@zrpl.co.in",
                        "condition_type": "eq"
                    }
                ]
            }
        ],
        "page_size": 1,
        "current_page": 1
    },
    "total_count": 885
}
{
    "message": "The consumer isn't authorized to access %resources.",
    "parameters": {
        "resources": "Magento_Sales::actions_view"
    }
}

Root Level

  1. items

    • A list of orders retrieved based on the search criteria.

  2. search_criteria

    • Defines the filters and parameters used to search for orders.

  3. total_count

    • The total number of orders matching the search criteria.


Inside items (Order-Level Attributes)

  1. applied_rule_ids

    • IDs of promotion rules applied to the order.

  2. base_currency_code

    • Base currency for the order (INR = Indian Rupee).

  3. base_discount_amount

    • Discount applied to the order in base currency. (Negative value indicates a discount.)

  4. base_grand_total

    • Final order total in base currency, including all discounts and taxes.

  5. base_discount_tax_compensation_amount

    • Compensation for taxes adjusted due to discounts, in base currency.

  6. base_shipping_amount

    • Shipping charges for the order in base currency.

  7. base_shipping_discount_amount

    • Discount applied to shipping, in base currency.

  8. base_shipping_incl_tax

    • Total shipping cost inclusive of taxes in base currency.

  9. base_tax_amount

    • Total tax applied to the order in base currency.

  10. base_subtotal

    • Subtotal of the order (product prices without tax or discounts) in base currency.

  11. base_subtotal_incl_tax

    • Subtotal of the order, inclusive of taxes, in base currency.

  12. base_total_due

    • Remaining amount to be paid for the order in base currency.

  13. base_to_global_rate / base_to_order_rate

    • Conversion rates between the base, global, and order currency.

  14. billing_address_id

    • ID of the billing address associated with the order.

  15. coupon_code

    • Applied coupon code for the order.

  16. created_at / updated_at

    • Order creation and last updated timestamps.

  17. customer_email / customer_firstname / customer_lastname

    • Customer’s email and name.

  18. customer_group_id

    • ID representing the group to which the customer belongs (e.g., retail, wholesale).

  19. customer_is_guest

    • Indicates if the order was placed by a guest (0 = registered, 1 = guest).

  20. discount_amount

    • Total discount applied to the order (same as base_discount_amount, in order currency).

  21. discount_description

    • Description of the discount applied (e.g., "UPI 2%").

  22. entity_id

    • Unique identifier for the order.

  23. global_currency_code / order_currency_code / store_currency_code

    • Currency codes for global, order, and store contexts.

  24. grand_total

    • Final total amount for the order in order currency.

  25. increment_id

    • Order number, often used for display purposes.

  26. is_virtual

    • Indicates if the order contains virtual products only (1 = yes, 0 = no).

  27. quote_id

    • Associated shopping cart ID for the order.

  28. remote_ip

    • IP address from which the order was placed.

  29. shipping_description

    • Description of the shipping method used.

  30. state / status

    • Current state and status of the order (e.g., canceled, processing).

  31. subtotal / subtotal_incl_tax

    • Subtotal amount (excluding and including tax) in order currency.

  32. tax_amount

    • Total tax applied to the order in order currency.

  33. total_due

    • Outstanding amount in order currency.

  34. total_item_count

    • Number of unique items in the order.

  35. total_qty_ordered

    • Total quantity of all products in the order.

  36. weight

    • Combined weight of all products in the order.

  37. x_forwarded_for

    • Proxy IP address if the order was placed via a proxy server.


Nested Levels

Inside items -> items (Order Items)

  1. amount_refunded

    • Amount refunded for the item.

  2. base_price / price

    • Unit price of the item in base currency and order currency.

  3. base_row_total / row_total

    • Total price for the item (unit price × quantity) in base and order currency.

  4. discount_percent

    • Percentage discount applied to the item.

  5. name

    • Name of the product.

  6. product_id / sku

    • Product ID and SKU.

  7. qty_ordered

    • Quantity of the item ordered.

  8. original_price

    • Original price of the product before any discounts.

  9. tax_percent / tax_amount

    • Tax percentage and tax amount applied to the item.


Inside items -> billing_address

  1. address_type

    • Type of address (e.g., billing).

  2. city / postcode / region

    • Billing address city, postal code, and region.

  3. street

    • Street address (as a list for multi-line addresses).

  4. telephone

    • Customer’s phone number.


Inside items -> payment

  1. method

    • Payment method used (e.g., cashfree).

  2. amount_authorized / amount_ordered

    • Authorized and total order amounts.

  3. additional_information

    • Additional data related to the payment method (e.g., "Cashfree").


Inside items -> status_histories

  1. status

    • Historical statuses of the order (e.g., processing).

  2. comment

    • Comments or notes on the status update.


Inside items -> extension_attributes

  1. shipping_assignments

    • Details about shipping, including the shipping address and method.

  2. payment_additional_info

    • Additional information about payment (e.g., "method_title": "Cashfree").

  3. mw_earn_points_data

    • Earned points data in loyalty programs.

PreviousOrder DetailsNextCreate Customer

Last updated 4 months ago