Skip to content

get-customer-mandate ​

Method: GET
Path: /customers/{customer_id}/mandates/{mandate_id}

Tags: Customers

Summary ​

Get mandate

Description ​

Retrieve a mandate for a given customer.

Storefront SDK Usage ​

SDK Method: sdk.customer.getMandate()

Example:

typescript
const { data, error } = await sdk.customer.getMandate({
  mandate_id: "mandate_456"
});

// Force a sync with the upstream provider
const { data: synced } = await sdk.customer.getMandate(
  { mandate_id: "mandate_456" },
  { sync: true }
);

if (error) {
  console.error("Failed to get mandate:", error);
  return;
}

console.log("Mandate:", data.mandate);

TypeScript Definition ​

typescript
"get-customer-mandate": {
        parameters: {
            query?: {
                /** @description If true, sync the mandate status from the external mandate provider before returning. */
                sync?: boolean;
            };
            header?: never;
            path: {
                /** @description Customer Id */
                customer_id: string;
                /** @description Mandate Id */
                mandate_id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            mandate: components["schemas"]["CustomerMandate"];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References ​

ReferenceResolves To
components["schemas"]["CustomerMandate"]CustomerMandate
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters ​

  • sync (query): If true, sync the mandate status from the external mandate provider before returning.

Responses ​

200 ​

OK

401 ​

Not authorized for given operation on the Resource

404 ​

Requested resource not found

OpenAPI Definition ​

json
{
  "tags": [
    "Customers"
  ],
  "operationId": "get-customer-mandate",
  "summary": "Get mandate",
  "description": "Retrieve a mandate for a given customer.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/get-customer-mandate",
    "description": "API reference for the get-customer-mandate operation"
  },
  "parameters": [
    {
      "name": "sync",
      "in": "query",
      "description": "If true, sync the mandate status from the external mandate provider before returning.",
      "required": false,
      "schema": {
        "type": "boolean"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "message",
              "success",
              "content"
            ],
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "mandate": {
                    "$ref": "#/components/schemas/CustomerMandate"
                  }
                },
                "required": [
                  "mandate"
                ],
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "customers",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "getCustomerMandate"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: