Skip to content

pos-list-promotions

Method: GET
Path: /pos/carts/available-promotions

Tags: POS

Summary

Retrieve all promotions

Description

All active promotions

Pos SDK Usage

SDK Method: pos.listPromotions()

Example:

typescript
// Get all available promotions
const { data, error } = await pos.listPromotions();

if (error) {
  console.error("Failed to get available promotions:", error.message);
} else {
  const promotions = data.promotions || [];
  console.log("Available promotions:", promotions.length);
  promotions.forEach(promotion => {
    console.log("Promotion:", promotion.name, "Type:", promotion.promotion_type);
  });
}

// Override customer group ID for this specific request
const { data: overrideData, error: overrideError } = await pos.listPromotions({
  "x-customer-group-id": "01H9GROUP12345ABC" // Override default SDK config
});

TypeScript Definition

typescript
"pos-list-promotions": {
        parameters: {
            query?: never;
            header?: {
                /** @description This param is used to determine product pricing, promotions, and subscription rates.  If a valid customer group id is provided, pricing details will be retrieved accordingly.  If no matching data is found for the specified customer group id, the system will fall back to the default customer group id.  If no data is found for the default group either, the highest applicable price will be returned. */
                "x-customer-group-id"?: components["parameters"]["CustomerGroupId"];
            };
            path?: never;
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            promotions: components["schemas"]["Promotion"][];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
        };
    };

Component References

ReferenceResolves To
components["parameters"]["CustomerGroupId"]CustomerGroupId
components["schemas"]["Promotion"]Promotion
components["responses"]["Unauthorized"]Unauthorized

Parameters

  • x-customer-group-id (header): This param is used to determine product pricing, promotions, and subscription rates. If a valid customer group id is provided, pricing details will be retrieved accordingly. If no matching data is found for the specified customer group id, the system will fall back to the default customer group id. If no data is found for the default group either, the highest applicable price will be returned.

Responses

200

OK

401

Not authorized for given operation on the Resource

OpenAPI Definition

json
{
  "tags": [
    "POS"
  ],
  "operationId": "pos-list-promotions",
  "summary": "Retrieve all promotions",
  "description": "All active promotions",
  "parameters": [
    {
      "$ref": "#/components/parameters/CustomerGroupId"
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "promotions": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/Promotion"
                    }
                  }
                },
                "required": [
                  "promotions"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "pos",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "listPromotions"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: