# Calculate Employee Costs Globally

POST https://api.letsdeel.com/rest/v2/eor/employment_cost
Content-Type: application/json

Determine the total employment costs for an Employee of Record (EOR) arrangement across different countries, including salary, employer costs, benefits, and additional fees.

Reference: https://developer.deel.com/api/eor-endpoints/eor-cost-calculator/get-employment-cost

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /eor/employment_cost:
    post:
      operationId: get-employment-cost
      summary: Calculate Employee Costs Globally
      description: >-
        Determine the total employment costs for an Employee of Record (EOR)
        arrangement across different countries, including salary, employer
        costs, benefits, and additional fees.
      tags:
        - subpackage_costCalculator
      parameters:
        - name: Authorization
          in: header
          description: >
            ## Authentication

            The Deel API uses bearer tokens to authenticate requests. All API
            calls must be made over HTTPS — calls over plain HTTP or without
            authentication will fail.


            ```curl

            curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
              -H 'Authorization: Bearer YOUR-TOKEN-HERE'
            ```


            [Learn more about authentication](/api/authentication)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successfully calculated employee costs.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/cost-calculator_getEmploymentCost_Response_200
        '401':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '403':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
        '404':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  $ref: >-
                    #/components/schemas/EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaData
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaDataBenefitsItems:
      type: object
      properties:
        plan_id:
          type:
            - string
            - 'null'
          description: The ID of the benefits plan, if applicable.
        provider_id:
          type: string
          description: The ID of the benefits provider.
      required:
        - provider_id
      title: >-
        EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaDataBenefitsItems
    EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaData:
      type: object
      properties:
        state:
          type: string
          description: The state or region within the country, if applicable.
        salary:
          type: number
          format: double
          description: The base salary for the employee.
        country:
          type: string
          description: The full name of the country where the employee is based.
        benefits:
          type:
            - array
            - 'null'
          items:
            $ref: >-
              #/components/schemas/EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaDataBenefitsItems
          description: A list of selected benefit plans for the employee.
        currency:
          type: string
          description: The currency in which the costs are calculated.
        country_code:
          type: string
          description: The two-letter country code where the employee is based.
      required:
        - salary
        - country
        - currency
      title: EorEmploymentCostPostRequestBodyContentApplicationJsonSchemaData
    EorEmploymentCostPostResponsesContentApplicationJsonSchemaCostsItems:
      type: object
      properties:
        name:
          type: string
          description: Name of the cost item.
        amount:
          type: string
          description: Cost amount.
        country:
          type: string
          description: The country of the cost item.
        frequency:
          type: string
          description: The frequency of the cost (e.g., monthly, annually).
        country_code:
          type: string
          description: ISO Alpha-2 code of the country.
      title: EorEmploymentCostPostResponsesContentApplicationJsonSchemaCostsItems
    EorEmploymentCostPostResponsesContentApplicationJsonSchemaBenefitsDataItems:
      type: object
      properties:
        name:
          type: string
          description: Benefit name.
        plan:
          type: string
          description: Benefit plan.
        amount:
          type: string
          description: Benefit cost.
        fee_amount:
          type: string
          description: Fees associated with the benefit.
      title: >-
        EorEmploymentCostPostResponsesContentApplicationJsonSchemaBenefitsDataItems
    EorEmploymentCostPostResponsesContentApplicationJsonSchemaAdditionalData:
      type: object
      properties:
        additional_notes:
          type: array
          items:
            type: string
      title: EorEmploymentCostPostResponsesContentApplicationJsonSchemaAdditionalData
    cost-calculator_getEmploymentCost_Response_200:
      type: object
      properties:
        costs:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorEmploymentCostPostResponsesContentApplicationJsonSchemaCostsItems
        salary:
          type: string
          description: The base salary for the employee.
        country:
          type: string
          description: The country where the employee is based.
        currency:
          type: string
          description: The currency used for cost calculation.
        deel_fee:
          type: string
          description: The Deel fee for managing the employee.
        frequency:
          type: string
          description: Frequency of the salary payment (e.g., monthly).
        total_costs:
          type: string
          description: Total employment costs.
        country_code:
          type: string
          description: ISO Alpha-2 code of the country.
        benefits_data:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorEmploymentCostPostResponsesContentApplicationJsonSchemaBenefitsDataItems
        employer_costs:
          type: string
          description: Costs incurred by the employer.
        additional_data:
          $ref: >-
            #/components/schemas/EorEmploymentCostPostResponsesContentApplicationJsonSchemaAdditionalData
        severance_accural:
          type: string
          description: Severance accrual costs.
      title: cost-calculator_getEmploymentCost_Response_200
    ApiErrorRequest:
      type: object
      properties:
        method:
          type: string
          description: The HTTP method of the failed request
        url:
          type: string
          description: The relative URL of the failed request
        status:
          type: number
          format: double
          description: The status code of the response
        api_req_id:
          type: string
          description: The request ID of the failed request
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        source:
          type: string
          description: The source handler which produced the returned error
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
      title: ApiErrorRequest
    ApiError:
      type: object
      properties:
        message:
          type: string
          description: A description of the returned error
        path:
          type: string
          description: The JSON path where input validation failed
      title: ApiError
    ApiErrorContainer:
      type: object
      properties:
        request:
          $ref: '#/components/schemas/ApiErrorRequest'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ApiError'
      title: ApiErrorContainer
  securitySchemes:
    deelToken:
      type: http
      scheme: bearer
      description: >
        ## Authentication

        The Deel API uses bearer tokens to authenticate requests. All API calls
        must be made over HTTPS — calls over plain HTTP or without
        authentication will fail.


        ```curl

        curl -X GET 'https://api.letsdeel.com/rest/v2/contracts' \
          -H 'Authorization: Bearer YOUR-TOKEN-HERE'
        ```


        [Learn more about authentication](/api/authentication)
    oauth2:
      type: http
      scheme: bearer
      description: >-
        Standard OAuth2 security scheme based on
        https://swagger.io/docs/specification/authentication/

```

## SDK Code Examples

```python Example of a successful response.
import requests

url = "https://api.letsdeel.com/rest/v2/eor/employment_cost"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Example of a successful response.
const url = 'https://api.letsdeel.com/rest/v2/eor/employment_cost';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example of a successful response.
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/eor/employment_cost"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example of a successful response.
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/eor/employment_cost")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Example of a successful response.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.letsdeel.com/rest/v2/eor/employment_cost")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Example of a successful response.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/v2/eor/employment_cost', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Example of a successful response.
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/eor/employment_cost");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Example of a successful response.
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/eor/employment_cost")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Example of a request body for calculating employee costs.
import requests

url = "https://api.letsdeel.com/rest/v2/eor/employment_cost"

payload = { "data": {
        "salary": 60000,
        "country": "Germany",
        "currency": "EUR",
        "state": "Bavaria",
        "benefits": [
            {
                "provider_id": "123",
                "plan_id": "basic-health"
            }
        ],
        "country_code": "DE"
    } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Example of a request body for calculating employee costs.
const url = 'https://api.letsdeel.com/rest/v2/eor/employment_cost';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"data":{"salary":60000,"country":"Germany","currency":"EUR","state":"Bavaria","benefits":[{"provider_id":"123","plan_id":"basic-health"}],"country_code":"DE"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example of a request body for calculating employee costs.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.letsdeel.com/rest/v2/eor/employment_cost"

	payload := strings.NewReader("{\n  \"data\": {\n    \"salary\": 60000,\n    \"country\": \"Germany\",\n    \"currency\": \"EUR\",\n    \"state\": \"Bavaria\",\n    \"benefits\": [\n      {\n        \"provider_id\": \"123\",\n        \"plan_id\": \"basic-health\"\n      }\n    ],\n    \"country_code\": \"DE\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example of a request body for calculating employee costs.
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/eor/employment_cost")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"data\": {\n    \"salary\": 60000,\n    \"country\": \"Germany\",\n    \"currency\": \"EUR\",\n    \"state\": \"Bavaria\",\n    \"benefits\": [\n      {\n        \"provider_id\": \"123\",\n        \"plan_id\": \"basic-health\"\n      }\n    ],\n    \"country_code\": \"DE\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Example of a request body for calculating employee costs.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.letsdeel.com/rest/v2/eor/employment_cost")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"data\": {\n    \"salary\": 60000,\n    \"country\": \"Germany\",\n    \"currency\": \"EUR\",\n    \"state\": \"Bavaria\",\n    \"benefits\": [\n      {\n        \"provider_id\": \"123\",\n        \"plan_id\": \"basic-health\"\n      }\n    ],\n    \"country_code\": \"DE\"\n  }\n}")
  .asString();
```

```php Example of a request body for calculating employee costs.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.letsdeel.com/rest/v2/eor/employment_cost', [
  'body' => '{
  "data": {
    "salary": 60000,
    "country": "Germany",
    "currency": "EUR",
    "state": "Bavaria",
    "benefits": [
      {
        "provider_id": "123",
        "plan_id": "basic-health"
      }
    ],
    "country_code": "DE"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Example of a request body for calculating employee costs.
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/eor/employment_cost");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"data\": {\n    \"salary\": 60000,\n    \"country\": \"Germany\",\n    \"currency\": \"EUR\",\n    \"state\": \"Bavaria\",\n    \"benefits\": [\n      {\n        \"provider_id\": \"123\",\n        \"plan_id\": \"basic-health\"\n      }\n    ],\n    \"country_code\": \"DE\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example of a request body for calculating employee costs.
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["data": [
    "salary": 60000,
    "country": "Germany",
    "currency": "EUR",
    "state": "Bavaria",
    "benefits": [
      [
        "provider_id": "123",
        "plan_id": "basic-health"
      ]
    ],
    "country_code": "DE"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/eor/employment_cost")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```