Order Management

Order Management

This section covers the complete lifecycle of managing orders through the Gett B2C API, from creation to cancellation.

Creating Orders

Endpoint

POST https://api.gett.com/v1/private/orders/create

Headers

Content-Type: application/json
Authorization: Bearer {your_token}

Request Parameters

ParameterTypeRequiredDescription
partner_idstringYesYour partner ID provided by Gett
product_idstringYesProduct ID from pricing response or provided by Gett
quote_idstringYesEstimation ID from the aggregated call response. This commits the price for the journey when price_concept is fixed_price. For meter pricing, the final price is calculated by the meter
user_accepted_terms_and_privacybooleanYesMust be true - indicates user accepted T&C
categorystringYesService category: transportation or delivery
lcstringNoLanguage code: en (English) or he (Hebrew)
scheduled_atstringNoPickup time in ISO8601 format. Omit for immediate booking
stopsarrayYesArray of stop objects (minimum 2: origin and destination)
paymentobjectYesPayment configuration
preferencesobjectNoAdditional preferences for the order

Stop Object Structure

ParameterTypeRequiredDescription
typestringYesStop type: origin, on_going, or destination
actionsarrayYesArray of action objects for this stop
locationobjectYesLocation details

Action Object Structure

ParameterTypeRequiredDescription
typestringYesAction type: pick_up, drop_off, or stop_by
userobjectYesUser information
user.namestringYesPassenger name
user.phonestringYesPhone number in international format (without +)

Location Object Structure

ParameterTypeRequiredDescription
latfloatYesLatitude coordinate
lngfloatYesLongitude coordinate
full_addressstringNoComplete address string
addressobjectNoDetailed address breakdown

Address Object Structure (Optional)

ParameterTypeRequiredDescription
housestringNoHouse/building number
streetstringNoStreet name
citystringNoCity name
statestringNoState/province name
countrystringNoCountry name
postcodestringNoPostal/ZIP code
notesstringNoSpecial delivery notes for driver
address_placeobjectNoAddress provider information

Example Request

curl --request POST 'https://api.gett.com/v1/private/orders/create' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer {your_token}' \
  --data '{
    "partner_id": "1f4c281e-b3eb-4676-beb7-b3a61caba0e6",
    "product_id": "economy",
    "quote_id": "1a22584a-9685-4153-a629-271ebc34dcda",
    "user_accepted_terms_and_privacy": true,
    "category": "transportation",
    "lc": "en",
    "scheduled_at": "2024-10-01T13:50:00+03:00",
    "stops": [
      {
        "type": "origin",
        "actions": [
          {
            "type": "pick_up",
            "user": {
              "name": "John Doe",
              "phone": "447700123456"
            }
          }
        ],
        "location": {
          "lat": 51.4988787,
          "lng": -0.020746,
          "full_address": "London Bridge Station, London, UK",
          "address": {
            "street": "Railway Approach",
            "city": "London",
            "postcode": "SE1 9SP",
            "country": "United Kingdom"
          }
        }
      },
      {
        "type": "destination",
        "actions": [
          {
            "type": "drop_off",
            "user": {
              "name": "John Doe",
              "phone": "447700123456"
            }
          }
        ],
        "location": {
          "lat": 51.4712475,
          "lng": 0.0357987,
          "full_address": "Canary Wharf Station, London, UK",
          "address": {
            "street": "Heron Quays",
            "city": "London",
            "postcode": "E14 4JB",
            "country": "United Kingdom"
          }
        }
      }
    ],
    "payment": {
      "payment_type": "cash"
    },
    "preferences": {
      "num_of_passengers": 1,
      "num_of_suitcases": 1
    }
  }'

Example Response

{
  "ride_request_id": "67a4cc3a-d9e5-430c-862f-b134c22035c7",
  "status": "success",
  "order": {
    "id": "72576544"
  }
}

Order Flows

Immediate Booking

For immediate pickup, omit the scheduled_at parameter:

{
  "partner_id": "your-partner-id",
  "product_id": "economy",
  "user_accepted_terms_and_privacy": true,
  "category": "transportation",
  "stops": [...],
  "payment": {
    "payment_type": "cash"
  }
}

Scheduled Booking

For future pickup, include scheduled_at:

{
  "partner_id": "your-partner-id",
  "product_id": "economy",
  "user_accepted_terms_and_privacy": true,
  "category": "transportation",
  "scheduled_at": "2024-10-01T13:50:00+03:00",
  "stops": [...],
  "payment": {
    "payment_type": "cash"
  }
}

Multi-Stop Journey

For routes with intermediate stops:

{
  "stops": [
    {
      "type": "origin",
      "actions": [
        {
          "type": "pick_up",
          "user": {
            "name": "John Doe",
            "phone": "447700123456"
          }
        }
      ],
      "location": {...}
    },
    {
      "type": "on_going",
      "actions": [
        {
          "type": "stop_by",
          "user": {
            "name": "John Doe",
            "phone": "447700123456"
          }
        }
      ],
      "location": {...}
    },
    {
      "type": "destination",
      "actions": [
        {
          "type": "drop_off",
          "user": {
            "name": "John Doe",
            "phone": "447700123456"
          }
        }
      ],
      "location": {...}
    }
  ]
}

Canceling Orders

Endpoint

POST https://api.gett.com/v1/private/orders/cancel/{order_id}

Query Parameters

ParameterTypeRequiredDescription
partner_idstringYesYour partner ID

Example Request

curl --request POST 'https://api.gett.com/v1/private/orders/cancel/500475?partner_id=1f4c281e-b3eb-4676-beb7-b3a61caba0e6' \
  --header 'Authorization: Bearer {your_token}' \
  --header 'Content-Type: application/json'

Example Response

Success (204 No Content):

HTTP/1.1 204 No Content

The API returns a 204 No Content status code for successful cancellations with an empty response body.

Handling Cancellation Response

async function cancelOrder(orderId, partnerId) {
  try {
    const response = await fetch(
      `https://api.gett.com/v1/private/orders/cancel/${orderId}?partner_id=${partnerId}`,
      {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${token}`,
          'Content-Type': 'application/json'
        }
      }
    );

    if (response.status === 204) {
      console.log('Order cancelled successfully');
      return { success: true, cancelled: true };
    } else if (response.status === 404) {
      throw new Error('Order not found');
    } else if (response.status === 400) {
      throw new Error('Order cannot be cancelled (may already be in progress)');
    } else {
      throw new Error(`Cancellation failed with status: ${response.status}`);
    }

  } catch (error) {
    console.error('Order cancellation failed:', error.message);
    throw error;
  }
}

Getting Order Details

Endpoint

GET https://api.gett.com/v1/private/orders/{order_id}

Query Parameters

ParameterTypeRequiredDescription
partner_idstringYesYour partner ID

Example Request

curl --request GET 'https://api.gett.com/v1/private/orders/72576544?partner_id=1f4c281e-b3eb-4676-beb7-b3a61caba0e6' \
  --header 'Authorization: Bearer {your_token}' \
  --header 'Content-Type: application/json'

Example Response

{
  "order": {
    "order_id": "72576544",
    "status": "Confirmed",
    "type": "private",
    "source": "api",
    "product": {
      "uuid": "f765c6a7-7c14-48a0-b247-de0882880846",
      "category": "transportation",
      "name": "b2c bc taxi butler"
    },
    "payment": {
      "payment_type": "cash"
    },
    "pricing": {
      "quote_id": null
    },
    "note_to_driver": "",
    "scheduled_at": "2025-10-06T10:26:48+01:00",
    "created_at": "2025-10-06T10:26:48+01:00",
    "rides": {
      "full_ride": {
        "stops": [
          {
            "uuid": "5f0a5e5b-8736-4c9f-b27e-674b15c6275f",
            "type": "origin",
            "progress_status": "Confirmed",
            "location": {
              "lat": 51.50665859,
              "lng": -0.1442844643,
              "type": "street_address",
              "address": {
                "full_address": "Flemings Mayfair Hotel, 7-12 Half Moon St, London W1J 7BH, United Kingdom",
                "city": "London",
                "house": "1-5",
                "state": "England",
                "street": "Clarges Street",
                "country": "United Kingdom",
                "postcode": "W1J 8AB",
                "notes": null
              },
              "address_place": null,
              "is_airport": false
            },
            "actions": [
              {
                "type": "pick_up",
                "user": {
                  "name": "John D",
                  "phone": "447700123456"
                },
                "status": "pending_pickup"
              }
            ]
          },
          {
            "uuid": "74c140cf-0360-4146-b70f-b8f70adeed5f",
            "type": "destination",
            "progress_status": "Pending",
            "location": null,
            "actions": [
              {
                "type": "drop_off",
                "user": {
                  "name": "John D",
                  "phone": "447700123456"
                },
                "status": "pending_drop_off"
              }
            ]
          }
        ]
      }
    },
    "actual": {
      "supplier": {
        "fleet": {
          "name": "Gett UK",
          "phone": "442073974300",
          "pickup_instructions": null
        },
        "driver": {
          "driver_id": 1234567,
          "driver_name": "John Smith",
          "driver_phone": "+447700987654",
          "car_model": "TXE (6 Seater)",
          "car_color": "Black",
          "plate_number": "AB12CDE",
          "photo_url": "https://example.com/driver-photo.jpg",
          "rating": 5,
          "license": {
            "number": ""
          },
          "location": {
            "lat": 51.5079095284033,
            "lon": -0.1440413978223828,
            "bearing": 52.67864227294922
          }
        }
      },
      "will_arrive_at": "2025-10-06T10:30:12+01:00",
      "arrived_at": null,
      "started_at": null,
      "ended_at": null,
      "cancelled_at": null,
      "cancelled_by": null,
      "ride_start_pin_code": null
    },
    "flight": null,
    "preferences": null
  },
  "route_info": {
    "eta_to_destination_minutes": 2,
    "distance_to_destination": {
      "unit": "meter",
      "value": 549.9008388675134
    }
  },
  "droppedoff_at": null
}

Order Status Tracking

Orders go through various states throughout their lifecycle:

Order Status Values

StatusDescription
PendingOrder created, awaiting processing
ReservedFuture order scheduled, not yet dispatched (driver is not yet on the way)
UnreservedFuture order unreserved, released from schedule
RoutingLooking for driver
ConfirmedDriver is on the way to pickup
WaitingDriver is waiting at pickup location
DrivingOrder is progressing (passenger on board)
CompletedOrder is completed
CancelledOrder is cancelled
RejectedFailed to find a driver
CareReqSupport team is manually handling the order

Action Status Values

Each stop action also has its own status:

StatusDescription
pending_pickupWaiting for passenger pickup
pending_drop_offWaiting for passenger drop-off
completedAction completed successfully

Tracking Information

The response provides comprehensive tracking data:

  • Driver Information: Name, phone, vehicle details, current location
  • ETA Updates: Real-time arrival estimates
  • Progress Status: Current status of each stop
  • Route Information: Distance and time to destination
  • Timestamps: Created, scheduled, arrival, start, and end times

📘

Webhook Notifications

Contact Gett support for details on webhook notifications for real-time order status updates.

Best Practices

Validation Before Creation

  1. Verify Locations: Ensure coordinates are valid and reachable
  2. Check Phone Numbers: Validate phone numbers are in international format
  3. Confirm Terms Acceptance: Always ensure user_accepted_terms_and_privacy is true
  4. Product Availability: Use recent pricing data to select available products

Error Handling

async function createOrder(orderData) {
  try {
    const response = await fetch('/v1/private/orders/create', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(orderData)
    });

    if (!response.ok) {
      const error = await response.json();
      
      switch(response.status) {
        case 400:
          throw new Error(`Invalid request: ${error.message}`);
        case 402:
          throw new Error('Payment required or insufficient funds');
        case 404:
          throw new Error('Product not available');
        case 422:
          throw new Error('Validation failed: check your parameters');
        default:
          throw new Error('Order creation failed');
      }
    }

    return await response.json();
  } catch (error) {
    console.error('Order creation failed:', error);
    throw error;
  }
}

Cancellation Policy

  • Orders can typically be cancelled free of charge within a few minutes of creation
  • Cancellation fees may apply for last-minute cancellations
  • Some orders cannot be cancelled once a driver is assigned and en route

❗️

Cancellation Policies

Check with Gett for specific cancellation policies and fee structures for your integration.