Initiating a Transaction and Creating an Order
Before an order can be created, a transaction must first be initiated. This ensures that the total amount is calculated, and the client receives a payment link to complete the payment. Once the payment is successfully confirmed via a webhook from the payment gateway, the order is created.
Ordering Equipment Per Country
Orders must be placed on a per-country basis, meaning equipment can only be ordered for employees within the same country in a single request.
Step-by-Step Process
-
Retrieve Available Equipment for a Country
Call the Get Assets endpoint to get a list of available equipment in a specific country, and your currency of payment:
GET /api/v2/clients/assets?country={{country_id}}¤cy=USD
This response provides a list of assets available in the specified country.
-
Obtain Asset Pricing
Each asset will have associated pricing information found in asset->asset_pricing->id. This pricing ID is required when creating an order.
-
Initiate a Transaction
Use the retrieved asset pricing IDs to initiate a transaction by calling the Initiate Transaction endpoint:
POST /api/v2/clients/transactions/initiate
The following details must be included in the request:
- payment_method – Specifies the payment type (e.g., Card, Credit).
- employee_country_id – The country for which the order is being placed.
- redirect_url - The URL to which the client will be redirected after payment.
- orders – A list of employees within the selected country and the equipment they are ordering, specified by by the asset_pricing_id.
The system calculates the total cost and provides a payment link.
-
Complete Payment
The client must complete the payment using the provided payment link.
-
Payment Confirmation & Order Creation
Once the payment is processed successfully, the payment gateway sends a webhook to our system. If validated as successful, the order is created, and the equipment is assigned to the respective employees.
Orders can only be placed for employees within a single country at a time.
Key Considerations
- Orders are country-specific and cannot be combined across multiple countries.
- The correct asset pricing ID must be used for accurate billing.
- Orders are only finalized after successful payment confirmation.