Completion
curl --request POST \
--url https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "<string>",
"report": {
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": true,
"followUpNote": "<string>",
"completedAt": "<string>",
"reasons": [
"<string>"
]
},
"photoAttachmentIds": [
"<string>"
],
"nextStep": {
"parts": {
"part": "<string>",
"ordered": true,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": true,
"currentFinishes": true
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
report: {
outcome: '<string>',
workDone: '<string>',
materials: '<string>',
followUpNeeded: true,
followUpNote: '<string>',
completedAt: '<string>',
reasons: ['<string>']
},
photoAttachmentIds: ['<string>'],
nextStep: {
parts: {
part: '<string>',
ordered: true,
expectedOn: '<string>',
returnDurationMinutes: 123,
supplier: '<string>',
costMinor: 123
},
quote: {
lines: [{description: '<string>', amountMinor: 123}],
totalMinor: 123,
vatMinor: 123,
earliestStartOn: '<string>'
},
hazard: {description: '<string>', madeSafe: true, anyoneAtRisk: true},
returnVisit: {needed: '<string>', timeNeededMinutes: 123, returnBy: '<string>'},
photoDocumentIds: ['<string>']
},
otherTrade: {
trade: '<string>',
purpose: '<string>',
safeMeanwhile: true,
currentFinishes: true
}
})
};
fetch('https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion"
payload = {
"requestId": "<string>",
"report": {
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": True,
"followUpNote": "<string>",
"completedAt": "<string>",
"reasons": ["<string>"]
},
"photoAttachmentIds": ["<string>"],
"nextStep": {
"parts": {
"part": "<string>",
"ordered": True,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": True,
"anyoneAtRisk": True
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": ["<string>"]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": True,
"currentFinishes": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"kind": "<string>",
"visitStartsAt": "<string>",
"expectedAt": "<string>",
"note": "<string>",
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": true,
"followUpNote": "<string>",
"photoAttachmentIds": [
"<string>"
],
"occurredAt": "<string>",
"recordedAt": "<string>",
"reasons": [
"<string>"
]
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}maintenance-pro-contractor
Completion
The contractor’s completion report; fixed on a booked visit marks it done
POST
/
p
/
:tenant
/
contractor
/
jobs
/
{id}
/
completion
Completion
curl --request POST \
--url https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion \
--header 'Content-Type: application/json' \
--data '
{
"requestId": "<string>",
"report": {
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": true,
"followUpNote": "<string>",
"completedAt": "<string>",
"reasons": [
"<string>"
]
},
"photoAttachmentIds": [
"<string>"
],
"nextStep": {
"parts": {
"part": "<string>",
"ordered": true,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": true,
"anyoneAtRisk": true
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": [
"<string>"
]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": true,
"currentFinishes": true
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
requestId: '<string>',
report: {
outcome: '<string>',
workDone: '<string>',
materials: '<string>',
followUpNeeded: true,
followUpNote: '<string>',
completedAt: '<string>',
reasons: ['<string>']
},
photoAttachmentIds: ['<string>'],
nextStep: {
parts: {
part: '<string>',
ordered: true,
expectedOn: '<string>',
returnDurationMinutes: 123,
supplier: '<string>',
costMinor: 123
},
quote: {
lines: [{description: '<string>', amountMinor: 123}],
totalMinor: 123,
vatMinor: 123,
earliestStartOn: '<string>'
},
hazard: {description: '<string>', madeSafe: true, anyoneAtRisk: true},
returnVisit: {needed: '<string>', timeNeededMinutes: 123, returnBy: '<string>'},
photoDocumentIds: ['<string>']
},
otherTrade: {
trade: '<string>',
purpose: '<string>',
safeMeanwhile: true,
currentFinishes: true
}
})
};
fetch('https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.sortx.co.uk/p/:tenant/contractor/jobs/{id}/completion"
payload = {
"requestId": "<string>",
"report": {
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": True,
"followUpNote": "<string>",
"completedAt": "<string>",
"reasons": ["<string>"]
},
"photoAttachmentIds": ["<string>"],
"nextStep": {
"parts": {
"part": "<string>",
"ordered": True,
"expectedOn": "<string>",
"returnDurationMinutes": 123,
"supplier": "<string>",
"costMinor": 123
},
"quote": {
"lines": [
{
"description": "<string>",
"amountMinor": 123
}
],
"totalMinor": 123,
"vatMinor": 123,
"earliestStartOn": "<string>"
},
"hazard": {
"description": "<string>",
"madeSafe": True,
"anyoneAtRisk": True
},
"returnVisit": {
"needed": "<string>",
"timeNeededMinutes": 123,
"returnBy": "<string>"
},
"photoDocumentIds": ["<string>"]
},
"otherTrade": {
"trade": "<string>",
"purpose": "<string>",
"safeMeanwhile": True,
"currentFinishes": True
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"kind": "<string>",
"visitStartsAt": "<string>",
"expectedAt": "<string>",
"note": "<string>",
"outcome": "<string>",
"workDone": "<string>",
"materials": "<string>",
"followUpNeeded": true,
"followUpNote": "<string>",
"photoAttachmentIds": [
"<string>"
],
"occurredAt": "<string>",
"recordedAt": "<string>",
"reasons": [
"<string>"
]
}{
"_tag": "TenantCreateRejected",
"reason": "<string>",
"field": "<string>"
}{
"_tag": "Unauthenticated"
}{
"_tag": "TenantSuspended",
"tenantId": "<string>",
"reason": "<string>"
}{
"_tag": "EntitlementMissing",
"tenantId": "<string>",
"moduleId": "<string>"
}{
"_tag": "TenantNotFound",
"slug": "<string>"
}{
"_tag": "WebhookDuplicate",
"integration": "<string>",
"externalId": "<string>"
}{
"_tag": "RateLimited",
"key": "<string>",
"retryAfterSeconds": 123,
"message": "<string>"
}{
"_tag": "IntegrationUnavailable",
"integration": "<string>",
"detail": "<string>"
}Path Parameters
Body
application/json
Response
Success