SquareConnect\TerminalApi

April 22, 2020 ยท View on GitHub

All URIs are relative to https://connect.squareup.com

MethodHTTP requestDescription
cancelTerminalCheckoutPOST /v2/terminals/checkouts/{checkout_id}/cancelCancelTerminalCheckout
createTerminalCheckoutPOST /v2/terminals/checkoutsCreateTerminalCheckout
getTerminalCheckoutGET /v2/terminals/checkouts/{checkout_id}GetTerminalCheckout
searchTerminalCheckoutsPOST /v2/terminals/checkouts/searchSearchTerminalCheckouts

cancelTerminalCheckout

Note: This endpoint is in beta.

\SquareConnect\Model\CancelTerminalCheckoutResponse cancelTerminalCheckout($checkout_id)

CancelTerminalCheckout

Cancels a Terminal checkout request, if the status of the request permits it.

Example

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

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\TerminalApi();
$checkout_id = "checkout_id_example"; // string | Unique ID for the desired `TerminalCheckout`

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

Parameters

NameTypeDescriptionNotes
checkout_idstringUnique ID for the desired `TerminalCheckout`

Return type

\SquareConnect\Model\CancelTerminalCheckoutResponse

Authorization

oauth2

HTTP request headers

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

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

createTerminalCheckout

Note: This endpoint is in beta.

\SquareConnect\Model\CreateTerminalCheckoutResponse createTerminalCheckout($body)

CreateTerminalCheckout

Creates a new Terminal checkout request and sends it to the specified device to take a payment for the requested amount.

Example

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

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\TerminalApi();
$body = new \SquareConnect\Model\CreateTerminalCheckoutRequest(); // \SquareConnect\Model\CreateTerminalCheckoutRequest | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

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

Parameters

NameTypeDescriptionNotes
body\SquareConnect\Model\CreateTerminalCheckoutRequestAn object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

\SquareConnect\Model\CreateTerminalCheckoutResponse

Authorization

oauth2

HTTP request headers

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

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

getTerminalCheckout

Note: This endpoint is in beta.

\SquareConnect\Model\GetTerminalCheckoutResponse getTerminalCheckout($checkout_id)

GetTerminalCheckout

Retrieves a Terminal checkout request by checkout_id.

Example

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

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\TerminalApi();
$checkout_id = "checkout_id_example"; // string | Unique ID for the desired `TerminalCheckout`

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

Parameters

NameTypeDescriptionNotes
checkout_idstringUnique ID for the desired `TerminalCheckout`

Return type

\SquareConnect\Model\GetTerminalCheckoutResponse

Authorization

oauth2

HTTP request headers

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

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

searchTerminalCheckouts

Note: This endpoint is in beta.

\SquareConnect\Model\SearchTerminalCheckoutsResponse searchTerminalCheckouts($body)

SearchTerminalCheckouts

Retrieves a filtered list of Terminal checkout requests created by the account making the request.

Example

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

// Configure OAuth2 access token for authorization: oauth2
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

$apiInstance = new SquareConnect\Api\TerminalApi();
$body = new \SquareConnect\Model\SearchTerminalCheckoutsRequest(); // \SquareConnect\Model\SearchTerminalCheckoutsRequest | An object containing the fields to POST for the request.  See the corresponding object definition for field details.

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

Parameters

NameTypeDescriptionNotes
body\SquareConnect\Model\SearchTerminalCheckoutsRequestAn object containing the fields to POST for the request. See the corresponding object definition for field details.

Return type

\SquareConnect\Model\SearchTerminalCheckoutsResponse

Authorization

oauth2

HTTP request headers

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

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