Pluto Core API

Powerful GraphQL API for seamless corporate card transaction management and accounting integration.

πŸš€

Real-time Data

Access transaction data instantly as it flows through the system

πŸ”’

Secure & Reliable

Enterprise-grade security with 99.9% uptime SLA

⚑

GraphQL Powered

Query exactly what you need with powerful filtering

Authentication

All API requests require authentication using an API key in the request headers.

POST https://api.plutocard.cloud/v1/graphql
Headers
X-Pluto-Token: your-api-token-here
Content-Type: application/json
Note: Keep your API token secure. Never expose it in client-side code or public repositories.

Quick Start

Get up and running with the Pluto Core API in minutes. Follow this guide to integrate with your systems.

Quick Implementation Timeline

  • 1.5 - 2 weeks for API development after commercial sign-off
  • Postman collection provided for immediate testing
  • Technical onboarding session with our API experts
  • 72-hour SLA for ongoing support

Example Implementation

JavaScript
const PLUTO_API_URL = 'https://api.plutocard.cloud/v1/graphql';
const PLUTO_TOKEN = 'your-api-token';

async function getVerifiedTransactions() {
  const query = `
    query GetVerifiedTransactions {
      accounting_integration_transactions(
        where: {status: {_eq: "VERIFIED"}}
      ) {
        card_transaction_id
        card_transaction {
          id
          merchant_name
          charged_amount
          transaction_date
        }
      }
    }
  `;

  const response = await fetch(PLUTO_API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Pluto-Token': PLUTO_TOKEN
    },
    body: JSON.stringify({ query })
  });

  return response.json();
}

async function exportTransactions(transactionIds, filename) {
  const mutation = `
    mutation ExportTransactions($ids: [uuid!]!, $date: timestamptz!, $file: String!) {
      update_accounting_integration_transactions(
        where: {card_transaction_id: {_in: $ids}}
        _set: {status: "EXPORTED", exported_at: $date, exported_file_name: $file}
      ) {
        affected_rows
      }
    }
  `;

  const variables = {
    ids: transactionIds,
    date: new Date().toISOString(),
    file: filename
  };

  const response = await fetch(PLUTO_API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'X-Pluto-Token': PLUTO_TOKEN
    },
    body: JSON.stringify({ query: mutation, variables })
  });

  return response.json();
}

API Flows

Six powerful workflows to handle every aspect of transaction management.

← Back to flows

Flow 1: Daily Transaction Verification

Accounting Daily Process

Perfect for accounting teams who need to verify and reconcile transactions daily. This workflow helps maintain accurate records and ensures all transactions are properly reviewed before export.

1

Get Unverified Transactions

Retrieve all transactions that haven't been verified yet.

GraphQL
query GetUnverifiedTransactions {
  accounting_integration_transactions(
    where: {status: {_neq: "VERIFIED"}}
  ) {
    card_transaction_id
    card_transaction {
      id
      transaction_date
      merchant_name
      charged_amount
      memo
      card {
        employee {
          user {
            full_name
          }
        }
        last_four
      }
    }
  }
}
2

Mark as Verified

After review, mark transactions as verified to prepare them for export.

GraphQL
mutation MarkTransactionsVerified($txIds: [uuid!]!) {
  update_accounting_integration_transactions(
    where: {card_transaction_id: {_in: $txIds}}
    _set: {status: "VERIFIED"}
  ) {
    affected_rows
  }
}
← Back to flows

Flow 2: Export to Accounting System

Integration Microsoft Dynamics

Complete workflow for exporting verified transactions to Microsoft Dynamics or other accounting systems. Includes all necessary data for proper accounting integration.

1

Get Export-Ready Transactions

Retrieve all verified transactions with complete details for export.

GraphQL
query GetCardTransactionsForExport {
  accounting_integration_transactions(
    where: {status: {_eq: "VERIFIED"}}
  ) {
    # Memo fields
    needs_details_memo
    
    # Account mapping
    chart_of_account_debit { 
      account_code 
      name
    }
    chart_of_account_credit { 
      account_code 
      name
    }
    
    # Transaction details
    card_transaction {
      id
      transaction_date
      transaction_currency
      charged_amount
      charged_amount_in_org_currency
      memo
      merchant_name
      
      # Employee information
      card {
        employee {
          user {
            full_name
          }
          employee_department {
            department {
              accounting_code
              name
            }
          }
        }
        last_four
      }
      
      # Supporting documents
      card_transactions_attachments {
        user_attachment { 
          url
        }
      }
      
      # Custom field values
      card_transaction_custom_field_values {
        selected_option {
          org_custom_field { 
            name 
          }
          name
        }
      }
    }
  }
}
2

Mark as Exported

Update transaction status after successful export to prevent duplicates.

GraphQL
mutation ExportCardTransactions(
  $txIds: [uuid!]!, 
  $exportDate: timestamptz!, 
  $exportFilename: String!
) {
  update_accounting_integration_transactions(
    where: {card_transaction_id: {_in: $txIds}}
    _set: {
      status: "EXPORTED", 
      exported_at: $exportDate, 
      exported_file_name: $exportFilename
    }
  ) {
    affected_rows
  }
}
← Back to flows

Flow 3: Department-Based Analysis

Analytics Reporting

Track and analyze spending patterns by department. Perfect for budget monitoring and departmental expense reports.

1

Query by Department

Filter transactions by department code for targeted analysis.

GraphQL
query GetTransactionsByDepartment($deptCode: String!) {
  accounting_integration_transactions(
    where: {
      card_transaction: {
        card: {
          employee: {
            employee_department: {
              department: {
                accounting_code: {_eq: $deptCode}
              }
            }
          }
        }
      }
    }
  ) {
    card_transaction {
      charged_amount_in_org_currency
      transaction_date
      merchant_name
      card {
        employee {
          user {
            full_name
          }
          employee_department {
            department {
              accounting_code
              name
            }
          }
        }
      }
    }
  }
}
← Back to flows

Flow 4: Custom Field Reporting

Custom Data Flexible

Extract transactions based on custom field values for specialized reporting needs. Ideal for project tracking, vendor analysis, or custom categorization.

1

Filter by Custom Fields

Query transactions using your organization's custom field values.

GraphQL
query GetTransactionsByCustomField($fieldName: String!, $fieldValue: String!) {
  accounting_integration_transactions(
    where: {
      card_transaction: {
        card_transaction_custom_field_values: {
          selected_option: {
            org_custom_field: {name: {_eq: $fieldName}},
            name: {_eq: $fieldValue}
          }
        }
      }
    }
  ) {
    card_transaction {
      id
      merchant_name
      charged_amount
      transaction_date
      card_transaction_custom_field_values {
        selected_option {
          org_custom_field {
            name
          }
          name
        }
      }
    }
  }
}
← Back to flows

Flow 5: Error Recovery

Error Handling Retry Logic

Handle failed exports gracefully with built-in error recovery. Identify problematic transactions and retry the export process.

1

Identify Failed Exports

Find all transactions that failed during the export process.

GraphQL
query GetTransactionsFailedToExport {
  accounting_integration_transactions(
    where: {status: {_eq: "ERROR_EXPORTING"}}
  ) {
    accounting_class_id
    accounting_department_id
    status
    card_transaction_id
    card_transaction {
      id
      merchant_name
      charged_amount
      card {
        employee {
          user {
            full_name
          }
        }
      }
    }
  }
}
2

Reset for Retry

Reset failed transactions back to verified status for re-export.

GraphQL
mutation ResetFailedTransactions($txIds: [uuid!]!) {
  update_accounting_integration_transactions(
    where: {card_transaction_id: {_in: $txIds}}
    _set: {status: "VERIFIED"}
  ) {
    affected_rows
  }
}
← Back to flows

Flow 6: Employee Lifecycle & User Management

HR Users & Employees

Manage your organisation’s workforce directly via the API – create new users, deactivate them, and update key attributes such as department or location.

1

List Users

Retrieve all users that belong to your organisation along with their employee records.

GraphQL
query ListUsers {
  public_users(order_by: {first_name: asc}) {
    id
    email_address
    full_name
    employees {
      id
      status
      title
      employee_department { department { id name accounting_code } }
      employee_locations   { location   { id name code } }
    }
  }
}
2

Add New User

Create a user and the corresponding employee record in a single request.

GraphQL
mutation AddUser(
  $email: String!,
  $first: String!,
  $last: String!,
  $employeeTitle: String!,
  $orgId: uuid!
) {
  insert_users_one(
    object: {
      email_address: $email,
      first_name: $first,
      last_name: $last,
      employees: {
        data: {
          org_id: $orgId,
          status: "ONBOARDING",
          title: $employeeTitle
        }
      }
    }
  ) { id }
}
3

Deactivate User

Soft-delete an employee by marking them inactive and setting deleted_at.

GraphQL
mutation DeactivateUser($employeeId: uuid!) {
  update_employees_by_pk(
    pk_columns: {id: $employeeId},
    _set: {status: "INACTIVE", deleted_at: "now()"}
  ) {
    id status deleted_at
  }
}
4

Change Department

Move an employee to another department.

GraphQL
mutation ChangeDepartment($employeeId: uuid!, $deptId: uuid!) {
  update_department_employees(
    where: {employee_id: {_eq: $employeeId}},
    _set: {department_id: $deptId}
  ) { affected_rows }
}
5

Change Location

Update the primary location of an employee.

GraphQL
mutation ChangeLocation($employeeId: uuid!, $locationId: uuid!) {
  update_employee_locations(
    where: {employee_id: {_eq: $employeeId}},
    _set: {location_id: $locationId}
  ) { affected_rows }
}

Data Models

Transaction Status Values

Track the lifecycle of each transaction with these status values:

PENDING

New transaction awaiting review

VERIFIED

Transaction verified by accounting

EXPORTED

Successfully exported to accounting system

ERROR_EXPORTING

Export failed, requires retry

Field Reference

Complete mapping of all available fields in the transaction data model.

Transaction Financial Fields

charged_amount Original transaction amount in the currency used at point of sale
charged_amount_in_org_currency Transaction amount converted to your organization's base currency
transaction_currency ISO 4217 currency code (e.g., USD, EUR, GBP)
transaction_date Timestamp when the transaction occurred (ISO 8601 format)
is_cash_withdrawal Boolean flag indicating if this was an ATM cash withdrawal

Employee & Department Fields

employee.user.full_name Full name of the cardholder employee
employee_department.department.accounting_code Department accounting code (e.g., "2106" for Supply Chain)
employee_department.department.name Full department name including code and description
card.last_four Last 4 digits of the corporate card used
card.account_id Internal account identifier for the card

Accounting Integration Fields

chart_of_account_debit Debit account mapping with account_code and name
chart_of_account_credit Credit account mapping with account_code and name
accounting_class_id Accounting class identifier for categorization
accounting_department_id Department ID in the accounting system
needs_details_memo Additional memo requirements from accounting review

Export Tracking Fields

exported_at Timestamp when the transaction was exported
exported_file_name Name of the export file containing this transaction
status Current status in the workflow (PENDING, VERIFIED, EXPORTED, ERROR_EXPORTING)

Supporting Documentation

card_transactions_attachments Array of receipt attachments with URLs
user_attachment.url Direct URL to access uploaded receipts or documentation

Custom Fields

card_transaction_custom_field_values Array of custom field values specific to your organization
selected_option.name Selected value for the custom field (e.g., "Account Type - Vendor")
org_custom_field.name Name of the custom field as configured in your organization