Confirm delivery via QR token
PUT/company/qr/confirm
Confirm the completion of a delivery. Upon confirmation:
- The shipment status changes to
delivered - The recipient's digital signature is recorded
- Proof of delivery photos are saved (if attached)
- The geolocation of the confirmation is recorded
- The
confirm_tokenis invalidated - The service payment is processed (Stripe)
- The eCMR is signed digitally
- Confirmation emails are sent to all parties
This endpoint is PUBLIC — no authentication required.
Usage Flow
- Obtain the
confirm_tokenfrom theGET /company/qr/{token}endpoint - Collect the recipient's digital signature (base64 canvas)
- Optionally, take photos of the delivery
- Call this endpoint with all the data
The data Field
The data field must be sent as a JSON string in the multipart form.
It contains the signer's data and their digital signature:
{
name: Juan,
surname: Pérez,
taxid: 12345678A,
email: juan@example.com,
image: data:image/png;base64,iVBORw0KG...
}
Technical Notes
- Source code:
src/features/company/qr_delivery/controller.js→confirmDelivery - Accepts up to 6 attached images (field
images, uploaded to S3) - Geolocation is optional but recommended for auditing
- The action is irreversible: a confirmed shipment cannot be reverted to a previous status
Request
Responses
- 200
- 400
- 401
- 404
- 500
Delivery successfully confirmed
Invalid data. Occurs when:
- Required parameters are missing (
service_code,token,data) - Incorrect JSON format in the
datafield
Operation not allowed. This occurs when:
- The delivery is already in a final state (
delivered,canceled) - The signature (
image) is not present in thedatafield
Delivery not found. Possible causes:
- The
tokenorservice_codeis incorrect or does not match - The delivery was deleted
Internal server error while saving the confirmation