Activities Integration Guide

Use the Activities API to list the financial activities for a user. Activities are records for all payments, currency transfers, money conversions, requests for payments, and promises of payments.

Important: The Activities API is a limited-release solution at this time. It is available to select partners for approved cases. For more information, reach out to your PayPal account manager or contact us.

To filter or limit the size of the list, you can specify one or more query parameters.

The API provides detailed financial activity information, including the financial activity amount and its type and currency, and the activity time and counterparty information.

Integration steps

1. Required Meet the prerequisites.
2. Optional List activities.

Prerequisites

Before you can use the Activities API, you must make your first call and learn about HTTP request headers. If you are a non-US developer, see International Developer Questions.

To list activities for users, you must pass a valid user access token that corresponds to the user's activity history consent.

Important: You cannot run the following sample requests as-is. Replace all call-specific parameter values, such as tokens and IDs, with your own values.

List activities

Lists activities based on the information and filters passed in the request.

  • If you omit a date range or other filters, the response lists all available activities for the last 90 days.
  • If you include only a start and end date, the response lists all available activities for the specified date range.
  • The default number of activities is 30.

Query parameters

Parameter Type Description
start_time string Filters the list by a time range. The start_time is the lower bound of the time range in Internet date and time format. The start_time cannot be greater than one year before the end_time. Default is the end_time value minus 30 days.
end_time string Filters the list by a time range. The end_time is the upper bound of the time range in Internet date and time format. Default is the current time.
next_page_token number The zero-relative start index of the list of items in the response. So, the combination of next_page_token=1 and page_size=20 returns the first 20 items.
page_size integer The number of items to return in the list. The maximum value is 150.

Example

This example request specifies a start and end date and time and a page size of 10:

curl -v -X GET https://api.sandbox.paypal.com/v1/activities/activities?start_time=2012-01-01T00:00:01.000Z&end_time=2014-10-01T23:59:59.999Z&page_size=10 \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token"

The response lists all possible activities for the date range:

{
  "items": [
  {
    "extensions":
    {
      "payment_properties":
      {
        "debit_credit_code": "CREDIT"
      }
    },
    "status": "COMPLETED",
    "subtype": "REFUND",
    "gross":
    {
      "currency_code": "JPY",
      "value": "5000"
    },
    "counterparty":
    {
      "email": "buyer@example.com",
      "name": "Jennifer McVittie"
    },
    "id": "74M09958P9936162T",
    "fee":
    {
      "currency_code": "JPY",
      "value": "0"
    },
    "net":
    {
      "currency_code": "JPY",
      "value": "5000"
    },
    "activity_type": "PAYMENT",
    "time_created": "2013-10-29T22:41:08.000Z"
  },
  {
    "extensions":
    {
      "payment_properties":
      {
        "debit_credit_code": "DEBIT"
      }
    },
    "status": "DENIED",
    "subtype": "PAYMENT",
    "gross":
    {
      "currency_code": "JPY",
      "value": "5000"
    },
    "counterparty":
    {
      "email": "buyer@example.com",
      "name": "Jennifer McVittie"
    },
    "id": "8B290053Y34018504",
    "fee":
    {
      "currency_code": "JPY",
      "value": "0"
    },
    "net":
    {
      "currency_code": "JPY",
      "value": "5000"
    },
    "activity_type": "PAYMENT",
    "time_created": "2013-10-29T22:40:53.000Z"
  },
  {
    "extensions":
    {
      "payment_properties":
      {
        "debit_credit_code": "CREDIT"
      }
    },
    "gross":
    {
      "currency_code": "USD",
      "value": "85.00"
    },
    "counterparty":
    {
      "name": "PayPal"
    },
    "subtype": "BONUS",
    "status": "COMPLETED",
    "fee":
    {
      "currency_code": "USD",
      "value": "0.00"
    },
    "net":
    {
      "currency_code": "USD",
      "value": "85.00"
    },
    "id": "6YH431316S832112L",
    "time_created": "2017-04-18T03:31:54.000Z"
  }]
}

Additional information

Feedback