Skip to content

update-customer-mandate

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

Tags: Customers

Summary

Update mandate

Description

Updates the max_amount or end_at of an existing mandate. Only mandates with an active status can be updated. Returns the updated CustomerMandate.

Storefront SDK Usage

SDK Method: sdk.customer.updateMandate()

Example:

typescript
const { data, error } = await sdk.customer.updateMandate(
  { mandate_id: "mandate_456" },
  {
    max_amount: 50000,
    end_at: "2027-12-31T23:59:59Z"
  }
);

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

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

TypeScript Definition

typescript
"update-customer-mandate": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description Customer Id */
                customer_id: string;
                /** @description Mandate Id */
                mandate_id: string;
            };
            cookie?: never;
        };
        requestBody: {
            content: {
                "application/json": {
                    max_amount?: number;
                    /** Format: date-time */
                    end_at?: string;
                };
            };
        };
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            mandate: components["schemas"]["CustomerMandate"];
                        };
                    };
                };
            };
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

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

Request Body

Content Types: application/json

Responses

200

OK

400

Bad request

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Customers"
  ],
  "operationId": "update-customer-mandate",
  "summary": "Update mandate",
  "description": "Updates the `max_amount` or `end_at` of an existing mandate. Only mandates with an `active` status can be updated. Returns the updated `CustomerMandate`.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/update-customer-mandate",
    "description": "API reference for the update-customer-mandate operation"
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "max_amount": {
              "type": "number"
            },
            "end_at": {
              "type": "string",
              "format": "date-time"
            }
          }
        }
      }
    }
  },
  "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"
              }
            }
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "customers",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "updateCustomerMandate"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: