Closed otaviolbarbosa closed 1 month ago
looking at the screen shot i see you sent a lat/lng near Israel
in order for the offer to be created and accepted, you need to have an active driver in environment and the given radius.
Hi @AlonAF800, thanks for your answer. Even with lat/lng covered it's not working.
curl --location 'https://api.autofleet.io/api/v1/offers' \
--header 'Content-Type: application/json' \
--header 'Authorization: ••••••' \
--data '{
"rideType": "passenger",
"pooling": "active",
"stopPoints": [
{
"type": "pickup",
"verificationMethods": [
{
"type": "photo"
}
],
"lat": 48.4026688,
"lng": -89.2611372
},
{
"type": "dropoff",
"lat": 48.4180285,
"lng": -89.2629133
}
],
"demandSourceId": "not-displayed",
"numberOfPassengers": 1,
"businessModelId": "not-displayed"
}'
This is the answer
{
"id": "3b09f99c-128f-48be-9952-9ecda1a089be",
"state": "offer-rejected",
"rideType": "passenger",
"externalId": null,
"demandSourceId": "not-displayed",
"stopPoints": [
{
"id": "38e85208-3654-41cf-8386-8ca2098f820f",
"state": "pending",
"beforeTime": null,
"afterTime": null,
"lat": "48.4026688",
"lng": "-89.2611372",
"description": null,
"externalId": null,
"contactPersonName": null,
"contactPersonAvatar": null,
"orderInParent": 0,
"etaAtMatching": null,
"type": "pickup",
"notes": null,
"webhookUrl": null,
"packageId": null,
"packageDescription": null,
"numberOfItems": null,
"verificationMethods": [
{
"type": "photo"
}
],
"contactPersonPhone": null,
"maskedContactPersonPhoneNumber": null,
"maskedDriverPhoneNumber": null,
"stopDurationSec": 0,
"additionalStopDurationSec": 0,
"cargoWeight": null,
"cargoVolume": null,
"customCargoUnits": {},
"createdAt": "2024-07-10T14:47:44.190Z",
"preferences": {}
},
{
"id": "61722504-00ab-482f-bbd3-8f283e753120",
"state": "pending",
"beforeTime": null,
"afterTime": null,
"lat": "48.4180285",
"lng": "-89.2629133",
"description": null,
"externalId": null,
"contactPersonName": null,
"contactPersonAvatar": null,
"orderInParent": 1,
"etaAtMatching": null,
"type": "dropoff",
"notes": null,
"webhookUrl": null,
"packageId": null,
"packageDescription": null,
"numberOfItems": null,
"verificationMethods": null,
"contactPersonPhone": null,
"maskedContactPersonPhoneNumber": null,
"maskedDriverPhoneNumber": null,
"stopDurationSec": 0,
"additionalStopDurationSec": 0,
"cargoWeight": null,
"cargoVolume": null,
"customCargoUnits": {},
"createdAt": "2024-07-10T14:47:44.190Z",
"preferences": {}
}
],
"vehicleId": null,
"driverId": null,
"fleetId": null,
"businessModelId": "not-shown",
"rating": null,
"priceCurrency": "CAD",
"priceAmount": 15.14,
"plannedDistance": 4000,
"webhookUrl": null,
"pooling": "active",
"numberOfPassengers": 1,
"createdAt": "2024-07-10T14:47:44.181Z",
"scheduledTo": null,
"predecessorId": null,
"constraints": {
"vehicleList": {
"include": [],
"exclude": [],
"required": []
},
"vendorList": {
"include": [],
"exclude": [],
"required": []
},
"vehicleClassList": {
"include": [],
"exclude": [],
"required": []
},
"vehicleLabels": {
"include": [],
"exclude": [],
"required": []
},
"driverList": {
"include": [],
"exclude": [],
"required": []
}
},
"successorId": null,
"offer": null,
"rejectionReason": null,
"lastMatchAttempt": null,
"lastMatchingCycleFirstAttempt": null,
"audits": [],
"cancelable": false,
"unassignableByDriver": false,
"labels": [],
"matchingType": "automatic",
"dispatchType": "automatic",
"disableMatchingRetry": false,
"priceCalculationId": "b52cd189-4f2f-4666-ae81-45ca4ad3da77",
"payment": null,
"serviceId": null,
"estimationId": null,
"clientId": null,
"matchingRetryDurationSec": null,
"cancellationReasonId": null,
"rideTemplateId": null,
"dispatchedAt": null,
"vendorId": null,
"origin": null,
"customFields": {},
"showInOpportunities": true,
"planningJobId": null,
"businessAccountId": null
}
Hey @otaviolbarbosa Please make a new request, and provide with the x-trace-id you got from the response headers This way i can debug the issue much faster
@OmerGery We still can't get data from this endpoint. This is the x-trace-id: kCMSyVv_fD
i will look into it @otaviolbarbosa thanks
@otaviolbarbosa
errors: [
0: "Demand Source <> not found or associated to the selected business model"
]
the reason is a mismatch between the demand source id and the business model id on the api body payload. the demand source id you used is of your production app the business model id you used is of your testing app It needs to be either both testing or both prod.
Hi,
I'm trying to create a ride offer using api, but I'm always getting state as "offer-rejected" as you can see on image. Any ideas on how to fix it?