@extends('layouts.app') @section('title', 'Shipping') @section('content')

Dispatch

Orders and shipping

Prepare pending Etsy orders and follow Parcel2Go shipments.

@isset($integrationError)@endisset @if($etsyNotice)
{{ $etsyNotice }} Settings
@endif @if($profileNotice)
{{ $profileNotice }} See the access steps in Settings.
@endif @if($bookingPending)@endif @if($bookingResult) @php $paymentUrl = $bookingResult['Links']['payment'] ?? null; $paymentHost = is_string($paymentUrl) ? parse_url($paymentUrl, PHP_URL_HOST) : null; @endphp

Collection order #{{ $bookingResult['OrderId'] ?? '—' }} created

Total: £{{ number_format((float) ($bookingResult['TotalPrice'] ?? 0), 2) }}. Payment and collection confirmation are completed with Parcel2Go.

@if($paymentHost && ($paymentHost === 'parcel2go.com' || str_ends_with($paymentHost, '.parcel2go.com')))Complete payment ↗@endif
@endif @if($account || $balance)

Account

{{ trim(($account['Forename'] ?? '').' '.($account['Surname'] ?? '')) ?: 'Unavailable' }}

{{ $account['Email'] ?? '' }}

Prepay balance

{{ isset($balance['Balance']) ? '£'.number_format((float) $balance['Balance'], 2) : 'Unavailable' }}

@endif

Pending Etsy orders

Quotes use the Etsy delivery postcode and order value. Enter the packed parcel size and weight.

{{ count($pendingOrders) }} pending
@if(blank($collectionPostcode))

Set your collection postcode once in Parcel2Go settings to quote these orders.

@endif
@forelse($pendingOrders as $receipt) @php $canQuote = filled($collectionPostcode) && filled($receipt['zip'] ?? null) && ($receipt['country_iso'] ?? 'GB') === 'GB' && ($receipt['grandtotal']['currency_code'] ?? 'GBP') === 'GBP'; @endphp

Order #{{ $receipt['receipt_id'] ?? '—' }}

{{ $receipt['name'] ?? 'Buyer' }} · {{ $receipt['city'] ?? 'City unavailable' }} · {{ $receipt['zip'] ?? 'Postcode unavailable' }}

@if(isset($receipt['grandtotal']['amount']))

{{ $receipt['grandtotal']['currency_code'] ?? 'GBP' }} {{ number_format((float) $receipt['grandtotal']['amount'] / max(1, (int) ($receipt['grandtotal']['divisor'] ?? 1)), 2) }}

@endif
@if($canQuote)
@csrf @foreach([['weight','Weight (kg)','0.1'],['length','Length (cm)','1'],['width','Width (cm)','1'],['height','Height (cm)','1']] as [$field,$label,$step])@endforeach
@else

{{ blank($collectionPostcode) ? 'Add a collection postcode in Settings.' : 'A UK delivery postcode and GBP order value are needed from Etsy before this order can be quoted.' }}

@endif
@empty

No paid, unshipped Etsy orders to prepare.

@endforelse
@if(count($quotes) && $selectedReceipt)

Collection services for Etsy order #{{ $selectedReceipt['receipt_id'] }}

@foreach($quotes as $quote)@php $service = $quote['Service'] ?? []; @endphp

{{ $service['Name'] ?? 'Courier service' }}

{{ $service['CourierName'] ?? '' }} · {{ $service['CollectionType'] ?? 'Unknown' }}

{{ isset($quote['TotalPrice']) ? '£'.number_format((float) $quote['TotalPrice'], 2) : 'See details' }}

@if(($service['CollectionType'] ?? null) === 'Collection' && ! empty($service['Slug']))
@csrf
@endif
@endforeach
@endif @if(count($collectionDates) && $selectedService && $selectedReceipt)

Arrange collection for Etsy order #{{ $selectedReceipt['receipt_id'] }}

Creating the order does not take payment. Parcel2Go will provide a payment link.

@csrf
Sender and collection@foreach([['sender_name','Name'],['sender_email','Email'],['sender_phone','Phone'],['sender_property','Property'],['sender_street','Street'],['sender_town','Town']] as [$field,$label])@endforeach
Recipient and delivery@foreach([['recipient_name','Name'],['recipient_email','Email'],['recipient_phone','Phone'],['recipient_property','Property'],['recipient_street','Street'],['recipient_town','Town']] as [$field,$label])@endforeach
@endif

Existing shipments

Current Parcel2Go progress and labels from your account history.

@forelse(($orders['Orders'] ?? []) as $order) @empty@endforelse
OrderCourierServiceProgressEstimated deliveryRecipientDestinationLabel
{{ $order['OrderLineId'] ?? '—' }}{{ $order['Courier'] ?? '—' }}{{ $order['Service'] ?? '—' }} $order['Tracking']['Delivered'] ?? false, 'bg-sky-500/10 text-sky-300' => ! ($order['Tracking']['Delivered'] ?? false)])>{{ ($order['Tracking']['Delivered'] ?? false) ? 'Delivered' : 'In transit' }}{{ app(\App\Services\Display::class)->dateTime($order['EstimatedDeliveryDate'] ?? null) }}{{ $order['DeliveryAddress']['ContactName'] ?? '—' }}{{ app(\App\Services\Display::class)->flag($order['DeliveryAddress'] ?? []) }}@if(app(\App\Services\Parcel2Go::class)->labelHash($order) && ! empty($order['OrderLineId']))4×6A4@elseUnavailable@endif
{{ $historyAvailable ? 'No shipments in Parcel2Go account history.' : 'Shipment history is unavailable. Check the Client Credentials in Settings.' }}
@endsection