> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocartapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# My Account - Get Single Order

> Retrieve detailed information about a specific customer order

<Warning>
  This endpoint is currently shown as a preview of what's currently in development and is subject to change.
</Warning>

<Tip>
  As WooCommerce sends customers an email of the order review, you could use this endpoint to allow customers to return and view their full order without authorization so long as the order ID and order billing email address match. This is useful for guest checkouts.
</Tip>

<Info>
  If the endpoint is accessed with authentication, the order ID must belong to the authenticated user. The billing email address is not required in this case.
</Info>


## OpenAPI

````yaml api-reference/pre-release/openapi-spec-preview.yaml get /my-account/orders/{id}
openapi: 3.0.3
info:
  title: CoCart Preview API
  description: >
    CoCart Preview provides enhanced REST API endpoints for WooCommerce headless
    e-commerce solutions.

    This API extends CoCart with additional functionality for checkout, customer
    account management, and order handling.


    ## Authentication


    The API supports multiple authentication methods:

    - **Cart Key**: For guest customers, pass the cart key via `Cart-Key` header
    or `cart_key` parameter

    - **Basic Auth**: For registered customers using username/password

    - **JWT**: For registered customers using JWT tokens (requires JWT plugin)

    - **Session**: For logged-in WordPress users


    ## Base URL


    All API endpoints are prefixed with `/wp-json/cocart/preview/`


    ## Response Format


    All responses follow the CoCart standard format with consistent error
    handling and data structure.
  termsOfService: http://cocartapi.com/terms-of-conditions-polar/
  contact:
    email: support@cocartapi.com
  license:
    name: GNU General Public License v3.0
    url: http://www.gnu.org/licenses/gpl-3.0.html
  version: 0.0.1
servers:
  - url: '{protocol}://{host}/wp-json/cocart/preview'
    description: API Preview
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
      host:
        default: example-store.com
        description: Your store domain
security: []
tags:
  - name: Checkout
    description: Complete checkout process including payment and order creation
  - name: My Account
    description: Customer account information and profile management
  - name: My Orders
    description: Customer order history and details
  - name: My Downloads
    description: Customer digital downloads
  - name: My Subscriptions
    description: Customer subscription management
externalDocs:
  description: Find out more about CoCart API
  url: https://docs.cocartapi.com
paths:
  /my-account/orders/{id}:
    get:
      tags:
        - My Orders
      summary: Get specific order details
      description: Retrieve detailed information about a specific customer order
      operationId: getMyOrder
      parameters:
        - name: id
          in: path
          description: Unique identifier for the order
          required: true
          schema:
            type: integer
        - name: email
          in: query
          description: The orders billing email address
          required: false
          schema:
            type: string
            format: email
      responses:
        '200':
          description: Order details retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerOrder'
              examples:
                customerOrder:
                  $ref: '#/components/examples/CustomerOrderExample'
        '403':
          description: Forbidden - user must be logged in
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Order not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CustomerOrder:
      type: object
      properties:
        order_id:
          type: integer
          description: Order ID
        order_number:
          type: string
          description: Order number
        order_parent:
          type: integer
          description: Parent order ID
        order_date:
          type: string
          description: Order date
        order_status:
          type: string
          description: Order status
        order_currency:
          type: string
          description: Order currency
        billing_address:
          type: string
          description: >-
            Formatted billing address as comma-separated string (br tags
            replaced with commas)
        shipping_address:
          type: string
          description: >-
            Formatted shipping address as comma-separated string (br tags
            replaced with commas)
        phone:
          type: string
          description: Phone number
        email:
          type: string
          format: email
          description: Email address
        ship_to_billing:
          type: boolean
          description: Whether shipping to billing address
        items:
          type: array
          description: List of order items (converted from object to array)
          items:
            $ref: '#/components/schemas/OrderItem'
        totals:
          type: object
          description: >-
            Order totals with renamed keys (cart_subtotal→subtotal,
            order_subtotal→total)
          additionalProperties:
            $ref: '#/components/schemas/OrderTotal'
        order_note:
          type: string
          description: Customer order note
        order_notes:
          type: array
          items:
            $ref: '#/components/schemas/OrderNote'
        downloads:
          type: array
          items:
            $ref: '#/components/schemas/DownloadItem'
        order_actions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/OrderAction'
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Error code identifier
        message:
          type: string
          description: Human-readable error message
        data:
          type: object
          description: Additional error data
          properties:
            status:
              type: integer
              description: HTTP status code
    OrderItem:
      type: object
      properties:
        item_id:
          type: integer
          description: Item ID
        product_id:
          type: integer
          description: Product ID
        variation_id:
          oneOf:
            - type: integer
            - type: string
          description: >-
            Variation ID (integer for existing variations, string for deleted
            variations)
        product_image:
          type: string
          format: uri
          description: Product image URL
        product_name:
          type: string
          description: Product name
        product_title:
          type: string
          description: Product title
        product_type:
          type: string
          description: Product type
        sku:
          type: string
          description: Product SKU
        quantity:
          type: string
          description: Item quantity
        subtotal:
          type: string
          description: Item subtotal
        purchase_note:
          type: string
          description: Purchase note
        refunded_qty:
          type: string
          description: Refunded quantity
        meta:
          type: object
          description: Item metadata
        link:
          type: string
          format: uri
          description: Link to product
    OrderTotal:
      type: object
      properties:
        label:
          type: string
          description: Total label
        value:
          type: string
          description: Total value
    OrderNote:
      type: object
      properties:
        date:
          type: string
          description: Note date
        note:
          type: string
          description: Note content
    DownloadItem:
      type: object
      properties:
        product_name:
          type: string
          description: Product name
        download_name:
          type: string
          description: Download name
        file:
          type: string
          format: uri
          description: Download URL
        downloads_remaining:
          type: string
          description: Downloads remaining
        download_expires:
          type: string
          description: Download expiration date
    OrderAction:
      type: object
      properties:
        url:
          type: string
          format: uri
          description: Action URL
        name:
          type: string
          description: Action name
  examples:
    CustomerOrderExample:
      value:
        order_id: 789
        order_number: '789'
        order_parent: 0
        order_date: December 15, 2024, 2:20 pm
        order_status: Completed
        order_currency: USD
        billing_address: John Doe, 123 Main St, Apt 4B, Anytown, CA, 12345, US
        shipping_address: John Doe, 123 Main St, Apt 4B, Anytown, CA, 12345, US
        phone: '+1234567890'
        email: john@example.com
        ship_to_billing: false
        items:
          - item_id: 1
            product_id: 456
            variation_id: 0
            product_image: https://example.com/wp-content/uploads/product.jpg
            product_name: Premium T-Shirt
            product_title: Premium T-Shirt
            product_type: simple
            sku: TSHIRT-001
            quantity: '2'
            subtotal: $39.98
            purchase_note: ''
            refunded_qty: '0'
            meta: {}
            link: https://example.com/wp-json/cocart/preview/products/456
        totals:
          subtotal:
            label: Subtotal
            value: $39.98
          shipping:
            label: Shipping
            value: $5.00
          total:
            label: Total
            value: $44.98
        order_note: Please leave at the door
        order_notes:
          - date: December 15, 2024, 2:25 pm
            note: Your order has been shipped
        downloads: []
        order_actions:
          view:
            url: https://example.com/wp-json/cocart/preview/my-account/orders/789
            name: View

````