Endpoint

Create carwash payment intent

The Create Carwash Payment Intent endpoints allow the creation of a carwash payment intent within the Neatcar platform. This payment intent is used to complete the payment on our Web App and redirect the user to your platform with the necessary information to show the carwash that was bought from this user.

POST

/user/carwawsh-payment-intent

Body

The request body now requires a single carwash type identifier in 'id' and its origin in 'source'. The values for 'id' and 'source' must be copied directly from the JSON returned by GET store.

From the GET store response example, this corresponds to 'source: "network"' with 'id: 3' or 'source: "store"' with 'id: 18'. The previous 'networkCarwashTypeId' and 'storeCarwashTypeId' fields are no longer required in this request body.

Carwash Payment Intent Model data

The following list provides a selection of key values included in the model; however, it is non-exhaustive. Developers can expect to find additional fields and data within the model, offering comprehensive information about each payment intent. This abbreviated list serves as a starting point for understanding the structure of the model and the types of information available for each payment intent.

uuid
Unique identifier for the payment intent

The uuid returned from this endpoint will be used to redirect the user to our Web App. When the user complete or cancel the payment, they will be redirected to the redirectUrl specified in the payment intent creation request.

The redirectUrl that will be called from our Web App will inject the uuid into the URL to identify the payment intent in a query parameter named carwashPaymentIntentUUID. The carwashPaymentIntentUUID will be injected with this logic:

  • If the redirectUrl contains a '?', the carwashPaymentIntentUUID will be injected into the URL with a '&' before. i.e yourapp://carwash/paymentDone?internalReferenceId=123 will become yourapp://carwash/paymentDone?internalReferenceId=123&carwashPaymentIntentUUID=5b57354f-acc1-4b2b-9120-1c41c51cbeca
  • If the redirectUrl does not contain a '?', the carwashPaymentIntentUUID will be injected into the URL with a '?' before. i.e yourapp://carwash/paymentDone will become yourapp://carwash/paymentDone?carwashPaymentIntentUUID=5b57354f-acc1-4b2b-9120-1c41c51cbeca

The carwash payment intent is short lived and will be invalid after 15 minutes.

Response example

Below is an example of the API endpoint response, showcasing the structure and format of the data returned by the specified endpoint. This example serves as a practical illustration, demonstrating how developers can expect the information to be organized and presented when interacting with the API. It provides insight into the content and layout of the response, facilitating effective integration and utilization of the endpoint within your applications.

Possible errors

The following list provides a selection of possible errors that can occur when creating a carwash payment intent. However, it is non-exhaustive. Developers can expect to find additional errors and data within the model, offering comprehensive information about each error.

HTTP 400

Bad Request due to missing parameters

When the API token is valid and present, this error is returned when the request contains missing parameters to be processed. This error can be returned when neither networkCarwashTypeId nor storeCarwashTypeId have value.

Error body response example:

  
HTTP 400

Bad Request due to invalid id

The userUUID, storeId, storeCarwashTypeId or networkCarwashTypeId passed are invalid or do not exist.

Error body response example:

  
HTTP 401

Unauthorized

The API token is invalid, missing or the client IP is not part of the allowed IP list.

Error body response example:

  
HTTP 500

Internal Server Error

An unexpected error occurred while processing the request. Please try again later or contact support if the problem persists.

Error body response example: