Transactions API

The Transactions API is an integral component of the core service. As a result, all requests should be directed to: https://api.subsbase.io/core/v2/graphql.

The core service expects 2 headers, the X-SITE-ID and Authorization so the request would be:

POST https://api.subsbase.io/core/v2/graphql
Authorization: Bearer {server token}
X-SITE-ID: {your site id}
Consuming the Transactions API requires that a server token is used to authenticate the request. The server token is expected in the Authorization header.

Queries

Transactions Query

query GetTransactions($siteId: String!, $pagination: PaginationGQLInputType, $sorting: [SortingGQLInputType], $filter: FilterGQLInputType) {
  transactions(
    siteId: $siteId
    pagination: $pagination
    sorting: $sorting
    filter: $filter
  ) {
    isSuccess
    message
    pagination {
      page
      perPage
      totalRecords
    }
    data {
      amount
      currency
      referenceNumber
      id
      failureReason
      paymentMethodTransactionSource {
        id
        displayText
        isDefault
        type
      }
      walletTransactionSource {
        id
        displayText
        type
      }
      sitePaymentMethod {
        displayText
        paymentProviderCode
      }
      status
      timestamp
      utcTimestamp
      type
      customer {
        fullName
      }
    }
  }
}
#All properties are found in the TransactionGQLType
// Variables Sample:
{
  "siteId": "test-site",
  "pagination": {
    "perPage": 20,
    "page": 1
  },
  "sorting": [
    {
      "field": "utcTimestamp",
      "direction": "Descending"
    }
  ]
}

Transaction Query

query GetTransaction($siteId: String!, $transactionId: String!) {
  transaction(siteId: $siteId, transactionId: $transactionId) {
    amount
    currency
    referenceNumber
    gatewayResponse
    id
    invoice {
      id
      number
    }
    paymentMethodTransactionSource {
      id
      displayText
      isDefault
      type
    }
    walletTransactionSource {
      id
      displayText
      type
    }
    status
    timestamp
    utcTimestamp
    type
    customer {
      customerId
      fullName
    }
  }
}
#All properties are found in the TransactionGQLType
// Variables Sample:
{
  "siteId": "test-site",
  "transactionId": "tx_test-site_17191597036254857390"
}