# Infor

> Read and update Infor M3 customers and run any M3 API transaction through Infor OS.

App · 6 actions. Web page: https://docs.lodol.com/docs/integrations/infor

## Actions

### Get current user

Get the M3 user the connection signs in as, with its default company and division.

**Inputs**: None.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "record": {
      "CONO": "example",
      "DIVI": "example",
      "NAME": "example",
      "USID": "example"
    }
  }
}
```

### Get customer

Get a customer's name and address.

**Inputs**

- Customer number (`customer_number`, text, required): M3 customer number (CUNO), such as from List customers.
- Company (`company`, text): M3 company number, such as 100. Leave empty to use the service account's default company.
- Division (`division`, text): M3 division code, such as AAA. Leave empty to use the service account's default division.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "record": {
      "CSCD": "example",
      "CUA1": "example",
      "CUA2": "example",
      "CUA3": "example",
      "CUA4": "example",
      "CUNM": "example",
      "CUNO": "example",
      "TOWN": "example"
    }
  }
}
```

### List customers

List customers in customer number order. To read the next page, start from the last customer number returned.

**Inputs**

- Start from customer number (`starting_customer`, text): Customer number to start from. Leave empty to start at the first customer.
- Max rows (`max_records`, number): Most rows to return, up to 10,000. Defaults to 100. From 1 to 10000.
- Company (`company`, text): M3 company number, such as 100. Leave empty to use the service account's default company.
- Division (`division`, text): M3 division code, such as AAA. Leave empty to use the service account's default division.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "count": 1,
    "records": [
      {
        "CUA1": "example",
        "CUNM": "example",
        "CUNO": "example",
        "PHNO": "example",
        "STAT": "example",
        "TOWN": "example",
        "YREF": "example"
      }
    ]
  }
}
```

### List transaction output fields

List the fields an M3 API transaction returns, with each field's description, type and length.

**Inputs**

- API program (`program`, text, required): M3 API program, such as CRS610MI for customers. M3's API Repository lists them.
- Transaction (`transaction`, text, required): Transaction of that program, such as LstByNumber or GetBasicData.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "count": 1,
    "records": [
      {
        "FLDS": "example",
        "FLNM": "example",
        "LENG": "example",
        "TYPE": "example"
      }
    ]
  }
}
```

### Run M3 API transaction

Run any M3 API transaction your service account may use, such as adding an order line or reading stock, and get the rows it returns.

**Inputs**

- API program (`program`, text, required): M3 API program, such as CRS610MI for customers. M3's API Repository lists them.
- Transaction (`transaction`, text, required): Transaction of that program, such as LstByNumber or GetBasicData.
- Inputs (`inputs`, object): The transaction's input fields and values, such as CUNO with a customer number.
- Output fields (`output_fields`, list): M3 field names to return, such as CUNO and CUNM. Leave empty for all of them.
- Max rows (`max_records`, number): Most rows to return, up to 10,000. Defaults to 100. From 1 to 10000.
- Company (`company`, text): M3 company number, such as 100. Leave empty to use the service account's default company.
- Division (`division`, text): M3 division code, such as AAA. Leave empty to use the service account's default division.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "count": 1,
    "records": [
      {}
    ]
  }
}
```

### Update customer

Change a customer's name or address. Fields left empty keep their value.

**Inputs**

- Customer number (`customer_number`, text, required): M3 customer number (CUNO), such as from List customers.
- Name (`name`, text): Customer name (CUNM).
- Address line 1 (`address_line_1`, text): First address line (CUA1).
- Address line 2 (`address_line_2`, text): Second address line (CUA2).
- Address line 3 (`address_line_3`, text): Third address line (CUA3).
- Address line 4 (`address_line_4`, text): Fourth address line (CUA4).
- Town (`town`, text): Town or city (TOWN).
- Country (`country`, text): M3 country code (CSCD), such as US or SE.
- Company (`company`, text): M3 company number, such as 100. Leave empty to use the service account's default company.
- Division (`division`, text): M3 division code, such as AAA. Leave empty to use the service account's default division.

**Outputs**

- `data` (object): The response from Infor.

**Example output**

```json
{
  "data": {
    "record": {
      "CSCD": "example",
      "CUA1": "example",
      "CUA2": "example",
      "CUA3": "example",
      "CUA4": "example",
      "CUNM": "example",
      "CUNO": "example",
      "TOWN": "example"
    }
  }
}
```
