Skip to content

Latest commit

 

History

History
179 lines (130 loc) · 6.92 KB

TransactionsApi.md

File metadata and controls

179 lines (130 loc) · 6.92 KB

DillerAPI\TransactionsApi

All URIs are relative to /

Method HTTP request Description
cancelTransaction POST /api/v2.0/stores/{storeId}/transactions/{externalTransactionId}/cancel Cancel transaction
createRefundTransaction POST /api/v2.0/stores/{storeId}/members/{memberId}/transactions/{transactionId}/refund Allows for the partial refund of a previous transaction, without taking into account any coupons or stamp cards applied earlier.
createTransaction POST /api/v2.0/stores/{storeId}/members/{memberId}/transactions Creates transaction

cancelTransaction

\DillerAPI\Model\ActionResponse cancelTransaction($storeId, $externalTransactionId, $body)

Cancel transaction

Example

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

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

$apiInstance = new DillerAPI\Api\TransactionsApi(
    // 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
);
$storeId = "storeId_example"; // string | 
$externalTransactionId = "externalTransactionId_example"; // string | The store's transaction unique identifier. Eg. Order-1234
$body = new \DillerAPI\Model\CancelationReason(); // \DillerAPI\Model\CancelationReason | 

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

Parameters

Name Type Description Notes
storeId string
externalTransactionId string The store's transaction unique identifier. Eg. Order-1234
body \DillerAPI\Model\CancelationReason [optional]

Return type

\DillerAPI\Model\ActionResponse

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json, text/json, application/_*+json
  • Accept: application/json

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

createRefundTransaction

\DillerAPI\Model\ActionResponse createRefundTransaction($storeId, $memberId, $transactionId, $body)

Allows for the partial refund of a previous transaction, without taking into account any coupons or stamp cards applied earlier.

If the entire transaction needs to be refunded, consider using the "cancel transaction" endpoint, as it fully reverses the transaction, including coupons and stamp cards.

Example

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

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

$apiInstance = new DillerAPI\Api\TransactionsApi(
    // 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
);
$storeId = "storeId_example"; // string | Store Id
$memberId = "memberId_example"; // string | Member Id
$transactionId = "transactionId_example"; // string | The original transaction Id that is being refunded
$body = new \DillerAPI\Model\CreateRefundTransactionRequest(); // \DillerAPI\Model\CreateRefundTransactionRequest | CreateRefundTransactionRequest object

try {
    $result = $apiInstance->createRefundTransaction($storeId, $memberId, $transactionId, $body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TransactionsApi->createRefundTransaction: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
storeId string Store Id
memberId string Member Id
transactionId string The original transaction Id that is being refunded
body \DillerAPI\Model\CreateRefundTransactionRequest CreateRefundTransactionRequest object [optional]

Return type

\DillerAPI\Model\ActionResponse

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json, text/json, application/_*+json
  • Accept: application/json

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

createTransaction

\DillerAPI\Model\ActionResponse createTransaction($storeId, $memberId, $body)

Creates transaction

Example

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

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

$apiInstance = new DillerAPI\Api\TransactionsApi(
    // 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
);
$storeId = "storeId_example"; // string | Store Id
$memberId = "memberId_example"; // string | Member Id
$body = new \DillerAPI\Model\CreateTransactionRequest(); // \DillerAPI\Model\CreateTransactionRequest | CreateTransactionRequest object

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

Parameters

Name Type Description Notes
storeId string Store Id
memberId string Member Id
body \DillerAPI\Model\CreateTransactionRequest CreateTransactionRequest object [optional]

Return type

\DillerAPI\Model\ActionResponse

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json, text/json, application/_*+json
  • Accept: application/json

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