Skip to content

Deliveroo UK: order_number type mismatch (int vs string) #2

@Paul-Simpson

Description

@Paul-Simpson

Description

When using ordercli deliveroo history with a UK Deliveroo account, the command fails with:

json: cannot unmarshal number into Go struct field Order.orders.order_number of type string

Cause

The Deliveroo UK API returns order_number as an integer:

"order_number": 7756

But internal/deliveroo/model.go expects a string:

OrderNumber string `json:"order_number"`

Suggested fix

Change the type to int or use json.Number for flexibility:

OrderNumber int `json:"order_number"`

Environment

  • ordercli v0.1.0
  • Market: UK
  • macOS (arm64)

Workaround

Calling the API directly works:

curl -H "Authorization: Bearer $TOKEN" \
  "https://co-m.uk.deliveroo.com/consumer/order-history/v1/orders?limit=3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions