Find below some information on the steps to create your orders using the API
We will present all the elements needed to create a job, update the options, check the returns...

Web Hooks

In the Intelligent Hybrid mail application, the administrator must configure the webhook url (your server) Then each time a document is updated you will receive a JSON data
{
	"eventType": string, //SHIPMENT_STATUS or TRACKING_TEXT or TRACKING_FILE
	"shipmentId": integer, //Id of the shipment
	"shipmentExternalId": integer, // ExternalId of the shipment
	"name": string, //Name of the tracking type (can be used to retrieve a tracking file) ; null if eventType is SHIPMENT_STATUS
	"value": string, //For SHIPMENT_STATUS it is a numeric Shipment status
	//for TRACKING_TEXT the value depends of the name (ex. registration number)
	//for TRACKING_FILE this is the original file name
	"serverTimestamp": longepochMillis, //Timestamp is long epoch millis. Date of the processing of the event on PODX / IHM server
	"eventDate": longepochMillis, //Timestamp is long epoch millis or null. Date of the event as given by an external provider.
}
Resend policy: we try each 15 minutes for 48 hours to send you the message. We consider the message OK if we receive a 200 OK

Shipment statuses

250: "Being created"
300: "Ready"
400: "In production"
600: "Mailed"
610: "Delivered"
700: "Sent"
710: "Received"
711: "Not opened"
712: "Reprint sent"
713: "Recipient reject"
714: "Signed"
715: "Opened"
716: "Clicked"
730: "Unsubscribe"
751: "Invoice sent"
760: "Accepted"
-610: "Not delivered"
-611: "Not claimed by client"
-612: "Refused by client"
-613: "Incorrect recipient"
-614: "Incorrect address"
-700: "Shipment error"
-710: "Undelivered"
-711: "Bounced"
-712: "Blocked"
-720: "Neglected"
-740: "Tax instruction"
-741: "Invoice pending"
-742: "ChorusPro error"
-743: "Transmission error"
-744: "Invoice error"
-750: "Waiting user action"
-761: "Refused"
-765: "Deleted"
-900: "Canceled"
-910: "Cancelled, after printing"
-920: "Cancelled, after enveloping"
-930: "Cancelled, after franking"
-990: "Cancelled, on site destruction"

Status 6XX are linked to classic mail or registered mail channel (channel with physical paper)
Status 7XX are linked to electronic channels (email, registered mail letter, ChorusPro...) mail or registered mail channel (channel with physical paper)

API limitations

By default there is no restrictions to use the api.
However, it must be used wisely and for the PostGreen instance, we may ban IPs interracting too much with the instance.

You can poll the job every 5 minutes.
- Either the job is in PACK_GROUP_CREATED, there is no point in querying,
- Either the job is in PROCESSING_ERROR (there the files are not correct), it is useless to query
- Either the job is still in progress, ask in 5 minutes.

Then you look at the deliveries.
- if no delivery created, then there is generally a problem with the recipient address. It is useless to question further, you have to correct the address in the interface (or set up the calls to retrieve the address and correct it)
- if delivery created, then nothing to do, it should be in READY or OUTPUTTED, no need to query anymore, it doesn't evolve anymore at this level.
After that, there's no point in querying the delivery. From the next day, once a day, query the shipment to retrieve the recommended tracking number, for example. And the status of the shipment.

Currently in the application there is no concept of final status.
For mail: the PND is a final status, and two months after sending (without PND) the status of the envelope is considered final.
For the registered: the PND is final, the return AR is final. And two months after sending (without PND or AR), the status is considered final.
Recommendation: scan every day for 1 month. 99% should be done. Then well maybe once a week for more than a month...

About the address page

The address page is not an option you can configure on the delivery creation process.
The address page exists or not and it's configured in the service

LaPoste_Fr or LaPoste_BE tracking (PostGreen instance)

{
	"tracker": "LAPOSTE",
	"tracking": "2C1XXXXXXX",
	"status": "DELIVERED",
	"events": [{"dateTime": 1643238000000,
	"label": "Votre courrier a été distribué à son destinataire contre sa signature."},
	{"dateTime": 1643238000000,
	"label": "Votre courrier est disponible en point de retrait. Il y sera conservé pendant 15 jours et sera remis au destinataire sur
	présentation d\u0027une pièce d\u0027identité."},
	{"dateTime": 1643151600000,
	"label": "Votre courrier est arrivé dans le site en vue de sa distribution."},
	{"dateTime": 1643151600000,
	"label": "Votre envoi n\u0027a pas pu être distribué ce jour et sera mis à disposition au bureau de poste. Une relivraison à
	l\u0027adresse ou en point de retrait peut également être choisie avant minuit sur notre site internet."},
	{"dateTime": 1643151600000,
	"label": "Votre courrier est arrivé dans le site en vue de sa distribution."},
	{"dateTime": 1643151600000,
	"label": "Votre courrier est en cours d\u0027acheminement vers sa destination"},
	{"dateTime": 1643151600000,
	"label": "Votre courrier est en cours d\u0027acheminement vers sa destination"},
	{"dateTime": 1643065200000,
	"label": "Votre courrier est en cours d\u0027acheminement vers sa destination"},
	{"dateTime": 1643065200000,
	"label": "Une erreur s\u0027est produite dans l\u0027acheminement de votre courrier. Nous mettons tout en œuvre pour
	qu\u0027il reprenne son parcours et vous prions d\u0027accepter nos excuses."},
	{"dateTime": 1642978800000,
	"label": "Votre courrier a été remis à La Poste par l\u0027expéditeur."
	}]
}