asplinsol / trustshare-api-php
PHP library for access to TrustShare API
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2025-07-10 03:08:57 UTC
README
Welcome to the trustshare API Reference documentation. Here you can find detailed information about the endpoints we provide as well as the shape of entities within the system. # Getting Started It only takes a few minutes to begin using our Sandbox environment straight away. Let's begin... 1. Create an Organisation — Head over to the dashboard to login and being creating your Organisation. You can provide your logo and your brand's accent colour to customise the Checkout UI which is instantiated from the Client SDK. 1. Generate an API Key — Head to the developers section of the dashboard and generate a new key pair. The private key is used to interact with the trustshare API, where-as the public key is used to instantiate the Client SDK. # Environments The trustshare API has two environments, Sandbox and Live. Both environments are available under the same endpoint however API Keys and client secrets are prefixed with the environment name. - A Sandbox API Key will be in the format: sandbox_api_[0-9a-z]
. - A Live API Key will be in the format: live_api_[0-9a-z]
. ## Sandbox Our Sandbox environment endeavours to be as close to the Live environment as possible, however, there are a couple of limitations and features which should be noted. - Card payments take around 7 days to settle into accounts. In Live this is generally closer to 2 days. - Manual inbound payments can only be "faked" in Sandbox when they are less-than or equal-to 250,000.00
. - Open Banking in Sandbox will always use a "Mock Bank" UI to accept the payment. # Webhooks Payments are, by their very nature, asynchronous. As such methods of payment, including the receipt and release of funds can take an arbitrary amount of time to settle or execute. It is therefore advised to integrate with our Webhook Events to be notified of changes to payments in real-time. For more information about our Webhooks, please visit our Webhook Events guide. # Authentication Every API call must include an Authorization
header containing your API Key.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
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 Swagger\Client\Api\ParticipantsApi( // 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() ); $body = new \Swagger\Client\Model\V1ParticipantsBody(); // \Swagger\Client\Model\V1ParticipantsBody | $authorization = "authorization_example"; // string | Your API Key in the format `[sandbox|live]_api_[0-9a-z]`. try { $result = $apiInstance->createParticipant($body, $authorization); print_r($result); } catch (Exception $e) { echo 'Exception when calling ParticipantsApi->createParticipant: ', $e->getMessage(), PHP_EOL; } $apiInstance = new Swagger\Client\Api\ParticipantsApi( // 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() ); $authorization = "authorization_example"; // string | Your API Key in the format `[sandbox|live]_api_[0-9a-z]`. $id = "id_example"; // string | A unique ID of an existing participant. A string in the format: `participant_[0-9a-z]` try { $result = $apiInstance->getParticipant($authorization, $id); print_r($result); } catch (Exception $e) { echo 'Exception when calling ParticipantsApi->getParticipant: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://rest.trustshare.io
Class | Method | HTTP request | Description |
---|---|---|---|
ParticipantsApi | createParticipant | POST /v1/participants | Create a Participant |
ParticipantsApi | getParticipant | GET /v1/participant/{id} | Get a Participant |
PaymentsApi | createPaymentIntent | POST /v1/intents/payment | Create a Payment Intent |
PaymentsApi | createRefunds | POST /v1/outbounds/refunds | Create Refunds |
PaymentsApi | createReleases | POST /v1/outbounds/releases | Create Releases |
PaymentsApi | getCheckout | GET /v1/checkout/{id} | Get a Checkout |
PaymentsApi | getInbound | GET /v1/inbound/{id} | Get an Inbound |
PaymentsApi | getIntent | GET /v1/intent/{id} | Get an Intent |
PaymentsApi | getInvoice | GET /v1/invoice/{id} | Get an Invoice |
PaymentsApi | getOutbound | GET /v1/outbound/{id} | Get an Outbound |
PaymentsApi | getProject | GET /v1/project/{id} | Get a Project |
PaymentsApi | getSettlement | GET /v1/settlement/{id} | Get a Settlement |
ProjectsApi | createProject | POST /v1/projects | Create a Project |
ProjectsApi | getProject | GET /v1/project/{id} | Get a Project |
VerificationsApi | createVerification | POST /v1/verifications | Create a Verification |
VerificationsApi | getParticipant | GET /v1/participant/{id} | Get a Participant |
VerificationsApi | getVerification | GET /v1/verification/{id} | Get a Verification |
Documentation For Models
- Address
- AddressInput
- AddressType
- AllOfAddressInputType
- AllOfAddressType
- AllOfBankAccountCountry
- AllOfBankAccountCurrency
- AllOfBankAccountInputCountry
- AllOfBankAccountInputCurrency
- AllOfBankAccountRoutingCodeType
- AllOfCheckoutParticipant
- AllOfCheckoutStatus
- AllOfCheckoutTransfersItems
- AllOfCheckoutType
- AllOfConversionFrom
- AllOfConversionStatus
- AllOfConversionTo
- AllOfInboundStatus
- AllOfInboundType
- AllOfIntentBankAccountInputCountry
- AllOfIntentBankAccountInputCurrency
- AllOfIntentParticipantInputAddress
- AllOfIntentParticipantInputBankAccount
- AllOfIntentParticipantInputType
- AllOfInvoiceAccount
- AllOfInvoiceCurrency
- AllOfInvoiceParticipant
- AllOfInvoiceSettlementsItems
- AllOfInvoiceStatus
- AllOfKnownParticipantAddress
- AllOfKnownParticipantBankAccount
- AllOfKnownParticipantStatus
- AllOfKnownParticipantType
- AllOfLinkIntentCurrency
- AllOfLinkIntentFrom
- AllOfLinkIntentSettlementsItems
- AllOfLinkIntentStatus
- AllOfLinkIntentType
- AllOfOutboundConversion
- AllOfOutboundPausedReason
- AllOfOutboundResultOutboundsItems
- AllOfOutboundStatus
- AllOfOutboundTo
- AllOfOutboundTransfersItems
- AllOfOutboundType
- AllOfPaymentIntentCurrency
- AllOfPaymentIntentFrom
- AllOfPaymentIntentSettlementsItems
- AllOfPaymentIntentStatus
- AllOfPaymentIntentType
- AllOfProjectAccount
- AllOfProjectAccountCurrency
- AllOfProjectAccountRoutingDataItems
- AllOfProjectCheckoutsItems
- AllOfProjectCurrency
- AllOfProjectInboundsItems
- AllOfProjectOutboundsItems
- AllOfProjectRoutingDataRoutingCodeType
- AllOfProjectSettlementsItems
- AllOfProjectStatus
- AllOfProjectType
- AllOfReleaseInputTo
- AllOfSettlementCurrency
- AllOfSettlementFrom
- AllOfSettlementInputTo
- AllOfSettlementInputType
- AllOfSettlementIntentTo
- AllOfSettlementIntentType
- AllOfSettlementStatus
- AllOfSettlementTo
- AllOfSettlementType
- AllOfTransferSubtype
- AllOfTransferType
- AllOfVerificationParticipant
- AllOfVerificationStatus
- AllOfVerificationType
- AllOfintentsPaymentBodyCurrency
- AllOfintentsPaymentBodyFrom
- AllOfintentsPaymentBodySettlementsItems
- AllOfintentsPaymentBodyType
- AllOfoutboundsRefundsBodyRefundsItems
- AllOfoutboundsReleasesBodyReleasesItems
- AllOfv1ParticipantsBodyAddress
- AllOfv1ParticipantsBodyBankAccount
- AllOfv1ParticipantsBodyType
- AllOfv1ProjectsBodyCurrency
- AllOfv1VerificationsBodyAddress
- AllOfv1VerificationsBodyBankAccount
- AllOfv1VerificationsBodyType
- BankAccount
- BankAccountCountry
- BankAccountCurrency
- BankAccountInput
- Checkout
- CheckoutStatus
- CheckoutType
- Conversion
- ConversionStatus
- CreatedPaymentIntent
- Currency
- Inbound
- InboundStatus
- InboundType
- InlineResponse200
- InlineResponse2001
- InlineResponse20010
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2006
- InlineResponse2007
- InlineResponse2008
- InlineResponse2009
- Intent
- IntentBankAccountInput
- IntentParticipantInput
- IntentStatus
- IntentType
- IntentsPaymentBody
- Invoice
- InvoiceStatus
- KnownParticipant
- LinkIntent
- OneOfCreatedPaymentIntent
- OneOfIntent
- Outbound
- OutboundPausedReason
- OutboundResult
- OutboundStatus
- OutboundType
- OutboundsRefundsBody
- OutboundsReleasesBody
- ParticipantStatus
- ParticipantType
- PaymentIntent
- PaymentSubType
- PaymentType
- Project
- ProjectAccount
- ProjectRoutingCodeType
- ProjectRoutingData
- ProjectStatus
- ProjectType
- RefundInput
- ReleaseInput
- RoutingCodeType
- Settlement
- SettlementInput
- SettlementIntent
- SettlementStatus
- SettlementType
- Transfer
- TransferSubType
- TransferType
- V1ParticipantsBody
- V1ProjectsBody
- V1VerificationsBody
- Verification
- VerificationStatus
- VerificationType
Documentation For Authorization
All endpoints do not require authorization.