Confirm Checkout Session
curl --request POST \
--url https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm', 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://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"checkoutId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ticketIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"checkoutSession": {
"checkoutSessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tripId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "CASH",
"status": "CREATED",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"tripItineraryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qrToken": "<string>",
"passengerDraft": {
"name": "Mariana Costa",
"document": "12345678909",
"documentType": "CPF",
"birthDate": "1992-04-18"
},
"requestedCreditAmount": 1,
"linkedAt": "2023-11-07T05:31:56Z",
"preparedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"canceledBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canceledAt": "2023-11-07T05:31:56Z",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cashSettlementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [
{
"code": "invalid_type",
"message": "Required",
"path": "name"
}
]
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}Checkout
Confirm Checkout Session
Confirms a linked and prepared session. For CASH sessions, calling this endpoint means the cash payment was accepted.
POST
/
api
/
v1
/
driver
/
checkout-sessions
/
{checkoutSessionId}
/
confirm
Confirm Checkout Session
curl --request POST \
--url https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm', 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://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/driver/checkout-sessions/{checkoutSessionId}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"checkoutId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"orderIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"ticketIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"checkoutSession": {
"checkoutSessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tripId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"paymentMethod": "CASH",
"status": "CREATED",
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"tripItineraryId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"seatId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"qrToken": "<string>",
"passengerDraft": {
"name": "Mariana Costa",
"document": "12345678909",
"documentType": "CPF",
"birthDate": "1992-04-18"
},
"requestedCreditAmount": 1,
"linkedAt": "2023-11-07T05:31:56Z",
"preparedAt": "2023-11-07T05:31:56Z",
"confirmedAt": "2023-11-07T05:31:56Z",
"canceledBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"canceledAt": "2023-11-07T05:31:56Z",
"createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updatedBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"paymentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cashSettlementId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"statusCode": 400,
"message": "Bad Request Error",
"errors": [
{
"code": "invalid_type",
"message": "Required",
"path": "name"
}
]
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}{
"statusCode": 404,
"error": "Not Found",
"message": "resource.not_found"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Checkout session identifier.
Query Parameters
Comma-separated list of fields to include in the response. Supports dot notation.
Response
OK
Confirmation result for a checkout session.
Checkout created by the confirmation.
Orders created by the checkout.
Tickets issued by the checkout.
Checkout session linked by the customer app through a QR token.
Show child attributes
Show child attributes
Payment created for a CASH session; null when no external or cash payment is required.
Automatically submitted cash settlement for a CASH session.