> This page is for version Latest Version (default).
> For other versions, use one of these documentation indexes:
> - Latest Version (default): https://paylocity-develop.ferndocs.com/payroll/latest-version/llms.txt
> - v2026-02-17: https://paylocity-develop.ferndocs.com/payroll/v-2026-02-17/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://paylocity-develop.ferndocs.com/payroll/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://paylocity-develop.ferndocs.com/payroll/_mcp/server.

# Upsert Employee Deduction by resourceId

PUT https://api.paylocity.com/apiHub/payroll/v1/companies/{companyId}/employees/{employeeId}/deductions/{deductionCode}/{resourceId}
Content-Type: application/json

**Summary Description**

This function will allow the API user to update details for a particular deduction code that occurs in the past/present/future. Garnishments cannot be updated using the Deduction endpoints.

Reference: https://paylocity-develop.ferndocs.com/payroll/api-reference/paylocity-ap-is/pay-setup-recurring-deductions/upsert-employee-deduction-by-resource-id

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `companyId` (string, required)
- `employeeId` (string, required)
- `deductionCode` (string, required)
- `resourceId` (string, required)

## Response

### 200

Successful response

## Examples

**Request**

```json
{
  "effectiveFrom": "<dateTime>",
  "effectiveTo": "<dateTime>",
  "calculationCode": "<string>",
  "rate": "<double>",
  "frequency": "<string>",
  "agency": "<string>",
  "arrear": "<double>",
  "miscellaneousInfo": "<string>",
  "note": "<string>",
  "selfInsured": "<boolean>",
  "priority": "<integer>",
  "loan401K": {
    "loanNumber": "<string>",
    "issueDate": "<dateTime>",
    "firstPaymentDate": "<dateTime>"
  },
  "costCenters": [
    {
      "level": "<integer>",
      "code": "<string>",
      "id_c77": {}
    },
    {
      "level": "<integer>",
      "code": "<string>"
    }
  ],
  "limits": {
    "goal": "<double>",
    "paidToDate": "<double>",
    "payPeriodMinimum": "<double>",
    "payPeriodMaximum": "<double>",
    "annualMaximum": "<double>"
  }
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId"

payload = {
    "effectiveFrom": "<dateTime>",
    "effectiveTo": "<dateTime>",
    "calculationCode": "<string>",
    "rate": "<double>",
    "frequency": "<string>",
    "agency": "<string>",
    "arrear": "<double>",
    "miscellaneousInfo": "<string>",
    "note": "<string>",
    "selfInsured": "<boolean>",
    "priority": "<integer>",
    "loan401K": {
        "loanNumber": "<string>",
        "issueDate": "<dateTime>",
        "firstPaymentDate": "<dateTime>"
    },
    "costCenters": [
        {
            "level": "<integer>",
            "code": "<string>",
            "id_c77": {}
        },
        {
            "level": "<integer>",
            "code": "<string>"
        }
    ],
    "limits": {
        "goal": "<double>",
        "paidToDate": "<double>",
        "payPeriodMinimum": "<double>",
        "payPeriodMaximum": "<double>",
        "annualMaximum": "<double>"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"effectiveFrom":"<dateTime>","effectiveTo":"<dateTime>","calculationCode":"<string>","rate":"<double>","frequency":"<string>","agency":"<string>","arrear":"<double>","miscellaneousInfo":"<string>","note":"<string>","selfInsured":"<boolean>","priority":"<integer>","loan401K":{"loanNumber":"<string>","issueDate":"<dateTime>","firstPaymentDate":"<dateTime>"},"costCenters":[{"level":"<integer>","code":"<string>","id_c77":{}},{"level":"<integer>","code":"<string>"}],"limits":{"goal":"<double>","paidToDate":"<double>","payPeriodMinimum":"<double>","payPeriodMaximum":"<double>","annualMaximum":"<double>"}}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId"

	payload := strings.NewReader("{\n  \"effectiveFrom\": \"<dateTime>\",\n  \"effectiveTo\": \"<dateTime>\",\n  \"calculationCode\": \"<string>\",\n  \"rate\": \"<double>\",\n  \"frequency\": \"<string>\",\n  \"agency\": \"<string>\",\n  \"arrear\": \"<double>\",\n  \"miscellaneousInfo\": \"<string>\",\n  \"note\": \"<string>\",\n  \"selfInsured\": \"<boolean>\",\n  \"priority\": \"<integer>\",\n  \"loan401K\": {\n    \"loanNumber\": \"<string>\",\n    \"issueDate\": \"<dateTime>\",\n    \"firstPaymentDate\": \"<dateTime>\"\n  },\n  \"costCenters\": [\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\",\n      \"id_c77\": {}\n    },\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\"\n    }\n  ],\n  \"limits\": {\n    \"goal\": \"<double>\",\n    \"paidToDate\": \"<double>\",\n    \"payPeriodMinimum\": \"<double>\",\n    \"payPeriodMaximum\": \"<double>\",\n    \"annualMaximum\": \"<double>\"\n  }\n}")

	req, _ := http.NewRequest("PUT", 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
require 'uri'
require 'net/http'

url = URI("https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"effectiveFrom\": \"<dateTime>\",\n  \"effectiveTo\": \"<dateTime>\",\n  \"calculationCode\": \"<string>\",\n  \"rate\": \"<double>\",\n  \"frequency\": \"<string>\",\n  \"agency\": \"<string>\",\n  \"arrear\": \"<double>\",\n  \"miscellaneousInfo\": \"<string>\",\n  \"note\": \"<string>\",\n  \"selfInsured\": \"<boolean>\",\n  \"priority\": \"<integer>\",\n  \"loan401K\": {\n    \"loanNumber\": \"<string>\",\n    \"issueDate\": \"<dateTime>\",\n    \"firstPaymentDate\": \"<dateTime>\"\n  },\n  \"costCenters\": [\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\",\n      \"id_c77\": {}\n    },\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\"\n    }\n  ],\n  \"limits\": {\n    \"goal\": \"<double>\",\n    \"paidToDate\": \"<double>\",\n    \"payPeriodMinimum\": \"<double>\",\n    \"payPeriodMaximum\": \"<double>\",\n    \"annualMaximum\": \"<double>\"\n  }\n}"

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.put("https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"effectiveFrom\": \"<dateTime>\",\n  \"effectiveTo\": \"<dateTime>\",\n  \"calculationCode\": \"<string>\",\n  \"rate\": \"<double>\",\n  \"frequency\": \"<string>\",\n  \"agency\": \"<string>\",\n  \"arrear\": \"<double>\",\n  \"miscellaneousInfo\": \"<string>\",\n  \"note\": \"<string>\",\n  \"selfInsured\": \"<boolean>\",\n  \"priority\": \"<integer>\",\n  \"loan401K\": {\n    \"loanNumber\": \"<string>\",\n    \"issueDate\": \"<dateTime>\",\n    \"firstPaymentDate\": \"<dateTime>\"\n  },\n  \"costCenters\": [\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\",\n      \"id_c77\": {}\n    },\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\"\n    }\n  ],\n  \"limits\": {\n    \"goal\": \"<double>\",\n    \"paidToDate\": \"<double>\",\n    \"payPeriodMinimum\": \"<double>\",\n    \"payPeriodMaximum\": \"<double>\",\n    \"annualMaximum\": \"<double>\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId', [
  'body' => '{
  "effectiveFrom": "<dateTime>",
  "effectiveTo": "<dateTime>",
  "calculationCode": "<string>",
  "rate": "<double>",
  "frequency": "<string>",
  "agency": "<string>",
  "arrear": "<double>",
  "miscellaneousInfo": "<string>",
  "note": "<string>",
  "selfInsured": "<boolean>",
  "priority": "<integer>",
  "loan401K": {
    "loanNumber": "<string>",
    "issueDate": "<dateTime>",
    "firstPaymentDate": "<dateTime>"
  },
  "costCenters": [
    {
      "level": "<integer>",
      "code": "<string>",
      "id_c77": {}
    },
    {
      "level": "<integer>",
      "code": "<string>"
    }
  ],
  "limits": {
    "goal": "<double>",
    "paidToDate": "<double>",
    "payPeriodMinimum": "<double>",
    "payPeriodMaximum": "<double>",
    "annualMaximum": "<double>"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"effectiveFrom\": \"<dateTime>\",\n  \"effectiveTo\": \"<dateTime>\",\n  \"calculationCode\": \"<string>\",\n  \"rate\": \"<double>\",\n  \"frequency\": \"<string>\",\n  \"agency\": \"<string>\",\n  \"arrear\": \"<double>\",\n  \"miscellaneousInfo\": \"<string>\",\n  \"note\": \"<string>\",\n  \"selfInsured\": \"<boolean>\",\n  \"priority\": \"<integer>\",\n  \"loan401K\": {\n    \"loanNumber\": \"<string>\",\n    \"issueDate\": \"<dateTime>\",\n    \"firstPaymentDate\": \"<dateTime>\"\n  },\n  \"costCenters\": [\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\",\n      \"id_c77\": {}\n    },\n    {\n      \"level\": \"<integer>\",\n      \"code\": \"<string>\"\n    }\n  ],\n  \"limits\": {\n    \"goal\": \"<double>\",\n    \"paidToDate\": \"<double>\",\n    \"payPeriodMinimum\": \"<double>\",\n    \"payPeriodMaximum\": \"<double>\",\n    \"annualMaximum\": \"<double>\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "effectiveFrom": "<dateTime>",
  "effectiveTo": "<dateTime>",
  "calculationCode": "<string>",
  "rate": "<double>",
  "frequency": "<string>",
  "agency": "<string>",
  "arrear": "<double>",
  "miscellaneousInfo": "<string>",
  "note": "<string>",
  "selfInsured": "<boolean>",
  "priority": "<integer>",
  "loan401K": [
    "loanNumber": "<string>",
    "issueDate": "<dateTime>",
    "firstPaymentDate": "<dateTime>"
  ],
  "costCenters": [
    [
      "level": "<integer>",
      "code": "<string>",
      "id_c77": []
    ],
    [
      "level": "<integer>",
      "code": "<string>"
    ]
  ],
  "limits": [
    "goal": "<double>",
    "paidToDate": "<double>",
    "payPeriodMinimum": "<double>",
    "payPeriodMaximum": "<double>",
    "annualMaximum": "<double>"
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.paylocity.com/apiHub/payroll/v1/companies/companyId/employees/employeeId/deductions/deductionCode/resourceId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```