(customer_portal.customers)
- get - Get Customer
- update - Update Customer
- get_payment_methods - Get Customer Payment Methods
- add_payment_method - Add Customer Payment Method
- delete_payment_method - Delete Customer Payment Method
Get authenticated customer.
Scopes: customer_portal:read
customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.customers.get(security=polar_sdk.CustomerPortalCustomersGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
))
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
security |
models.CustomerPortalCustomersGetSecurity | ✔️ | The security requirements to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.SDKError | 4XX, 5XX | */* |
Update authenticated customer.
Scopes: customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.customers.update(security=polar_sdk.CustomerPortalCustomersUpdateSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
))
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CustomerPortalCustomerUpdate | ✔️ | The request object to use for the request. |
security |
models.CustomerPortalCustomersUpdateSecurity | ✔️ | The security requirements to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Get saved payment methods of the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.customers.get_payment_methods(security=polar_sdk.CustomerPortalCustomersGetPaymentMethodsSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
))
while res is not None:
# Handle items
res = res.next()
Parameter | Type | Required | Description |
---|---|---|---|
security |
models.CustomerPortalCustomersGetPaymentMethodsSecurity | ✔️ | N/A |
page |
Optional[int] | ➖ | Page number, defaults to 1. |
limit |
Optional[int] | ➖ | Size of a page, defaults to 10. Maximum is 100. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.CustomerPortalCustomersGetPaymentMethodsResponse
Error Type | Status Code | Content Type |
---|---|---|
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Add a payment method to the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.customers.add_payment_method(security=polar_sdk.CustomerPortalCustomersAddPaymentMethodSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), request={
"confirmation_token_id": "<id>",
"set_default": False,
"return_url": "https://slight-digestive.info",
})
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.CustomerPaymentMethodCreate | ✔️ | The request object to use for the request. |
security |
models.CustomerPortalCustomersAddPaymentMethodSecurity | ✔️ | The security requirements to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.CustomerPortalCustomersAddPaymentMethodResponseCustomerPortalCustomersAddPaymentMethod
Error Type | Status Code | Content Type |
---|---|---|
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |
Delete a payment method from the authenticated customer.
Scopes: customer_portal:read
customer_portal:write
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
polar.customer_portal.customers.delete_payment_method(security=polar_sdk.CustomerPortalCustomersDeletePaymentMethodSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<id>")
# Use the SDK ...
Parameter | Type | Required | Description |
---|---|---|---|
security |
models.CustomerPortalCustomersDeletePaymentMethodSecurity | ✔️ | N/A |
id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
Error Type | Status Code | Content Type |
---|---|---|
models.ResourceNotFound | 404 | application/json |
models.HTTPValidationError | 422 | application/json |
models.SDKError | 4XX, 5XX | */* |