Skip to content

Nift-London/evermile-sdk

Repository files navigation

OpenAPIClient-php

This is Evermile's commercial API for handling delivery quotes and orders

For more information, please visit https://www.evermile.io.

Installation & Usage

Generating new version

openapi-generator generate -i oapi.yaml -g php -o ./

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

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

Manual Installation

Download the files and include autoload.php:

<?php
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');



// Configure OAuth2 access token for authorization: Prod
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Configure OAuth2 access token for authorization: Sandbox
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\GDPRApi(
    // 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
);
$type = 'type_example'; // string
$gdpr_customer_post_request = new \OpenAPI\Client\Model\GdprCustomerPostRequest(); // \OpenAPI\Client\Model\GdprCustomerPostRequest
$x_evermile_merchant_id = 'x_evermile_merchant_id_example'; // string | The merchant ID, if using a client credentials token. Will be ignored with a regular user token.
$x_evermile_trace_id = 'x_evermile_trace_id_example'; // string | A trace ID for tracing the request through the Evermile platform

try {
    $apiInstance->gdprCustomerPost($type, $gdpr_customer_post_request, $x_evermile_merchant_id, $x_evermile_trace_id);
} catch (Exception $e) {
    echo 'Exception when calling GDPRApi->gdprCustomerPost: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api.prod.evermile.io/v1/commercial

Class Method HTTP request Description
GDPRApi gdprCustomerPost POST /gdpr/customer Customer data request
GDPRApi gdprMerchantPost POST /gdpr/merchant Merchant data request
LocationsApi senderInfoPut PUT /sender_info Create or update a delivery location.
LocationsApi senderInfoSenderInfoIdDelete DELETE /sender_info/{senderInfoId} Delete a delivery location.
LocationsApi senderInfosGet GET /sender_infos Get sender and location infos
OrdersApi orderMultiRoutePost POST /order/multiRoute Order a route with multiple orders
OrdersApi orderOrderIdDelete DELETE /order/{orderId} Cancel an order
OrdersApi orderOrderIdGet GET /order/{orderId} Fetch order details
OrdersApi orderOrderIdLabelGet GET /order/{orderId}/label Create a label for an order
OrdersApi orderOrderIdLiveTrackingGet GET /order/{orderId}/liveTracking Fetch live order tracking
OrdersApi orderOrderIdPatch PATCH /order/{orderId} Update order details
OrdersApi orderPost POST /order Order a delivery
OrdersApi ordersGet GET /orders Get orders
OrdersApi ordersPaginatedHistoryGet GET /orders/paginatedHistory Get orders history with pagination
PickupLocationsApi locationPut PUT /location Create or update a delivery location
PickupLocationsApi locationsGet GET /locations Get pickup locations
PickupLocationsApi locationsLocationIdDelete DELETE /locations/{locationId} Delete a pickup location
QuotesApi proposalProposalIdGet GET /proposal/{proposalId} Retrieve a proposal
QuotesApi quoteMultiRoutePost POST /quote/multiRoute Get a quote for a route
QuotesApi quotePost POST /quote Get a quote
SchemaApi schemaGet GET /schema API schema
ValidationsApi addressValidateGet GET /address/validate Validate address
ValidationsApi emailValidateGet GET /email/validate Validate email
ValidationsApi phoneValidateGet GET /phone/validate Validate phone number

Models

Authorization

Authentication schemes defined for the API:

Sandbox

  • Type: OAuth
  • Flow: application
  • Authorization URL: ``
  • Scopes:
    • order: Order deliveries
    • read: Get quotes and read information about deliveries

Prod

  • Type: OAuth
  • Flow: application
  • Authorization URL: ``
  • Scopes:
    • order: Order deliveries
    • read: Get quotes and read information about deliveries

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

support@evermile.io

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
    • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published