{{-- Back link --}}
Back to Orders
{{-- Header --}}

{{ $order->amazon_order_id }}

{{-- Status badge --}} @php $color = $order->statusColor(); $badgeClass = [ 'green' => 'bg-green-50 text-green-700 ring-green-200', 'yellow' => 'bg-yellow-50 text-yellow-700 ring-yellow-200', 'blue' => 'bg-blue-50 text-blue-700 ring-blue-200', 'red' => 'bg-red-50 text-red-700 ring-red-200', 'gray' => 'bg-gray-100 text-gray-600 ring-gray-200', ][$color] ?? 'bg-gray-100 text-gray-600 ring-gray-200'; @endphp {{ $order->order_status }} @if($order->is_prime) ★ Prime @endif @if($order->is_business_order) B2B @endif

Purchased {{ $order->purchase_date?->format('D, d M Y \a\t H:i') }} UTC  ·  {{ $order->sales_channel ?? 'Amazon' }}  ·  {{ $order->fulfillment_channel === 'AFN' ? 'Fulfilled by Amazon (FBA)' : 'Fulfilled by Merchant (FBM)' }}

{{-- Order total --}} @if($order->order_total)
{{ $order->currency_code }} {{ number_format($order->order_total, 2) }}
Order total
@endif
{{-- Main grid --}}
{{-- LEFT COLUMN: Items + Financials --}}
{{-- Order Items --}}

Order Items

{{ $order->items->count() }} item{{ $order->items->count() !== 1 ? 's' : '' }}
@if($order->items->isEmpty())
No item data synced yet.
@else
@foreach($order->items as $item)
{{-- Product icon placeholder --}}
{{-- Title --}}

{{ $item->title ?? 'Unknown Product' }}

{{-- Identifiers --}}
@if($item->asin) ASIN: {{ $item->asin }} @endif @if($item->seller_sku) SKU: {{ $item->seller_sku }} @endif @if($item->order_item_id) Item ID: {{ $item->order_item_id }} @endif
{{-- Qty + pricing row --}}
Qty ordered: {{ $item->quantity_ordered }}
Qty shipped: {{ $item->quantity_shipped }}
{{-- Customization data --}} @php // Parsed ZIP data (after Amazon Custom role is enabled) $customFields = $item->customization_data ?? []; // Fallback: read directly from raw_data if ZIP not parsed yet if (empty($customFields) && !empty($item->raw_data['BuyerCustomizedInfo']['CustomizedURL'])) { $customFields = [['label' => 'Customization URL', 'value' => $item->raw_data['BuyerCustomizedInfo']['CustomizedURL']]]; } @endphp @if(!empty($customFields))
Customization
@foreach($customFields as $field) @if(!empty($field['value'])) @if(($field['type'] ?? 'text') === 'image') {{-- Image field --}}
{{ $field['label'] ?? 'Image' }}: {{ $field['label'] ?? 'Customization image' }}
@else {{-- Text field --}}
{{ $field['label'] ?? 'Field' }}: {{ $field['value'] }}
@endif @endif @endforeach
@endif
{{-- Pricing block --}}
@if($item->item_price !== null)
{{ $item->currency_code }} {{ number_format($item->item_price, 2) }}
@endif @if($item->item_tax)
+ {{ $item->currency_code }} {{ number_format($item->item_tax, 2) }} tax
@endif @if($item->shipping_price)
+ {{ $item->currency_code }} {{ number_format($item->shipping_price, 2) }} shipping
@endif @if($item->promotion_discount)
− {{ $item->currency_code }} {{ number_format($item->promotion_discount, 2) }} promo
@endif
@endforeach
{{-- Items total --}}
{{ $order->number_of_items_shipped }} shipped / {{ $order->number_of_items_unshipped }} unshipped @if($order->order_total)
Total: {{ $order->currency_code }} {{ number_format($order->order_total, 2) }}
@endif
@endif
{{-- Financial breakdown --}} @if($order->items->isNotEmpty())

Financial Breakdown

@php $subtotal = $order->items->sum('item_price'); $totalTax = $order->items->sum('item_tax'); $totalShip = $order->items->sum('shipping_price'); $totalDisc = $order->items->sum('promotion_discount'); $currency = $order->currency_code; @endphp
Items subtotal {{ $currency }} {{ number_format($subtotal, 2) }}
@if($totalTax > 0)
Tax {{ $currency }} {{ number_format($totalTax, 2) }}
@endif @if($totalShip > 0)
Shipping {{ $currency }} {{ number_format($totalShip, 2) }}
@endif @if($totalDisc > 0)
Promotions / Discounts − {{ $currency }} {{ number_format($totalDisc, 2) }}
@endif
Order Total {{ $currency }} {{ number_format($order->order_total ?? ($subtotal + $totalTax + $totalShip - $totalDisc), 2) }}
@endif
{{-- RIGHT COLUMN: Meta panels --}}
{{-- Buyer Info --}}

Buyer

@if($order->buyer_name)
{{ strtoupper(substr($order->buyer_name, 0, 1)) }}
{{ $order->buyer_name }}
@if($order->buyer_email)
{{ $order->buyer_email }}
@endif
@else

Buyer opted out of contact info sharing.

@endif
{{-- Shipping Address --}}

Shipping Address

@if($order->shipping_address) @php $addr = $order->shipping_address; @endphp
@if(!empty($addr['Name']))
{{ $addr['Name'] }}
@endif @if(!empty($addr['AddressLine1']) && $addr['AddressLine1'] !== 'null')
{{ $addr['AddressLine1'] }}
@endif @if(!empty($addr['AddressLine2']) && $addr['AddressLine2'] !== 'null')
{{ $addr['AddressLine2'] }}
@endif @if(!empty($addr['AddressLine3']) && $addr['AddressLine3'] !== 'null')
{{ $addr['AddressLine3'] }}
@endif
@if(!empty($addr['PostalCode'])) {{ $addr['PostalCode'] }} @endif @if(!empty($addr['City'])) {{ $addr['City'] }} @endif
@if(!empty($addr['StateOrRegion']))
{{ $addr['StateOrRegion'] }}
@endif @if(!empty($addr['CountryCode']))
{{ $addr['CountryCode'] }}
@endif
@else

No shipping address available.

@endif
{{-- Dates --}}

Timeline

@foreach([ ['label' => 'Purchase Date', 'value' => $order->purchase_date], ['label' => 'Last Updated', 'value' => $order->last_update_date], ['label' => 'Earliest Ship Date', 'value' => $order->earliest_ship_date], ['label' => 'Latest Ship Date', 'value' => $order->latest_ship_date], ['label' => 'Earliest Delivery', 'value' => $order->earliest_delivery_date], ['label' => 'Latest Delivery', 'value' => $order->latest_delivery_date], ] as $date) @if($date['value'])
{{ $date['label'] }} {{ $date['value']->format('d M Y') }}
{{ $date['value']->format('H:i') }} UTC
@endif @endforeach
{{-- Order metadata --}}

Order Details

@foreach([ ['label' => 'Marketplace', 'value' => $order->marketplace_id], ['label' => 'Sales Channel', 'value' => $order->sales_channel], ['label' => 'Fulfillment', 'value' => $order->fulfillment_channel === 'AFN' ? 'FBA' : 'FBM'], ['label' => 'Seller Order ID', 'value' => $order->seller_order_id], ['label' => 'Amazon Account', 'value' => $order->amazonAccount?->seller_id], ['label' => 'Prime', 'value' => $order->is_prime ? 'Yes' : 'No'], ['label' => 'Business Order', 'value' => $order->is_business_order ? 'Yes' : 'No'], ['label' => 'Replacement', 'value' => $order->is_replacement_order ? 'Yes' : 'No'], ] as $meta) @if(!is_null($meta['value']) && $meta['value'] !== '')
{{ $meta['label'] }} {{ $meta['value'] }}
@endif @endforeach