Pular para conteúdo

Customers reference

Product

Bases: BaseModel

A product to be appended to a billing when it's being created

Parameters:

Name Type Description Default
external_id str

the product ID in your application.

required
name str

the product name.

required
description Optional[str]

a detailed description of the product.

required
quantity int

the number of units of the given product (min: 1).

required
price int

the price of the product in cents (min: 100).

required
Source code in abacatepay/products/models.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Product(BaseModel):
    """A product to be appended to a billing when it's being created

    Args:
        external_id (str): the product ID in your application.
        name (str): the product name.
        description (Optional[str]): a detailed description of the product.
        quantity (int): the number of units of the given product (min: 1).
        price (int): the price of the product in cents (min: 100).
    """
    external_id: str = Field(
        validation_alias=AliasChoices('externalId', 'external_id'),
        serialization_alias='externalId',
    )
    name: str
    description: Optional[str] = None
    quantity: Annotated[int, Ge(1)]
    price: Annotated[int, Ge(100)]

ProductInline

Bases: BaseModel

Represents a product inside a Billing.

Parameters:

Name Type Description Default
id str

the product ID.

required
external_id str

the product ID in your application.

required
quantity int

the number of units of the given product.

required
Source code in abacatepay/products/models.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class ProductInline(BaseModel):
    """Represents a product inside a Billing.

    Args:
        id (str): the product ID.
        external_id (str): the product ID in your application.
        quantity (int): the number of units of the given product.
    """
    id: str
    external_id: str = Field(
        validation_alias=AliasChoices('external_id', 'externalId'),
        serialization_alias='externalId',
    )
    quantity: Annotated[int, Ge(1)]