AutoFleet: Create an additional charge
Opened this issue · 1 comments
joseuride commented
I'm working on the API https://docs.autofleet.io/reference/post-api-v1-price-calculation-pricingcalculationid-additional-charges-1. I found that this API doesn't seem to be working correctly.
- I fetch this API to create a 'custom' fee with an amount of $1, and it worked.
- I called this API a second time with the same pricingcalculationid but a different amount ($5). The response was successful, but the amount was not updated—it remained $1.
=> Is there any way for me to create multiple 'custom' additional charges for one pricingcalculationid? Currently, it seems that you only support creating one 'custom' fee and don't allow updating the amount either.
curl --request POST \
--url https://api.staging.eu.autofleet.io/api/v1/price-calculation/fa9030c1-96d5-4bb0-a80b-bd1edbcb3281/additional-charges \
--header 'accept: application/json' \
--header 'authorization: Bearer {{accessToken}}' \
--header 'content-type: application/json' \
--data '
{
"chargeFor": "custom",
"amount": 5
}
'
OmerGery commented
Hey, @joseuride
No, because the price calculation is re generated each time
Not meant to be updated this way. If we want to update the ride price so we create a new price calculation with the new data, then patch the priceCalculationId on the ride