Stay organized with collections Save and categorize content based on your preferences.

Export transaction data

This page describes how you can use the issuer switch API to export transaction data to a Cloud Storage bucket.

If you need to back up transaction data, you can export the following categories of transaction data to a Cloud Storage bucket:

  • Financial transactions data
  • Metadata transactions data
  • Mandate transactions data
  • Complaint transactions data

Before you begin

Before you start using the export transaction data APIs, complete the following tasks to set up your Cloud Storage bucket:

  1. Create a Cloud Storage bucket in your Google Cloud project. See Create storage buckets.
  2. Add a Google-provided IAM service account as a principal for the newly created bucket, and then grant the storage.objectCreator role to the principal. For more information, see Add a principal to a bucket-level policy.
  3. (Optional) If you want to configure a custom file path for the CSV file in your Cloud Storage bucket, contact Google Support.

    If you don't configure a file path, the CSV files are stored in the transactions/ folder in the root of the Cloud Storage bucket.

Export financial transactions data

To export financial transactions data using the issuer switch API, use the ExportFinancialTransactions method [REST, gRPC].

In the request, specify a transaction type and a start and end time for the export. The transaction type that you specify must be one of the valid transaction types for the SETTLE_PAYMENT API type. All transactions of the specified transaction type that were processed within the specified timeframe are exported as a single CSV file. If you don't specify a transaction type, all transactions of the SETTLE_PAYMENT API type are exported. For information about the transaction details that are exported, see the ExportFinancialTransactions method.

The following curl command exports all debit transactions that took place in the specified timeframe.

  curl -i -H "Authorization: Bearer $TOKEN" -d '
  {
    "parent": "projects/PROJECT_ID",
    "startTime": "2022-06-15T13:24:54.554629498Z",
    "endTime": "2022-06-16T13:24:54.554629498Z",
    "transactionType": "TRANSACTION_TYPE_DEBIT"
  }'
  -H "content-type: application/json" -X POST "https://ISSUER_SWITCH_API_ENDPOINT/v1/projects/PROJECT_ID/financialTransactions:export"

In this example:

  • PROJECT_ID is the ID of your Google Cloud project.
  • $TOKEN is your OAuth 2.0 access token.
  • ISSUER_SWITCH_API_ENDPOINT is your issuer switch API endpoint. For example, api.129a0b1a-bb73-4906-a5b7-a6e0bfe7860e.issuerswitch.goog.

Replace these with values specific to your environment.

When you run the command on a terminal, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID"
  }

You can use the name returned in this response to poll the export operation [REST, gRPC]. When the export operation is complete, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID",
    "done": true,
    "response": {
      "@type": "type.googleapis.com/google.cloud.paymentgateway.issuerswitch.v1.ExportFinancialTransactionsResponse",
      "targetUri": "https://storage.cloud.google.com/BUCKET_ID/transactions/c8f9044c-5c66-4618-9518-a061834d9a9f.csv"
    }
  }

Export metadata transactions data

To export metadata transactions data using the issuer switch API, use the ExportMetadataTransactions method [REST, gRPC].

In the request, specify a valid API type and a start and end time for the export.

All transactions of the specified API type that were processes within the specified timeframe are exported as a single CSV file. If no API type is specified, then metadata transactions of all the valid API types are exported. For information about the transaction details that are exported, see the ExportMetadataTransactions method.

The following curl command exports all balance enquiry transactions that took place in the specified timeframe.

  curl -i -H "Authorization: Bearer $TOKEN" -d '
  {
    "parent":"projects/PROJECT_ID",
    "startTime":"2022-04-16T13:24:50.01Z",
    "endTime":"2022-04-16T13:24:59.90Z",
    "apiType":"BALANCE"
  }'
  -H "content-type: application/json" -X POST "https://ISSUER_SWITCH_API_ENDPOINT/v1/projects/PROJECT_ID/metadataTransactions:export"

In this example:

  • PROJECT_ID is the ID of your Google Cloud project.
  • $TOKEN is your OAuth 2.0 access token.
  • ISSUER_SWITCH_API_ENDPOINT is your issuer switch API endpoint. For example, api.129a0b1a-bb73-4906-a5b7-a6e0bfe7860e.issuerswitch.goog.

Replace these with values specific to your environment.

When you run the command on a terminal, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID"
  }

You can use the name returned in this response to poll the export operation [REST, gRPC]. When the export operation is complete, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID",
    "done": true,
    "response": {
      "@type": "type.googleapis.com/google.cloud.paymentgateway.issuerswitch.v1.ExportMetadataTransactionsResponse",
      "targetUri": "https://storage.cloud.google.com/BUCKET_ID/transactions/c8f9044c-5c66-4618-9518-a061834d9a9f.csv"
    }
  }

Export mandate transactions data

To export mandate transactions data using the issuer switch API, use the ExportMandateTransactions method [REST, gRPC].

In the request, specify a transaction type and a start and end time for the export. The transaction type that you specify must be one of the valid transaction types for the MANDATE API type. All transactions of the specified transaction type that were processed within the specified timeframe are exported as a single CSV file. If you don't specify a transaction type, all transactions of the MANDATE API type that were processed within the specified timeframe are exported. For information about the transaction details that are exported, see the ExportMandateTransactions method.

The following curl command exports all transactions that created a mandate in the specified timeframe.

  curl -i -H "Authorization: Bearer ${AUTHN_TOKEN}" -d '
  {
    "parent":"projects/PROJECT_ID",
    "startTime": "2022-05-17T18:00:00Z",
    "endTime": "2022-05-17T19:00:00Z",
    "transactionType": "TRANSACTION_TYPE_CREATE",
  }'
  -H "content-type: application/json" -X POST "https://ISSUER_SWITCH_API_ENDPOINT/v1/projects/PROJECT_ID/mandateTransactions:export"

In this example:

  • PROJECT_ID is the ID of your Google Cloud project.
  • $TOKEN is your OAuth 2.0 access token.
  • ISSUER_SWITCH_API_ENDPOINT is your issuer switch API endpoint. For example, api.129a0b1a-bb73-4906-a5b7-a6e0bfe7860e.issuerswitch.goog.

Replace these with values specific to your environment.

When you run the command on a terminal, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID"
  }

You can use the name returned in this response to poll the export operation [REST, gRPC]. When the export operation is complete, you see a response similar to the following:

  {
    "name": "projects/PROJECT_ID/operations/OPERATION_ID",
    "done": true,
    "response": {
      "@type": "type.googleapis.com/google.cloud.paymentgateway.issuerswitch.v1.ExportMandateTransactionsResponse",
      "targetUri": "https://storage.cloud.google.com/BUCKET_ID/transactions/c8f9044c-5c66-4618-9518-a061834d9a9f.csv"
    }
  }

Export complaint transactions data

To export complaint transactions data using the issuer switch API, use the ExportComplaintTransactions method [REST, gRPC].

In the request, specify a transaction type and a start and end time for the export. The transaction type that you specify must be one of the valid transaction types for the COMPLAINT API type. All transactions of the specified transaction type that were processed within the specified timeframe are exported as a single CSV file. If you don't specify a transaction type, all transactions of the COMPLAINT API type are exported. For information about the transaction details that are exported, see the ExportComplaintTransactions method.

The following curl command exports all complaint transactions that took place in the specified timeframe.

 curl -i -H "Authorization: Bearer $TOKEN" -d '
  {
  "parent": "projects/PROJECT_ID",
  "transactionType": "TRANSACTION_TYPE_COMPLAINT",
  "startTime": "2022-02-28T23:59:00.000Z",
  "endTime": "2022-03-28T23:59:59.000Z"
}'
  -H "content-type: application/json" -X POST "https://ISSUER_SWITCH_API_ENDPOINT/v1/projects/PROJECT_ID/complaintTransactions:export"

In this example:

  • PROJECT_ID is the ID of your Google Cloud project.
  • $TOKEN is your OAuth 2.0 access token.
  • ISSUER_SWITCH_API_ENDPOINT is your issuer switch API endpoint. For example, api.129a0b1a-bb73-4906-a5b7-a6e0bfe7860e.issuerswitch.goog.

Replace these with values specific to your environment.

When you run the command on a terminal, you see a response similar to the following:

{
  "name": "projects/PROJECT_ID/operations/OPERATION_ID",
}