CSV Export Job Endpoint

How to Create a CSV Export Job

Method: POST > Create CSV Export Job for a business

Endpoint: /third-party-api-server/api/business/{businessId}/branch/{branchId}/csvexportjob

Postman URL: https://platform.phorest.com/third-party-api-server/api/business/INSERT BUSINESS_ID HERE/branch/INSERT BRANCH_ID HERE/csvexportjob

Note:
You can pull all transactions for a branch over a date range. Get the data that is used to generate the Phorest Sales Transactions Report (found in Manager -> Reports -> Additional Reports -> Sales Transactions).

The Phorest API can be used to extract the following jobs:
TRANSACTIONS_CSV - containing all transaction data
SUNDRIES_CSV - Sundries is just petty cash sales in the salon
DATEV_CSV - Datev is for exporting financial data in Germany to import into accountancy software
CLIENT_COURSES_CSV - Client course data

Body request
Note: This request will generate the jobID

{  
 "failureReason": "No records found",  
 "finishFilter": "2021-10-21",  
 "finished": "2021-10-21T13:37:13.836Z",  
 "jobId": "hui", (not necessary to post as it will create the jobId anyway)  
 "jobStatus": "DONE",  
 "jobType": "CLIENT_COURSES_CSV",  
 "startFilter": "2021-10-21",  
 "started": "2021-10-21T13:37:13.836Z",  
 "succeededRows": 492,  
 "tempCsvExternalUrl": "<https://eu1-mem.s3-eu-west-1.amazonaws.com/mem-prd/business/eTC3QY5W3p_HmGHezKfxJw/csvexport">,  
 "totalRows": 530  
}

Response

{  
   "jobId": "vfvLSzpUP2dIvwR6kGw8Fg",  
   "jobType": "CLIENT_COURSES_CSV",  
   "jobStatus": "SCHEDULED",  
   "startFilter": "2021-10-21",  
   "finishFilter": "2021-10-21"  
}

💡 Once you have run this endpoint, you will be able to find the CSV in the Phorest GUI under Manager > Business > CSV Exports

How to Return a CSV Export Job

Method: GET > Return a csv export job

Endpoint: /third-party-api-server/api/business/{businessId}/branch/{branchId}/csvexportjob/{jobId}

Postman URL: https://platform.phorest.com/third-party-api-server/api/business/INSERT BUSINESS_ID HERE/branch/INSERT BRANCH_ID HERE/csvexportjob/INSERT JOB_ID HERE

Response

{  
   "jobId": "GBitzqPF9io0SCSZIFiiIg",  
   "jobType": "CLIENT_COURSES_CSV",  
   "jobStatus": "DONE",  
   "finished": "2021-10-21T14:27:36.000Z",  
   "startFilter": "2021-10-21",  
   "finishFilter": "2021-10-21",  
   "totalRows": 45,  
   "succeededRows": 45,  
   "tempCsvExternalUrl": "<https://eu1-mem.s3-eu-west-1.amazonaws.com/mem-prd/business/lX2aRtkmatLBSjcoU-Y2nQ/csvexport/GBitzqPF9io0SCSZIFiiIg?response-cache-control=public%2C%20max-age%3D1799&X-Amz-Security-Token=IQoJb3JpZ2luX2VjEGYaCWV1LXdlc3QtMSJHMEUCIH1YGvWCbu2oNTz%2FWicXUiFVik2N2MlUU5tX7AwKrpzEAiEAm%2FMoL4u%2BfrW5ZnoNdu7In8RKDonRD44JtBNW7y%2F6hIMq7wMI7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAAGgw2MTMyMjc4MDEwNzYiDBAd3NgRHywlpbls8SrDA2c8%2FjjcHDncV3a%2B9tuBYHMZU0NvXV8iL79RBLApqGjqjX%2BX%2FECitaWM3UCJ5F16ggdKO%2Beh1hLRJ9fqrS1yWiPoLPSUQkwOQ%2BdXRf2cIL1mFw7r%2F5VuyTG7i6L7htUjNwze7VX%2Fxw7uzj3WXofZI0r68AH8rbq5097C%2F482%2B7Uhm7o0vTRs%2FUcomGAC5D8KBtrFC10D13QF%2F3EbNj18o95VDgSDPMXK9ezvj0geOoODULRuCpuQOwQfBrBDgH0FRJ7u9QwoQqBsuKNUBIsbLYoZVihskoU8JT7DQNNw7d2RxiCpjvB9i%2FLLU2t9FCH5oyLe8QU8uKkKemusCN63QGfzOASUElepu5kD%2Bd2NPEuQ2Fi8UHuvD34gBgF3GjsEykU1MukmPL5Aku6nxA71nYeBLuWRfv0fNY1%2FjNuh7cvSpoG%2B%2F6vbzdA%2Bf1a6ktH8zMMyNucjna8DJ%2Bvl2AoReY7PsWr%2BfcOsAi%2FmP81fFc7afU3VeeaEM60ycSRXUqEPuD06UHr05KBHzbBL83YE%2Bs2O4lumvyL5YipnAYHHwYuMptbu%2F%2BJdEVVlC2Ur7gvYwlTAJO%2FfspgBK9EoTb5c89p7VrIwq%2BbFiwY6pQErqeaGrGTKgWIXChqVYuqORs%2B5S9IbJtD3fgFXPF%2BFGvTHFDpj4%2Fhh3BZtt0OvbRueauH5KY4nQNHOzohECrowxR34Sv6dIcA3ZoWfSITmv%2BzNkJL812d6e5qndtJgNb9ib%2FECVdHoi5cqJ%2F1%2B%2Bz%2BtpTKJCoJAKMqCfVO4LwGitcB3qR813HcCzcJD8rtcwWbjdMBopkktVp%2B7Obt2oN4SGaIhI48%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20211021T142757Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1799&X-Amz-Credential=ASIAY5RZZVH2MUC3HSUO%2F20211021%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Signature=96a87a8db7185deec157096ba5cca9e118550a0116b381e11b0282945f363967">  
}