Version: 1.0.0
Affranchissez rapidement et facilement tous vos colis Chronopost.
Chrono-API est une plateforme d'édition d'étiquettes Chronopost automatiquement.
Il est possible pour un développeur de :
Votre client doit créér un compte sur www.chrono-api.fr nécessitant:
Le client doit créer un compte Chrono-API sur www.chrono-api.fr au préalable.
Il obtiendra alors une clé API vous permettant de faire la majorité des appels au WebService. En effet, il n'est pas possible de modifier l'email du client par exemple, sans s'être authentifié au préalable. Pour s'identifier, vous avez besoin de l'email et du mot de passe du client. Le WebService vous donnera un token appelé sessionId qui vous permettra de réaliser les appels plus risqués.
Le coeur de l'API est la génération d'étiquettes d'envoi Chronopost. Une redirection vers www.chrono-api.fr est nénécessaire afin de terminer l'affranchissement. Vous devrez donc rediriger le client vers une page dédiée afin de terminer l'affranchissement.
Les étapes pour générer les étiquettes:
Voici l'url d'appel au WebService: https://ws.chrono-api.fr/services
Certains appels nécessitent la clé API, vous verrez alors dans les URLs le paramètre {api_key}. La clé API s'obtient dans la tableau de bord du compte du client sur www.chrono-api.fr.
Attention: Les appels ne fonctionneront pas si la clé API n'est pas active. Pour qu'elle soit active, il faut que le client ait rempli les conditions de Chrono-API.fr.
Certains appels nécessitent une authentification forte à l'aide de l'adresse email et du mot de passe du client. Vous verrez alors dans les URLs le paramètre {session_id}. En effet, vous devez récupérer cet identifiant de session en vous authentifiant au travers du WebService.
Attention: L'identifiant n'est valide que 30 minutes. Passé ce délai, vous serez bloqué par un code 403. Dans ce cas, soit vous vous réauthentifiez, soit vous rafraichissez la durée de validité de l'identifiant avant les 30 minutes. (toutes les 15 minutes par exemple).
Pour rediriger vers la page de l'affranchissement, voici l'url à compléter: https://www.chrono-api.fr/admin/admin.html#/mes_affranchissements/{reference_task} ou il faut remplacer {reference_task} par la référence de la tâche retourné lors de la création de la tâche.
Vous devez vous créér un compte sur www.chrono-api.fr. Vous devez le rendre actif. Il est préférable que votre client s'en occupe afin de se familiariser avec l'interface de Chrono-API.fr et pour qu'il puisse procéder au renseignement des données de paiement.
Une fois l'api active (instantané). Vous pourrez récupérer la clé API du tableau de bord.
ATTENTION: Lorsque vous faites des tests pour affranchir des étiquettes, vous testerez la redirection vers le site pour terminer l'affranchissement.
Le passage au paiement n'est pas fictif. Ne dépassez pas l'étape du calcul du prix.
J'ai dépassé l'étape du paiement et j'ai généré des étiquettes alors que je n'aurai pas dû. Pas de panique, il vous ait possible d'annuler les envois en vous rendant sur Chronopost.fr dans le menu Historique de mes envois. Une croix rouge vous permettra d'annuler les étiquettes.
Lors d'un affranchissement, il est demandé au client de renseigner certains champs comme le type d'envoi (chrono-express / chrono-classic...) avant de pouvoir générer les étiquettes. Il est possible d'appliquer en prévention un ensemble de valeurs par défaut, évitant de saisir la même valeur des 10 ènes de fois.
Un menu sur Chrono-API.fr permet au client de saisir ces configurations et d'en définir une par défaut.
En effet, il est possible d'avoir plusieurs configurations, que l'on peut appliquer aux colis d'une tâche d'affranchissement via un bouton. On peut définir une configuration par défaut, dans ce cas la configuration est appliquée automatiquement sans action de l'utilisateur.
Une configuration appliquée est l'équivalent de faire remplir les champs des colis par un robot. La modification avant validation est toujours possible.
Un webhook est une URL qui sera appelé par les serveurs de Chrono-API afin de vous notifier d'un évènement.
Sur Chrono-API, les appels sont uniquement HTTP au travers de la méthode POST. Pour chaque hook, des informations sont envoyées en JSON directement dans le corps de la requête.
Si jamais votre serveur n'est pas joignable, les serveurs de Chrono-API rééssairont 5 fois toutes les 30 secondes. Si aucun appel ne réussi, nos serveurs abandonneront.
List des Webhooks:
Action | Ressource(s) | Description | Paramètres envoyés par Chrono-API | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CALLBACK_ONFINISHED | CreateTask | Cette action est réalisée lorsqu'une tâche est terminée et que les étiquettes sont prêtes. |
|
Operation | Description |
---|---|
POST /parcel_config_presets/{session_id}/create | Create a new parcel configuration preset. |
GET /parcel_config_presets/{session_id}/list | Retrieve the list of the parcel config presets for the sessionId user. |
POST /parcel_config_presets/{session_id}/{preset_id}/default/set | Update parcel preset is defaut or not. |
POST /parcel_config_presets/{session_id}/{preset_id}/delete | Delete the specified parcel configuration preset. |
POST /parcel_config_presets/{session_id}/{preset_id}/update | Update the specified parcel configuration preset. |
GET /task/required/fields/labels | Retrieve the list of static labels associated with required fields. |
POST /task/{api_key}/create | Create a new task. |
GET /task/{api_key}/getPdf/{signature} | Download the specified PDF file according to its signature. |
GET /task/{api_key}/tasks/parcels/not_notified/list | Retrieve the list of tasks parcels not notified for the sessionId user. |
POST /task/{api_key}/tasks/parcels/set/to/notified | Update the task parcels to set it to notified state for the apiKey user. |
GET /task/{api_key}/{task_id}/get | Retrieve the specified task if you are the owner. |
GET /task/{session_id}/tasks/last/{nbr_tasks}/list | Retrieve the list of {nbr_task} last tasks in the database including working tasks. |
GET /task/{session_id}/tasks/list | Retrieve the list of tasks for the sessionId user. |
GET /task/{session_id}/{task_id}/cancel | Try to cancel the task. |
Operation | Description |
---|---|
GET /postage/chronopost/{api_key}/checkApiKey | Check API KEY |
GET /postage/chronopost/{api_key}/constraints/info | Returns the constraints info like maximum number of parcels which can be send to edit labels or the minimum delay between each call for editing labels... |
GET /postage/chronopost/{api_key}/parcel/tracking/infos/{lang}/{parcel_ref} | Retrieve parcel (from its 'reference number') tracking information on Chronopost.fr. |
GET /postage/chronopost/{api_key}/time/remaining/before/being/able/to/edit/labels | Returns time remaining before being able to edit labels again. If the value is positive and you make a call, the webservice will block you. |
Operation | Description |
---|---|
GET /module/broadcast/message | Get broadcast message if any.. |
GET /module/{module_id}/download | Download a prestashop module. |
GET /module/{prestashop_version_id}/last/module | Returns the last module available. |
GET /module/{prestashop_version_id}/last/module/download | Download the last prestashop module version according to the prestashop version. |
GET /module/{session_id}/list | List the modules. |
GET /module/{session_id}/prestashop_version/list | List Prestashop versions |
Operation | Description |
---|---|
POST /user/auth | Authenticate on API |
POST /user/auth/refresh | Resfresh session id on API |
GET /user/{session_id}/address/list | Retrieve list of addresses for the specified users. |
GET /user/{session_id}/api/get | Get user api informations. |
POST /user/{session_id}/disconnect | Destroy the specified session. |
POST /user/{session_id}/email/update | Update the connected user email. |
GET /user/{session_id}/get | Get user connected informations. |
POST /user/{session_id}/option/set | Set a user option. |
POST /user/{session_id}/password/update | Update the connected user password. |
GET /user/{session_id}/posted/parcels/current/month/list | Returns the list of parcels posted for this month (including canceled parcels). |
POST /user/{session_id}/update/chronopost/identifiers | Update chronopost identifiers after testing them on Chronopost.fr. |
Operation | Description |
---|---|
GET /business/{session_id}/bill/list | List user bills. |
GET /business/{session_id}/bill/list/filter/by/not_paid | List user bills which are not paid. |
GET /business/{session_id}/bill/{bill_id}/download | Download a bill PDF file. |
Returns list of bills on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to list specified user bills due to server side error.
Returns list of bills on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to list specified user not paid bills due to server side error.
Returns the .pdf bill file on success.
application/json
bill_id | The bill identifier. |
path | integer (int32) | |
session_id | Session identifier retrieved during authentication. |
path | string |
application/pdf
Forbidden access. Session is not valid or you are not the bill owner.
Bill not found.
Unable to download the bill due to server side error.
Returns message if any..
application/json
application/json
successful operation
Forbidden access. Session is not valid.
Unable to get message due to server side error.
Returns the .zip module file on success.
application/json
module_id | The module identifier. |
path | integer (int32) |
application/zip
Forbidden access. Session is not valid.
Module version not found.
Unable to download the module due to server side error.
Returns last module (or 404 when no module available) on success.
application/json
prestashop_version_id | The prestashop version identifier. |
path | integer (int32) |
application/json
successful operation
Forbidden access. Session is not valid or you are not an administrator.
No new module version available.
Unable to compare the specified version to the server version due to server side error.
Returns the .zip module file on success.
application/json
prestashop_version_id | The prestashop version identifier. |
path | integer (int32) |
application/zip
Module version not found.
Unable to download the module due to server side error.
Returns list of modules on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to list the modules due to server side error.
Returns list of prestashop versions on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to retrieve list of the Prestashop versions due to server side error.
Returns nothing.
application/json
session_id | Session identifier. |
path | string |
application/json
Invalid parameter.
Forbidden access. SessionId is not valid.
A preset with this name already exists.
Unable to create the parcel configuration preset due to server side error.
Returns list of parcel config presets.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. SessionId is not valid or you are not authorized.
Unable to retrieve the list of parcel config presets due to server side error.
Returns nothing.
application/json
The body contains 'true' or 'false' string.
preset_id | Preset db identifier. |
path | integer (int32) | |
session_id | Session identifier. |
path | string |
application/json
Forbidden access. SessionId is not valid.
Unable to update the parcel configuration preset default state due to server side error.
Returns nothing.
application/json
preset_id | Preset db identifier. |
path | integer (int32) | |
session_id | Session identifier. |
path | string |
application/json
Forbidden access. SessionId is not valid or you are not allowed to delete this preset.
The preset does not exists in our database.
Unable to delete the parcel configuration preset due to server side error.
Returns nothing.
application/json
preset_id | Preset db identifier. |
path | integer (int32) | |
session_id | Session identifier. |
path | string |
application/json
Invalid parameter.
Forbidden access. SessionId is not valid or you are not allowed to update this preset.
The preset does not exists in our database.
Another preset with this name already exists.
Unable to create the parcel configuration preset due to server side error.
Returns nothing on success.
application/json
api_key | API key. |
path | string |
application/json
API Key is in a disabled state.
Forbidden access. ApiKey is not valid.
Unable to check api key due to server side error.
Returns contraints info.
application/json
parcels_count | path | integer (int32) | ||
api_key | API key. |
path | string |
application/json
successful operation
API Key is in a disabled state.
Forbidden access. ApiKey is not valid.
Unable to retrieve constraints info due to server side error.
Returns the tracking events for the specified parcel.
application/json
lang | Tracking events language (EN|FR). |
path | string , x ∈ { FR , EN } | |
parcel_ref | Chronopost parcel reference. |
path | string | |
api_key | API key. |
path | string |
application/json
successful operation
API Key is in adisabled access. ApiKey is not valid.
No tracking information availabled.
Unable to retrieve specified parcel information due to server side error.
application/json
api_key | API key. |
path | string |
application/json
successful operation
API Key is in a disabled state.
Forbidden access. ApiKey is not valid.
Unable to retrieve time remaining due to server side error.
Returns the list of static labels.
application/json
application/json
successful operation
Forbidden access. SessionId is not valid or you are not authorized.
Unable to retrieve the required fields labels due to server side error.
Returns the task reference on success.
application/json
api_key | API key. |
path | string |
application/json
Invalid parameter.
Invalid identifiers.
API Key is in a disabled state.
Forbidden access. ApiKey is not valid.
You must wait several minutes before doing another call to edit labels (the number of minutes is available at #/{api_key}/contraints/info).
The number of parcels specified is reaching the maximum limit. (the number of maximum parcels is available at #/{api_key}/contraints/info)
Another task is already working.
Unable to retrieve required fields due to server side error.
Returns a PDF file.
text/plain
signature | PDF File signatured you retrieved from generated PDF resource call. |
path | string | |
api_key | API key. |
path | string |
application/octet-stream
successful operation
API Key is in a disabled state.
Forbidden access. ApiKey is not valid.
Generated PDF signature not found.
Unable to download PDF due to server side error.
Returns list of tasks parcels.
application/json
api_key | API key. |
path | string |
application/json
successful operation
API Key is in a disabled state.
Forbidden access. ApiKey is not valid or you are not authorized.
Unable to retrieve the list of tasks parcels due to server side error.
Returns nothing.
application/json
api_key | API key. |
path | string |
application/json
API Key is in a disabled state.
Forbidden access. ApiKey is not valid or you are not authorized.
Unable to update task parcels to notified state due to server side error.
Returns the task.
application/json
api_key | API key. |
path | string | |
task_id | Task identifier. |
path | integer (int32) |
application/json
successful operation
Forbidden access. ApiKey is not valid or you are not authorized.
Specified task is not found.
Unable to retrieve the specified task due to server side error.
Returns list of tasks.
application/json
session_id | Session identifier retrieved during authentication. |
path | string | |
nbr_tasks | Maximum number of tasks returned. |
path | integer (int64) |
application/json
successful operation
Forbidden access. SessionId is not valid or you are not authorized.
Unable to retrieve the list of tasks due to server side error.
Returns list of tasks.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. SessionId is not valid or you are not authorized.
Unable to retrieve the list of tasks due to server side error.
application/json
task_id | Task identifier. |
path | integer (int32) | |
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Forbidden access. SessionId is not valid or you are not authorized to cancel the task beacause of its status.
Specified task is not found.
Unable to cancel the task due to server side error.
Returns a string corresponding to a SessionID, needed to use API resources.
application/json
application/json
successful operation
Request contains invalid inputs.
Email/Password does not match.
Returns nothing on success.
application/json
Session identifier retrieved during authentication.
application/json
successful operation
Invalid session identifier specified or the session has expired.
Returns list of addresses.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Unable to list the addresses due to server side error.
Returns user api information on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to get user api information due to server side error.
Returns nothing. Always returns 200.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Returns nothing on success.
application/json
New email.
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Email specified is not valid.
Forbidden access. Session is not valid.
Unable to update the email due to server side error.
Returns user information on success.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to update the passwordget user information due to server side error.
Returns nothing on success.
application/json
Option to set.
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Forbidden access. Session is not valid.
Option key is not found.
Unable to set the user option due to server side error.
Returns nothing on success.
application/json
New blank password. You must not encrypt the password, the server will do it.
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Password specified is not valid.
Forbidden access. Session is not valid.
Unable to update the password due to server side error.
application/json
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
successful operation
Forbidden access. Session is not valid.
Unable to retrieve list of posted parcels due to server side error.
Returns nothing.
application/json
Identifiers.
session_id | Session identifier retrieved during authentication. |
path | string |
application/json
Identifier are not valid.
Chronopost identifiers are invalid.
Forbidden access. Session is not valid.
Unable to update chronopost identifiers to an internal error.
Model which describes identifiers in order to authenticate or refresh session.
This is the user email. String length [10, 255].
This is the user password already encrypted in SHA256. String length [64, 64].
Chronopost parcel options at shipment
Inform sender about shipment
Inform sender way. 'MAIL' or 'SMS'. Ignore if 'informSender' is set to false.
Send a mail to the recipient.
Shipment date if defered
Value to insure
Option to set if you want Chronopost deliver your parcel on saturday.
Model to create a parcel config preset
This is the preset name. String length [3,30].
Hashmap of entries with their associated value. Keys are ParcelConfigPresetEntry and values are String. {ENUM}ParcelConfigPresetEntry: {"VALUE_TO_DECLARE_TO_CUSTOMS", "LENGTH", "WIDTH", "HEIGHT", "WEIGHT", "PRODUCT_DESCRIPTION", "CONTAINER", "SEND_TYPE_INTERNATIONAL", "SEND_TYPE_NATIONAL", "INFORM_SENDER_BY", "SEND_MAIL_RECIPIENT", "INSURANCE_VALUE"}
This is the config default state.
Model to describe an encrusted token on PDF files
This is the product reference if any. String.
This is the product name. String.
This is the product quantity. Integer.
True to display the product on the label. Boolean.
This is the product weight. Float.
This is the product width. Float.
This is the product height. Float.
This is the product length/depth. Float.
Model describing a user address
This is the address id.
This is the address label name.
This is the recipient firstname.
This is the recipient lastname.
This is the recipient country.
Address line 1.
Address line 2.
Address line 3.
ZipCode if any.
This is the recipient city name.
This is the recipient phonenumber.
This is the recipient company name.
Model describing a bill
Bill identifier
Bill user identifier
Bill name
Bill created date
Bill amount HT
Bill amount TTC
Bill current status
Bill payment way
Model describing postage constraints
Maximum number of parcels which can be sent to edit labels for each call to the webservice.
Minimum number of minutes between each webservice call to edit labels.
Model describing a prestashop module
Module identifier
Module created date
Module version
Prestashop version
Model describing a user option
Option key
Option value
Model describing a parcel configuration preset
This is the preset db identifier.
This is the preset name.
This is the list of the fields.
Model describing a parcel configuration preset field
This is the preset field db identifier.
This is the preset field key.
This is the preset field value.
Model describing a posted parcel
Db identifier
Posted date
The reference (track number)
HT amount
Model describing Prestashop version
This is the Prestashop version id.
This is the prestashop version name.
Model describing a proxy
Proxy index in list
Proxy
List of users associated
Model describing a string but compatible with json structure
Variable containing raw string response.
Model describing a task
This is the task db identifier.
This is the task creation date.
This is the associated task user id.
This is the task status.
This is the task reference.
This is the task associated chronopost order number.
This is the ttc amount calculated.
This is the ht amount calculated.
This is the tva amount calculated.
This is the money symbol for amounts calculated.
This is the path to the built PDF.
This is the list of task logs associated.
This is the list of the task parcels associated.
Model describing a task log message
This is the task log db identifier.
This is the task log creation date.
This is the task log reference (depending on type, for steps it is the state).
This is the task log message type.
This is the task log message.
This is the task log data if any.
Model describing a task parcel
This is the task parcel db identifier.
Country in ISO format
Country name
Parcel type (PARTICULAR or COMPANY)
Social reason (mandatory if type is COMPANY)
Last name
First name
Address line 1
Address line 2
Door code
Zip code
City
State
Phone number
Custom token (this value is the prestashop order id when this parcel comes from the prestashop module)
Tracking number
HT amount
Model describing a task required field label
This is the task required field name.
This is the task required field label.
Model describing the time remaining
The remaining hours.
The remaining minutes.
The remaining seconds.
Model describing a user
This is the user id.
This is the user firstname.
This is the user lastname.
This is the user birthday date.
This is the user email.
This is the user phonenumber. Must be in international format.
This is the user commission amount in euros.
This is the user company name.
This is the user company website.
This is the chronopost user username.
This is the chronopost user password.
Date until parcels are free.
API information.
Bill address.
Proxy used (automatically determined).
AutoWithdraw status.
Options associated to the user.
Model describing a list element violations
This is the element id in the list passed as parameter.
This is list of violations of this element.
Abstract model describing a generic parcel
Recipient country in two letter. Example: FR. String length [2, 2].
Recipient country complete name. Example: FRANCE. String length [2, 50].
Recipient type.
Recipient social reason. Mandatory when the parcelType is set to COMPANY. String length [0, 150].
Recipient lastname. String length [3, 100].
Recipient firstname. String length [3, 100].
Recipient address. String length [1, 255].
Recipient more address. String length [0, 255].
Recipient door code. String length [0, 50].
Recipient zip code. String length [0, 30].
Recipient city name. String length [3, 255].
Recipient state/region. String length [0, 150].
Recipient phone number. String length [1, 50].
Recipient email. String length [4, 255].
Required fields filled by user. This bean is used by webservice as a request.
This is the task parcel identifier.
This is the list of chosen data. This is an hashmap where the Keys are String and Values are String.
Chronopost parcel options
Model to set user option
Option key
Option value
Model describing task
Cancel current waiting task to create this one, only if the current task state allows it, default to false
List of parcels
List of webhooks. Optional.
Model describing a task parcel
This id is set by the user and is not used at server side EXCEPTING for identify the parcel in a returned error.
Chronopost parcel
Inscrusted token
Inscrusted products
Model to update chronopost identifiers
This is the user chronopost username. String min [3].
This is the user chronopost password. String min [3].
Model to update a mail
Mail subject.
The mail template.
Model which describe a request constraint violation
This is the request model property path.
This is the request model constraint violation message (in user language) to display to the user.