POST /v1/Customers

Creates a new Customer with the provided CustomerViewModel. Available to the roles: csp, reseller

Headers

  • X-Tenant string Required

    The domain used to access the portal.

  • Authorization string Required

    JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"

    Default value is Bearer eyJ0eXAiO....

  • X-Correlation-Id string(uuid)

    This header is optional and by setting it you can correlate the audit logs made by this request.

application/json

Body

The customer info to create the customer.

  • id string(uuid)

    The GUID identifier for the customer.

  • companyName string | null Required

    The name of the company. This may be up to 255 characters.

  • taxId string | null

    The company tax Id. This may be up to 255 characters.

  • country string | null Required

    The company country code in the ISO 3166-1 alpha-2 standard.

  • addressLine1 string | null Required

    The company address line 1. This may be up to 255 characters.

  • addressLine2 string | null

    The company address line 2. This may be up to 255 characters.

  • city string | null Required

    The company city. This may be up to 255 characters.

  • state string | null Required

    The company State. This may be up to 255 characters.

  • zip string | null Required

    The company ZIP. This may be up to 30 characters.

  • firstName string | null Required

    The company primary contact first name. This may be up to 255 characters.

  • middleName string | null

    The company primary contact middle name. This may be up to 255 characters.

  • lastName string | null Required

    The company primary contact last name. This may be up to 255 characters.

  • email string | null Required

    The company primary contact email. This may be up to 255 characters.

  • phone string | null Required

    The company primary contact phone. This may be up to 30 characters.

  • internalIdentifier string | null

    The customer internal identifier. This may be up to 255 characters.

  • resellerId string(uuid) | null

    The reseller identifier. If this value is set a relation between this customer and the reseller will be created, if null a direct relation between the CSP and the customer will be created instead.

  • providerCustomers object | null Required

    The provider customers. A list containing the info about this customer in one or more provider instances.

  • customerAssociations array[object] | null

    The list of partners associated to a customer

    The viewmodel for the customer relationships.

    Hide customerAssociations attributes Show customerAssociations attributes object
    • resellerId string(uuid) | null

      The reseller id.

    • name string | null

      The name of the partner.

Responses

  • OK

  • Created

  • Bad Request

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

  • 401

    Unauthorized

  • 403

    Forbidden

  • Internal Server Error

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

    Hide response attributes Show response attributes object
    • statusCode integer(int32)

      The HTTP status code that represents a specific error scenario.

    • type string | null

      The type of error that occurred.

    • description string | null

      Describes the error scenario that occurred.

    • correlationId string | null

      The correlationId of the request that originated the error.

    • errors array[object] | null

      A list containing the detail of the errors that occurred in this error scenario.

      This class is used to represent the details of an error and specifies the name of the property and the description of each of the errors associated with that property.

      Hide errors attributes Show errors attributes object
      • propertyName string | null

        The name of the property involved in the error.

      • description array[string] | null

        A description of each error associated with the given property.

POST /v1/Customers
curl \
 --request POST 'https://api.cloudcockpit.com/v1/Customers' \
 --header "Content-Type: application/json" \
 --header "X-Tenant: portal.cloudcockpit.com" \
 --header "Authorization: Bearer eyJ0eXAiO..." \
 --header "X-Correlation-Id: string" \
 --data '{"id":"string","companyName":"string","taxId":"string","country":"PT","addressLine1":"string","addressLine2":"string","city":"string","state":"string","zip":"string","firstName":"string","middleName":"string","lastName":"string","email":"string","phone":"string","internalIdentifier":"string","resellerId":"string","providerCustomers":{"cb3cd15b-1d6e-45be-b493-c71549cbfd87":{"margin":{"value":10.6,"marginRule":{"name":"markup"}},"providerName":"Microsoft","offerTypeMargins":{"Value":{"license":{"Value":10,"MarginRule":{"Name":"markup"}}}},"providerCustomerId":"f574cf12-a7d6-43fe-9663-1af97b04e5ab","providerInstanceId":"cb3cd15b-1d6e-45be-b493-c71549cbfd87","providerCustomerData":"{\"Domain\":\"TestDomain\",\"CredentialsEmail\":\"test@email.com\",\"AcceptedMCA\":true,\"AgreementDate\":\"2022-12-28T00:00:00Z\",\"KeepPrimaryInformation\":true,\"FirstName\":\"Test\",\"LastName\":\"Test\",\"Email\":\"test@email.com\",\"Phone\":\"921231231\",\"DefaultCulture\":\"en-US\",\"Language\":\"en\",\"AssociatedPartnerId\":null,\"Qualifications\":[],\"EnableGDAP\":true}","microsoftCustomerAgreement":{"status":{"name":"required"},"customerId":"3fa85f64-5717-4562-b3fc-2c963f66afa6","dateAgreed":null,"lastUpdate":null,"attestationId":null,"signatoryContact":null,"providerInstanceId":"cb3cd15b-1d6e-45be-b493-c71549cbfd87"}}},"customerAssociations":[{"resellerId":"string","name":"string"}]}'
Request examples
# Headers
X-Tenant: portal.cloudcockpit.com
Authorization: Bearer eyJ0eXAiO...
X-Correlation-Id: string

# Payload
{
  "id": "string",
  "companyName": "string",
  "taxId": "string",
  "country": "PT",
  "addressLine1": "string",
  "addressLine2": "string",
  "city": "string",
  "state": "string",
  "zip": "string",
  "firstName": "string",
  "middleName": "string",
  "lastName": "string",
  "email": "string",
  "phone": "string",
  "internalIdentifier": "string",
  "resellerId": "string",
  "providerCustomers": {
    "cb3cd15b-1d6e-45be-b493-c71549cbfd87": {
      "margin": {
        "value": 10.6,
        "marginRule": {
          "name": "markup"
        }
      },
      "providerName": "Microsoft",
      "offerTypeMargins": {
        "Value": {
          "license": {
            "Value": 10,
            "MarginRule": {
              "Name": "markup"
            }
          }
        }
      },
      "providerCustomerId": "f574cf12-a7d6-43fe-9663-1af97b04e5ab",
      "providerInstanceId": "cb3cd15b-1d6e-45be-b493-c71549cbfd87",
      "providerCustomerData": "{\"Domain\":\"TestDomain\",\"CredentialsEmail\":\"test@email.com\",\"AcceptedMCA\":true,\"AgreementDate\":\"2022-12-28T00:00:00Z\",\"KeepPrimaryInformation\":true,\"FirstName\":\"Test\",\"LastName\":\"Test\",\"Email\":\"test@email.com\",\"Phone\":\"921231231\",\"DefaultCulture\":\"en-US\",\"Language\":\"en\",\"AssociatedPartnerId\":null,\"Qualifications\":[],\"EnableGDAP\":true}",
      "microsoftCustomerAgreement": {
        "status": {
          "name": "required"
        },
        "customerId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "dateAgreed": null,
        "lastUpdate": null,
        "attestationId": null,
        "signatoryContact": null,
        "providerInstanceId": "cb3cd15b-1d6e-45be-b493-c71549cbfd87"
      }
    }
  },
  "customerAssociations": [
    {
      "resellerId": "string",
      "name": "string"
    }
  ]
}
Response examples (200)
string
Response examples (200)
string
Response examples (201)
string
Response examples (201)
string
Response examples (400)
{
  "statusCode": 42,
  "type": "string",
  "description": "string",
  "correlationId": "string",
  "errors": [
    {
      "propertyName": "string",
      "description": [
        "string"
      ]
    }
  ]
}
Response examples (400)
{
  "statusCode": 42,
  "type": "string",
  "description": "string",
  "correlationId": "string",
  "errors": [
    {
      "propertyName": "string",
      "description": [
        "string"
      ]
    }
  ]
}
Response examples (500)
{
  "statusCode": 42,
  "type": "string",
  "description": "string",
  "correlationId": "string",
  "errors": [
    {
      "propertyName": "string",
      "description": [
        "string"
      ]
    }
  ]
}
Response examples (500)
{
  "statusCode": 42,
  "type": "string",
  "description": "string",
  "correlationId": "string",
  "errors": [
    {
      "propertyName": "string",
      "description": [
        "string"
      ]
    }
  ]
}