> ## Documentation Index
> Fetch the complete documentation index at: https://developer.uphold.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Venmo deposit via the REST API

> Fund a user's account from Venmo through the Uphold REST API.

This guide covers funding a user's account from Venmo using the REST API together with the Payment Widget. It handles both cases: **authorizing a new account** for the first time, and **depositing from an account the user already authorized**. Both run through the widget's `transaction:authorize` flow — your backend only creates the quote and the widget session.

> [!NOTE]
>
> Authorization always runs through the Payment Widget — for both new and already-authorized accounts. The widget collects Braintree **device data** and submits it with the transaction, which Venmo uses for fraud and risk analysis.

> [!NOTE]
>
> The transaction flows were renamed to the `<context>:<action>` format. The previous names still work, as aliases with the same behavior and `complete` payload, but they are **deprecated** and will be removed in a future release:
>
> | Deprecated name | New name |
> | - | - |
> | `select-for-deposit` | `transaction:select-deposit-origin` |
> | `select-for-withdrawal` | `transaction:select-withdrawal-destination` |
> | `authorize` | `transaction:authorize` |
>
> To migrate, change the `flow` of the Create session request and, with the Web SDK, the `PaymentWidget` generic type. See [Flows](https://developer.uphold.com/widgets/payment/flows.md#deprecated-flow-names).

## Prerequisites

* The user has [completed onboarding](https://developer.uphold.com/developer-guides/user-onboarding/introduction.md) and has a **verified phone number**.
* The `venmo` and `deposits` capabilities are enabled.
* The Payment Widget is set up in your frontend. See [Installation and setup](https://developer.uphold.com/widgets/payment/installation-and-setup.md).
* [Venmo's additional requirements](https://developer.uphold.com/developer-guides/apm-transfers/introduction.md#venmo) are met.
* The target browser or platform [supports Venmo](https://developer.uphold.com/developer-guides/apm-transfers/introduction.md#cross-platform-support).

## Walkthrough

The diagram shows a first-time authorization. For an already-authorized account, skip the sign-in — the widget only collects device data and reuses the stored authorization.

```mermaid theme={null}
sequenceDiagram
  autonumber
  participant Usr as User
  participant U as Your App
  participant B as Your Backend
  participant P as Payment Widget
  participant A as Uphold

  Usr->>U: Start deposit
  U->>B: Get rails and capabilities
  B->>A: GET /core/rails?type=apm
  A-->>B: { rails }
  B->>A: GET /core/capabilities
  A-->>B: { capabilities }
  B-->>U: { rails, capabilities }
  U->>B: Get accounts
  B->>A: GET /core/accounts
  A-->>B: { accounts }
  B-->>U: { accounts }
  Usr->>U: Select Venmo and destination account
  Usr->>U: Choose amount
  U->>B: Create quote
  B->>A: Create quote (APM → account)
  A-->>B: { quote }
  B-->>U: { quote }
  U->>B: Create authorize session
  B->>A: Create widget session (transaction:authorize)
  A-->>B: { session }
  B-->>U: { session }
  U->>P: Initialize widget
  Usr->>P: Sign in & authorize (first time only)
  P->>A: Create transaction
  A-->>P: { transaction }
  P-->>U: complete { transaction, trigger }
  B-->>Usr: Notify the user
```

***

## Check available rails

Call [List rails](https://developer.uphold.com/rest-apis/core-api/assets/list-rails.md) to verify Venmo deposit is available.

```http theme={null}
GET /core/rails?type=apm
```

```json theme={null}
{
  "rails": [
    {
      "type": "apm",
      "network": "venmo",
      "method": "venmo",
      "asset": "USD",
      "decimals": 2,
      "features": ["deposit", "withdraw"]
    }
  ]
}
```

## Check capabilities

Call [List capabilities](https://developer.uphold.com/rest-apis/core-api/capabilities/list-user-capabilities.md) to confirm the user has the `venmo` and `deposits` capabilities enabled with no unmet requirements.

```http theme={null}
GET /core/capabilities
```

```json theme={null}
{
  "capabilities": [
     {
      "code": "deposits",
      "name": "Deposit from other methods",
      "enabled": true,
      "requirements": [],
      "restrictions": []
    },
    {
      "code": "venmo",
      "name": "Venmo",
      "enabled": true,
      "requirements": [],
      "restrictions": []
    }
  ]
}
```

## Select destination account

Venmo deposits can target any account. If the selected account is not in the Venmo account's currency, the amount will be converted at settlement using Uphold's prevailing rate. Make sure the destination asset has the necessary [features enabled](https://developer.uphold.com/rest-apis/core-api/assets/overview.md#features-and-deposits-/-withdrawals).

### Find an existing account

Call [List accounts](https://developer.uphold.com/rest-apis/core-api/accounts/list-accounts.md) to retrieve the user's accounts and let them pick the one they want to fund.

```http theme={null}
GET /core/accounts
```

```json theme={null}
{
  "accounts": [
    {
      "id": "a00507fe-628c-4f27-ae81-e1c40b2a8fb8",
      "ownerId": "e4ce04dc-67b7-4e9f-af91-482cb6f9fc4a",
      "label": "My USD account",
      "asset": "USD",
      "balance": {
        "total": "500.00",
        "available": "500.00"
      },
      "createdAt": "2026-06-01T12:00:00Z",
      "updatedAt": "2026-06-01T12:00:00Z"
    }
  ]
}
```

### Create a new account

If the user has no accounts, create one with [Create account](https://developer.uphold.com/rest-apis/core-api/accounts/create-account.md) before proceeding.

```http theme={null}
POST /core/accounts
{
  "label": "My USD account",
  "asset": "USD"
}
```

```json theme={null}
{
  "account": {
    "id": "a00507fe-628c-4f27-ae81-e1c40b2a8fb8",
    "ownerId": "e4ce04dc-67b7-4e9f-af91-482cb6f9fc4a",
    "label": "My USD account",
    "asset": "USD",
    "balance": {
      "total": "0",
      "available": "0"
    },
    "createdAt": "2026-06-01T12:00:00Z",
    "updatedAt": "2026-06-01T12:00:00Z"
  }
}
```

***

## Create a quote

Call [Create quote](https://developer.uphold.com/rest-apis/core-api/transactions/create-quote.md) with Venmo as the origin and the user's account as the destination.

There are two ways to specify the Venmo origin:

* **`apm` shortcut** — use `type: "apm"` with `method: "venmo"`. This is always accepted, whether or not the user already has a linked Venmo account.
* **`external-account` reference** — if the user already has a linked Venmo account, you can reference it directly with `type: "external-account"` and its `id` (from [List external accounts](https://developer.uphold.com/rest-apis/core-api/external-accounts/list-external-accounts.md)):

  ```json theme={null}
  {
    "origin": {
      "type": "external-account",
      "id": "9d3cce5f-a448-f985-b64f-a62930b18eea"
    }
  }
  ```

The example below uses the `apm` shortcut.

```http theme={null}
POST /core/transactions/quote
{
  "origin": {
    "type": "apm",
    "method": "venmo"
  },
  "destination": {
    "type": "account",
    "id": "71e9fd4b-dfcd-4643-a5b0-51fd33e50a8d"
  },
  "denomination": {
    "asset": "USD",
    "amount": "50",
    "target": "origin"
  }
}
```

A successful response includes the quote details and a `requirements` array. If it contains `authorize:venmo`, the user must authorize Venmo before the transaction can be created.

```json [expandable] theme={null}
{
  "quote": {
    "id": "c3e8d2f7-9a41-4b75-b8e3-1d6f4a9c2e57",
    "origin": {
      "amount": "50.00",
      "asset": "USD",
      "node": {
        "type": "apm",
        "method": "venmo"
      },
      "rate": "1"
    },
    "destination": {
      "amount": "48.75",
      "asset": "USD",
      "node": {
        "type": "account",
        "id": "71e9fd4b-dfcd-4643-a5b0-51fd33e50a8d",
        "ownerId": "48e40cb2-6c34-44ce-b2f1-6adac459bb37"
      },
      "rate": "1"
    },
    "denomination": {
      "asset": "USD",
      "amount": "50.00",
      "target": "origin",
      "rate": "1"
    },
    "fees": [
      {
        "type": "deposit",
        "code": "alternative-payment-method-deposit",
        "asset": "USD",
        "amount": "1.25",
        "percentage": "2.50"
      }
    ],
    "requirements": [
      "authorize:venmo"
    ],
    "refreshAt": "2025-06-18T01:55:39Z",
    "expiresAt": "2025-06-18T01:55:39Z"
  }
}
```

***

## Present the order summary

Before creating the transaction, display an order summary of the quote — the amount, fees, and the origin and destination — so the user can review it. Here's an example:

![Venmo order summary](https://mintcdn.com/uphold-d4756e17/gaQw1kZVgC0BnpSf/developer-guides/apm-transfers/_media/venmo-deposit-transaction-preview.png?fit=max\&auto=format\&n=gaQw1kZVgC0BnpSf\&q=85\&s=5552910e07b801618a4f523523636647)

> [!NOTE]
>
> Quotes are short-lived. Use `refreshAt` to drive re-quoting: if the user hasn't confirmed by then, create a new quote and show the updated amounts, since there's no refresh endpoint. The quote's `expiresAt` is equal to or later than `refreshAt`, to give the user time to complete an external action needed to proceed, such as authorizing an APM payment.

***

## Authorize and create the transaction

After the user confirms the Venmo quote, hand off to the Payment Widget's `transaction:authorize` flow. It creates the transaction, runs the Venmo authorization, and polls until a terminal status is reached — so the same flow works for both new and already-authorized accounts.

### Create an authorize session

Call [Create widget session](https://developer.uphold.com/rest-apis/widgets-api/payment/create-session.md) to start the `transaction:authorize` flow, passing the `quoteId` and adding `authorize:venmo` to the `requirements` array. To customize the theme and layout, see [Create a session](https://developer.uphold.com/widgets/payment/installation-and-setup.md#1-create-a-session-on-your-backend).

```http theme={null}
POST /widgets/payment/sessions
{
  "flow": "transaction:authorize",
  "data": {
    "quoteId": "<quoteId>",
    "requirements": [
      "authorize:venmo"
    ]
  }
}
```

The response contains a `session` object with a `url` field that loads the widget. Return `response.session` to your frontend as is.

```jsonc theme={null}
{
  "session": {
    "url": "https://payment-widget.enterprise.uphold.com/?sessionToken=..."
    // ...
  }
}
```

### Set up the widget

Initialize the widget with the session. The widget interacts with Venmo, creates the transaction, and polls until a terminal status is reached. For a **new account** the user signs in to Venmo to authorize; for an **already-authorized account** they do not sign in again — the widget only collects device data and reuses the stored authorization.

```typescript Web SDK [expandable] theme={null}
import { PaymentWidget } from '@uphold/enterprise-payment-widget-web-sdk';

// session is `response.session` from your backend
const initializeAuthorizeWidget = async (session) => {
  const widget = new PaymentWidget<'transaction:authorize'>(session, { debug: true });

  widget.on('complete', (event) => {
    const { transaction, trigger } = event.detail.value;
    console.log('Complete', transaction.status, trigger.reason);
    widget.unmount();
  });

  widget.on('cancel', () => {
    console.log('Cancelled');
    widget.unmount();
  });

  widget.on('error', (event) => {
    console.error('Error', event.detail.error);
    widget.unmount();
  });

  widget.mountIframe(document.getElementById('payment-container'));
};
```

```javascript Without SDK [expandable] theme={null}
// session is `response.session` from your backend
async function initializeAuthorizeWidget(session) {
  const container = document.getElementById('payment-container');
  const sessionOrigin = new URL(session.url).origin;

  const iframe = document.createElement('iframe');
  iframe.src = session.url;
  iframe.setAttribute('allow', "clipboard-write 'src'; clipboard-read 'src';");
  iframe.style.width = '100%';
  iframe.style.height = '100%';
  iframe.style.border = 'none';

  function teardown() {
    window.removeEventListener('message', onMessage);
    iframe.remove();
  }

  function onMessage(event) {
    if (event.origin !== sessionOrigin) return;

    switch (event.data?.type) {
      case 'load':
        // Optional: repeat theme, layout, or authorize.mode from Create session to avoid a brief flash of defaults
        iframe.contentWindow.postMessage({ options: {}, type: 'init' }, sessionOrigin);
        break;
      case 'complete': {
        const { transaction, trigger } = event.data.value;
        console.log('Complete', transaction.status, trigger.reason);
        teardown();
        break;
      }
      case 'cancel':
        console.log('Cancelled');
        teardown();
        break;
      case 'error':
        console.error('Error', event.data.error);
        teardown();
        break;
    }
  }

  window.addEventListener('message', onMessage);
  container.appendChild(iframe);
}
```

> [!NOTE]
>
> Both examples above are for web applications — either creating the iframe yourself or letting the SDK do it. For native apps using a WebView, see [Native apps with the Web SDK](https://developer.uphold.com/widgets/payment/installation-and-setup.md#native-apps-with-the-web-sdk) for the SDK's native-bundling pattern, or [Setup without the SDK](https://developer.uphold.com/widgets/payment/installation-and-setup.md#setup-without-the-sdk) for the no-SDK approach that loads the session `url` directly as the WebView's top-level page.

### Handle the complete event

> [!WARNING]
>
> The `complete` event does not guarantee success. Always check `transaction.status` and `trigger.reason`.

```javascript Web SDK theme={null}
widget.on('complete', (event) => {
  const { transaction, trigger } = event.detail.value;

  if (trigger.reason === 'transaction-status-changed') {
    if (transaction.status === 'completed') {
      // Show success — the account is now authorized and the transfer settled
    } else if (transaction.status === 'failed') {
      // Map transaction.statusDetails.reason to a user-facing message
    }
  } else if (trigger.reason === 'max-retries-reached') {
    // Widget stopped polling — continue monitoring via webhooks or polling
  }

  widget.unmount();
});
```

```javascript Without SDK theme={null}
// Inside the onMessage switch from Set up the widget
case 'complete': {
  const { transaction, trigger } = event.data.value;

  if (trigger.reason === 'transaction-status-changed') {
    if (transaction.status === 'completed') {
      // Show success — the account is now authorized and the transfer settled
    } else if (transaction.status === 'failed') {
      // Map transaction.statusDetails.reason to a user-facing message
    }
  } else if (trigger.reason === 'max-retries-reached') {
    // Widget stopped polling — continue monitoring via webhooks or polling
  }

  teardown();
  break;
}
```

Failure reasons in `transaction.statusDetails.reason`:

| Reason | Description |
| - | - |
| `apm-authorization-failed` | The Venmo authorization could not be completed |
| `apm-payment-method-declined` | Venmo declined the payment method |
| `apm-account-holder-data-mismatch` | The account holder details did not match |
| `apm-missing-account-holder-data` | Required account holder details were missing |
| `insufficient-funds` | The origin account has insufficient funds |
| `provider-maximum-limit-exceeded` | The transaction exceeds provider limits |
| `velocity` | The transaction was blocked by velocity rules |
| `unspecified-error` | The transaction failed for an unspecified reason |

### Handle cancellations

The `cancel` event fires when the user navigates back without completing authorization.

```javascript Web SDK theme={null}
widget.on('cancel', () => {
  widget.unmount();
  // Return the user to the previous screen
});
```

```javascript Without SDK theme={null}
// Inside the onMessage switch from Set up the widget
case 'cancel':
  teardown();
  // Return the user to the previous screen
  break;
```

### Handle errors

The `error` event fires for critical unrecoverable errors.

On iOS Safari, when the `transaction:authorize` flow is opened inside an iframe, the Widget fires `error` with `code: 'venmo_not_available'` and `message: 'Venmo is not available.'`. Venmo is still available on iOS Safari when the Widget is the top-level page. See [Cross-platform support](https://developer.uphold.com/developer-guides/apm-transfers/introduction.md#cross-platform-support).

Most failures in this flow surface with a generic `code: 'error'` and a descriptive `message`. Transaction-creation failures are the exception: they use `code: 'authorize_transaction_failed'` with `event.detail.error.details.reason: 'unable-to-create-transaction'`. As with any Widget error, the original failure is preserved in [`event.detail.error.cause`](https://developer.uphold.com/widgets/payment/sdk-reference#error). For `unable-to-create-transaction`, it is the error of [Create transaction](https://developer.uphold.com/rest-apis/core-api/transactions/create-transaction.md), with the same `code` and `details` as in the [Request errors](#request-errors) table of the REST API guide, and the status in `httpStatusCode`.

```javascript Web SDK theme={null}
widget.on('error', (event) => {
  const { code, cause, details } = event.detail.error;
  console.error('Widget error:', code, details, cause);

  if (code === 'authorize_transaction_failed' && details?.reason === 'unable-to-create-transaction') {
    // The real reason is nested here, not in the top-level `code`
    console.error('Create transaction failed:', cause?.code);
  }

  widget.unmount();
  // Show a user-friendly error message
});
```

```javascript Without SDK theme={null}
// Inside the onMessage switch from Set up the widget
case 'error': {
  const { code, cause, details } = event.data.error;
  console.error('Widget error:', code, details, cause);

  if (code === 'authorize_transaction_failed' && details?.reason === 'unable-to-create-transaction') {
    console.error('Create transaction failed:', cause?.code);
  }

  teardown();
  // Show a user-friendly error message
  break;
}
```

> [!WARNING]
>
> The Payment Widget handles most errors internally. For unrecoverable errors, the widget fires an `error` event. It is the host application's responsibility to handle these events, present an error message to the user, and unmount the widget.

***

## Monitor for settlement

Venmo deposit transactions remain in `processing` while the payment settles. Monitor until the transaction reaches a terminal state.

* **Webhook events** (recommended):
  * [core.transaction.created](https://developer.uphold.com/rest-apis/core-api/transactions/webhooks/transaction-created.md) — `status: processing` → transaction created, pending settlement
  * [core.transaction.status-changed](https://developer.uphold.com/rest-apis/core-api/transactions/webhooks/transaction-status-changed.md) — `status: completed` → funds settled; `status: failed` → irrecoverable error
* **Polling** (fallback): [Get transaction](https://developer.uphold.com/rest-apis/core-api/transactions/get-transaction.md)

***

## Sample transaction

In a successful Venmo deposit, the origin is the external account representing the user's Venmo account and the destination is the user's `account`.

```json [expandable] theme={null}
{
  "transaction": {
    "id": "9b2f4a17-5e3c-4d77-a8e1-9bcdef2c0a42",
    "origin": {
      "asset": "USD",
      "amount": "50.00",
      "node": {
        "type": "external-account",
        "via": "apm",
        "id": "90acb64a-510d-f9d1-b542-d44e6c53eb5d",
        "ownerId": "48e40cb2-6c34-44ce-b2f1-6adac459bb37"
      }
    },
    "destination": {
      "asset": "USD",
      "amount": "48.75",
      "node": {
        "type": "account",
        "id": "71e9fd4b-dfcd-4643-a5b0-51fd33e50a8d",
        "ownerId": "48e40cb2-6c34-44ce-b2f1-6adac459bb37"
      }
    },
    "status": "completed",
    "quotedAt": "2025-06-18T00:55:39Z",
    "createdAt": "2025-06-18T00:56:39Z",
    "updatedAt": "2025-06-18T00:57:08Z",
    "denomination": {
      "asset": "USD",
      "amount": "50.00",
      "target": "origin"
    },
    "fees": []
  }
}
```

***

## Notify the user

After the transaction completes, display the transaction details to the user so they can confirm the deposit succeeded. It must include the **Venmo logo and the Venmo account used**. Here's an example:

![Venmo transaction completed confirmation](https://mintcdn.com/uphold-d4756e17/gaQw1kZVgC0BnpSf/developer-guides/apm-transfers/_media/venmo-deposit-transaction-completed.png?fit=max\&auto=format\&n=gaQw1kZVgC0BnpSf\&q=85\&s=601e5b56b9ba2ba469abc9097fa60187)

***

> [!TIP]
>
> You now support Venmo deposits via the REST API together with the Payment Widget.

## Request errors

[Create quote](https://developer.uphold.com/rest-apis/core-api/transactions/create-quote.md) and [Create transaction](https://developer.uphold.com/rest-apis/core-api/transactions/create-transaction.md) reject a request with an HTTP error when it can't go ahead, in which case no transaction is created. The table only lists the errors your integration should act on, such as by showing the user a message. The other errors usually point to an issue in your integration. See the API reference of each endpoint for the full list. The Payment Widget creates the transaction, so errors from creating it reach you through its `error` event instead: an `authorize_transaction_failed` error whose `event.detail.error.cause` is the original error, with the status in `httpStatusCode` and the same `code` and `details` as in the table. Errors from creating the quote are returned to your backend as usual.

| Error | Cause | Recommended action |
| - | - | - |
| `409 user_capability_failure` | The user can't make the deposit, for example without the `deposits` capability, or without the capability of this payment method, such as `paypal`. `details.capability` lists the `requirements` to complete and the `restrictions` that apply. | Have the user complete the requirements, or explain the restriction. |
| `409 transaction_amount_invalid` (`minimum-limit-not-met`, `maximum-limit-exceeded`) | The amount is below the minimum or above the maximum of a single deposit. | Show the limit from `details.limit` and ask for another amount. |
| `409 transaction_amount_invalid` (`amount-exceeds-daily-limit`, `amount-exceeds-weekly-limit`, `amount-exceeds-monthly-limit`) | The amount exceeds the user's limit for the period. | Show the `details.limit.remainingAmount` and ask for a lower amount. |
| `409 operation_not_allowed` with a [transaction status reason](https://developer.uphold.com/rest-apis/core-api/transactions/get-transaction.md), such as `apm-authorization-failed` or `apm-payment-method-declined` | When creating the transaction, the payment failed. | Handle it as the matching [failure reason](#failure-reasons). |
| `409 operation_not_allowed` (`duplicate-deposit`) | When creating the transaction, the same quote was already being committed, for example after a double submit. | Don't retry. Follow the transaction of the first request instead. |
| `409 operation_not_allowed` (`country-restricted-transaction`) | The deposit isn't allowed for the user's country. | Tell the user the deposit isn't available to them. |
| `404 entity_not_found` (`entity: "quote"`) | When creating the transaction, the quote expired or no longer exists. | Create a new quote and ask the user to confirm again. |
| `409 operation_not_allowed` (`quote-rate-variance-not-allowed`) | When creating the transaction, the rate moved too far from the rate of the quote. | Create a new quote and ask the user to confirm again. |
| `409 operation_not_allowed` (`unspecified-error`) | The request failed for another reason. | Show a generic error, and ask the user to try again or contact support. |

## Failure reasons

A transaction that was created can still fail afterwards: its `status` becomes `failed`, or `on-hold` when information is requested, and `statusDetails.reason` says why. You learn about it through the [`core.transaction.status-changed`](https://developer.uphold.com/rest-apis/core-api/transactions/webhooks/transaction-status-changed) webhook, or by polling [Get transaction](https://developer.uphold.com/rest-apis/core-api/transactions/get-transaction.md). The table only lists the reasons your integration should act on, such as by notifying the user.

| Reason | Cause | Recommended action |
| - | - | - |
| `apm-authorization-failed`, `apm-payment-method-declined` | The payment provider didn't authorize the deposit, or declined the payment method. | Ask the user to try another payment method. |
| `apm-account-holder-data-mismatch`, `apm-missing-account-holder-data` | The payment provider couldn't match the account holder details. | Ask the user to check their account details and try again. |
| `provider-maximum-limit-exceeded` | The amount exceeds what the payment provider allows. | Ask the user to try a lower amount. |
| `velocity` | Too many transactions were made in a short time. | Ask the user to try again later. |
| `unspecified-error` | The transaction failed for another reason. | Tell the user the transaction failed, and ask them to try again or contact support. |
