woob.capabilities.shop

exception OrderNotFound(msg='Order not found')[source]

Bases: UserError

Raised when an order is not found.

class Order(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Purchase order.

Variables:
  • url – (str) url

  • date – (date, datetime) Date when the order was placed

  • shipping – (Decimal) Shipping price

  • discount – (Decimal) Discounts

  • tax – (Decimal) Tax

  • total – (Decimal) Total

class Payment(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Payment for an order.

Variables:
  • url – (str) url

  • date – (date, datetime) The date when payment was applied

  • method – (str) Payment method; e.g. “VISA 1234”

  • amount – (Decimal) Payment amount

class Item(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Purchased item within an order.

Variables:
  • url – (str) url

  • label – (str) Item label

  • price – (Decimal) Item price

class CapShop[source]

Bases: CapCollection

Capability of online shops to see orders history.

iter_resources(objs, split_path)[source]

Iter resources.

Default implementation of this method is to return on top-level all orders (by calling iter_accounts()).

Parameters:
  • objs (tuple[BaseObject]) – type of objects to get

  • split_path (list) – path to discover

Return type:

iter[BaseObject]

get_currency()[source]

Get the currency this shop uses.

Return type:

str

iter_orders()[source]

Iter history of orders.

Return type:

iter[Order]

get_order(id)[source]

Get an order from its ID.

Parameters:

id (str) – ID of the order

Return type:

Order

Raises:

OrderNotFound

iter_payments(order)[source]

Iter payments of a specific order.

Parameters:

order (Order) – order to get payments

Return type:

iter[Payment]

Raises:

OrderNotFound

iter_items(order)[source]

Iter items of a specific order.

Parameters:

order (Order) – order to get items

Return type:

iter[Item]

Raises:

OrderNotFound