Delivery Checkout provides almost unlimited flexibility in selecting delivery options while securing that the process is as convenient and as fast as it physically can. ⚡
$ openapi-generator generate \
-i https://api.ingrid.com/v1/siw/_/swagger.json \
-g php \
-o siw
PHP 7.4 and later. Should also work with PHP 8.0.
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
}
],
"require": {
"GIT_USER_ID/GIT_REPO_ID": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$apiInstance = new OpenAPI\Client\Api\DefaultApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$body = new \OpenAPI\Client\Model\CompleteSessionRequest(); // \OpenAPI\Client\Model\CompleteSessionRequest
try {
$result = $apiInstance->siwCompleteSession($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->siwCompleteSession: ', $e->getMessage(), PHP_EOL;
}
All URIs are relative to /v1/siw
Class | Method | HTTP request | Description |
---|---|---|---|
DefaultApi | siwCompleteSession | POST /session.complete | When the customer completes the purchase you also need to complete the session. At this point you will have to supply us with the address and the contact details of the user. |
DefaultApi | siwCreateSession | POST /session.create | To add the Ingrid widget to the checkout page you will need to create a new session. This can be done by this call. When doing this you will need to provide some required information. |
DefaultApi | siwCreateSessionFromOrder | POST /session.createFromOrder | Creates a session from an already existing order. |
DefaultApi | siwGetSession | GET /session.get | Fetches a session by ID. Can be used for loading a previously created session that have been stored together with a customer's shopping cart from a previous visit. |
DefaultApi | siwListSessionsSummaries | GET /sessions_summaries.list | Allows the user to get shipping data (session IDs and result fields) associated with tos ID. |
DefaultApi | siwUpdateSession | POST /session.update | Update the session with new information. Useful for cases where the customer or cart information is changed. The later being the most common case. |
- AdditionalInfo
- Address
- Any
- BillingItem
- CarrierAddon
- Cart
- CartItem
- CompleteSessionRequest
- CompleteSessionResponse
- Coordinates
- Cost
- CreateSessionFromOrderRequest
- CreateSessionFromOrderResponse
- CreateSessionRequest
- CreateSessionResponse
- CustomerInfo
- DateTimeRange
- Dimensions
- Distance
- DistanceSpec
- Error
- GetSessionResponse
- LegLocation
- ListSessionsSummariesResponse
- OperationalHours
- PickupLocation
- PickupLocationType
- PriceComponent
- PriceComponentType
- Result
- ResultCategory
- ResultDeliveryAddon
- ResultDeliveryTime
- ResultDeliveryTimeRange
- ResultPricing
- ResultSelection
- ResultShipping
- ResultWarehouse
- Route
- Section
- SectionColumnItem
- SectionItem
- SelectedShippingOption
- Session
- SessionSummary
- ShippingCost
- ShippingDate
- ShippingDateTag
- ShippingLeg
- SnippetConfiguration
- Supports
- Tag
- TimeSlot
- UpdateSessionRequest
- UpdateSessionResponse
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
To run the tests, use:
composer install
vendor/bin/phpunit
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen