# Pre Auth or Post Pay **POST /gas-stations/{gasStationId}/transactions** This call supports two different flows. The *Pre Auth* flow and the *Post Pay* flow. This call will notify the user via email with a payment receipt if transaction is finished successfully. Only use after approaching, otherwise returns `403 Forbidden`. ### Pre Auth This flow is used if a pump is having the status `locked`. A `locked` pump requires a *Pre Auth* to unlock. Only after this *Pre Auth* the pump and can be used by the user * `carFuelType` may be passed to only unlock a certain nozzle of the pump. Not all pumps support this feature, and some require it. It is advised to always pass the desired fuel type. ### Post Pay You can optionally provide: * `priceIncludingVAT` and `currency` in the request body to check if the price the user has seen is still correct. If the values don't match, the status `409 Conflict` is returned. * `carFuelType` may be provided but has no effect. * The token will still be available for use in case the payment fails. It may need to be deleted by the caller ### Unattended Payment As an additional feature, the caller can - in case of Post Pay - opt for unattended payment. In summary, this means that when given a token with a certain authorized amount, the service will watch over the status of the fueling process and finish the transaction in the background, with no further user interaction required. This will only work if the amount fueled does not exceed the amount authorized in the token. Otherwise, an error response will be sent to the callback URL * `unattendedPayment` in the request body designates whether this should be done or not. Note that this is only possible if a valid token has been provided * `callbackURL` is an optional URL that will be called with what would usually be the response to the final `ProcessPayment` call after the process has finished * The token will still be available for use in case the payment fails. It may need to be deleted by the caller * This process is only available if the pump is in status `free`. Otherwise, `422` is returned. * The backend will wait for a grace period of 20 seconds after this call was sent before starting the process ## Servers - Production server (stable release 2022-1): https://api.pace.cloud/fueling/2022-1 (Production server (stable release 2022-1)) ## Authentication methods - OAuth2 - Oidc ## Parameters #### Path parameters - **gasStationId** (string(uuid)) Gas station ID ## Body parameters Content-type: application/vnd.api+json - **data** (object) ## Responses ### 201: Post Pay: Payment successful, or unattended payment enqueued #### Body Parameters: application/vnd.api+json (object) - **data** (object) ### 202: Pre Auth: Pump unlocked #### Headers - **Location** (string(url)) Location of the future payment transaction details ### 400: Bad request #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 401: OAuth token missing or invalid or a linked identity is missing. Linked identity missing is a special case where you need to make sure that the user has additionally logged in / authorized with a third-party. This is not relevant for most use-cases. The specific error code that identifies a missing linked identity is `missing-linked-identity` Example: ``` { "errors": [ { "id": "cbgmhslmp1o9or9kh1p0", "title": "Missing linked identity for authorized access", "detail": "Linked identity is needed to access this resource, please check why the user does not have a linked identity", "status": "401", "code": "missing-linked-identity" } ] } ``` #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 403: Forbidden #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 404: Resource not found #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 406: The specified accept header is invalid #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 409: The provided priceIncludingVAT does not match the actual price #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 415: The specified content type header is invalid #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 422: The request was well-formed but was unable to be followed due to semantic errors. #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 500: Internal server error #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) ### 502: Error occurred while communicating with PACE services #### Body Parameters: application/vnd.api+json (object) - **errors** (array[object]) [Powered by Bump.sh](https://bump.sh)