# Profile information API

On this page you'll find detailed information how to create, update, delete and retrieve info about certain user's all delivery addresses and billing adresses with possibility to manipulate this data using our public API.

# Technical details:

  • {INSTANCE_URL} is URL of current instance without slash at the end and protocol. e.g. creators-hub-instance.com
  • {USER_ID} is ID of an user you want to fetch/modify avatar from/for. e.g. 6
  • {DELIVERY_ADDRESS_ID} is ID of delivery address entry in instance database
  • {BILLING_ADDRESS_ID} is ID of billing address entry in instance database

# Delivery address

# Get user's all delivery addresses

To get other user's delivery addresses:

GET https://{INSTANCE_URL}/api/public/user/{USER_ID}/deliveryAddresses

To get your delivery addresses:

GET https://{INSTANCE_URL}/api/public/user/me/deliveryAddresses

Response
{
  "deliveryAddresses": [
    {
      "id": 2,
      "userId": 6,
      "name": null,
      "street": "Sezamkowa 14",
      "postal": null,
      "city": null,
      "country": null,
      "companyName": null,
      "taxId": null,
      "email": null,
      "mobilePhone": null,
      "default": false,
      "createdAt": "2023-02-21T13:42:18.056Z",
      "updatedAt": "2023-02-21T13:42:37.028Z",
      "deletedAt": null
    }
  ]
}

# Create delivery address

POST https://{INSTANCE_URL}/api/public/deliveryAddress?id={DELIVERY_ADDRESS_ID}
Payload (application/json)
{
  "userId": 6,
  "name": "Buzz Lightyear",
  "street": "Cosmos",
  "postal": "00-001",
  "city": "Mars Central Station",
  "country": "Moon",
  "companyName": "License Rocks",
  "taxId": "0",
  "email": "buzzlightyear@space-mission.de",
  "mobilePhone": "+48 133 713 371"
}
Response
{
  "newDeliveryAddress": {
    "id": 4,
    "userId": 6,
    "name": "Buzz Lightyear",
    "street": "Cosmos",
    "postal": "00-001",
    "city": "Mars Central Station",
    "country": "Moon",
    "companyName": "License Rocks",
    "taxId": "0",
    "email": "buzzlightyear@space-mission.de",
    "mobilePhone": "+48 133 713 371",
    "default": false,
    "createdAt": "2023-02-22T14:58:58.082Z",
    "updatedAt": "2023-02-22T14:58:58.082Z",
    "deletedAt": null
  }
}

# Update particular delivery address

PUT https://{INSTANCE_URL}/api/public/deliveryAddress?id={DELIVERY_ADDRESS_ID}
Payload (application/json)
{
  "name": "Igor Klepacki",
  "street": "Sezamkowa",
  "postal": "99-999",
  "city": "Sezamki",
  "country": "Poland",
  "companyName": "License Rocks",
  "taxId": "1337",
  "email": "igor@licenserocks.de",
  "mobilePhone": "+48 133 713 371"
}
Response
{
  "updatedDeliveryAddress": {
    "id": 2,
    "userId": 6,
    "name": "Igor Klepacki",
    "street": "Sezamkowa",
    "postal": "99-999",
    "city": "Sezamki",
    "country": "Poland",
    "companyName": "License Rocks",
    "taxId": "1337",
    "email": "igor@licenserocks.de",
    "mobilePhone": "+48 133 713 371",
    "default": false,
    "createdAt": "2023-02-21T13:42:18.056Z",
    "updatedAt": "2023-02-22T14:47:53.846Z",
    "deletedAt": "2023-02-22T14:47:53.845Z"
  }
}

# Delete particular delivery address

DELETE https://{INSTANCE_URL}/api/public/deliveryAddress?id={DELIVERY_ADDRESS_ID}
Response
{
  "updatedDeliveryAddress": {
    "id": 3,
    "userId": 6,
    "name": "Igor Klepacki",
    "street": "Sezamkowa",
    "postal": "99-999",
    "city": "Sezamki",
    "country": "Poland",
    "companyName": "License Rocks",
    "taxId": "1337",
    "email": "igor@licenserocks.de",
    "mobilePhone": "+48 133 713 371",
    "default": false,
    "createdAt": "2023-02-22T08:59:34.633Z",
    "updatedAt": "2023-02-22T14:46:32.925Z",
    "deletedAt": "2023-02-22T14:46:32.924Z"
  }
}

# Billing address

# Get user's all billing addresses

To get other user's delivery addresses:

GET https://{INSTANCE_URL}/api/public/user/{USER_ID}/billingAddresses

To get your billing addresses

GET https://{INSTANCE_URL}/api/public/user/me/billingAddresses

Response
{
  "billingAddresses": [
    {
      "id": 3,
      "isDefault": false,
      "city": "Mars Central Station",
      "country": "Moon",
      "companyName": "License Rocks",
      "postal": "00-001",
      "street": "Cosmos",
      "taxId": "0",
      "userId": 6,
      "createdAt": "2023-02-22T20:43:18.902Z",
      "deletedAt": null,
      "updatedAt": "2023-02-22T20:43:18.903Z"
    }
  ]
}

# Create billing address

POST https://{INSTANCE_URL}/api/public/deliveryAddress?id={BILLING_ADDRESS_ID}
Payload (application/json)
{
  "userId": 6,
  "street": "Cosmos",
  "postal": "00-001",
  "city": "Mars Central Station",
  "country": "Moon",
  "companyName": "License Rocks",
  "taxId": "0"
}
Response
{
  "newBillingAddress": {
    "id": 4,
    "isDefault": false,
    "city": "Mars Central Station",
    "country": "Moon",
    "companyName": "License Rocks",
    "postal": "00-001",
    "street": "Cosmos",
    "taxId": "0",
    "userId": 6,
    "createdAt": "2023-02-22T20:43:33.958Z",
    "deletedAt": null,
    "updatedAt": "2023-02-22T20:43:33.959Z"
  }
}

# Update particular billing address

PUT https://{INSTANCE_URL}/api/public/billingAddress?id={DELIVERY_ADDRESS_ID}
Payload (application/json)
{
  "street": "Cosmos",
  "postal": "00-001",
  "city": "Venus East Station",
  "country": "Moon",
  "companyName": "License Rocks",
  "taxId": "0"
}
Response
{
  "updatedBillingAddress": {
    "id": 3,
    "isDefault": false,
    "city": "Venus East Station",
    "country": "Moon",
    "companyName": "License Rocks",
    "postal": "00-001",
    "street": "Cosmos",
    "taxId": "0",
    "userId": 6,
    "createdAt": "2023-02-22T20:43:33.958Z",
    "deletedAt": null,
    "updatedAt": "2023-02-22T20:45:47.655Z"
  }
}

# Delete particular billing address

DELETE https://{INSTANCE_URL}/api/public/billingAddress?id={DELIVERY_ADDRESS_ID}
Response
{
  "updatedBillingAddress": {
    "id": 4,
    "isDefault": false,
    "city": "Venus East Station",
    "country": "Moon",
    "companyName": "License Rocks",
    "postal": "00-001",
    "street": "Cosmos",
    "taxId": "0",
    "userId": 6,
    "createdAt": "2023-02-22T20:43:33.958Z",
    "deletedAt": "2023-02-22T20:46:36.158Z",
    "updatedAt": "2023-02-22T20:46:36.159Z"
  }
}