### CLI: Get Payment Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payment Provides a concrete example of how to use the `gc get payment` command with a sample payment ID. ```CLI gc get payment XYZ12344 ``` -------------------------------- ### CLI: Example of Printing GoCardless CLI Version Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_version An example of how to execute the 'gc version' command to display the installed GoCardless CLI version. ```Shell gc version ``` -------------------------------- ### Example JSON Response for Account Transactions Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide This JSON object illustrates the typical structure of the response received from the GoCardless Bank Account Data API's transactions endpoint. It includes arrays for 'booked' and 'pending' transactions, each containing details such as transactionId, debtorName, debtorAccount, transactionAmount (with currency and amount), bookingDate, valueDate, and remittanceInformationUnstructured. ```json { "transactions":{ "booked":[ { "transactionId":"2020103000624289-1", "debtorName":"MON MOTHMA", "debtorAccount":{ "iban":"GL53SAFI055151515" }, "transactionAmount":{ "currency":"EUR", "amount":"45.00" }, "bookingDate":"2020-10-30", "valueDate":"2020-10-30", "remittanceInformationUnstructured":"For the support of Restoration of the Republic foundation" }, { "transactionId":"2020111101899195-1", "transactionAmount":{ "currency":"EUR", "amount":"-15.00" }, "bankTransactionCode":"PMNT", "bookingDate":"2020-11-11", "valueDate":"2020-11-11", "remittanceInformationUnstructured":"PAYMENT Alderaan Coffe" } ], "pending":[ { "transactionAmount":{ "currency":"EUR", "amount":"-10.00" }, "valueDate":"2020-11-03", "remittanceInformationUnstructured":"Reserved PAYMENT Emperor's Burgers" } ] } } ``` -------------------------------- ### Create Requisition and Generate Authentication Link with GoCardless API Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide This step involves creating a requisition, which is essential for generating authentication links and subsequently retrieving accounts. It requires an `institution_id` and a `redirect` URL. Optional parameters include a `reference` ID, an `agreement` ID from Step 3, and `user_language` for enforcing a specific language in the end-user flow. ```curl curl -X POST "https://bankaccountdata.gocardless.com/api/v2/requisitions/" \ -H "accept: application/json" -H "Content-Type: application/json" \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d "{\"redirect\": \"http://www.yourwebpage.com\",\n \"institution_id\": \"REVOLUT_REVOGB21\",\n \"reference\": \"124151\",\n \"agreement\": \"2dea1b84-97b0-4cb4-8805-302c227587c8\",\n \"user_language\":\"EN\" }" ``` ```json { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "created": "2025-05-14T11:05:56.276Z", "redirect": "http://www.yourwebpage.com", "status": "CR", "institution_id": "string", "agreement": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "reference": "string", "accounts": [], "user_language": "EN", "link": "https://ob.gocardless.com/psd2/start/3fa85f64-5717-4562-b3fc-2c963f66afa6/{$INSTITUTION_ID}", "ssn": "string", "account_selection": false, "redirect_immediate": false } ``` -------------------------------- ### GoCardless CLI: Example `gc get payout` Usage Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payout Illustrates a practical example of fetching a payout using the `gc get payout` command with a sample ID. ```Shell gc get payout XYZ12344 ``` -------------------------------- ### CLI Example: Fetch Customer Bank Account by ID Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer_bank_account Provides a practical example of using the `gc get customer_bank_account` command with a sample ID. ```CLI gc get customer_bank_account XYZ12344 ``` -------------------------------- ### Install GoCardless Client Library Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/making-your-first-api-request Instructions on how to install the GoCardless API client library using a package manager for PHP. The 'pro' libraries are recommended for all new integrations. ```PHP composer require gocardless/gocardless-pro ``` -------------------------------- ### CLI Example: Listing all customers Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_customers An example demonstrating the basic usage of the `gc list customers` command to retrieve a list of all customers. ```CLI gc list customers ``` -------------------------------- ### Install GoCardless Pro Client Library (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/api/making-your-first-request This snippet demonstrates how to install the GoCardless Pro client library for PHP using Composer, the dependency manager. This library simplifies interaction with the GoCardless API by handling boilerplate code. ```PHP composer require gocardless/gocardless-pro ``` -------------------------------- ### CLI: Get Creditor by ID Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_creditor Provides a concrete example of how to use the `gc get creditor` command with a sample ID. ```CLI gc get creditor XYZ12344 ``` -------------------------------- ### CLI: Get Mandate Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_mandate Provides a practical example of how to use the 'gc get mandate' command with a placeholder ID. ```shell gc get mandate XYZ12344 ``` -------------------------------- ### List End User Bank Accounts via GoCardless API Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide After the end user completes the authentication process and is redirected back, this step allows retrieving a list of their bank accounts. The `requisition ID` obtained from Step 4 is required to view the associated accounts. ```curl curl -X GET "https://bankaccountdata.gocardless.com/api/v2/requisitions/8126e9fb-93c9-4228-937c-68f0383c2df7/" \ -H "accept: application/json" \ -H "Authorization: Bearer ACCESS_TOKEN" ``` ```json { "id":"8126e9fb-93c9-4228-937c-68f0383c2df7", "status":"LN", "agreements":"2dea1b84-97b0-4cb4-8805-302c227587c8", "accounts":[ "065da497-e6af-4950-88ed-2edbc0577d20", "bc6d7bbb-a7d8-487e-876e-a887dcfeea3d" ], "reference":"124151" } ``` -------------------------------- ### CLI: Get Customer Notification Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer_notification Illustrates how to fetch a specific customer notification by providing a sample ID using the GoCardless CLI. ```Shell gc get customer_notification XYZ12344 ``` -------------------------------- ### Import GoCardless Client Library Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/making-your-first-api-request How to import the GoCardless client library into your PHP code after installation, making it ready for use. ```PHP require 'vendor/autoload.php'; ``` -------------------------------- ### GoCardless CLI: Example to List Customer Bank Accounts Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_customer_bank_accounts Illustrates a basic example of how to list customer bank accounts using the GoCardless CLI. This snippet shows the simplest form of the command for immediate use. ```bash gc list customer_bank_accounts ``` -------------------------------- ### GoCardless CLI: Example for Listing Customer Notifications Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_customer_notifications A practical example demonstrating how to execute the `gc list customer_notifications` command without any additional flags. ```CLI gc list customer_notifications ``` -------------------------------- ### gc list payouts Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_payouts An example of how to use the `gc list payouts` command without any additional flags. ```Shell gc list payouts ``` -------------------------------- ### Example: List all payments Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_payments An example of how to use the `gc list payments` command without any additional flags to retrieve a list of payments. ```CLI gc list payments ``` -------------------------------- ### CLI: List Webhooks Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_webhooks Illustrates a simple usage example of the `gc list webhooks` command to fetch a list of webhooks. ```CLI gc list webhooks ``` -------------------------------- ### CLI: Get Customer Example by ID Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer An example of using the `gc get customer` command to retrieve a customer with a specific ID, 'XYZ12344'. ```CLI gc get customer XYZ12344 ``` -------------------------------- ### GoCardless CLI: Examples for gc create Command Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_create Illustrates practical usage of the `gc create` command to create payments and subscriptions. Examples include specifying data directly with `--data` and using an editor with `--editorName`. ```bash # create a payment linked to a mandate gc create payments -d amount=1000 -d currency=GBP -d "links[mandate]=MD1234" # create a payment with editor # opens vim prompt and then you can enter json data. gc create payments --editorName vim # create a subscription gc create subscriptions -d amount=1000 -d currency=GBP -d interval_unit=monthly -d "links[mandate]=MD1234" ``` -------------------------------- ### CLI: Get Specific Refund Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_refund Provides a concrete example of how to use the `gc get refund` command to fetch a refund with a specific ID 'XYZ12344'. ```Shell gc get refund XYZ12344 ``` -------------------------------- ### CLI Example: Listing all subscriptions Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_subscriptions An example demonstrating the basic usage of the `gc list subscriptions` command to retrieve a list of all subscriptions without any additional filters or options. ```CLI gc list subscriptions ``` -------------------------------- ### Make First API Request: List Customers Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/making-your-first-api-request Example of making the first API request to list customers using the initialized GoCardless client in PHP. This verifies authentication and connectivity to the API. ```PHP $customers = $client->customers()->list()->records; print_r($customers); ``` -------------------------------- ### CLI Example: Get Webhook by ID Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_webhook An example of fetching a webhook using a specific, hypothetical ID 'XYZ12344' with the `gc get webhook` command. ```Shell gc get webhook XYZ12344 ``` -------------------------------- ### Initialize GoCardless API Client (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/api/making-your-first-request This code initializes the GoCardless API client in PHP, configuring it with an access token and setting the environment to SANDBOX. It is recommended to store your access token securely, for example, in an environment variable. ```PHP getenv('GC_ACCESS_TOKEN'), // Change me to LIVE when you're ready to go live 'environment' => \GoCardlessPro\Environment::SANDBOX ]); ``` -------------------------------- ### gc list refunds Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_refunds Provides a straightforward example of how to execute the `gc list refunds` command to list all refunds without any additional parameters. ```Shell gc list refunds ``` -------------------------------- ### HTTP Example: Create Creditor Bank Account Source: https://developer.gocardless.com/bank-account-data/overview/gc-embed/adding-a-creditor-bank-account Example HTTP POST request to the `/creditor_bank_accounts` endpoint, demonstrating how to create a UK creditor bank account with a sample request body and the corresponding 201 Created response including the new bank account details. ```HTTP POST https://api.gocardless.com/creditor_bank_accounts HTTP/1.1 Content-Type: application/json { "creditor_bank_accounts": { "account_number": "55779911", "branch_code": "200000", "country_code": "GB", "account_holder_name": "Nude Wines", "links": { "creditor": "CR123" } } } HTTP/1.1 201 Created Location: /creditor_bank_accounts/BA123 Content-Type: application/json { "creditor_bank_accounts": { "id": "BA123", "created_at": "2014-05-27T12:43:17.000Z", "account_holder_name": "Nude Wines", "account_number_ending": "11", "account_type": null, "country_code": "GB", "currency": "GBP", "bank_name": "BARCLAYS BANK PLC", "enabled": true, "verification_status": "pending", "links": { "creditor": "CR123" } } } ``` -------------------------------- ### CLI: Get Payment Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payment Lists the specific options available for the `gc get payment` command, such as the help flag. ```CLI -h, --help help for payment ``` -------------------------------- ### Setup GoCardless CLI Autocompletion for Various Shells Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_completion Comprehensive examples and instructions for configuring persistent shell autocompletion for the GoCardless CLI across Bash, Zsh, Fish, and PowerShell environments. ```bash #### Bash: $ source <(gc completion bash) # To load completions for each session, execute once: # Linux: $ gc completion bash > /etc/bash_completion.d/gc # macOS: $ gc completion bash > /usr/local/etc/bash_completion.d/gc ``` ```zsh # If shell completion is not already enabled in your environment, # you will need to enable it. You can execute the following once: $ echo "autoload -U compinit; compinit" >> ~/.zshrc # To load completions for each session, execute once: $ gc completion zsh > "${fpath[1]}/_gc" # You will need to start a new shell for this setup to take effect. ``` ```fish $ gc completion fish | source # To load completions for each session, execute once: $ gc completion fish > ~/.config/fish/completions/gc.fish ``` ```powershell PS> gc completion powershell | Out-String | Invoke-Expression # To load completions for every new session, run: PS> gc completion powershell > gc.ps1 # and source this file from your PowerShell profile. ``` -------------------------------- ### CLI Example: Fetch Specific Subscription Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_subscription Provides a concrete example of how to use the `gc get subscription` command to fetch a subscription by a specific ID, such as 'XYZ12344'. ```bash gc get subscription XYZ12344 ``` -------------------------------- ### GoCardless CLI: `gc listen` Command Examples Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_listen Illustrates practical usage of the `gc listen` command, demonstrating how to print webhook events to the console and how to forward them to a specified HTTP endpoint. ```Shell # listen for events and print them to console gc listen ``` ```Shell # listen for events and forward them to a webhook url gc listen --forward "http://localhost:8001/webhook" ``` -------------------------------- ### List Available Financial Institutions by Country Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide Retrieve a list of all available financial institutions in a given country using the institutions endpoint. This requires an access token for authorization and a two-letter ISO 3166 country code (e.g., 'gb' for Great Britain). The 'id' of the chosen bank from this list will be used in subsequent API calls. ```curl curl -X GET "https://bankaccountdata.gocardless.com/api/v2/institutions/?country=gb" \ -H "accept: application/json" \ -H "Authorization: Bearer ACCESS_TOKEN" ``` ```json [ { "id":"ABNAMRO_ABNAGB2LXXX", "name":"ABN AMRO Bank Commercial", "bic":"ABNAGB2LXXX", "transaction_total_days":"540", "countries":[ "GB" ], "logo":"https://cdn-logos.gocardless.com/ais/ABNAMRO_FTSBDEFAXXX.png", "max_access_valid_for_days": "180" }, { "..." }, { "id":"REVOLUT_REVOGB21", "name":"Revolut", "bic":"REVOGB21", "transaction_total_days":"730", "countries":[ "GB" ], "logo":"https://cdn-logos.gocardless.com/ais/REVOLUT_REVOGB21.png", "max_access_valid_for_days": "90" } ] ``` -------------------------------- ### CLI: List Payer Authorisations Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_payer_authorisations Demonstrates a basic usage example of the `gc list payer_authorisations` command without any additional parameters, showing how to retrieve a list of payer authorisations. ```CLI gc list payer_authorisations ``` -------------------------------- ### Install PHP OAuth Client Library Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/partners/connecting-your-users-accounts Instructions to install the `adoy/oauth2` OAuth client library for PHP using Composer. This library facilitates interaction with OAuth 2.0 providers. ```PHP composer require adoy/oauth2 ``` -------------------------------- ### CLI: Get Customer Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer Lists the specific options available for the `gc get customer` command, such as the help flag. ```CLI -h, --help help for customer ``` -------------------------------- ### gc trigger payment_submitted Command Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_payment_submitted Provides a simple example of how to use the `gc trigger payment_submitted` command without any arguments or flags. ```GoCardless CLI gc trigger payment_submitted ``` -------------------------------- ### CLI: gc list mandates Example Usage Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_mandates Provides a practical example of how to execute the 'gc list mandates' command using the GoCardless CLI to fetch a list of mandates. ```Shell gc list mandates ``` -------------------------------- ### Example: Add Payer Theme via HTTP POST Request Source: https://developer.gocardless.com/bank-account-data/overview/gc-embed/setting-up-branding Illustrates an example HTTP POST request to the `/branding/payer_themes` endpoint, showing the JSON payload for setting various colour themes and linking to a creditor, along with the expected 201 Created response. ```HTTP POST https://api.gocardless.com/branding/payer_themes HTTP/1.1 Content-Type: application/json { "payer_themes": { "header_background_colour": "#BD10E0", "link_text_colour": "#7ED321", "button_background_colour": "#128DAA", "content_box_border_colour": "#BD10E0", "links": { "creditor": "CR123" } } } HTTP/1.1 201 Created Content-Type: application/json { "payer_themes": { "id": "PTH123" } } ``` -------------------------------- ### Install GoCardless React Drop-in Package Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/billing-requests/using-dropin Install the official GoCardless react-dropin library, which provides React bindings and TypeScript definitions. This package can be installed using either npm or yarn, offering a convenient way to integrate the Drop-in into React applications. ```npm npm install --save @gocardless/react-dropin ``` ```yarn yarn add @gocardless/react-dropin ``` -------------------------------- ### Unzip GoCardless CLI for Windows manual installation Source: https://developer.gocardless.com/bank-account-data/overview/developer-tools/gc-cli Unzips the downloaded GoCardless CLI zip file for manual installation on Windows. Replace '' and '' with the actual file details from the downloaded archive. ```Shell tar -xvf gc-cli__Windows_.tar.gz ``` -------------------------------- ### CLI Options: `gc get customer_bank_account` Command Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer_bank_account Lists specific command-line options available for the `gc get customer_bank_account` command, such as the help flag. ```CLI -h, --help help for customer_bank_account ``` -------------------------------- ### Simulating Instalment Schedule States Source: https://developer.gocardless.com/bank-account-data/overview/developer-tools/scenario-simulators This table explains how to simulate different states for instalment schedules, such as `completed`, `errored`, and `creation_failed`, by using either a special customer `given_name` or a specific `name` for the instalment schedule itself. ```APIDOC Instalment Schedule `name` | Customer `given_name` | Description | What happens on instalment schedule creation --- | --- | --- | --- N/A | Successful | All payments belonging to the instalment schedule are successfully collected. | The instalment schedule is marked as `completed`. N/A | Penniless | Payments belonging to the instalment schedule cannot be collected. | The instalment schedule is marked as `errored`. Faily | N/A | Instalment schedule will fail with payment creation error message: must be on or after mandate's next_possible_customer_charge_date. | The instalment schedule is marked as `creation_failed`. ``` -------------------------------- ### GoCardless CLI: Triggering Events with Examples Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger Demonstrates how to use the `gc trigger` command to simulate various events within the GoCardless system. It shows examples of triggering events without parameters, which autogenerates necessary objects, and with specific resource IDs (like customer or mandate IDs) to use existing resources. ```CLI # trigger a mandate_activated event without params - this autogenerates all objects required for mandate activation gc trigger mandate_activated # trigger a mandate activated event with a customer id - this triggers a mandate activated event for the specified customer gc trigger mandate_activated customer=customer_id # trigger a payment_confirmed event with a mandate id - this triggers a payment confirmed event for the specified mandate gc trigger payment_confirmed mandate=MA00192829 ``` -------------------------------- ### Create End User Agreement with GoCardless API Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide This step details how to create an end-user agreement, which defines the terms for accessing bank account data. It allows specifying custom terms for transaction history length, account access period, and information scope, or using default settings. The `institution_id` is required, with `max_historical_days`, `access_valid_for_days`, and `access_scope` as optional parameters. ```curl curl -X POST "https://bankaccountdata.gocardless.com/api/v2/agreements/enduser/" \ -H "accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d "{\"institution_id\": \"REVOLUT_REVOGB21\",\n \"max_historical_days\": \"180\",\n \"access_valid_for_days\": \"30\",\n \"access_scope\": [\"balances\", \"details\", \"transactions\"] }" ``` ```json { "id":"2dea1b84-97b0-4cb4-8805-302c227587c8", "created":"2021-10-25T16:41:09.753Z", "max_historical_days":180, "access_valid_for_days":30, "access_scope":[ "balances", "details", "transactions" ], "accepted":"", "institution_id":"REVOLUT_REVOGB21" } ``` -------------------------------- ### CLI Options for gc get webhook Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_webhook Lists command-specific options available for the `gc get webhook` command, such as the help flag. ```Shell -h, --help help for webhook ``` -------------------------------- ### Simulate Instalment Schedule States Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/developer-tools/scenario-simulators This table explains how to simulate `completed`, `errored`, and `creation_failed` states for instalment schedules by using specific customer `given_name` or instalment schedule `name` values. ```APIDOC Instalment Schedule Simulation: - Scenario 1: Instalment Schedule Name: N/A Customer Given Name: Successful Description: All payments belonging to the instalment schedule are successfully collected. On Instalment Schedule Creation: The instalment schedule is marked as `completed`. - Scenario 2: Instalment Schedule Name: N/A Customer Given Name: Penniless Description: Payments belonging to the instalment schedule cannot be collected. On Instalment Schedule Creation: The instalment schedule is marked as `errored`. - Scenario 3: Instalment Schedule Name: Faily Customer Given Name: N/A Description: Instalment schedule will fail with payment creation error message: must be on or after mandate's next_possible_customer_charge_date. On Instalment Schedule Creation: The instalment schedule is marked as `creation_failed`. ``` -------------------------------- ### Unzip GoCardless CLI for Linux manual installation Source: https://developer.gocardless.com/bank-account-data/overview/developer-tools/gc-cli Unzips the downloaded GoCardless CLI zip file for manual installation on Linux. Replace '' and '' with the actual file details from the downloaded archive. ```Shell tar -xvf gc-cli__Windows_.tar.gz ``` -------------------------------- ### GoCardless CLI: `gc get payout` Command Specific Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payout Lists command-specific options available for `gc get payout`, such as the help flag. ```Shell -h, --help help for payout ``` -------------------------------- ### CLI Command Example: Get Payer Authorisation by ID Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payer_authorisation Provides an example of how to use the 'gc get payer_authorisation' command with a specific ID. ```CLI gc get payer_authorisation XYZ12344 ``` -------------------------------- ### CLI: Get Payment Command Synopsis Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payment Shows the basic syntax for the `gc get payment` command, including placeholders for the payment ID and optional flags. ```CLI gc get payment {ID} [flags] ``` -------------------------------- ### Install PHP OAuth Client Library Source: https://developer.gocardless.com/bank-account-data/overview/partners/connecting-your-users This command installs the `adoy/oauth2` client library for PHP using Composer, a dependency manager, which is necessary to interact with the GoCardless OAuth flow. ```PHP composer require adoy/oauth2 ``` -------------------------------- ### GoCardless CLI: gc open Command Examples Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_open Illustrates common usage patterns for the 'gc open' command, including listing all supported shortcuts and directly opening specific GoCardless web pages such as API documentation, general documentation, customer lists, and the webhooks dashboard. ```Shell gc open --list gc open api gc open docs gc open customers gc open dashboard/webhooks ``` -------------------------------- ### CLI: Example Usage of gc list events Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_events A practical example demonstrating how to execute the `gc list events` command to retrieve a list of events. ```Shell gc list events ``` -------------------------------- ### CLI Option: Display Help for Subscription Command Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_subscription Describes the `-h` or `--help` option available for the `gc get subscription` command, which provides detailed usage information and available flags. ```bash -h, --help help for subscription ``` -------------------------------- ### CLI: Get Event by ID Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_event An example of using the `gc get event` command with a specific event ID 'XYZ12344' to demonstrate its practical usage. ```CLI gc get event XYZ12344 ``` -------------------------------- ### Example usage of gc trigger payment_failed Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_payment_failed Provides a simple example of how to execute the `gc trigger payment_failed` command without any additional arguments or flags. ```bash gc trigger payment_failed ``` -------------------------------- ### Install GoCardless CLI with Homebrew Source: https://developer.gocardless.com/bank-account-data/overview/developer-tools/gc-cli Installs the official GoCardless CLI using the Homebrew package manager, typically used on macOS and Linux systems. ```Shell brew install gocardless/taps/cli ``` -------------------------------- ### Make First API Request: List Customers (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/api/making-your-first-request This snippet demonstrates how to make your first API request to GoCardless using the PHP client library by listing customers. It uses the initialized client to call the `customers()->list()` method and prints the records. ```PHP $customers = $client->customers()->list()->records; print_r($customers); ``` -------------------------------- ### GoCardless CLI: Example for Listing Mandate Imports Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_mandate_imports A practical example demonstrating the basic usage of the `gc list mandate_imports` command to retrieve a list of mandate imports without any additional parameters. ```CLI gc list mandate_imports ``` -------------------------------- ### Install GoCardless React Drop-in Package Source: https://developer.gocardless.com/bank-account-data/overview/billing-requests/verified-mandates/using-dropin Install the GoCardless React Drop-in library using npm or yarn. This package provides React bindings and TypeScript definitions for the Drop-in functionality. ```React //With npm: npm install --save @gocardless/react-dropin // With yarn: yarn add @gocardless/react-dropin ``` -------------------------------- ### Retrieve Account Transactions using cURL Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide This cURL command demonstrates how to make a GET request to the GoCardless Bank Account Data API's transactions endpoint. It requires an account ID (e.g., '065da497-e6af-4950-88ed-2edbc0577d20') and a Bearer ACCESS_TOKEN for authorization to retrieve transaction details for a specific account. ```curl curl -X GET "https://bankaccountdata.gocardless.com/api/v2/accounts/065da497-e6af-4950-88ed-2edbc0577d20/transactions/" \ -H "accept: application/json" \ -H "Authorization: Bearer ACCESS_TOKEN" ``` -------------------------------- ### CLI: Inherited Options for Get Commands Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_payment Details options that are inherited from parent commands, applicable to `gc get` and its subcommands, such as specifying a configuration file. ```CLI --config string config file (default is $HOME/.gc-cli/config.json) ``` -------------------------------- ### CLI Example: Triggering a Payment Confirmed Event Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_payment_confirmed A practical example demonstrating the basic usage of the `gc trigger payment_confirmed` command to simulate a payment confirmation event. ```Shell gc trigger payment_confirmed ``` -------------------------------- ### Unzip GoCardless CLI for macOS manual installation Source: https://developer.gocardless.com/bank-account-data/overview/developer-tools/gc-cli Unzips the downloaded GoCardless CLI tar.gz file for manual installation on macOS. Replace '' and '' with the actual file details from the downloaded archive. ```Shell tar -xvf gc-cli__macOS_.tar.gz ``` -------------------------------- ### CLI Synopsis for gc get webhook Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_webhook Shows the basic syntax for using the `gc get webhook` command, indicating the required webhook ID and optional flags. ```Shell gc get webhook {ID} [flags] ``` -------------------------------- ### CLI Command Example: gc trigger billing_request_fulfilled Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_billing_request_fulfilled Demonstrates a basic usage example of the `gc trigger billing_request_fulfilled` command without any additional arguments or flags. ```Shell gc trigger billing_request_fulfilled ``` -------------------------------- ### Import GoCardless Pro Client Library (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/api/making-your-first-request This snippet shows how to import the GoCardless Pro client library into your PHP project, making its functionalities available for use in your code. ```PHP require 'vendor/autoload.php'; ``` -------------------------------- ### GoCardless CLI: gc login Command Examples Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_login Illustrates how to use `gc login` to authorize directly with the GoCardless CLI or with a specific partner application using its App ID. ```CLI # authorise against the Gocardless CLI gc login # authorise against a partner app by providing the App ID gc login --app {APP_ID} ``` -------------------------------- ### Initialize GoCardless API Client Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/making-your-first-api-request Initialize the GoCardless API client in PHP using your access token and specifying the environment (e.g., SANDBOX). It's recommended to store the access token securely in an environment variable. ```PHP getenv('GC_ACCESS_TOKEN'), // Change me to LIVE when you're ready to go live 'environment' => \GoCardlessPro\Environment::SANDBOX ]); ``` -------------------------------- ### CLI Command: Get Mandate Import by ID Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_mandate_import Documentation for the `gc get mandate_import` command, used to fetch a mandate import using its ID. This section includes the command's synopsis, an example of its usage, and a list of available options. ```Shell gc get mandate_import {ID} [flags] ``` ```Shell gc get mandate_import XYZ12344 ``` ```Shell -h, --help help for mandate_import ``` ```Shell --config string config file (default is $HOME/.gc-cli/config.json) ``` -------------------------------- ### CLI Command Example: Trigger Billing Request Pending Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_billing_request_pending A practical example demonstrating the basic usage of the `gc trigger billing_request_pending` command without any additional parameters. ```CLI gc trigger billing_request_pending ``` -------------------------------- ### CLI Command Example: Get Current Session Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_config_current-session Illustrates a basic usage example of the `gc config current-session` command without any additional flags, returning the current user session. ```Shell gc config current-session ``` -------------------------------- ### Get Access Token for GoCardless Bank Account Data API Source: https://developer.gocardless.com/bank-account-data/overview/bank-account-data/quick-start-guide Obtain an access token required for authenticating subsequent API calls. This involves retrieving a user secret (secret_id and secret_key) from the GoCardless Bank Account Data portal and using them to make a POST request to the token endpoint. The successful response provides the access token, its expiration time, and a refresh token. ```curl curl -X POST "https://bankaccountdata.gocardless.com/api/v2/token/new/" \ -H "accept: application/json" \ -H "Content-Type: application/json" \ -d "{\"secret_id\":\"string\", \"secret_key\":\"string\"}" ``` ```json { "access": "string", "access_expires": 86400, "refresh": "string", "refresh_expires": 2592000 } ``` -------------------------------- ### CLI Command Example: Trigger Payment Pending Submission Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_payment_pending_submission Illustrates a basic usage example of the `gc trigger payment_pending_submission` command without any additional arguments or flags. ```CLI gc trigger payment_pending_submission ``` -------------------------------- ### Create GoCardless Instalment Schedule in PHP Source: https://developer.gocardless.com/bank-account-data/overview/direct-debit/taking-installment-payments This code demonstrates how to create an instalment schedule using the GoCardless PHP client. It sets up a schedule to collect a total amount (e.g., £100) in multiple instalments (e.g., 3 payments of £34, £34, and £32) with a specified start date and interval. It also includes parameters for application fees, currency, and links to a mandate. ```PHP $client = new \GoCardlessPro\Client([ 'access_token' => 'your_access_token_here', 'environment' => \GoCardlessPro\Environment::SANDBOX ]); $instalment_schedule = $client->instalmentSchedules()->createWithSchedule([ "params" => [ "name" => "ACME Invoice 103", "total_amount" => 10000, // 100 GBP in pence, collected from the customer "app_fee" => 10, // Your 10 pence fee, applied to each instalment, // to be paid out to you "currency" => "GBP", "instalments" => [ "start_date" => "2019-08-20", "interval_unit" => "weekly", "interval" => 2, "amounts" => [ 3400, 3400, 3200 ] ], "links" => [ "mandate" => "MD0000XH9A3T4C" ], "metadata" => [] ], "headers" => [ "Idempotency-Key" => "random_instalment_schedule_specific_string" ] ]); ``` -------------------------------- ### Example GoCardless Webhook HTTP POST Request Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/api/staying-up-to-date-with-webhooks This snippet shows an example HTTP POST request that GoCardless sends to your webhook endpoint. It includes standard HTTP headers like User-Agent and Content-Type, a Webhook-Signature for verification, and a JSON body containing one or more event objects, such as a 'mandates' resource with a 'cancelled' action. ```HTTP POST https://example.com/webhooks HTTP/1.1 User-Agent: gocardless-webhook-service/1.1 Content-Type: application/json Webhook-Signature: 78e3507f61f141046969c73653402cb50b714f04322da04d766ee0f6d2afe65f { "events": [ { "id": "EV123", "created_at": "2014-08-04T12:00:00.000Z", "action": "cancelled", "resource_type": "mandates", "links": { "mandate": "MD123", "organisation": "OR123" }, "details": { "origin": "bank", "cause": "bank_account_disabled", "description": "Your customer closed their bank account.", "scheme": "bacs", "reason_code": "ADDACS-B" } } ] } ``` -------------------------------- ### CLI: Event Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_event Lists the specific options available for the `gc get event` command, such as the help flag. ```CLI -h, --help help for event ``` -------------------------------- ### CLI: Trigger Payment Charged Back Event Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_payment_charged_back Demonstrates a basic example of how to trigger a payment charged back event with the GoCardless CLI without any additional arguments. ```CLI gc trigger payment_charged_back ``` -------------------------------- ### CLI: Refund Command Help Option Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_refund Shows the standard help option available for the `gc get refund` command, which provides usage information and available flags. ```Shell -h, --help help for refund ``` -------------------------------- ### GoCardless Payout Fee Processing: Option 1 - One Transaction Per Fee Line Item Source: https://developer.gocardless.com/bank-account-data/overview/guides/handling-tax Details the process of creating a separate transaction for each fee line item within a payout. This approach is useful for displaying fees connected to specific payments and future-proofs against complex tax setups. ```APIDOC Steps: 1. Get the payout_items from the API (https://developer.gocardless.com/api-reference/#payout-items-get-all-payout-items-in-a-single-payout). 2. For each payout item that has a 'taxes' array, iterate through each item. 3. Apply the corresponding tax in your system using the 'tax_rate_id' and 'exchange_rate' provided. ``` -------------------------------- ### GoCardless CLI: gc open Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_open Lists the specific options available for the 'gc open' command, including '--help' for displaying command-line help and '--list' to show all supported shortcuts that can be opened. ```Shell -h, --help help for open --list List all supported short cuts ``` -------------------------------- ### Example JSON for Billing Request Created Event Source: https://developer.gocardless.com/bank-account-data/overview/billing-requests/responding-to-billing-request-events This example demonstrates the structure of a `billing_request_created` event, triggered whenever a new Billing Request is initiated. It includes details such as the event ID, creation timestamp, resource type, action, and links to associated resources like customer, bank account, and billing request IDs. The `details` field provides origin, cause, and a description of the event. ```json { "id": "EV0039FK74X5Y4", "created_at": "2021-05-03T18:23:08.141Z", "resource_type": "billing_requests", "action": "created", "links": { "customer": "CU00016Y7P8FPA", "customer_bank_account": "BA0000QF3HBM4V", "payment_request_payment": "PM000SY3392D1T", "billing_request": "BRQ000012HQV2J4" }, "details": { "origin": "payer", "cause": "billing_request_created", "description": "This billing request has been created." }, "metadata": {} } ``` -------------------------------- ### Pseudocode Algorithm for GoCardless Instalment Calculation Source: https://developer.gocardless.com/bank-account-data/overview/direct-debit/taking-installment-payments This pseudocode provides a sample algorithm for integrators to calculate and split invoice amounts into multiple instalments. It includes two functions: `calculateInstalmentValue` which determines the value of each instalment rounded up, and `getInstalmentAmounts` which generates an array of instalment amounts, handling remainders and minimums. The algorithm ensures that all individual instalment amounts sum up to the original total. ```pseudocode // @param total - the total in GBP/USD etc. // @param number_of_instalments - the number of instalments you'd like to split the // invoice into function calculateInstalmentValue(total, number_of_instalments) { // work out the value of each instalment, rounded up to the nearest whole unit rounded_units = ceiling(total/number_of_instalments) if (rounded_units * (number_of_instalments - 1) >= total) { return floor(total / number_of_instalments); } else { return rounded_units; } } // @param total - the invoice total in GBP/USD etc. // @param number_of_instalments - the number of instalments you'd like to split the // invoice into // @param normal_instalment_amount - the amount in pence/cents etc. for all payments // except the final 'balancing' payment function getInstalmentAmounts(total, number_of_instalments, normal_instalment_amount) { number_of_normal_instalments = floor(total / normal_instalment_amount); minimum = 200 // some "reasonable minimum" instalment amount amounts = []; for (i = 1; i < number_of_normal_instalments; i++) { amounts.push(normal_instalment_amount); } remainder = total % normalInstalmentAmount; if (remainder < minimum) { amounts[amounts.length - 1] += remainder; } else { amounts.push(remainder); } return amounts; } normal_instalment_amount = calculateInstalmentValue(total, number_of_instalments) instalment_amounts = getInstalmentAmounts( total, number_of_instalments, normal_instalment_amount ) ``` -------------------------------- ### List and Cancel GoCardless Instalment Schedules (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/direct-debit/taking-installment-payments This snippet demonstrates how to list all instalment schedules, filter them by creation date, and cancel a specific schedule by its ID. Cancelling an instalment schedule will cancel all remaining payments that are not yet submitted, collected, or failed. ```PHP $client = new \GoCardlessPro\Client([ 'access_token' => 'your_access_token_here', 'environment' => \GoCardlessPro\Environment::SANDBOX ]); $client->instalmentSchedules()->list(); $client->instalmentSchedules()->list([ "params" => ["created_at[gt]" => "2015-11-03T09:30:00Z"] ]); $client->instalmentSchedules()->cancel("IS123"); ``` -------------------------------- ### Listen for GoCardless Webhook Events with CLI Source: https://developer.gocardless.com/bank-account-data/overview/resources/testing-webhooks-cli This command starts the GoCardless CLI in listen mode, which will print any new webhook events received directly to your console. It's useful for real-time monitoring during development. ```bash $ gc listen Started listening for new webhooks. Any new webhooks will be printed to your console. ``` -------------------------------- ### CLI: Get Refund Command Synopsis Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_refund Displays the general syntax for fetching a refund using its ID with the GoCardless CLI tool, including optional flags. ```Shell gc get refund {ID} [flags] ``` -------------------------------- ### CLI Inherited Options: GoCardless CLI Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer_bank_account Details common command-line options inherited from parent commands in the GoCardless CLI, such as specifying a configuration file. ```CLI --config string config file (default is $HOME/.gc-cli/config.json) ``` -------------------------------- ### Example GoCardless Webhook HTTP POST Request Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/staying-up-to-date-with-webhooks This snippet illustrates an example HTTP POST request sent by GoCardless to your server as a webhook. It includes standard HTTP headers like User-Agent, Content-Type, and Webhook-Signature, along with a JSON body containing an array of event objects. Each event specifies the resource type, ID, associated organization, and the action that occurred, providing detailed information about the event. ```HTTP POST https://example.com/webhooks HTTP/1.1 User-Agent: gocardless-webhook-service/1.1 Content-Type: application/json Webhook-Signature: 78e3507f61f141046969c73653402cb50b714f04322da04d766ee0f6d2afe65f { "events": [ { "id": "EV123", "created_at": "2014-08-04T12:00:00.000Z", "action": "cancelled", "resource_type": "mandates", "links": { "mandate": "MD123", "organisation": "OR123" }, "details": { "origin": "bank", "cause": "bank_account_disabled", "description": "Your customer closed their bank account.", "scheme": "bacs", "reason_code": "ADDACS-B" } } ] } ``` -------------------------------- ### Complete `collect_customer_details` Action (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/getting-started/billing-requests/billing-request-actions Illustrates how to complete the `collect_customer_details` action by POSTing to the relevant endpoint, providing the required customer and customer billing details. This example shows partial completion. ```PHP $client = new \GoCardlessPro\Client(array( 'access_token' => 'your_access_token_here', 'environment' => \GoCardlessPro\Environment::SANDBOX )); $client->billingRequests()->collectCustomerDetails("BR123", [ "params" => [ "customer" => [ "given_name" => "Alice", "family_name" => "Smith" ], "customer_billing_detail" => [ "address_line1" => "1 Somewhere Lane" ] ] ]); ``` -------------------------------- ### Install GoCardless Javascript Drop-in Script Source: https://developer.gocardless.com/bank-account-data/overview/billing-requests/verified-mandates/using-dropin Add this script tag to your HTML to initialize the GoCardless Drop-in. It is recommended not to bundle or vendor this script to ensure automatic updates and backward compatibility. ```Javascript ``` -------------------------------- ### Example: Billing Request Flow Creation Response Source: https://developer.gocardless.com/bank-account-data/overview/billing-requests/verified-mandates/billing-request-actions This JSON snippet shows the response received after successfully creating a Billing Request Flow. It includes the `authorisation_url` which should be presented to the customer for initiating the bank login process. ```json { "billing_request_flows": { "authorisation_url": "https://pay.gocardless.com/billing/static/flow?id=", "lock_customer_details": false, "lock_bank_account": false, "auto_fulfil": true, "created_at": "2021-03-30T16:23:10.679Z", "expires_at": "2021-04-06T16:23:10.679Z", "redirect_uri": "https://my-company.com/completed", "links": { "billing_request": "BRQ123" } } } ``` -------------------------------- ### CLI Command Synopsis: Get Customer Bank Account Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_customer_bank_account Displays the general syntax for the `gc get customer_bank_account` command, indicating the required ID and optional flags. ```CLI gc get customer_bank_account {ID} [flags] ``` -------------------------------- ### GoCardless CLI: `gc listen` Command Synopsis Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_listen Shows the basic syntax for using the `gc listen` command, indicating it can be used with various flags. ```Shell gc listen [flags] ``` -------------------------------- ### Create GoCardless Instalment Schedule with Custom Dates (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/direct-debit/taking-installment-payments This snippet demonstrates how to create a new instalment schedule with specific charge dates and amounts. It allows for irregular payment cadences and includes parameters for total amount, application fees, currency, individual instalment details, and linking to a mandate. The schedule initially enters a 'pending' state. ```PHP $client = new \GoCardlessPro\Client([ 'access_token' => 'your_access_token_here', 'environment' => \GoCardlessPro\Environment::SANDBOX ]); $instalment_schedule = $client->instalmentSchedules()->createWithDates([ "params" => [ "name" => "ACME Invoice 103", "total_amount" => 10000, // 100 GBP in pence, collected from the customer "app_fee" => 10, // Your 10 pence fee, applied to each instalment, // to be paid out to you "currency" => 'GBP', "instalments" => [ [ "charge_date" => '2019-08-20', "amount" => 3400 ], [ "charge_date" => '2019-09-03', "amount" => 3400 ], [ "charge_date" => '2019-09-17', "amount" => 3200 ] ], "links" => [ "mandate" => 'MD0000XH9A3T4C' ], "metadata" => [] ], "headers" => [ 'Idempotency-Key' => 'random_instalment_schedule_specific_string' ] ]); ``` -------------------------------- ### GoCardless CLI: Options for Listing Customer Bank Accounts Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_list_customer_bank_accounts Details the specific command-line options available for the `gc list customer_bank_accounts` command. This includes the help flag, which provides further information directly from the CLI. ```bash -h, --help help for customer_bank_accounts ``` -------------------------------- ### GoCardless CLI Global Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc Lists the global command-line options available for the `gc` command, including configuration file path, help, and toggle options. ```cli --config string config file (default is $HOME/.gc-cli/config.json) -h, --help help for gc -t, --toggle Help message for toggle ``` -------------------------------- ### CLI: Get Creditor Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_get_creditor Lists command-specific options for `gc get creditor`, such as the help flag. ```CLI -h, --help help for creditor ``` -------------------------------- ### Initialize GoCardless Client for Merchant API Calls (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/partners/setting-up-mandates This code snippet demonstrates how to initialize the GoCardlessPro client in PHP to make API calls on behalf of a merchant. It requires a previously obtained merchant access token and allows setting the environment to SANDBOX or LIVE. ```PHP $user->gocardlessAccessToken, // Change me to LIVE when you're ready to go live 'environment' => \GoCardlessPro\Environment::SANDBOX ]); ``` -------------------------------- ### CLI: Trigger Mandate Transferred Example Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_trigger_mandate_transferred Provides a simple example of how to execute the `gc trigger mandate_transferred` command. ```Shell gc trigger mandate_transferred ``` -------------------------------- ### GoCardless CLI `gc config` Command Options Source: https://developer.gocardless.com/bank-account-data/overview/cli-reference/gc_config Displays help information for the `gc config` command, detailing its available flags and usage. ```CLI -h, --help help for config ``` -------------------------------- ### Retrieve GoCardless Instalment Schedule by ID (PHP) Source: https://developer.gocardless.com/bank-account-data/overview/direct-debit/taking-installment-payments This snippet shows how to retrieve an existing instalment schedule using its unique ID. This is useful for inspecting the schedule's current state (e.g., 'pending' or 'active') and details after creation, especially if not relying on webhooks. ```PHP $client = new \GoCardlessPro\Client([ 'access_token' => 'your_access_token_here', 'environment' => \GoCardlessPro\Environment::SANDBOX ]); $client->instalmentSchedules()->get("IS123"); ``` -------------------------------- ### Example: Create a Creditor via POST /creditors (HTTP) Source: https://developer.gocardless.com/bank-account-data/overview/gc-embed/creating-a-creditor Demonstrates how to create a creditor using a direct HTTP POST request to the /creditors endpoint, including the request body with required parameters and the expected 201 Created response with the new creditor's details. ```HTTP POST https://api.gocardless.com/creditors HTTP/1.1 Content-Type: application/json { "creditors": { "name": "Example Ltd", "country_code": "GB", "creditor_type": "company" } } HTTP/1.1 201 Created Location: /creditors/CR123 Content-Type: application/json { "creditors": { "id": "CR123", "created_at": "2017-02-16T12:34:56.000Z", "name": "Example Ltd", "creditor_type": "company", "country_code": "GB", ... } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.