(customer_portal.orders)
List orders of the authenticated customer.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.list(security=polar_sdk.CustomerPortalOrdersListSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), page=1, limit=10)
while res is not None:
# Handle items
res = res.next()
models.CustomerPortalOrdersListResponse
| Error Type |
Status Code |
Content Type |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get an order by ID for the authenticated customer.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.get(security=polar_sdk.CustomerPortalOrdersGetSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)
models.CustomerOrder
| Error Type |
Status Code |
Content Type |
| models.ResourceNotFound |
404 |
application/json |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Update an order for the authenticated customer.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.update(security=polar_sdk.CustomerPortalOrdersUpdateSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>", customer_order_update={
"billing_address": {
"country": polar_sdk.AddressInputCountryAlpha2Input.US,
},
})
# Handle response
print(res)
models.CustomerOrder
| Error Type |
Status Code |
Content Type |
| models.ResourceNotFound |
404 |
application/json |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Trigger generation of an order's invoice.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.generate_invoice(security=polar_sdk.CustomerPortalOrdersGenerateInvoiceSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)
Any
| Error Type |
Status Code |
Content Type |
| models.MissingInvoiceBillingDetails |
422 |
application/json |
| models.NotPaidOrder |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get an order's invoice data.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.invoice(security=polar_sdk.CustomerPortalOrdersInvoiceSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)
models.CustomerOrderInvoice
| Error Type |
Status Code |
Content Type |
| models.ResourceNotFound |
404 |
application/json |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Get the current payment status for an order.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.get_payment_status(security=polar_sdk.CustomerPortalOrdersGetPaymentStatusSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>")
# Handle response
print(res)
models.CustomerOrderPaymentStatus
| Error Type |
Status Code |
Content Type |
| models.ResourceNotFound |
404 |
application/json |
| models.HTTPValidationError |
422 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |
Confirm a retry payment using a Stripe confirmation token.
import polar_sdk
from polar_sdk import Polar
with Polar() as polar:
res = polar.customer_portal.orders.confirm_retry_payment(security=polar_sdk.CustomerPortalOrdersConfirmRetryPaymentSecurity(
customer_session="<YOUR_BEARER_TOKEN_HERE>",
), id="<value>", customer_order_confirm_payment={})
# Handle response
print(res)
models.CustomerOrderPaymentConfirmation
| Error Type |
Status Code |
Content Type |
| models.ResourceNotFound |
404 |
application/json |
| models.PaymentAlreadyInProgress |
409 |
application/json |
| models.OrderNotEligibleForRetry |
422 |
application/json |
| models.ManualRetryLimitExceeded |
429 |
application/json |
| models.SDKError |
4XX, 5XX |
*/* |