> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.mycargoextra.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.mycargoextra.com/_mcp/server.

# Delete User Address

DELETE http://localhost:9000/api/v1/address/{addressId}

Deletes an address owned by the authenticated customer.

Path parameter: `addressId`.

Response: HTTP 204 No Content on success.

Possible errors:
- 400: Invalid address Id - path id is not a valid Mongo ObjectId.
- 404: Address not found or not authorized - address does not exist or belongs to another customer.
- 409: Address already exists - duplicate address detected.
- 400: Default address cannot be deleted - unset/change default first.
- 400: Missing One or More Required Parameters - required body/query fields were not supplied.
- 401: Unauthorized - token is missing, expired, invalid, or the account/token pair was not found.
- 403: Access denied - gateway traffic guard/rate policy blocked the request.
- 429: Too many requests - gateway rate limit exceeded.
- 500: Unexpected Error - unhandled gateway or downstream service failure.

Reference: https://docs.mycargoextra.com/cargo-extra-gateway-api-copy/address/address-address-id/delete-user-address

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/address/{addressId}:
    delete:
      operationId: delete-user-address
      summary: Delete User Address
      description: >-
        Deletes an address owned by the authenticated customer.


        Path parameter: `addressId`.


        Response: HTTP 204 No Content on success.


        Possible errors:

        - 400: Invalid address Id - path id is not a valid Mongo ObjectId.

        - 404: Address not found or not authorized - address does not exist or
        belongs to another customer.

        - 409: Address already exists - duplicate address detected.

        - 400: Default address cannot be deleted - unset/change default first.

        - 400: Missing One or More Required Parameters - required body/query
        fields were not supplied.

        - 401: Unauthorized - token is missing, expired, invalid, or the
        account/token pair was not found.

        - 403: Access denied - gateway traffic guard/rate policy blocked the
        request.

        - 429: Too many requests - gateway rate limit exceeded.

        - 500: Unexpected Error - unhandled gateway or downstream service
        failure.
      tags:
        - subpackage_address.subpackage_address/addressAddressId
      parameters:
        - name: addressId
          in: path
          description: AddressId path parameter.
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestForbiddenError
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestNotFoundError
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestConflictError
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestTooManyRequestsError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/DeleteApiV1AddressAddressidRequestInternalServerError
servers:
  - url: http://localhost:9000
    description: http://localhost:9000
components:
  schemas:
    DeleteApiV1AddressAddressidRequestBadRequestError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestBadRequestError
    DeleteApiV1AddressAddressidRequestUnauthorizedError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestUnauthorizedError
    DeleteApiV1AddressAddressidRequestForbiddenError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestForbiddenError
    DeleteApiV1AddressAddressidRequestNotFoundError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestNotFoundError
    DeleteApiV1AddressAddressidRequestConflictError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestConflictError
    DeleteApiV1AddressAddressidRequestTooManyRequestsError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestTooManyRequestsError
    DeleteApiV1AddressAddressidRequestInternalServerError:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: DeleteApiV1AddressAddressidRequestInternalServerError

```

## Examples



**SDK Code**

```python
import requests

url = "http://localhost:9000/api/v1/address/string"

response = requests.delete(url)

print(response.json())
```

```javascript
const url = 'http://localhost:9000/api/v1/address/string';
const options = {method: 'DELETE'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:9000/api/v1/address/string"

	req, _ := http.NewRequest("DELETE", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:9000/api/v1/address/string")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Delete.new(url)

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("http://localhost:9000/api/v1/address/string")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'http://localhost:9000/api/v1/address/string');

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:9000/api/v1/address/string");
var request = new RestRequest(Method.DELETE);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:9000/api/v1/address/string")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```