Valider le code de dépôt
curl --request PUT \
--url http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'import requests
url = "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3091",
CURLOPT_URL => "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code"
payload := strings.NewReader("{\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}Réservations
Scanner le QR code de dépôt
Valide le code de dépôt confirmant que le colis a été remis au transporteur.
PUT
/
v1
/
api
/
bookings
/
{bookingId}
/
deposit-code
Valider le code de dépôt
curl --request PUT \
--url http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"code": "<string>"
}
'import requests
url = "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code"
payload = { "code": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: '<string>'})
};
fetch('http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3091",
CURLOPT_URL => "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'code' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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 := "http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code"
payload := strings.NewReader("{\n \"code\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3091/v1/api/bookings/{bookingId}/deposit-code")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"id": 123,
"reservationNumber": "<string>",
"announcementId": 123,
"senderId": 123,
"carrierId": 123,
"status": "<string>",
"reservedWeight": 123,
"contentInfo": "<string>",
"depositCode": "<string>",
"deliveryCode": "<string>",
"departureCity": "<string>",
"arrivalCity": "<string>",
"departureDate": "2023-12-25",
"arrivalDate": "2023-12-25",
"pickupPoint": "<string>",
"deliveryPoint": "<string>",
"pricePerKg": 123,
"totalAmount": 123,
"platformCommission": 123,
"carrierAmount": 123,
"paymentId": "<string>",
"authorizationId": "<string>",
"captureId": "<string>",
"refundId": "<string>",
"paymentStatus": "<string>",
"paymentDate": "2023-11-07T05:31:56Z",
"paymentApprovalUrl": "<string>",
"senderName": "<string>",
"senderEmail": "<string>",
"carrierName": "<string>",
"carrierEmail": "<string>",
"invoiceId": "<string>",
"invoiceUrl": "<string>",
"items": [
{
"categoryId": 123,
"code": "<string>",
"name": "<string>",
"reservedQuantity": 123,
"description": "<string>",
"weight": 123,
"lengthCm": 123,
"widthCm": 123,
"heightCm": 123,
"isFragile": true,
"containsLiquids": true,
"imageUrl": "<string>"
}
],
"recipient": {
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"postalCode": "<string>",
"instructions": "<string>"
},
"reservationDate": "2023-11-07T05:31:56Z"
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}Authorizations
JWT access token from POST /v1/api/auth/login
Path Parameters
Body
application/json
Response
Deposit code validated
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I