# Yokoy

> Work with expenses, trips, supplier invoices, users and cost objects in Yokoy.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/yokoy

## Actions

### Create a cost object

Create a cost object (cost center) in a legal entity.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Name (`name`, text, required): Name of the cost object.
- Code (`code`, text, required): The cost object's account code in your ERP.
- Description (`description`, text): Description of the cost object.
- Parent cost object (`parent_id`, text): The parent cost object, for a hierarchy.
- Approver (`approver_id`, text): The user who approves costs on this cost object.
- Who can use it (`access_type`, text): Who can submit costs to it: everyone, finance only, or specific users. One of: `all`, `finance`, `specificUsers`.
- Active (`status_active`, true/false): Whether the cost object can be used.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accessType": "example",
    "approvalLimit": 1,
    "approverId": "example",
    "autoApprovalLimit": 1,
    "code": "example",
    "customInformation": {},
    "delegateId": "example",
    "description": "example",
    "id": "example",
    "name": "example",
    "parentId": "example",
    "scopes": [
      "example"
    ],
    "statusActive": true
  }
}
```

### Create a supplier

Add a supplier for the whole organization.

**Inputs**

- External ID (`external_id`, text, required): Your own ID for the supplier, such as its ERP vendor number. It must be unique and can't be changed later.
- Name (`name`, text, required): The supplier's full company name.
- Short name (`short_name`, text): A short name to show.
- Street (`street`, text): Street address.
- Postal code (`zip_code`, text): Postal code.
- City (`city`, text): City.
- Country (`country_code`, text): Two-letter country code, such as `CH` or `DE`.
- Website (`url`, text): The supplier's website.
- Active (`status_active`, true/false): Whether the supplier can be used.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "bankAccounts": [
      {}
    ],
    "city": "example",
    "contacts": [
      {}
    ],
    "countryCode": "example",
    "externalId": "example",
    "id": "example",
    "name": "example",
    "shortName": "example",
    "statusActive": true,
    "street": "example",
    "taxNumbers": [
      "example"
    ],
    "url": "example",
    "zipCode": "example"
  }
}
```

### Create a tag

Create a tag in one of a legal entity's tag dimensions.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Name (`name`, text, required): Name of the tag.
- Code (`code`, text, required): The tag's reference in your ERP. It can be the same as the dimension code.
- Dimension code (`dimension_code`, text, required): The code of the tag dimension the tag belongs to.
- Active (`status_active`, true/false, required): Whether the tag can be used.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "code": "example",
    "customInformation": {},
    "dimensionCode": "example",
    "expenseApproverIds": [
      "example"
    ],
    "id": "example",
    "invoiceApproverIds": [
      "example"
    ],
    "name": "example",
    "statusActive": true
  }
}
```

### Create a user

Add a user to your Yokoy organization, optionally sending them an invitation to sign in.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) the user belongs to.
- First name (`first_name`, text, required): The user's first name.
- Last name (`last_name`, text, required): The user's last name.
- Email (`email`, text, required): The email address the user signs in with. It must be unique in the organization.
- Employee ID (`employee_id`, text, required): The user's creditor or vendor account number, used to book their privately paid expenses.
- Active (`status_active`, true/false, required): Whether the user is active and can sign in to Yokoy.
- Cost object (`cost_center_id`, text): The user's cost object (cost center).
- Line manager (`line_manager_id`, text): The user's line manager, who approves their expenses.
- Language (`language`, text): The language the user sees Yokoy in. One of: `en`, `en-gb`, `de`, `de-ch`, `fr`, `es`, `nl`, `pl`, `zh`, `ja`.
- Currency (`currency`, text): The user's currency, as a three-letter code such as `CHF` or `EUR`.
- Send invitation (`send_invitation`, true/false): Email the user an invitation to Yokoy when they are created.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "costCenterId": "example",
    "created": "example",
    "currency": "example",
    "customInformation": {},
    "email": "example",
    "employeeId": "example",
    "firstName": "example",
    "id": "example",
    "language": "example",
    "lastModified": "example",
    "lastName": "example",
    "legalEntityId": "example",
    "lineManagerDelegateId": "example",
    "lineManagerId": "example",
    "policyId": "example",
    "statusActive": true,
    "submissionDelegateId": "example"
  }
}
```

### Delete a cost object

Delete a cost object (cost center) from a legal entity.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Cost object (`cost_center_id`, text, required): The cost object to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Delete a tag

Delete a tag from a legal entity.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Tag ID (`tag_id`, text, required): The tag to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Delete a user

Delete a user from your Yokoy organization.

**Inputs**

- User (`yokoy_user_id`, text, required): The user to delete.

**Outputs**

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

**Example output**

```json
{
  "data": {}
}
```

### Get a card transaction

Get a company card transaction and the expense it is matched to.

**Inputs**

- Transaction ID (`transaction_id`, text, required): The transaction.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "billingAmount": 1,
    "billingCurrency": "example",
    "bookingDate": "example",
    "cardId": "example",
    "country": "example",
    "created": "example",
    "expenseId": "example",
    "id": "example",
    "isCreditNote": true,
    "legalEntityId": "example",
    "matchingStatus": 1,
    "mccSicCode": "example",
    "merchant": "example",
    "sourceAmount": 1,
    "sourceCurrency": "example",
    "transactionDate": "example"
  }
}
```

### Get a cost object

Get a cost object (cost center) of a legal entity.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Cost object (`cost_center_id`, text, required): The cost object.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accessType": "example",
    "approvalLimit": 1,
    "approverId": "example",
    "autoApprovalLimit": 1,
    "code": "example",
    "customInformation": {},
    "delegateId": "example",
    "description": "example",
    "id": "example",
    "name": "example",
    "parentId": "example",
    "scopes": [
      "example"
    ],
    "statusActive": true
  }
}
```

### Get a trip

Get a trip with its dates, status and total claim.

**Inputs**

- Trip ID (`trip_id`, text, required): The trip.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "created": "example",
    "currency": "example",
    "customInformation": {},
    "endDatetime": "example",
    "id": "example",
    "lastModified": "example",
    "legalEntityId": "example",
    "name": "example",
    "startDatetime": "example",
    "status": "example",
    "totalClaim": 1,
    "userId": "example"
  }
}
```

### Get a user

Get a user's details.

**Inputs**

- User (`yokoy_user_id`, text, required): The user.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "costCenterId": "example",
    "created": "example",
    "currency": "example",
    "customInformation": {},
    "email": "example",
    "employeeId": "example",
    "firstName": "example",
    "id": "example",
    "language": "example",
    "lastModified": "example",
    "lastName": "example",
    "legalEntityId": "example",
    "lineManagerDelegateId": "example",
    "lineManagerId": "example",
    "policyId": "example",
    "statusActive": true,
    "submissionDelegateId": "example"
  }
}
```

### Get an expense

Get an expense with its amounts, taxes, cost objects and approvers.

**Inputs**

- Expense ID (`expense_id`, text, required): The expense.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "additionalCharges": 1,
    "approverIds": [
      "example"
    ],
    "categoryId": "example",
    "costCenterItems": [
      {}
    ],
    "country": "example",
    "created": "example",
    "currency": "example",
    "currentApproverIds": [
      "example"
    ],
    "customInformation": {},
    "description": "example",
    "expenseDate": "example",
    "expenseType": "example",
    "id": "example",
    "lastModified": "example",
    "legalEntityId": "example",
    "paymentMethod": "example",
    "postingDate": "example",
    "receipt": "example",
    "status": "example",
    "taxItems": [
      {}
    ],
    "totalAmount": 1,
    "totalClaim": 1,
    "tripId": "example",
    "userId": "example"
  }
}
```

### Get an invoice

Get a supplier invoice with its line items, amounts and status.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Invoice ID (`invoice_id`, text, required): The invoice.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "country": "example",
    "created": "example",
    "currency": "example",
    "customInformation": {},
    "date": "example",
    "dueDate": "example",
    "grossAmount": 1,
    "id": "example",
    "invoiceNumber": "example",
    "isCreditNote": true,
    "lastModified": "example",
    "lineItems": [
      {}
    ],
    "netAmount": 1,
    "paymentBlocked": true,
    "paymentTermId": "example",
    "postingDate": "example",
    "status": 1,
    "submitters": [
      "example"
    ],
    "supplierId": "example",
    "taxAmount": 1
  }
}
```

### List card transactions

List company card transactions, optionally only those created after a time.

**Inputs**

- Created after (`created_after`, date and time): Only records created after this time.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "transactions": [
      {
        "billingAmount": 1,
        "billingCurrency": "example",
        "bookingDate": "example",
        "cardId": "example",
        "country": "example",
        "created": "example",
        "expenseId": "example",
        "id": "example",
        "isCreditNote": true,
        "legalEntityId": "example",
        "matchingStatus": 1,
        "mccSicCode": "example",
        "merchant": "example",
        "sourceAmount": 1,
        "sourceCurrency": "example",
        "transactionDate": "example"
      }
    ]
  }
}
```

### List cost objects

List the cost objects (cost centers) of a legal entity, optionally by code or status.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Code (`code`, text): Only the cost object with this code.
- Active (`status_active`, true/false): Only active (true) or only inactive (false) records.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "costCenters": [
      {
        "accessType": "example",
        "approvalLimit": 1,
        "approverId": "example",
        "autoApprovalLimit": 1,
        "code": "example",
        "customInformation": {},
        "delegateId": "example",
        "description": "example",
        "id": "example",
        "name": "example",
        "parentId": "example",
        "scopes": [
          "example"
        ],
        "statusActive": true
      }
    ],
    "itemsPerPage": 1,
    "nextCursor": "example"
  }
}
```

### List expenses

List expenses across the organization, optionally by status, user, legal entity, expense date or when they were created or changed.

**Inputs**

- Status (`status`, text): Only expenses with this status. One of: `draft`, `needsRevision`, `forApproval`, `forReview`, `forExpenseExport`, `rejected`, `expenseExported`, `forTransactionExport`, `transactionExported`, `readyForTripSubmission`, `travelDraft`.
- User (`yokoy_user_id`, text): Only this user's expenses.
- Legal entity (`legal_entity_id`, text): Only expenses of this legal entity.
- Expense date from (`expense_date_from`, date): Only expenses dated on or after this day.
- Expense date to (`expense_date_to`, date): Only expenses dated on or before this day.
- Created after (`created_after`, date and time): Only records created after this time.
- Changed after (`modified_after`, date and time): Only records changed after this time.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "expenses": [
      {
        "additionalCharges": 1,
        "approverIds": [
          "example"
        ],
        "categoryId": "example",
        "costCenterItems": [
          {}
        ],
        "country": "example",
        "created": "example",
        "currency": "example",
        "currentApproverIds": [
          "example"
        ],
        "customInformation": {},
        "description": "example",
        "expenseDate": "example",
        "expenseType": "example",
        "id": "example",
        "lastModified": "example",
        "legalEntityId": "example",
        "paymentMethod": "example",
        "postingDate": "example",
        "receipt": "example",
        "status": "example",
        "taxItems": [
          {}
        ],
        "totalAmount": 1,
        "totalClaim": 1,
        "tripId": "example",
        "userId": "example"
      }
    ],
    "itemsPerPage": 1,
    "nextCursor": "example"
  }
}
```

### List invoices

List a legal entity's supplier invoices, optionally by status or when they were created or changed.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Status (`status`, text): Only invoices with this status. One of: `Draft`, `Needs revision`, `In approval`, `In review`, `Ready for export`, `Rejected`, `Exported`, `New`.
- Created after (`created_after`, date and time): Only records created after this time.
- Changed after (`modified_after`, date and time): Only records changed after this time.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "invoices": [
      {
        "country": "example",
        "created": "example",
        "currency": "example",
        "customInformation": {},
        "date": "example",
        "dueDate": "example",
        "grossAmount": 1,
        "id": "example",
        "invoiceNumber": "example",
        "isCreditNote": true,
        "lastModified": "example",
        "lineItems": [
          {}
        ],
        "netAmount": 1,
        "paymentBlocked": true,
        "paymentTermId": "example",
        "postingDate": "example",
        "status": 1,
        "submitters": [
          "example"
        ],
        "supplierId": "example",
        "taxAmount": 1
      }
    ],
    "itemsPerPage": 1,
    "nextCursor": "example"
  }
}
```

### List legal entities

List the legal entities (companies) in your Yokoy organization, with their categories, policies and tax rates.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "legalEntities": [
      {
        "categories": [
          {}
        ],
        "code": "example",
        "id": "example",
        "language": "example",
        "name": "example",
        "policies": [
          {}
        ],
        "taxRates": [
          {}
        ]
      }
    ]
  }
}
```

### List suppliers

List the suppliers shared across your organization, optionally by external ID or status.

**Inputs**

- External ID (`external_id`, text): Only the supplier with this external ID.
- Active (`status_active`, true/false): Only active (true) or only inactive (false) records.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "itemsPerPage": 1,
    "nextCursor": "example",
    "suppliers": [
      {
        "bankAccounts": [
          {}
        ],
        "city": "example",
        "contacts": [
          {}
        ],
        "countryCode": "example",
        "externalId": "example",
        "id": "example",
        "name": "example",
        "shortName": "example",
        "statusActive": true,
        "street": "example",
        "taxNumbers": [
          "example"
        ],
        "url": "example",
        "zipCode": "example"
      }
    ]
  }
}
```

### List tags

List the tags of a legal entity, which add extra dimensions to expenses and invoices.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Dimension code (`dimension_code`, text): Only tags of this dimension.
- Active (`status_active`, true/false): Only active (true) or only inactive (false) records.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "itemsPerPage": 1,
    "nextCursor": "example",
    "tags": [
      {
        "code": "example",
        "customInformation": {},
        "dimensionCode": "example",
        "expenseApproverIds": [
          "example"
        ],
        "id": "example",
        "invoiceApproverIds": [
          "example"
        ],
        "name": "example",
        "statusActive": true
      }
    ]
  }
}
```

### List trips

List trips across the organization, optionally by status, user or when they were created or changed.

**Inputs**

- Status (`status`, text): Only trips with this status. One of: `draft`, `needsRevision`, `forApproval`, `forReview`, `forExpenseExport`, `rejected`, `expenseExported`, `forTransactionExport`, `transactionExported`, `readyForTripSubmission`, and 6 more.
- User (`yokoy_user_id`, text): Only this user's trips.
- Created after (`created_after`, date and time): Only records created after this time.
- Changed after (`modified_after`, date and time): Only records changed after this time.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "itemsPerPage": 1,
    "nextCursor": "example",
    "trips": [
      {
        "created": "example",
        "currency": "example",
        "customInformation": {},
        "endDatetime": "example",
        "id": "example",
        "lastModified": "example",
        "legalEntityId": "example",
        "name": "example",
        "startDatetime": "example",
        "status": "example",
        "totalClaim": 1,
        "userId": "example"
      }
    ]
  }
}
```

### List users

List the users in your Yokoy organization, optionally by email, legal entity or status.

**Inputs**

- Email (`email`, text): Only the user with this email.
- Legal entity (`legal_entity_id`, text): Only users of this legal entity.
- Active (`status_active`, true/false): Only active (true) or only inactive (false) records.
- Created after (`created_after`, date and time): Only records created after this time.
- Results (`count`, number): How many results to return, up to 100. Leave empty for 100. From 1 to 100.
- Next page cursor (`cursor`, text): To get the next page, the `nextCursor` value from the previous page.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "itemsPerPage": 1,
    "nextCursor": "example",
    "users": [
      {
        "costCenterId": "example",
        "created": "example",
        "currency": "example",
        "customInformation": {},
        "email": "example",
        "employeeId": "example",
        "firstName": "example",
        "id": "example",
        "language": "example",
        "lastModified": "example",
        "lastName": "example",
        "legalEntityId": "example",
        "lineManagerDelegateId": "example",
        "lineManagerId": "example",
        "policyId": "example",
        "statusActive": true,
        "submissionDelegateId": "example"
      }
    ]
  }
}
```

### Update a cost object

Change a cost object. Fields left empty keep their current value.

**Inputs**

- Legal entity (`legal_entity_id`, text, required): The legal entity (company) in Yokoy.
- Cost object (`cost_center_id`, text, required): The cost object to change.
- Name (`name`, text): Name of the cost object.
- Code (`code`, text): The cost object's account code in your ERP.
- Description (`description`, text): Description of the cost object.
- Parent cost object (`parent_id`, text): The parent cost object, for a hierarchy.
- Approver (`approver_id`, text): The user who approves costs on this cost object.
- Who can use it (`access_type`, text): Who can submit costs to it: everyone, finance only, or specific users. One of: `all`, `finance`, `specificUsers`.
- Active (`status_active`, true/false): Whether the cost object can be used.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "accessType": "example",
    "approvalLimit": 1,
    "approverId": "example",
    "autoApprovalLimit": 1,
    "code": "example",
    "customInformation": {},
    "delegateId": "example",
    "description": "example",
    "id": "example",
    "name": "example",
    "parentId": "example",
    "scopes": [
      "example"
    ],
    "statusActive": true
  }
}
```

### Update a supplier

Change an organization supplier. Fields left empty keep their current value.

**Inputs**

- Supplier ID (`supplier_id`, text, required): The supplier to change.
- Name (`name`, text): The supplier's full company name.
- Short name (`short_name`, text): A short name to show.
- Street (`street`, text): Street address.
- Postal code (`zip_code`, text): Postal code.
- City (`city`, text): City.
- Country (`country_code`, text): Two-letter country code, such as `CH` or `DE`.
- Website (`url`, text): The supplier's website.
- Active (`status_active`, true/false): Whether the supplier can be used.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "bankAccounts": [
      {}
    ],
    "city": "example",
    "contacts": [
      {}
    ],
    "countryCode": "example",
    "externalId": "example",
    "id": "example",
    "name": "example",
    "shortName": "example",
    "statusActive": true,
    "street": "example",
    "taxNumbers": [
      "example"
    ],
    "url": "example",
    "zipCode": "example"
  }
}
```

### Update a user

Change a user's details. Fields left empty keep their current value.

**Inputs**

- User (`yokoy_user_id`, text, required): The user to change.
- Legal entity (`legal_entity_id`, text): The legal entity (company) the user belongs to.
- First name (`first_name`, text): The user's first name.
- Last name (`last_name`, text): The user's last name.
- Email (`email`, text): The email address the user signs in with. It must be unique in the organization.
- Employee ID (`employee_id`, text): The user's creditor or vendor account number, used to book their privately paid expenses.
- Active (`status_active`, true/false): Whether the user is active and can sign in to Yokoy.
- Cost object (`cost_center_id`, text): The user's cost object (cost center).
- Line manager (`line_manager_id`, text): The user's line manager, who approves their expenses.
- Language (`language`, text): The language the user sees Yokoy in. One of: `en`, `en-gb`, `de`, `de-ch`, `fr`, `es`, `nl`, `pl`, `zh`, `ja`.
- Currency (`currency`, text): The user's currency, as a three-letter code such as `CHF` or `EUR`.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "costCenterId": "example",
    "created": "example",
    "currency": "example",
    "customInformation": {},
    "email": "example",
    "employeeId": "example",
    "firstName": "example",
    "id": "example",
    "language": "example",
    "lastModified": "example",
    "lastName": "example",
    "legalEntityId": "example",
    "lineManagerDelegateId": "example",
    "lineManagerId": "example",
    "policyId": "example",
    "statusActive": true,
    "submissionDelegateId": "example"
  }
}
```
