# Class PurchaseTransaction (0.13.1)

0.13.1 (latest) 0.13.0 0.12.0 0.11.0 0.10.18 0.9.0 0.8.2 0.7.1 0.6.2 0.5.1 0.4.0 0.3.3 0.2.2 0.1.0

    PurchaseTransaction(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A transaction represents the entire purchase transaction.

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `id` | `str` Optional. The transaction ID with a length limit of 128 bytes. |
| `revenue` | `float` Required. Total revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations. This field is not required if the event type is `refund`. |
| `taxes` | `MutableMapping[str, float]` Optional. All the taxes associated with the transaction. |
| `costs` | `MutableMapping[str, float]` Optional. All the costs associated with the product. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs. Total product cost such that profit = revenue - (sum(taxes) + sum(costs)) If product_cost is not set, then profit = revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is not specified for one of the items, CatalogItem.cost based profit \*cannot\* be calculated for this Transaction. |
| `currency_code` | `str` Required. Currency code. Use three-character ISO-4217 code. This field is not required if the event type is `refund`. |

## Classes

### CostsEntry

    CostsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |

### TaxesEntry

    TaxesEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

The abstract base class for a message.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `kwargs` | `dict` Keys and values corresponding to the fields of the message. |
| `mapping` | ``Union[dict, `.Message`]`` A dictionary or message to be used to determine the values for this message. |
| `ignore_unknown_fields` | `Optional(bool)` If True, do not raise errors for unknown fields. Only applied if `mapping` is a mapping type or there are keyword parameters. |