# Retrieve Benefits by Country

GET https://api.letsdeel.com/rest/v2/eor/benefits

Retrieves list of benefits available in a specific country based work visa requirement, work hours, employment type, team, and legal entity.
 **Token scopes**: `benefits:read`

Reference: https://developer.deel.com/api/eor-endpoints/eor-hiring/get-benefits

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Deel HRIS SCIM API
  version: 1.0.0
paths:
  /eor/benefits:
    get:
      operationId: get-benefits
      summary: Retrieve Benefits by Country
      description: >-
        Retrieves list of benefits available in a specific country based work
        visa requirement, work hours, employment type, team, and legal entity.
         **Token scopes**: `benefits:read`
      tags:
        - subpackage_eorHiring
      parameters:
        - name: country_code
          in: query
          description: Country code.
          required: true
          schema:
            type: string
        - name: work_visa
          in: query
          description: Indicates if work visa is required.
          required: true
          schema:
            type: boolean
        - name: work_hours_per_week
          in: query
          description: Working hours per week
          required: true
          schema:
            type: number
            format: double
        - name: employment_type
          in: query
          description: Type of employment
          required: true
          schema:
            $ref: '#/components/schemas/EorBenefitsGetParametersEmploymentType'
        - name: team_id
          in: query
          description: The ID of the team the worker belongs to.
          required: true
          schema:
            type: string
            format: uuid
        - name: legal_entity_id
          in: query
          description: The ID of the legal entity.
          required: true
          schema:
            type: string
            format: uuid
        - 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: Successful operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/eor-hiring_getBenefits_Response_200'
        '400':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RetrieveBenefitsByCountryRequestBadRequestError
        '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'
        '500':
          description: Operation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorContainer'
servers:
  - url: https://api.letsdeel.com/rest/v2
  - url: https://api-staging.letsdeel.com/rest/v2
components:
  schemas:
    EorBenefitsGetParametersEmploymentType:
      type: string
      enum:
        - Full-time
        - Part-time
      title: EorBenefitsGetParametersEmploymentType
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItemsAttachmentsItems:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the attachment.
        url:
          type: string
          description: The url of the attachment.
        label:
          type: string
          description: The label of the attachment.
      required:
        - id
        - url
        - label
      title: >-
        EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItemsAttachmentsItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItems:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the plan.
        name:
          type: string
          description: The name of the plan.
        price:
          type: number
          format: double
          description: The price of the plan.
        attachments:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItemsAttachmentsItems
      required:
        - id
        - name
        - price
        - attachments
      title: >-
        EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsAttachmentsItems:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the attachment.
        url:
          type: string
          description: The url of the attachment.
        label:
          type: string
          description: The label of the attachment.
      required:
        - id
        - url
        - label
      title: >-
        EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsAttachmentsItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsContributionOptionsItems:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the contribution.
        amount:
          type: number
          format: double
          description: Amount.
      required:
        - id
        - amount
      title: >-
        EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsContributionOptionsItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the benefit provider.
        name:
          type: string
          description: The name of the benefit provider.
        type:
          type: string
          description: Benefit type.
        plans:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsPlansItems
        country:
          type: string
          description: Country code.
        currency:
          type: string
          description: Currency.
        is_unisure:
          type: boolean
          description: Indicates if Unisure.
        attachments:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsAttachmentsItems
        client_info:
          type:
            - string
            - 'null'
          description: Client information.
        employee_info:
          type:
            - string
            - 'null'
          description: Employee information.
        home_page_url:
          type: string
          description: The home page URL of the benefit provider.
        max_contribution:
          type:
            - number
            - 'null'
          format: double
          description: Maximum contribution.
        min_contribution:
          type:
            - number
            - 'null'
          format: double
          description: Minimum contribution.
        contribution_options:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItemsContributionOptionsItems
      required:
        - id
        - name
        - type
        - plans
        - country
        - currency
        - is_unisure
        - attachments
        - home_page_url
        - contribution_options
      title: >-
        EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaDataItems:
      type: object
      properties:
        name:
          type: string
          description: The name of the benefit.
        providers:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItemsProvidersItems
        description:
          type: string
          description: The description of the benefit.
        is_mandatory:
          type: boolean
          description: Indicates if the benefit is mandatory.
        is_discriminatory:
          type: boolean
          description: Indicates if the benefit is discriminatory.
      required:
        - name
        - providers
        - description
        - is_mandatory
        - is_discriminatory
      title: EorBenefitsGetResponsesContentApplicationJsonSchemaDataItems
    eor-hiring_getBenefits_Response_200:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaDataItems
      required:
        - data
      title: eor-hiring_getBenefits_Response_200
    EorBenefitsGetResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        path:
          type: string
          description: The JSON path where input validation failed
        message:
          type: string
          description: A description of the returned error
      title: EorBenefitsGetResponsesContentApplicationJsonSchemaErrorsItems
    EorBenefitsGetResponsesContentApplicationJsonSchemaRequest:
      type: object
      properties:
        url:
          type: string
          description: The relative URL of the failed request
        code:
          type: number
          format: double
          description: The code of the source handler which produced the returned error
        docs:
          type: string
          description: >-
            A link to the official documentation for the requested endpoint
            resource
        method:
          type: string
          description: The HTTP method of the failed request
        source:
          type: string
          description: The source handler which produced the returned error
        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
      title: EorBenefitsGetResponsesContentApplicationJsonSchemaRequest
    RetrieveBenefitsByCountryRequestBadRequestError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaErrorsItems
        request:
          $ref: >-
            #/components/schemas/EorBenefitsGetResponsesContentApplicationJsonSchemaRequest
      title: RetrieveBenefitsByCountryRequestBadRequestError
    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
import requests

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

querystring = {"country_code":"US","work_visa":"true","work_hours_per_week":"40","employment_type":"Full-time","team_id":"123e4567-e89b-12d3-a456-426614174000","legal_entity_id":"123e4567-e89b-12d3-a456-426614174000"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

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

```go
package main

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

func main() {

	url := "https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000"

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

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000")

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

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.letsdeel.com/rest/v2/eor/benefits?country_code=US&work_visa=true&work_hours_per_week=40&employment_type=Full-time&team_id=123e4567-e89b-12d3-a456-426614174000&legal_entity_id=123e4567-e89b-12d3-a456-426614174000")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```