Logo PopinaPopina API

Create an address

Create an address

POST/v1/addresses/
authorization<token>

Use device JWT token

In: header

address1string
Length1 <= length
address2?string|null
citystring
Length1 <= length
countrystring
Length1 <= length
zipCodestring
Length1 <= length
regionCode?string|null
isPrimary?boolean
Defaulttrue
typestring
Value in"shipping" | "billing" | "both"
customerIdstring
Formatuuid

Response Body

application/json

application/json

application/json

curl -X POST "http://localhost:4012/v1/addresses/" \  -H "Content-Type: application/json" \  -d '{    "address1": "12 Avenue des Champs-Élysées",    "address2": "3ème étage",    "city": "Paris",    "country": "France",    "zipCode": "75008",    "regionCode": "IDF",    "isPrimary": true,    "type": "shipping",    "customerId": "abcdef01-2345-6789-abcd-ef0123456789"  }'
{
  "id": "003b9759-320d-44db-98d4-d37a17c84b0c",
  "createdAt": "2023-10-01T12:00:00.000Z",
  "updatedAt": "2023-10-01T12:00:00.000Z",
  "address1": "12 Avenue des Champs-Élysées",
  "address2": "3ème étage",
  "city": "Paris",
  "country": "France",
  "zipCode": "75008",
  "regionCode": "IDF",
  "isPrimary": true,
  "type": "shipping",
  "customerId": "abcdef01-2345-6789-abcd-ef0123456789"
}
{
  "message": "string",
  "code": "INSUFFICIENT_BALANCE",
  "meta": {
    "property1": null,
    "property2": null
  }
}
{
  "message": "string",
  "code": "INSUFFICIENT_BALANCE",
  "meta": {
    "property1": null,
    "property2": null
  }
}