Create an Export Job Event
curl --request POST \
--url https://external.pleo.io/v3/export-job-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureReason": "<string>"
}
'import requests
url = "https://external.pleo.io/v3/export-job-events"
payload = {
"jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureReason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({jobId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', failureReason: '<string>'})
};
fetch('https://external.pleo.io/v3/export-job-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://external.pleo.io/v3/export-job-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jobId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'failureReason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external.pleo.io/v3/export-job-events"
payload := strings.NewReader("{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v3/export-job-events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v3/export-job-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "INVALID_EXPORT_JOB_STATUS_CHANGE",
"message": "Export Job status change failed"
}Export API (v3)
Create an Export Job Event
The Export Job Events imply the current status of the Export Job through the export lifecycle. Send a request to this endpoint to update the status of the export job. If an export job has failed, mention the failure reason and the reason type.
POST
/
v3
/
export-job-events
Create an Export Job Event
curl --request POST \
--url https://external.pleo.io/v3/export-job-events \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureReason": "<string>"
}
'import requests
url = "https://external.pleo.io/v3/export-job-events"
payload = {
"jobId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"failureReason": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({jobId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', failureReason: '<string>'})
};
fetch('https://external.pleo.io/v3/export-job-events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://external.pleo.io/v3/export-job-events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jobId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'failureReason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://external.pleo.io/v3/export-job-events"
payload := strings.NewReader("{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://external.pleo.io/v3/export-job-events")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://external.pleo.io/v3/export-job-events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"jobId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"failureReason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"type": "INVALID_EXPORT_JOB_STATUS_CHANGE",
"message": "Export Job status change failed"
}Authorizations
bearerAuthbasicAuth
JWT Bearer token authentication. Include the token in the Authorization header as: Bearer <token>
Body
application/json;charset=UTF-8
| Value | Description |
|---|---|
| started | The integration has started processing the job. |
| failed | The job has failed due to a connection error, authentication failure, or similar issue. |
| completed | The job has been successfully processed. |
| completed_with_errors | The job has been completed, but only some accounting entries were exported successfully. |
Available options:
started, failed, completed, completed_with_errors Identifier of the job the event is to be processed for.
Reason why the job failed in the case of a failure. Include this only when the export job event has a failed status.
| Value | Description |
|---|---|
| invalid_configuration | This would define a failure reason pertaining to invalid configuration needed to complete the export job or interact with the accounting system. |
| missing_configuration | This would define a failure reason pertaining to incomplete configuration needed to complete the export job or interact with the accounting system. |
| authentication_failure | Pleo API failed to authenticate with the integration service when sending off a WebHook API call. |
| accounting_system_authentication_failure | Integration service could not authenticate with the accounting system. |
| pleo_rate_limit | Irrecoverable rate limit issue with Pleo API. |
| accounting_system_rate_limit | Irrecoverable rate limit issue with the accounting system. |
| service_unreachable | Integration service unreachable. |
| accounting_system_unreachable | Integration service unable to reach accounting system. |
| validation_failure | Irrecoverable validation error making the job unprocessable. |
| authorization_failure | Authorisation revoked or user no longer has access in the accounting system. |
| integration_unusable | Integration service blocked or unusable for the customer. |
| job_expired | Job not updated within expiry time limit. |
| service_timeout | Irrecoverable timeout communicating with integration service. |
| accounting_system_timeout | Irrecoverable timeout communicating with accounting system. |
| canceled_by_user | Job was canceled by user. |
Available options:
invalid_configuration, missing_configuration, authentication_failure, accounting_system_authentication_failure, pleo_rate_limit, accounting_system_rate_limit, service_unreachable, accounting_system_unreachable, validation_failure, authorization_failure, integration_unusable, job_expired, service_timeout, accounting_system_timeout, canceled_by_user Response
Export Job Event created successfully.
Was this page helpful?