Skip to content

pos-update-address ​

Method: PUT
Path: /pos/customers/{id}/addresses/{address_id}

Tags: Addresses

Summary ​

Update address detail

Description ​

Replace the address. Supply all required address fields. Omitted billing/shipping defaults reset to false; omitted country_code resets to +91. The primary address can't be unset: setting is_primary to false on it answers 400 primary-address-update-error. Make another address primary instead, which unsets it on the others.

Pos SDK Usage ​

SDK Method: pos.updateAddress()

Example:

typescript
const { data, error } = await pos.updateAddress(
  { id: "cust_123", address_id: "addr_456" },
  {
    first_name: "Jane", phone: "9876543210", address_line1: "123 Main St",
    city: "Mumbai", state: "Maharashtra", country: "India", pincode: "400001"
  }
);

if (error) {
  console.error("Failed to update address:", error.message);
}

TypeScript Definition ​

typescript
"pos-update-address": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description address id */
                address_id: string;
                /** @description customer id */
                id: string;
            };
            cookie?: never;
        };
        requestBody: {
            content: {
                "application/json": components["schemas"]["UpdateAdminAddress"];
            };
        };
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message: string;
                        success: boolean;
                        content: {
                            address: components["schemas"]["Address"];
                        };
                    };
                };
            };
            400: components["responses"]["AdminBadRequest"];
            401: components["responses"]["AdminUnauthorized"];
            403: components["responses"]["Forbidden"];
            404: components["responses"]["AdminNotFound"];
            /** @description Unsupported method. Use GET, PUT, DELETE. */
            405: components["responses"]["MethodNotAllowed"];
            408: components["responses"]["RequestTimeout"];
            500: components["responses"]["AdminInternalServerError"];
            504: components["responses"]["GatewayTimeout"];
        };
    };

Component References ​

ReferenceResolves To
components["schemas"]["UpdateAdminAddress"]UpdateAdminAddress
components["schemas"]["Address"]Address
components["responses"]["AdminBadRequest"]AdminBadRequest
components["responses"]["AdminUnauthorized"]AdminUnauthorized
components["responses"]["Forbidden"]Forbidden
components["responses"]["AdminNotFound"]AdminNotFound
components["responses"]["MethodNotAllowed"]MethodNotAllowed
components["responses"]["RequestTimeout"]RequestTimeout
components["responses"]["AdminInternalServerError"]AdminInternalServerError
components["responses"]["GatewayTimeout"]GatewayTimeout

Parameters ​

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

Request Body ​

Content Types: application/json

Responses ​

200 ​

OK

400 ​

401 ​

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 ​

405 ​

408 ​

500 ​

504 ​

The request timed out.

OpenAPI Definition ​

json
{
  "operationId": "pos-update-address",
  "summary": "Update address detail",
  "description": "Replace the address. Supply all required address fields. Omitted billing/shipping defaults reset to false; omitted country_code resets to +91. The primary address can't be unset: setting `is_primary` to `false` on it answers 400 `primary-address-update-error`. Make another address primary instead, which unsets it on the others.",
  "parameters": [
    {
      "name": "address_id",
      "in": "path",
      "description": "address id",
      "required": true,
      "schema": {
        "type": "string",
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]{1,128}$"
      }
    },
    {
      "name": "id",
      "in": "path",
      "description": "customer id",
      "required": true,
      "schema": {
        "type": "string",
        "maxLength": 128,
        "minLength": 1,
        "pattern": "^[A-Za-z0-9_-]{1,128}$"
      }
    }
  ],
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/UpdateAdminAddress"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "address": {
                    "$ref": "#/components/schemas/Address"
                  }
                },
                "required": [
                  "address"
                ],
                "type": "object"
              }
            },
            "required": [
              "message",
              "success",
              "content"
            ]
          }
        }
      }
    },
    "400": {
      "$ref": "#/components/responses/AdminBadRequest"
    },
    "401": {
      "$ref": "#/components/responses/AdminUnauthorized"
    },
    "403": {
      "$ref": "#/components/responses/Forbidden"
    },
    "404": {
      "$ref": "#/components/responses/AdminNotFound"
    },
    "405": {
      "description": "Unsupported method. Use GET, PUT, DELETE.",
      "$ref": "#/components/responses/MethodNotAllowed"
    },
    "408": {
      "$ref": "#/components/responses/RequestTimeout"
    },
    "500": {
      "$ref": "#/components/responses/AdminInternalServerError"
    },
    "504": {
      "$ref": "#/components/responses/GatewayTimeout"
    }
  },
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/admin-pos/operations/pos-update-address"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    "Addresses"
  ],
  "x-speakeasy-group": "pos"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: