External Accounts

External accounts are links to app stores from which sales and other data is imported. The /external_accounts resource provides complete control and allows retrieving, updating, adding, and deleting external_accounts.

For a complete list of supported stores check out the integrations page.

Listing existing accounts

Request

GET /external_accounts

Scope: This resource requires the account:read scope.

Example Response

// GET /external_accounts

{
  "50956": {
    "id": 50956,
    "account_id": 100101,
    "nickname": "Main iTunes",
    "username": "johnny@me.com",
    "auto_import": true,
    "store_id": 1,
    "store": "apple",
    "metadata": {
      "vendor_id": 85261205
    }
  },
  "31174": {
    "id": 31174,
    "account_id": 100101,
    "nickname": "Android apps",
    "username": "coolapps@gmail.com",
    "auto_import": true,
    "store_id": 2,
    "store": "google_play",
    "metadata": {
    }
  },
  ...
}

Looking up one account

Request

GET /external_accounts/{external_account_id}

Scope: This resource requires the account:read scope.

Example Response

// GET /external_accounts/31174

{
    "id": 31174,
    "account_id": 100101,
    "nickname": "Android apps",
    "username": "coolapps@gmail.com",
    "auto_import": true,
    "store_id": 2,
    "store": "google_play".
    "metadata": {
    }
}

Creating a new external account

Request

POST /external_accounts/

Scope: This resource requires the account:write scope.

Arguments

Arguments should be passed in as a JSON object in the body of your request.

Argument Type Description
nickname String A friendly name for this account
username String The username to the app store’s account
password String The password to the app store account
auto_import Bool true or false to import report for this account automatically
store String The type of account being linked. Possible options: apple, google_play, amazon. More types will be available in the future
metadata JSON Additional information related to this account. Currently, the only supported value is `vendor_id` for App Store Connect accounts. All other account types will have an empty object.

Example Request

// POST /external_accounts/31174

{
  "nickname": "A new account",
  "username": "myusername",
  "password": "p455w0rd!"
  "auto_import": true,
  "store": "apple"
}

Example Response

// POST /external_accounts/31174

{
    "id": 31175,
    "account_id": 100101,
    "nickname": "A new account",
    "username": "myusername",
    "auto_import": true,
    "store_id": 1,
    "store": "apple"
}

Updating an external account

Request

PUT /external_accounts/{accountId}

Scope: This resource requires the account:write scope.

Arguments

Arguments should be passed in as a JSON object in the body of your request.

Argument Type Description
nickname String A friendly name for this account
username String The username to the app store’s account
password String The password to the app store account
auto_import String true or false to import report for this account automatically

Example Request

// GET /external_accounts/31175

{
    "id": 31175,
    "nickname": "Games Account",
    "username": "awesomegames@me.com",
    "auto_import": true,
    "store": "apple"
}
// PUT /external_accounts/31175

{
    "nickname": "A new Nickname(Games Account)",
    "username": "awesomegames+edited@me.com",
    "password": "ipl4yallth3timexx",
    "auto_import": false,
    "store": "apple"
}

Example Response

// PUT /external_accounts/31175  with above request body

{
    "id": 31175,
    "nickname": "A new Nickname(Games Account)",
    "username": "awesomegames+edited@me.com",
    "auto_import": false,
    "store": "apple"
}

Deleting an external account

Request

DELETE /external_account/{id}

Scope: This resource requires the account:write scope.

Arguments

id
The ID of the external account to delete

Example Response

// DELETE /external_accounts/90438
// HTTP 204

Note: Deleting an external account will not remove products or data associated with it.