Skip to main content
Billing & Finance

Bank Details and GoCardless Mandates

Manage customer bank details and GoCardless direct debit mandates for automated payment collection.

Auth required: Yes (auth:api) for all endpoints.


Bank Detail Model Properties

Property Type Required Description
id integer auto Unique identifier
fileable_type string Yes PHP class name of the owning entity (e.g. App\Customer, App\Prospect)
fileable_id integer Yes ID of the owning entity
IBAN string Yes (create) International Bank Account Number
BIC string No Bank Identifier Code / SWIFT code
mandate_identification string No SEPA mandate reference. Auto-generated if not provided
dt_of_sgntr datetime No Date of mandate signature (format d/m/Y). Defaults to today if not provided
number_of_debit integer read-only Number of times this mandate has been debited. Managed by the system
user_id integer auto FK to users. Set to the user who created or last modified the record
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

Note: If a bank detail already exists for the given fileable entity, the POST endpoint will update the existing record instead of creating a new one.


GoCardless Mandate Model Properties

Property Type Required Description
id integer auto Unique identifier
customer_id integer Yes FK to customers
mandate_id string No GoCardless mandate ID (returned by GoCardless API)
status string No Mandate status as returned by GoCardless (e.g. pending_submission, active, cancelled)
created_at datetime auto Creation timestamp
updated_at datetime auto Last update timestamp

Bank Details

Base URL: /api/v1/bank-details

Customer bank details are polymorphic: they belong to either a Customer, a Prospect, or another fileable entity.

GET /v1/bank-details

List bank details for a specific fileable entity.

Query parameters (validated via customer_bank_details::attributes('index')):

Parameter Type Required Description
fileable_type string Yes PHP class name (must be a valid class)
fileable_id integer Yes ID of the owning entity

Response 200: Bank detail object for the fileable (or null if none). Response 404: Fileable entity not found.

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/bank-details?fileable_type=App%5CModels%5CCustomer&fileable_id=42" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/bank-details",
    params={
        "fileable_type": "App\\Models\\Customer",
        "fileable_id": 42
    },
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
bank_details = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/bank-details', [
        'fileable_type' => 'App\\Models\\Customer',
        'fileable_id' => 42,
    ]);

$bankDetails = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/bank-details?fileable_type=App%5CModels%5CCustomer&fileable_id=42",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const bankDetails = await response.json();

POST /v1/bank-details

Create a new bank detail record.

Query parameters:

Parameter Type Required Description
fileable_type string Yes PHP class name
fileable_id integer Yes ID of the owning entity

Body (JSON): Validated via customer_bank_details::attributes('body.common', 'body.store').

Field Type Required Description
dt_of_sgntr string No Mandate signature date (format d/m/Y). Defaults to today.
mandate_identification string No Mandate ID. Auto-generated if not provided.
... ... Other bank detail fields

If a bank detail already exists for the fileable, it is updated instead of creating a new one.

Response 201: Created (or updated) bank detail object. Response 422: Validation error. Response 500: Server error.

Examples:

curl -X POST "https://your-instance.bluerocktel.net/api/v1/bank-details?fileable_type=App%5CModels%5CCustomer&fileable_id=42" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "iban": "FR7630006000011234567890189",
    "bic": "AGRIFRPP",
    "dt_of_sgntr": "24/03/2026"
  }'
import requests

response = requests.post(
    "https://your-instance.bluerocktel.net/api/v1/bank-details",
    params={
        "fileable_type": "App\\Models\\Customer",
        "fileable_id": 42
    },
    headers={"Authorization": "Bearer YOUR_API_TOKEN"},
    json={
        "iban": "FR7630006000011234567890189",
        "bic": "AGRIFRPP",
        "dt_of_sgntr": "24/03/2026"
    }
)
bank_detail = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->post('https://your-instance.bluerocktel.net/api/v1/bank-details?fileable_type=App\\Models\\Customer&fileable_id=42', [
        'iban' => 'FR7630006000011234567890189',
        'bic' => 'AGRIFRPP',
        'dt_of_sgntr' => '24/03/2026',
    ]);

$bankDetail = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/bank-details?fileable_type=App%5CModels%5CCustomer&fileable_id=42",
  {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      iban: "FR7630006000011234567890189",
      bic: "AGRIFRPP",
      dt_of_sgntr: "24/03/2026"
    })
  }
);
const bankDetail = await response.json();

GET /v1/bank-details/{id}

Get a single bank detail by ID.

URL parameters:

Parameter Type Description
id integer Bank detail ID

Response 200: Bank detail object. Response 404: Not found.


PUT /v1/bank-details/{id}

Update a bank detail record.

URL parameters:

Parameter Type Description
id integer Bank detail ID

Body (JSON): Validated via customer_bank_details::attributes('body.common').

Response 201: Updated bank detail object. Response 404: Not found. Response 422/500: Error.


DELETE /v1/bank-details/{id}

Delete a bank detail record.

URL parameters:

Parameter Type Description
id integer Bank detail ID

Response 200: { "message": "element deleted" } Response 404: Not found.


GoCardless Mandates

Base URL: /api/v1/go-cardless-mandates

GoCardless direct debit mandates linked to customers.

GET /v1/go-cardless-mandates

List GoCardless mandates for a customer.

Query parameters:

Parameter Type Required Description
customer_id integer Yes Customer ID

Response 200: Array of mandate objects. Response 404: Customer not found.

Examples:

curl -X GET "https://your-instance.bluerocktel.net/api/v1/go-cardless-mandates?customer_id=42" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json"
import requests

response = requests.get(
    "https://your-instance.bluerocktel.net/api/v1/go-cardless-mandates",
    params={"customer_id": 42},
    headers={"Authorization": "Bearer YOUR_API_TOKEN"}
)
mandates = response.json()
$response = Http::withToken('YOUR_API_TOKEN')
    ->get('https://your-instance.bluerocktel.net/api/v1/go-cardless-mandates', [
        'customer_id' => 42,
    ]);

$mandates = $response->json();
const response = await fetch(
  "https://your-instance.bluerocktel.net/api/v1/go-cardless-mandates?customer_id=42",
  {
    headers: {
      "Authorization": "Bearer YOUR_API_TOKEN",
      "Accept": "application/json"
    }
  }
);
const mandates = await response.json();

POST /v1/go-cardless-mandates

Create a new GoCardless mandate for a customer.

Query parameters:

Parameter Type Required Description
customer_id integer Yes Customer ID

Body (JSON): Validated via go_cardless_mandate::attributes('common', 'store').

Response 201: Created mandate object. Response 404: Customer not found. Response 422/500: Error.


GET /v1/go-cardless-mandates/{id}

Get a single GoCardless mandate by ID.

URL parameters:

Parameter Type Description
id integer Mandate ID

Response 200: Mandate object. Response 404: Not found.


PUT /v1/go-cardless-mandates/{id}

Update a GoCardless mandate.

URL parameters:

Parameter Type Description
id integer Mandate ID

Body (JSON): Validated via go_cardless_mandate::attributes('common').

Response 201: Updated mandate object. Response 404: Not found.


DELETE /v1/go-cardless-mandates/{id}

Delete a GoCardless mandate.

Response 200: Success message. Response 404: Not found.