# Customer Management



# Get Customer Details By Uuid

This API request fetches the complete profile for an existing customer. The response includes the customer's personal information and their billing and shipping addresses.

----

### Endpoint

```
GET https://demo-api.frontpayment.no/api/v1/connect/customers/details/{CUSTOMER_UUID}
```

### Authentication
Include a **Bearer Token** in the `Authorization` header. You can obtain this token from **Front Payment**.

**Example:**  
```
Authorization: Bearer YOUR_FRONTPAYMENT_BEARER_TOKEN
```


### Response

A successful request will return a `200 OK` status with the following JSON payload:

```json
{
    "status_code": 200,
    "status_message": "OK",
    "message": "customerDetailsRetrievedSuccessfully",
    "is_data": true,
    "data": {
        "uuid": "CSRT1511414842",
        "type": "Private",
        "name": "Kari Nordmann",
        "countryCode": "+47",
        "msisdn": "00000000",
        "organizationId": null,
        "personalNumber": null,
        "email": "test@gmail.com",
        "preferredLanguage": null,
        "status": "Active",
        "addresses": {
            "billing": {
                "uuid": "ADRS2208147269",
                "street": "Luramyrveien 65",
                "zip": "4313",
                "city": "Sandnes",
                "country": "NO"
            },
            "shipping": {
                "uuid": "ADRS1016062549",
                "street": "Sjøhusbakken 42",
                "zip": "4313",
                "city": "Stavanger",
                "country": "NO"
            }
        }
    }
}
```


API returns a `404` error, it means requested customer with `CUSTOMER_UUID` could not be found in our system.

```json
{
    "status_code": 404,
    "status_message": "Not Found",
    "message": "customerNotFound",
    "is_data": false,
    "data": null
}
```


API returns a `510` error, it means something failed on the server side

```json
{
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "Something Went Wrong",
    "is_error": true,
    "errors": "Array"
}
```

# Update Private Customer

This API endpoint allows you to update the details of an existing private customer. You can modify information such as their name, email, phone number, and address.


----

### Endpoint

```
PUT https://demo-api.frontpayment.no/api/v1/connect/customers/update/private/{CUSTOMER_UUID}
```

### Authentication
Include a **Bearer Token** in the `Authorization` header. You can obtain this token from **Front Payment**.

**Example:**  
```
Authorization: Bearer YOUR_FRONTPAYMENT_BEARER_TOKEN
```

### Request Payload
Send the following JSON object in the request body:
```json
{
    "name": "Kari Nordmann",
    "personalNumber": "925710482",
    "preferredLanguage": "en",
    "msisdn": "46567468",
    "email": "test@gmail.com",
    "countryCode": "+47",
    "addresses": {
        "billing": {
            "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Sandnes ",
            "country": "NO"
        },
        "shipping": {
             "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Sandnes ",
            "country": "NO"
        }
    }
}
```

### Validation Rules

Make sure your request meets the following requirements:

<table style="width: 100%">
  <thead>
    <tr>
      <th style="width: 180px">Field</th>
      <th style="width: 100px">Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>name</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Customer's full name.</td>
    </tr>
    <tr>
      <td><code>email</code></td>
      <td><code>email</code></td>
      <td><strong>Required</strong> Customer's email address.</td>
    </tr>
    <tr>
      <td><code>countryCode</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Country code for the customer's phone number (e.g., "+47").</td>
    </tr>
    <tr>
      <td><code>msisdn</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Mobile Subscriber ISDN Number (phone number).</td>
    </tr>
    <tr>
      <td><code>preferredLanguage</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Customer preferred language. Available languages are <code>en</code>, <code>no</code>, <code>sv</code>, <code>da</code>, <code>de</code>.</td>
    </tr>
    <tr>
      <td><code>personalNumber</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Customer's personal identification number, must be exactly 11 characters containing only numbers and cannot contain spaces.</td>
    </tr>
    <tr>
      <td><code>addresses</code></td>
      <td><code>array</code></td>
      <td><strong>Required</strong> Customer's billing and shipping address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.street</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Street address of the customer.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.zip</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Zip code of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.city</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> City of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.country</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.street</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Street address of the customer.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.zip</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Zip code of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.city</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> City of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.country</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.</td>
    </tr>
  </tbody>
</table>


### Response
A successful request returns **202 OK**:
```json
{
    "status_code": 202,
    "status_message": "OK",
    "message": "customerUpdatedSuccessfully",
    "is_data": false,
    "data": null
}
```

If the API returns a **510 error**, it indicates a server-side failure:
```json
{
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "somethingWentWrong",
    "is_error": true,
    "errors": "Array"
}
```

# Update Corporate Customer

This API endpoint allows you to update the details of an existing corporate customer. You can modify information such as their name, email, phone number, and address.


----

### Endpoint

```
PUT https://demo-api.frontpayment.no/api/v1/connect/customers/update/corporate/{CUSTOMER_UUID}
```

### Authentication
Include a **Bearer Token** in the `Authorization` header. You can obtain this token from **Front Payment**.

**Example:**  
```
Authorization: Bearer YOUR_FRONTPAYMENT_BEARER_TOKEN
```

### Request Payload
Send the following JSON object in the request body:
```json
{
    "name": "Kari Nordmann",
    "organizationId": 192933933,
    "preferredLanguage": "en",
    "msisdn": "46567468",
    "email": "test@yopmail.com",
    "countryCode": "+47",
    "addresses": {
        "billing": {
            "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Sandnes",
            "country": "NO"
        },
        "shipping": {
            "street": "Luramyrveien 65",
            "zip": "4313",
            "city": "Oslo",
            "country": "NO"
        }
    },
    "additionalContact": {
        "0": {
            "name": "Tomas Simonen",
            "email": "test@mail.com",
            "designation": "CEO",
            "countryCode": "+88",
            "msisdn": "0175272184121",
            "note": "Note goes here"
        }
    }
}
```

### Validation Rules

Make sure your request meets the following requirements:

<table style="width: 100%">
  <thead>
    <tr>
      <th style="width: 180px">Field</th>
      <th style="width: 100px">Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code>name</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Customer's full name.</td>
    </tr>
    <tr>
      <td><code>email</code></td>
      <td><code>email</code></td>
      <td><strong>Required</strong> Customer's email address.</td>
    </tr>
    <tr>
      <td><code>countryCode</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Country code for the customer's phone number (e.g., "+47").</td>
    </tr>
    <tr>
      <td><code>msisdn</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Mobile Subscriber ISDN Number (phone number).</td>
    </tr>
    <tr>
      <td><code>preferredLanguage</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Customer preferred language. Available languages are <code>en</code>, <code>no</code>, <code>sv</code>, <code>da</code>, <code>de</code>.</td>
    </tr>
    <tr>
      <td><code>organizationId</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Organization identification number, must contain only numbers and cannot contain spaces.</td>
    </tr>
    <tr>
      <td><code>addresses</code></td>
      <td><code>array</code></td>
      <td><strong>Required</strong> Customer's billing and shipping address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.street</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Street address of the customer.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.zip</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> Zip code of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.city</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> City of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.billing.country</code></td>
      <td><code>string</code></td>
      <td><strong>Required</strong> ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.street</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Street address of the customer.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.zip</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Zip code of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.city</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> City of the customer's address.</td>
    </tr>
    <tr>
      <td><code>addresses.shipping.country</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> ISO Alpha-2 country code (e.g., NO). Custom validation IsoAlpha2Country applies.</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.name</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Additional Contact person Name.</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.designation</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Additional Contact person designation</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.countryCode</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Country code for the additional contact person phone number (e.g., "+47").</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.msisdn</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Mobile Subscriber ISDN Number (phone number).</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.email</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Additional contact person email address.</td>
    </tr>
    <tr>
      <td><code>additionalContact.*.note</code></td>
      <td><code>string</code></td>
      <td><strong>Optional</strong> Additional contact person notes.</td>
    </tr>
  </tbody>
</table>


### Response
A successful request returns **202 OK**:
```json
{
    "status_code": 202,
    "status_message": "OK",
    "message": "customerUpdatedSuccessfully",
    "is_data": false,
    "data": null
}
```

If the API returns a **510 error**, it indicates a server-side failure:
```json
{
    "status_code": 510,
    "status_message": "Execution Exception Occurred",
    "message": "somethingWentWrong",
    "is_error": true,
    "errors": "Array"
}
```