Skip to content

Latest commit

 

History

History
227 lines (160 loc) · 7.5 KB

FromWooCommerceApi.md

File metadata and controls

227 lines (160 loc) · 7.5 KB

Yoast\MyYoastApiClient\FromWooCommerceApi

All URIs are relative to https://my.yoast.test

Method HTTP request Description
customerFromWooCommerce PUT /api/Customers/fromWooCommerce Update or create a customer
orderFromWooCommerce PUT /api/Orders/fromWooCommerce Sync orders to MyYoast.
productFromWooCommerce PUT /api/Products/fromWooCommerce Sync products to MyYoast.
productGroupFromWooCommerce PUT /api/ProductGroups/fromWooCommerce Sync products to MyYoast.

customerFromWooCommerce

\Yoast\MyYoastApiClient\Model\Customer customerFromWooCommerce($body)

Update or create a customer

This endpoint can be used by WooCommerce to update or create a customer in the MyYoast database.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi(
    // 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 \Yoast\MyYoastApiClient\Model\CustomerFromWooDto(); // \Yoast\MyYoastApiClient\Model\CustomerFromWooDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\CustomerFromWooDto

Return type

\Yoast\MyYoastApiClient\Model\Customer

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

orderFromWooCommerce

\Yoast\MyYoastApiClient\Model\Order orderFromWooCommerce($body)

Sync orders to MyYoast.

This route allows WooCommerce to sync order data to MyYoast.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi(
    // 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 \Yoast\MyYoastApiClient\Model\OrderFromWooDto(); // \Yoast\MyYoastApiClient\Model\OrderFromWooDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\OrderFromWooDto

Return type

\Yoast\MyYoastApiClient\Model\Order

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

productFromWooCommerce

\Yoast\MyYoastApiClient\Model\Product productFromWooCommerce($body)

Sync products to MyYoast.

This route allows WooCommerce to sync product data to MyYoast.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi(
    // 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 \Yoast\MyYoastApiClient\Model\ProductFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductFromWooDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\ProductFromWooDto

Return type

\Yoast\MyYoastApiClient\Model\Product

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

productGroupFromWooCommerce

\Yoast\MyYoastApiClient\Model\ProductGroup productGroupFromWooCommerce($body)

Sync products to MyYoast.

This route allows WooCommerce to sync product data to MyYoast.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');
    // Configure HTTP bearer authorization: bearer
    $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()
    ->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi(
    // 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 \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto | 

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

Parameters

Name Type Description Notes
body \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto

Return type

\Yoast\MyYoastApiClient\Model\ProductGroup

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]