Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Alanaktion/magento2-swagger-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwaggerClient-php

Magento 2 REST API (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 2.3
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Generating/using this wrapper

You can generate this wrapper yourself with the included generate.sh file. If you want to use this one as-is, it's available via composer:

composer require alanaktion/magento2-swagger-api

Limitations

Due to how Magento 2 handles its URL parameters, this wrapper is not likely useful for anything beyond a reference implementation of some of the endpoints. Things like the search API use complex dynamic parameters that cannot be auto-generated correctly, making them unusable in this wrapper. I don't plan on manually modifying this wrapper in any way to improve compatibility or add features, but you are welcome to fork the repo if you want to try it yourself.

Due to these limitations, I'm most likely not going to update this at any point, and the repository will be archived unless that changes.

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "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:

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

$apiInstance = new MagentoApi\Api\AmazonPaymentAddressManagementV1Api(
    // 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()
);
$amazon_order_reference_id = "amazon_order_reference_id_example"; // string |
$body = new \stdClass; // object |

try {
    $result = $apiInstance->amazonPaymentAddressManagementV1GetBillingAddressPut($amazon_order_reference_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AmazonPaymentAddressManagementV1Api->amazonPaymentAddressManagementV1GetBillingAddressPut: ', $e->getMessage(), PHP_EOL;
}

$apiInstance = new MagentoApi\Api\AmazonPaymentAddressManagementV1Api(
    // 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()
);
$amazon_order_reference_id = "amazon_order_reference_id_example"; // string |
$body = new \stdClass; // object |

try {
    $result = $apiInstance->amazonPaymentAddressManagementV1GetShippingAddressPut($amazon_order_reference_id, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AmazonPaymentAddressManagementV1Api->amazonPaymentAddressManagementV1GetShippingAddressPut: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to /rest/default

Class Method HTTP request Description
AmazonPaymentAddressManagementV1Api amazonPaymentAddressManagementV1GetBillingAddressPut PUT /V1/amazon-billing-address/{amazonOrderReferenceId}
AmazonPaymentAddressManagementV1Api amazonPaymentAddressManagementV1GetShippingAddressPut PUT /V1/amazon-shipping-address/{amazonOrderReferenceId}
AmazonPaymentOrderInformationManagementV1Api amazonPaymentOrderInformationManagementV1RemoveOrderReferenceDelete DELETE /V1/amazon/order-ref
CatalogProductRenderListV1Api catalogProductRenderListV1GetListGet GET /V1/products-render-info
CheckoutGuestPaymentInformationManagementV1Api checkoutGuestPaymentInformationManagementV1GetPaymentInformationGet GET /V1/guest-carts/{cartId}/payment-information
CheckoutGuestPaymentInformationManagementV1Api checkoutGuestPaymentInformationManagementV1SavePaymentInformationAndPlaceOrderPost POST /V1/guest-carts/{cartId}/payment-information
CheckoutGuestPaymentInformationManagementV1Api checkoutGuestPaymentInformationManagementV1SavePaymentInformationPost POST /V1/guest-carts/{cartId}/set-payment-information
CheckoutGuestShippingInformationManagementV1Api checkoutGuestShippingInformationManagementV1SaveAddressInformationPost POST /V1/guest-carts/{cartId}/shipping-information
CheckoutGuestTotalsInformationManagementV1Api checkoutGuestTotalsInformationManagementV1CalculatePost POST /V1/guest-carts/{cartId}/totals-information
CustomerAccountManagementV1Api customerAccountManagementV1CreateAccountPost POST /V1/customers
CustomerAccountManagementV1Api customerAccountManagementV1InitiatePasswordResetPut PUT /V1/customers/password
CustomerAccountManagementV1Api customerAccountManagementV1IsEmailAvailablePost POST /V1/customers/isEmailAvailable
CustomerAccountManagementV1Api customerAccountManagementV1ResetPasswordPost POST /V1/customers/resetPassword
CustomerAccountManagementV1Api customerAccountManagementV1ValidateResetPasswordLinkTokenGet GET /V1/customers/{customerId}/password/resetLinkToken/{resetPasswordLinkToken}
DirectoryCountryInformationAcquirerV1Api directoryCountryInformationAcquirerV1GetCountriesInfoGet GET /V1/directory/countries
DirectoryCountryInformationAcquirerV1Api directoryCountryInformationAcquirerV1GetCountryInfoGet GET /V1/directory/countries/{countryId}
DirectoryCurrencyInformationAcquirerV1Api directoryCurrencyInformationAcquirerV1GetCurrencyInfoGet GET /V1/directory/currency
GiftMessageGuestCartRepositoryV1Api giftMessageGuestCartRepositoryV1GetGet GET /V1/guest-carts/{cartId}/gift-message
GiftMessageGuestCartRepositoryV1Api giftMessageGuestCartRepositoryV1SavePost POST /V1/guest-carts/{cartId}/gift-message
GiftMessageGuestItemRepositoryV1Api giftMessageGuestItemRepositoryV1GetGet GET /V1/guest-carts/{cartId}/gift-message/{itemId}
GiftMessageGuestItemRepositoryV1Api giftMessageGuestItemRepositoryV1SavePost POST /V1/guest-carts/{cartId}/gift-message/{itemId}
IntegrationAdminTokenServiceV1Api integrationAdminTokenServiceV1CreateAdminAccessTokenPost POST /V1/integration/admin/token
IntegrationCustomerTokenServiceV1Api integrationCustomerTokenServiceV1CreateCustomerAccessTokenPost POST /V1/integration/customer/token
QuoteGuestBillingAddressManagementV1Api quoteGuestBillingAddressManagementV1AssignPost POST /V1/guest-carts/{cartId}/billing-address
QuoteGuestBillingAddressManagementV1Api quoteGuestBillingAddressManagementV1GetGet GET /V1/guest-carts/{cartId}/billing-address
QuoteGuestCartItemRepositoryV1Api quoteGuestCartItemRepositoryV1DeleteByIdDelete DELETE /V1/guest-carts/{cartId}/items/{itemId}
QuoteGuestCartItemRepositoryV1Api quoteGuestCartItemRepositoryV1GetListGet GET /V1/guest-carts/{cartId}/items
QuoteGuestCartItemRepositoryV1Api quoteGuestCartItemRepositoryV1SavePost POST /V1/guest-carts/{cartId}/items
QuoteGuestCartItemRepositoryV1Api quoteGuestCartItemRepositoryV1SavePut PUT /V1/guest-carts/{cartId}/items/{itemId}
QuoteGuestCartManagementV1Api quoteGuestCartManagementV1CreateEmptyCartPost POST /V1/guest-carts
QuoteGuestCartManagementV1Api quoteGuestCartManagementV1PlaceOrderPut PUT /V1/guest-carts/{cartId}/order
QuoteGuestCartRepositoryV1Api quoteGuestCartRepositoryV1GetGet GET /V1/guest-carts/{cartId}
QuoteGuestCartTotalManagementV1Api quoteGuestCartTotalManagementV1CollectTotalsPut PUT /V1/guest-carts/{cartId}/collect-totals
QuoteGuestCartTotalRepositoryV1Api quoteGuestCartTotalRepositoryV1GetGet GET /V1/guest-carts/{cartId}/totals
QuoteGuestCouponManagementV1Api quoteGuestCouponManagementV1GetGet GET /V1/guest-carts/{cartId}/coupons
QuoteGuestCouponManagementV1Api quoteGuestCouponManagementV1RemoveDelete DELETE /V1/guest-carts/{cartId}/coupons
QuoteGuestCouponManagementV1Api quoteGuestCouponManagementV1SetPut PUT /V1/guest-carts/{cartId}/coupons/{couponCode}
QuoteGuestPaymentMethodManagementV1Api quoteGuestPaymentMethodManagementV1GetGet GET /V1/guest-carts/{cartId}/selected-payment-method
QuoteGuestPaymentMethodManagementV1Api quoteGuestPaymentMethodManagementV1GetListGet GET /V1/guest-carts/{cartId}/payment-methods
QuoteGuestPaymentMethodManagementV1Api quoteGuestPaymentMethodManagementV1SetPut PUT /V1/guest-carts/{cartId}/selected-payment-method
QuoteGuestShipmentEstimationV1Api quoteGuestShipmentEstimationV1EstimateByExtendedAddressPost POST /V1/guest-carts/{cartId}/estimate-shipping-methods
QuoteGuestShippingMethodManagementV1Api quoteGuestShippingMethodManagementV1GetListGet GET /V1/guest-carts/{cartId}/shipping-methods
SearchV1Api searchV1SearchGet GET /V1/search
TemandoShippingCheckoutGuestCartCollectionPointManagementV1Api temandoShippingCheckoutGuestCartCollectionPointManagementV1DeleteSearchRequestDelete DELETE /V1/guest-carts/{cartId}/collection-point/search-request
TemandoShippingCheckoutGuestCartCollectionPointManagementV1Api temandoShippingCheckoutGuestCartCollectionPointManagementV1GetCollectionPointsGet GET /V1/guest-carts/{cartId}/collection-point/search-result
TemandoShippingCheckoutGuestCartCollectionPointManagementV1Api temandoShippingCheckoutGuestCartCollectionPointManagementV1SaveSearchRequestPut PUT /V1/guest-carts/{cartId}/collection-point/search-request
TemandoShippingCheckoutGuestCartCollectionPointManagementV1Api temandoShippingCheckoutGuestCartCollectionPointManagementV1SelectCollectionPointPost POST /V1/guest-carts/{cartId}/checkout-collection-point/select
TemandoShippingCheckoutGuestCartPickupLocationManagementV1Api temandoShippingCheckoutGuestCartPickupLocationManagementV1SelectPickupLocationPost POST /V1/guest-carts/{cartId}/checkout-pickup-location/select
TemandoShippingDeliveryGuestCartCollectionPointManagementV1Api temandoShippingDeliveryGuestCartCollectionPointManagementV1SelectCollectionPointPost POST /V1/guest-carts/{cartId}/collection-point/select
TemandoShippingDeliveryGuestCartPickupLocationManagementV1Api temandoShippingDeliveryGuestCartPickupLocationManagementV1SelectPickupLocationPost POST /V1/guest-carts/{cartId}/pickup-location/select
TemandoShippingQuoteGuestCartCheckoutFieldManagementV1Api temandoShippingQuoteGuestCartCheckoutFieldManagementV1SaveCheckoutFieldsPost POST /V1/guest-carts/{cartId}/checkout-fields
TemandoShippingQuoteGuestCartDeliveryOptionManagementV1Api temandoShippingQuoteGuestCartDeliveryOptionManagementV1SavePost POST /V1/guest-carts/{cartId}/delivery-option

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

About

Auto-generated Swagger API client for Magento 2

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages