All URIs are relative to http://localhost/v1/delivery_checkout.
Method | HTTP request | Description |
---|---|---|
deliveryCheckoutCompleteSession() | 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. |
deliveryCheckoutCreateSession() | 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. |
deliveryCheckoutGetSession() | 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. It can contain obsolete data. To get the session with the freshest data, use /session.pull endpoint. |
deliveryCheckoutListSessionsSummaries() | GET /sessions_summaries.list | Allows the merchant to get shipping data (session IDs and result fields) associated with tos ID. |
deliveryCheckoutPullSession() | GET /session.pull | Pulls 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. Session will be refreshed if its in active state and if configuration has changed or delivery promise expires. |
deliveryCheckoutUpdateSession() | 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. |
deliveryCheckoutCompleteSession($body): \OpenAPI\Client\Model\CompleteSessionResponse
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.
This request will also result in completing order in TOS.
<?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->deliveryCheckoutCompleteSession($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutCompleteSession: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
body | \OpenAPI\Client\Model\CompleteSessionRequest |
\OpenAPI\Client\Model\CompleteSessionResponse
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deliveryCheckoutCreateSession($body): \OpenAPI\Client\Model\CreateSessionResponse
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.
The API will return a representation of the newly created session. The response will contain a session id which you can use to update and retrieve the session data. The response will also contain a snippet of HTML with all the necessary code for bootstrapping the Ingrid widget. Simple render the HTML snippet on your checkout page.
<?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\CreateSessionRequest(); // \OpenAPI\Client\Model\CreateSessionRequest
try {
$result = $apiInstance->deliveryCheckoutCreateSession($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutCreateSession: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
body | \OpenAPI\Client\Model\CreateSessionRequest |
\OpenAPI\Client\Model\CreateSessionResponse
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deliveryCheckoutGetSession($checkout_session_id): \OpenAPI\Client\Model\GetSessionResponse
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. It can contain obsolete data. To get the session with the freshest data, use /session.pull endpoint.
<?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
);
$checkout_session_id = 'checkout_session_id_example'; // string | Checkout session id.
try {
$result = $apiInstance->deliveryCheckoutGetSession($checkout_session_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutGetSession: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
checkout_session_id | string | Checkout session id. | [optional] |
\OpenAPI\Client\Model\GetSessionResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deliveryCheckoutListSessionsSummaries($tos_id): \OpenAPI\Client\Model\ListSessionsSummariesResponse
Allows the merchant to get shipping data (session IDs and result fields) associated with tos ID.
<?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
);
$tos_id = 'tos_id_example'; // string
try {
$result = $apiInstance->deliveryCheckoutListSessionsSummaries($tos_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutListSessionsSummaries: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
tos_id | string | [optional] |
\OpenAPI\Client\Model\ListSessionsSummariesResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deliveryCheckoutPullSession($checkout_session_id): \OpenAPI\Client\Model\GetSessionResponse
Pulls 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. Session will be refreshed if its in active state and if configuration has changed or delivery promise expires.
<?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
);
$checkout_session_id = 'checkout_session_id_example'; // string | Checkout session id.
try {
$result = $apiInstance->deliveryCheckoutPullSession($checkout_session_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutPullSession: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
checkout_session_id | string | Checkout session id. | [optional] |
\OpenAPI\Client\Model\GetSessionResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deliveryCheckoutUpdateSession($body): \OpenAPI\Client\Model\UpdateSessionResponse
Update the session with new information. Useful for cases where the customer or cart information is changed. The later being the most common case.
<?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\UpdateSessionRequest(); // \OpenAPI\Client\Model\UpdateSessionRequest
try {
$result = $apiInstance->deliveryCheckoutUpdateSession($body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DefaultApi->deliveryCheckoutUpdateSession: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
body | \OpenAPI\Client\Model\UpdateSessionRequest |
\OpenAPI\Client\Model\UpdateSessionResponse
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]