class

Polar::Api::CustomerPortal::Orders

Inherits Reference < Object

API client for orders operations in customer_portal context

Constants

Log = ::Log.for(self)

Constructors

new(client : Client)

Creates a new Orders instance

@param client [Client] The Polar API client instance

Source

Instance methods

Confirm Retry Payment

Confirm a retry payment using a Stripe confirmation token.

Scopes: customer_portal:write

Endpoint: POST /v1/customer-portal/orders/{id}/confirm-payment

Parameters:

  • id (required): The order ID.
  • body (required): Request body as Polar::Models::CustomerOrderConfirmPayment

Returns: Polar::Models::CustomerOrderPaymentConfirmation

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
generate_invoice(id : String)

Generate Order Invoice

Trigger generation of an order's invoice.

Scopes: customer_portal:read customer_portal:write

Endpoint: POST /v1/customer-portal/orders/{id}/invoice

Parameters:

  • id (required): The order ID.

Returns: JSON response string

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get Order

Get an order by ID for the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/orders/{id}

Parameters:

  • id (required): The order ID.

Returns: Polar::Models::CustomerOrder

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get Order Payment Status

Get the current payment status for an order.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/orders/{id}/payment-status

Parameters:

  • id (required): The order ID.

Returns: Polar::Models::CustomerOrderPaymentStatus

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Get Order Invoice

Get an order's invoice data.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/orders/{id}/invoice

Parameters:

  • id (required): The order ID.

Returns: Polar::Models::CustomerOrderInvoice

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source
list(product_id : String | Nil = nil, product_billing_type : String | Nil = nil, subscription_id : String | Nil = nil, query : String | Nil = nil, page : Int32 | Nil = nil, limit : Int32 | Nil = nil, sorting : String | Nil = nil) : Polar::Models::ListResource(Polar::Models::CustomerOrder)

List Orders

List orders of the authenticated customer.

Scopes: customer_portal:read customer_portal:write

Endpoint: GET /v1/customer-portal/orders/

Parameters:

  • 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.
  • subscription_id (optional): Filter by subscription ID.
  • query (optional): Search by product or organization name.
  • 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.

Returns: Polar::Models::ListResource(Polar::Models::CustomerOrder)

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source

Update Order

Update an order for the authenticated customer.

Scopes: customer_portal:write

Endpoint: PATCH /v1/customer-portal/orders/{id}

Parameters:

  • id (required): The order ID.
  • body (required): Request body as Polar::Models::CustomerOrderUpdate

Returns: Polar::Models::CustomerOrder

Raises:

  • ResourceNotFoundError on 404
  • NotPermittedError on 403
  • HTTPValidationError on 422
  • PolarError on other errors
Source