Skip to content

delete-address

Method: DELETE
Path: /customers/{user_id}/addresses/{address_id}

Tags: Customers

Summary

Remove particular address

Description

Delete address

Storefront SDK Usage

SDK Method: sdk.customer.deleteAddress()

Example:

typescript
const { data, error } = await sdk.customer.deleteAddress({
  user_id: "user_456",
  address_id: "addr_789"
});

if (error) {
  console.error("Failed to delete address:", error);
  return;
}

console.log("Address deleted:", data.message);

TypeScript Definition

typescript
"delete-address": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description address id */
                address_id: string;
                /** @description user id */
                user_id: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        /** @example address removed successfully */
                        message?: string;
                        success?: boolean;
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

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

Parameters

  • address_id (path): address id
  • user_id (path): user id

Responses

200

OK

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Customers"
  ],
  "operationId": "delete-address",
  "summary": "Remove particular address",
  "description": "Delete address",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/delete-address",
    "description": "API reference for the delete-address operation"
  },
  "parameters": [
    {
      "name": "address_id",
      "in": "path",
      "description": "address id",
      "required": true,
      "schema": {
        "type": "string"
      }
    },
    {
      "name": "user_id",
      "in": "path",
      "description": "user id",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string",
                "examples": [
                  "address removed successfully"
                ]
              },
              "success": {
                "type": "boolean"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "customers",
  "x-speakeasy-ignore": false,
  "x-speakeasy-name-override": "deleteAddress"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: