updatePayRun
-Updates a pay run
--
/PayRuns/{PayRunID}
- -
Usage and SDK Samples
- - -<?php
-require_once(__DIR__ . '/vendor/autoload.php');
-
-// Configure OAuth2 access token for authorization: OAuth2
-$config = XeroAPI\XeroPHP\Configuration::getDefaultConfiguration()->setAccessToken( 'YOUR_ACCESS_TOKEN' );
-
-$apiInstance = new XeroAPI\XeroPHP\Api\PayrollNzApi(
- new GuzzleHttp\Client(),
- $config
-);
-$xeroTenantId = "xeroTenantId_example";
-$payRunID = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
-$idempotencyKey = "KEY_VALUE";
-$startDate = new DateTime('2020-10-28');
-$paymentDate = new DateTime('2020-10-30');
-
-$payRunCalendar = new XeroAPI\XeroPHP\Models\PayrollNz\PayRunCalendar;
-$payRunCalendar->setCalendarType(XeroAPI\XeroPHP\Models\PayrollNz\CalendarType.WEEKLY);
-$payRunCalendar->setPeriodStartDate($startDate);
-$payRunCalendar->setPaymentDate($paymentDate);
-
-try {
- $result = $apiInstance->updatePayRun($xeroTenantId, $payRunID, $payRun, $idempotencyKey);
-} catch (Exception $e) {
- echo 'Exception when calling PayrollNzApi->updatePayRun: ', $e->getMessage(), PHP_EOL;
-}
-?>
-
- Scopes
-| payroll.payruns | -Grant read-write access to payroll payruns | -
Parameters
-| Name | -Description | -
|---|---|
| PayRunID* | -
-
-
-
-
-
-
-
-
- UUID
-
-
- (uuid)
-
-
-
-
-Identifier for the pay run
-
-
- Required
-
- |
-
| Name | -Description | -
|---|---|
| Xero-Tenant-Id* | -
-
-
-
-
-
-
-
-
- String
-
-
-
-
-Xero identifier for Tenant
-
-
- Required
-
- |
-
| Idempotency-Key | -
-
-
-
-
-
-
-
-
- String
-
-
-
-
-This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
-
- |
-
| Name | -Description | -
|---|---|
| payRun * | -
-
-
-
-
- PayRun
-
-
-
-
-
-
- Required
-
- |