Create Leasing Offer
Learn how the endpoint for creating a leasing offer works.
Create Leasing Offer
The Create Leasing Offer endpoint lets you generate leasing offers by submitting relevant customer and bike information. Use this endpoint to streamline leasing applications with a specified provider.
Endpoint
POST /v1/offers/{leasingproviderslug}
Parameters
leasingproviderslug
(string, required, path) The unique slug for the leasing provider. This represents the provider's name, typically formatted as lowercase with no spaces or symbols.x-api-key
(string, required, header) Your API key to authenticate requests. For more information on API keys, see Authentication.dryRun
(boolean, optional, query) Iftrue
, validates the request without creating an offer. This helps confirm required data without committing the transaction.
Request Body
The request body contains multiple sections for customer details, order details, bike specifications, and delivery information.
Customer (object, required)
userIdentifier
(string, required) Unique identifier of the user, such as an email.userFirstName
(string, optional) First name of the user.userLastName
(string, optional) Last name of the user.userCreate
(boolean, optional, default:false
) Whentrue
, creates a new user in the provider's system if they don't already exist.isSelfEmployed
(boolean, optional, default:false
) Indicates if the user is self-employed, which may affect eligibility criteria for some providers.
Order Details (object, required)
orderId
(string)frameNumber
(string)frameSize
(string, required)color
(string, required)year
(integer, required)purchasePrice
(number, required) The bike's purchase price.
Additional properties include deliveryCosts, assemblyCosts, accessories, and more to specify the leasing order.
Bike Specifications (object, required)
brand
(string, required) Select the bike brand from a predefined list (e.g., "trek", "canyon").model
(string)bikeType
(string, required) Type of bike, e.g.,pedelec
.category
(string, required) Categorizes the bike, e.g.,fully
,trekking-bike
.
Delivery Details (object, optional)
Details about the delivery date, mode, and address. Customize options for specific drop-off points, dates, and recipient names.
Enum Values
When using the Create Leasing Offer endpoint, keep in mind that some fields, such as accessoryType
, brand
, category
, and driveManufacturer
, require specific values from predefined enums. You can find the detailed lists of accepted values for these fields in the schemas section of the documentation.
For real-time integration, use the following endpoints to retrieve all possible enum values, which is particularly useful for ERP system integration and form population:
- Accessory Types:
GET /v1/config/accessory-types
- Bike Brands:
GET /v1/config/bike-brands
- Bike Categories:
GET /v1/config/bike-categories
- Drive Manufacturers:
GET /v1/config/drive-manufacturers
- Leasing Providers:
GET /v1/config/leasing-providers
By fetching these values dynamically, you can ensure that your fields remain up-to-date and compatible with Leasing Automation's requirements.
Response
Success Response (Status 201
)
Returns a JSON object with the leasing provider's internal offer ID of the created offer.
Note: To use the Leasing Offer Status API, you'll need the leasing provider's internal offer ID (
leasingProviderOfferId
). This ID is essential for querying the provider's system to retrieve the offer status. Make sure to store this ID after creating an offer, as it will be required for tracking and status updates. You can also get this ID from the leasing providers portals for offers that you already processed, but that might require additional work on your side.
Example Response
{ "offerID": "offer_12345" }
Error Responses
400 Bad Request
– Missing fields or validation errors.
{ "error": "Missing required fields *fieldName* in request body" }
401 Unauthorized
– API key missing.
{ "error": "API key missing" }
403 Forbidden
– Invalid API key.
{ "error": "Invalid API key" }
500 Internal Server Error
– Unexpected server error.
{ "error": "Internal server error" }
Example Request
Here's a sample curl
request to create an offer:
curl --location --request POST 'https://dev-api.leasingautomation.de/v1/offers/jobrad' \ --header 'x-api-key: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --data-raw '{ "customer": { "userIdentifier": "mustermitarbeiterin@gmx.net", "userCreate": true, "isSelfEmployed": false }, "orderDetails": { "orderId": "XYZ7890", "frameSize": "M", "color": "Matte Black", "year": 2024, "purchasePrice": 2000 }, "bikeSpecifications": { "brand": "trek", "model": "Powerfly FS 7", "bikeType": "pedelec", "category": "fully", "recommendedPurchasePrice": 2200 }, "deliveryDetails": { "deliveryDate": "2025-01-01T00:00:00+02:00", "deliveryTo": { "firstName": "Max", "lastName": "Muster", "email": "mustermitarbeiterin@gmx.net" } } }'
Interactive API Console
You can also explore and test each endpoint in our OpenAPI/Swagger interactive API console, which provides a hands-on way to examine request/response details in real time.