Skip to main content

API Reference

The AccruPay API is a GraphQL-based RESTful API that provides access to all payment processing features.

Overview

The API is built with GraphQL, providing:

  • Type Safety - Strongly typed queries and mutations
  • Flexibility - Request exactly the data you need
  • Self-Documenting - Schema introspection and built-in documentation
  • Single Endpoint - All operations through one endpoint

Base URL

Production

https://api.pay.accru.co/graphql

QA

https://api.qa.pay.accru.co/graphql

Authentication

All API requests require an API secret in the request headers:

accrupay-api-secret: your-api-secret

GraphQL Playground

Access the GraphQL Playground to explore the schema and test queries:

Making Requests

cURL Example

curl -X POST https://api.pay.accru.co/graphql \
-H "Content-Type: application/json" \
-H "accrupay-api-secret: your-api-secret" \
-d '{
"query": "{ merchantApi { id name } }"
}'

JavaScript Example

const response = await fetch('https://api.pay.accru.co/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'accrupay-api-secret': 'your-api-secret',
},
body: JSON.stringify({
query: `
query {
merchantApi {
id
name
}
}
`,
}),
});

const { data } = await response.json();

Key Concepts

Queries vs Mutations

  • Queries - Read data (transactions, payment methods, etc.)
  • Mutations - Modify data (start sessions, refund transactions, etc.)

Pagination

Most list queries support pagination with skip and take parameters:

query {
merchantApiTransactions(take: 10, skip: 0) {
items {
id
amount
}
totalCount
}
}

Sorting

List queries support sorting:

query {
merchantApiTransactions(
sorting: [{ field: createdAt, order: DESC }]
) {
items {
id
createdAt
}
}
}

Core Modules

Using the SDK

We recommend using the Node.js SDK instead of making raw GraphQL requests. The SDK provides:

  • Type safety
  • Simplified API
  • Built-in error handling
  • Better developer experience

Next Steps