Convert shift billables
Needs: Finance, Read-write, and Clients, Read-write
Converts a shift's pending billables to Unpaid, like Convert in Billing insights. By default it also completes the shift, clocking it in and out at its rostered times. Add keep_clock to leave the clock times alone, and run with dry_run first to list what would convert. Shift refs are described in the Roster page.
Errors
422withThis shift has no pending billables to convert.when there is nothing to convert.
Important: This endpoint needs Read-write on both Finance and Clients. With Finance alone the request is refused with a
422.
curl -X POST "https://app.imploy.com.au/api/integrations/v1/shifts/example_string/billables" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"dry_run": true
}'
import requests
import json
url = "https://app.imploy.com.au/api/integrations/v1/shifts/example_string/billables"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
data = {
"dry_run": true
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.imploy.com.au/api/integrations/v1/shifts/example_string/billables", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
},
body: JSON.stringify({
"dry_run": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"dry_run": true
}`)
req, err := http.NewRequest("POST", "https://app.imploy.com.au/api/integrations/v1/shifts/example_string/billables", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.imploy.com.au/api/integrations/v1/shifts/example_string/billables')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request.body = '{
"dry_run": true
}'
response = http.request(request)
puts response.body
{
"ref": "a:123",
"converted": 1,
"clock_kept": false
}
{
"message": "Invalid or expired access token."
}
{
"message": "Access token does not permit this action."
}
{
"message": "Too many requests."
}
/shifts/{ref}/billablesTarget server for requests. Edit to use your own host.
An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
imp_at_. Send it as Authorization: Bearer imp_at_XXXX.The shift ref, such as a:123 or g:456.
The media type of the request body
Bill the shift but leave its clock times empty, so staff can still clock real times.
Only this staff member's pending billables.
List the pending billables that would convert, without converting.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token. An organisation access token that starts with imp_at_. Send it as Authorization: Bearer imp_at_XXXX.
Path Parameters
The shift ref, such as a:123 or g:456.
Body
Bill the shift but leave its clock times empty, so staff can still clock real times.
Only this staff member's pending billables.
List the pending billables that would convert, without converting.
Responses
Converted