Pay Runs

Authentication: All endpoints require an Authorization: Bearer <access token> header.

Most endpoints require an X-Company-ID: <company_id> header to scope requests to a specific company. This is the recommended header for most API operations.

Some endpoints require an X-Location-ID: <location_id> header when the query doesn't accept a locationId parameter.

See Authentication for details on how to obtain and use these headers.

Query Pay Runs

GraphQL Query

query PayRuns {
  payRuns {
    id
    name
    description
    startDate
    endDate
    status
    createdAt
    timesheetsSelectedAt
    timesheetsSelectedBy {
      fullName
    }
    finalisedAt
    finalisedBy {
      fullName
    }
    processedAt
    processedBy {
      fullName
    }
    modifiedAt
    modifiedBy {
      fullName
    }
  }
}

Example Variables

{}

Example Response

{
  "data": {
    "payRuns": [
      {
        "id": "38",
        "name": "May 2024 - Fortnight 2",
        "description": null,
        "startDate": "2024-05-20",
        "endDate": "2024-06-02",
        "status": "Finalised",
        "createdAt": "2024-06-06T04:53:26.177Z",
        "timesheetsSelectedAt": null,
        "timesheetsSelectedBy": null,
        "finalisedAt": "2024-06-06T04:55:43.469Z",
        "finalisedBy": {
          "fullName": "Roubler Support"
        },
        "processedAt": null,
        "processedBy": null,
        "modifiedAt": "2024-06-06T04:53:26.177Z",
        "modifiedBy": {
          "fullName": "Roubler Support"
        }
      }
    ]
  }
}

Query Pay Run by ID

GraphQL Query

query PayRun($payRunId: ID!) {
  payRun(id: $payRunId) {
    id
    name
    description
    startDate
    endDate
    status
    createdAt
    finalisedAt
    finalisedBy {
      fullName
    }
    errors {
      message
      employee {
        id
        fullName
      }
    }
    payItems {
      employee {
        id
        fullName
      }
      payType {
        id
        name
      }
      startTime
      endTime
      unitAmount
      quantity
      amount
    }
    timesheets {
      id
      status
      startTime
      endTime
      hours
      employee {
        id
        text
      }
    }
    modifiedAt
    modifiedBy {
      fullName
    }
  }
}

Example Variables

{
  "payRunId": "38"
}

Example Response

{
  "data": {
    "payRun": {
      "id": "38",
      "name": "May 2024 - Fortnight 2",
      "description": null,
      "startDate": "2024-05-20",
      "endDate": "2024-06-02",
      "status": "Finalised",
      "createdAt": "2024-06-06T04:53:26.177Z",
      "finalisedAt": "2024-06-06T05:00:17.747Z",
      "finalisedBy": {
        "fullName": "Roubler Support"
      },
      "errors": [],
      "payItems": [
        {
          "employee": {
            "id": "72908",
            "fullName": "Craig Bussell"
          },
          "payType": {
            "id": "790",
            "name": "Ordinary - Standard - Standard"
          },
          "startTime": "2024-05-19T23:00:00.000Z",
          "endTime": "2024-05-20T05:00:00.000Z",
          "unitAmount": 14423,
          "quantity": 33,
          "amount": 475959
        },
        {
          "employee": {
            "id": "72909",
            "fullName": "Nicolas Chan"
          },
          "payType": {
            "id": "788",
            "name": "Overtime - Standard - Standard"
          },
          "startTime": "2024-06-01T06:00:00.000Z",
          "endTime": "2024-06-01T07:00:00.000Z",
          "unitAmount": 2200,
          "quantity": 1,
          "amount": 2200
        }
      ],
      "timesheets": [
        {
          "id": "4518861",
          "status": "payrolled",
          "startTime": "2024-05-29T21:00:00.000Z",
          "endTime": "2024-05-30T01:00:00.000Z",
          "hours": 4,
          "employee": {
            "id": "72908",
            "text": "Craig Bussell"
          }
        },
        {
          "id": "4518849",
          "status": "payrolled",
          "startTime": "2024-05-19T22:00:00.000Z",
          "endTime": "2024-05-20T05:00:00.000Z",
          "hours": 7,
          "employee": {
            "id": "72909",
            "text": "Nicolas Chan"
          }
        }
      ],
      "modifiedAt": "2024-06-06T04:53:26.177Z",
      "modifiedBy": {
        "fullName": "Roubler Support"
      }
    }
  }
}

Process Pay Run

GraphQL Mutation

mutation ProcessPayrun($id: ID!, $input: ProcessPayRunInput!) {
  processPayRun(id: $id, input: $input) {
    id
    status
  }
}

Example Variables

{
  "id": "40",
  "input": {
    "processedAt": "2024-05-20T20:00:00Z"
  }
}

Example Response

{
  "data": {
    "processPayRun": {
      "id": "40",
      "status": "Processed"
    }
  }
}

Delete Pay Run

GraphQL Mutation

mutation DeletePayrun($id: ID!) {
  deletePayRun(id: $id)
}

Example Variables

{
  "id": "39"
}

Example Response

{
  "data": {
    "deletePayRun": true
  }
}