Skip to content

Files

Latest commit

d81bb92 · Feb 18, 2025

History

History
127 lines (86 loc) · 4.41 KB

CountriesApi.md

File metadata and controls

127 lines (86 loc) · 4.41 KB

SynergiTech\Sage\CountriesApi

All URIs are relative to https://api.accounting.sage.com/v3.1, except if the operation defines another base path.

Method HTTP request Description
getCountries() GET /countries Returns all Countries
getCountriesKey() GET /countries/{key} Returns a Country

getCountries()

getCountries($itemsPerPage, $page, $attributes): \SynergiTech\Sage\Model\Base[]

Returns all Countries

Endpoint Availability * Accounting Plus: 🇨🇦, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸 * Accounting Standard: 🇬🇧, 🇮🇪 * Accounting Start: 🇨🇦, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸

Example

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



$apiInstance = new SynergiTech\Sage\Api\CountriesApi(
    // 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()
);
$itemsPerPage = 20; // int | Returns the given number of Countries per request.
$page = 1; // int | Go to specific page of Countries
$attributes = 'attributes_example'; // string | Specify the attributes that you want to expose for the Countries (expose all attributes with 'all'). These are in addition to the base attributes (name, path)

try {
    $result = $apiInstance->getCountries($itemsPerPage, $page, $attributes);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountriesApi->getCountries: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
itemsPerPage int Returns the given number of Countries per request. [optional] [default to 20]
page int Go to specific page of Countries [optional] [default to 1]
attributes string Specify the attributes that you want to expose for the Countries (expose all attributes with 'all'). These are in addition to the base attributes (name, path) [optional]

Return type

\SynergiTech\Sage\Model\Base[]

Authorization

No authorization required

HTTP request headers

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

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

getCountriesKey()

getCountriesKey($key, $attributes): \SynergiTech\Sage\Model\Base

Returns a Country

Endpoint Availability * Accounting Plus: 🇨🇦, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸 * Accounting Standard: 🇬🇧, 🇮🇪 * Accounting Start: 🇨🇦, 🇪🇸, 🇫🇷, 🇬🇧, 🇮🇪, 🇺🇸

Example

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



$apiInstance = new SynergiTech\Sage\Api\CountriesApi(
    // 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()
);
$key = 'key_example'; // string | The Country Key.
$attributes = 'attributes_example'; // string | Specify the attributes that you want to expose for the Country (expose all attributes with 'all'). These are in addition to the base attributes (name, path)

try {
    $result = $apiInstance->getCountriesKey($key, $attributes);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CountriesApi->getCountriesKey: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
key string The Country Key.
attributes string Specify the attributes that you want to expose for the Country (expose all attributes with 'all'). These are in addition to the base attributes (name, path) [optional]

Return type

\SynergiTech\Sage\Model\Base

Authorization

No authorization required

HTTP request headers

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

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