Polar::Api::Orders
API client for orders operations
Constants
Constructors
Creates a new Orders instance
@param client [Client] The Polar API client instance
Instance methods
Export Subscriptions
Export orders as a CSV file.
Scopes: orders:read
Endpoint: GET /v1/orders/export
Parameters:
organization_id(optional): Filter by organization ID.product_id(optional): Filter by product ID.
Returns: JSON response string
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Generate Order Invoice
Trigger generation of an order's invoice.
Scopes: orders:read
Endpoint: POST /v1/orders/{id}/invoice
Parameters:
id(required): The order ID.
Returns: JSON response string
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Get Order
Get an order by ID.
Scopes: orders:read
Endpoint: GET /v1/orders/{id}
Parameters:
id(required): The order ID.
Returns: Polar::Models::Order
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Get Order Invoice
Get an order's invoice data.
Scopes: orders:read
Endpoint: GET /v1/orders/{id}/invoice
Parameters:
id(required): The order ID.
Returns: Polar::Models::OrderInvoice
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
List Orders
List orders.
Scopes: orders:read
Endpoint: GET /v1/orders/
Parameters:
organization_id(optional): Filter by organization ID.product_id(optional): Filter by product ID.product_billing_type(optional): Filter by product billing type. recurring will filter data corresponding to subscriptions creations or renewals. one_time will filter data corresponding to one-time purchases.discount_id(optional): Filter by discount ID.customer_id(optional): Filter by customer ID.checkout_id(optional): Filter by checkout ID.page(optional): Page number, defaults to 1.limit(optional): Size of a page, defaults to 10. Maximum is 100.sorting(optional): Sorting criterion. Several criteria can be used simultaneously and will be applied in order. Add a minus sign - before the criteria name to sort by descending order.metadata(optional): Filter by metadata key-value pairs. It uses the deepObject style, e.g. ?metadata[key]=value.
Returns: Polar::Models::ListResource(Polar::Models::Order)
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors
Update Order
Update an order.
Scopes: orders:write
Endpoint: PATCH /v1/orders/{id}
Parameters:
id(required): The order ID.body(required): Request body as Polar::Models::OrderUpdate
Returns: Polar::Models::Order
Raises:
ResourceNotFoundErroron 404NotPermittedErroron 403HTTPValidationErroron 422PolarErroron other errors