Skip to content

delete-address ​

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

Tags: Addresses

Summary ​

Remove particular address

Description ​

Delete address

Storefront SDK Usage ​

SDK Method: sdk.customer.deleteAddress()

Example:

typescript
const { data, error } = await sdk.customer.deleteAddress({
  customer_id: "customer_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 customer id */
                customer_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;
                    };
                };
            };
            /** @description `primary-address-delete-error`: the primary address cannot be deleted. `cart-address-remove-error`: the address could not be removed from an active cart. */
            400: components["responses"]["BadRequest"];
            401: components["responses"]["Unauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["NotFound"];
            500: components["responses"]["InternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["responses"]["BadRequest"]BadRequest
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["NotFound"]NotFound
components["responses"]["InternalServerError"]InternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

  • address_id (path): address id
  • customer_id (path): customer id

Responses ​

200 ​

OK

400 ​

Bad request

401 ​

Authentication failed. Codes include token-required, token-expired and token_not_valid for an invalid or expired token.

403 ​

Access denied. token-required requires an authenticated session; permission-denied means the caller cannot access this resource. On POS, session-expired requires signing in again.

404 ​

Requested resource not found

500 ​

The request failed because of an unexpected error.

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "tags": [
    "Addresses"
  ],
  "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": "customer_id",
      "in": "path",
      "description": "customer 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"
              }
            }
          }
        }
      }
    },
    "400": {
      "description": "`primary-address-delete-error`: the primary address cannot be deleted. `cart-address-remove-error`: the address could not be removed from an active cart.",
      "$ref": "#/components/responses/BadRequest"
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    },
    "500": {
      "$ref": "#/components/responses/InternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "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: