Postman Import

The below Postman queries can be imported into Postman for testing, just cut and paste the JSON to a file and import into Postman.

Note the following variables will need set up in a collection for the queries to work:

Item
Description

ExternalApiClientId

The Bright Client ID provided to you by Bright

ExternalApiSecret

The Bright Secret provided to you by Bright

OrganisationId

Choose a value from the response from GetEmployers

EmployerId

Choose a value from the response from GetEmployers (Employer must have the same Organisation Id as OrganisationId above)

EmployeeId

Select a value from the response from GetEmployees

{
	"info": {
		"_postman_id": "64d0f1d6-49a8-4b92-875c-93f5546d04a9",
		"name": "Bright Pay External Api",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "35392265"
	},
	"item": [
		{
			"name": "GetUserDetails",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://external.brightpay.com/api/v1.0/Payroll/GetCurrentUserSummary",
					"protocol": "https",
					"host": [
						"external",
						"brightpay",
						"com"
					],
					"path": [
						"api",
						"v1.0",
						"Payroll",
						"GetCurrentUserSummary"
					]
				}
			},
			"response": []
		},
		{
			"name": "GetEmployers",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://external.brightpay.com/api/v1.0/Payroll/GetEmployers",
					"protocol": "https",
					"host": [
						"external",
						"brightpay",
						"com"
					],
					"path": [
						"api",
						"v1.0",
						"Payroll",
						"GetEmployers"
					]
				}
			},
			"response": []
		},
		{
			"name": "GetEmployees",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://external.brightpay.com/api/v1.0/Payroll/GetEmployees?EmployerId={{EmployerId}}&OrganisationId={{OrganisationId}}",
					"protocol": "https",
					"host": [
						"external",
						"brightpay",
						"com"
					],
					"path": [
						"api",
						"v1.0",
						"Payroll",
						"GetEmployees"
					],
					"query": [
						{
							"key": "EmployerId",
							"value": "{{EmployerId}}"
						},
						{
							"key": "OrganisationId",
							"value": "{{OrganisationId}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "GetHourlyRates",
			"request": {
				"method": "GET",
				"header": [],
				"url": {
					"raw": "https://external.brightpay.com/api/v1.0/Payroll/GetEmployerHourlyRates?EmployerId={{EmployerId}}&organisationId={{OrganisationId}}",
					"protocol": "https",
					"host": [
						"external",
						"brightpay",
						"com"
					],
					"path": [
						"api",
						"v1.0",
						"Payroll",
						"GetEmployerHourlyRates"
					],
					"query": [
						{
							"key": "EmployerId",
							"value": "{{EmployerId}}"
						},
						{
							"key": "organisationId",
							"value": "{{OrganisationId}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "PostHourlyPayments",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "raw",
					"raw": "{\"OrganisationId\":\"{{OrganisationId}}\",\"EmployerId\":\"{{EmployerId}}\",\"EmployeeId\":\"{{EmployeeId}}\",\"IsRunValidationOnly\":false,\"IsRemoveExistingHourlyPayments\":true,\"HourlyPayments\":[{\"RateName\":\"Standard rate\",\"Multiplier\":1,\"DateOfEntry\":\"2024-04-08T00:00:00\",\"HoursWorked\":7.5},{\"RateName\":\"Standard rate\",\"Multiplier\":1,\"DateOfEntry\":\"2024-04-09T00:00:00\",\"HoursWorked\":7.5},{\"RateName\":\"Standard rate\",\"Multiplier\":1,\"DateOfEntry\":\"2024-04-10T00:00:00\",\"HoursWorked\":7.5},{\"RateName\":\"Standard rate\",\"Multiplier\":1,\"DateOfEntry\":\"2024-04-11T00:00:00\",\"HoursWorked\":7.5},{\"RateName\":\"Standard rate\",\"Multiplier\":1,\"DateOfEntry\":\"2024-04-12T00:00:00\",\"HoursWorked\":7.5}]}",
					"options": {
						"raw": {
							"language": "json"
						}
					}
				},
				"url": {
					"raw": "https://external.brightpay.com/api/v1.0/Payroll/CreateEmployeeHourlyPayments",
					"protocol": "https",
					"host": [
						"external",
						"brightpay",
						"com"
					],
					"path": [
						"api",
						"v1.0",
						"Payroll",
						"CreateEmployeeHourlyPayments"
					]
				}
			},
			"response": []
		}
	],
	"auth": {
		"type": "oauth2",
		"oauth2": [
			{
				"key": "tokenName",
				"value": "BrightPayExternalAPI",
				"type": "string"
			},
			{
				"key": "scope",
				"value": "offline_access https://login.brightsg.com/456b7587-bc0e-4a1e-824e-756b078a2ade/brightpay.online.external.api",
				"type": "string"
			},
			{
				"key": "accessTokenUrl",
				"value": "https://login.brightsg.com/login.brightsg.com/B2C_1A_BPOL_SIGNIN_PROD/oauth2/v2.0/token",
				"type": "string"
			},
			{
				"key": "authUrl",
				"value": "https://login.brightsg.com/login.brightsg.com/B2C_1A_BPOL_SIGNIN_PROD/oauth2/v2.0/authorize",
				"type": "string"
			},
			{
				"key": "state",
				"value": "12344",
				"type": "string"
			},
			{
				"key": "clientSecret",
				"value": "{{ExternalApiSecret}}",
				"type": "string"
			},
			{
				"key": "clientId",
				"value": "{{ExternalApiClientId}}",
				"type": "string"
			},
			{
				"key": "useBrowser",
				"value": true,
				"type": "boolean"
			},
			{
				"key": "addTokenTo",
				"value": "header",
				"type": "string"
			}
		]
	},
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"packages": {},
				"exec": [
					""
				]
			}
		}
	]
}

Last updated