Billings reference
BillingClient
Bases: BaseClient
Source code in abacatepay/billings/client.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
create(data, **kwargs)
Create a new billing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
BillingIn
|
an instance of |
required |
Other Parameters:
Name | Type | Description |
---|---|---|
products |
List[Product]
|
List of products to be billed. |
returnURL |
str
|
The URL the user will be redirected to after the billing is completed. |
completionUrl |
str
|
The URL the API will make a POST request after the billing is completed. |
methods |
List[BILLING_METHODS]
|
The payment methods to be accepted. Defaults to ["PIX"]. |
frequency |
BILLING_KINDS
|
The frequency of the billing. Defaults to "ONE_TIME". |
customerId |
str
|
The ID of the customer. If provided, the customer information won't be required. |
customer |
CustomerMetadata
|
The customer information. If customerId is provided, this parameter is ignored. |
Returns:
Name | Type | Description |
---|---|---|
Billing |
Billing
|
The response with the billing data. |
Source code in abacatepay/billings/client.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
list()
List all bills.
Returns:
Name | Type | Description |
---|---|---|
BillingList |
BillingList
|
A list of billing objects. |
Source code in abacatepay/billings/client.py
42 43 44 45 46 47 48 49 50 51 |
|
Billing
Bases: BaseModel
Billing model
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id
|
str
|
Unique identifier of the billing. |
required |
url
|
str
|
the URL which the user can complete the payment. |
required |
amount
|
int
|
the amount to be paid (in cents). |
required |
status
|
BILLING_STATUS
|
the current billing status. |
required |
dev_mode
|
bool
|
if it's operating in dev mode. |
required |
methods
|
List[BILLING_METHODS]
|
the allowed method to the billing. |
required |
products
|
List[ProductInline]
|
The list of products in the billing. |
required |
frequency
|
BILLING_KINDS
|
The billing frequency. |
required |
next_billing
|
Optional[AwareDatetime]
|
date and time of the next billing. |
required |
customer
|
Optional[CustomerInline]
|
the data of the customer that the billing belongs to. |
required |
created_at
|
AwareDatetime
|
The date and time when the billing was created. |
required |
updated_at
|
AwareDatetime
|
the date and time of the last billing update. |
required |
allow_cupons
|
bool
|
If the billing has allowed coupons or not. |
required |
coupons
|
List[Coupon]
|
the available coupons. |
required |
coupons_used
|
List[Coupon]
|
active coupons for this billing. |
required |
metadata
|
BillingMetadata
|
the billing metadata. |
required |
Source code in abacatepay/billings/models.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
BillingIn
Bases: BaseModel
Represents a billing model to creation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
frequency
|
BILLING_KINDS
|
The billing frequency. Defaults to |
required |
methods
|
List[BILLING_METHODS]
|
the allowed method to the billing. Defaults to ['PIX'] |
required |
products
|
List[Product]
|
The list of products in the billing. |
required |
completion_url
|
HttpUrl
|
the redirect URL when the payment is completed. |
required |
return_url
|
HttpUrl
|
the redirect URL when the user clicks on the "back" button. |
required |
customer_id
|
Optional[CustomerID]
|
Unique identifier of the billing. |
required |
customer
|
CustomerMetadata
|
Your customer information. Defaults to {}. |
required |
Source code in abacatepay/billings/models.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
BillingList
Bases: BaseModel
Represents a list of Billings. It can be directly iterated and
supports the usage of the len
function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
List[Billing]
|
the list object having all the billings. |
required |
Source code in abacatepay/billings/models.py
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
BillingMetadata
Bases: BaseModel
model of a billing metadata
Parameters:
Name | Type | Description | Default |
---|---|---|---|
completion_url
|
str
|
the redirect URL when the payment is completed. |
required |
return_url
|
str
|
the redirect URL when the user clicks on the "back" button. |
required |
fee
|
int
|
the billing fee. |
required |
Source code in abacatepay/billings/models.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|