---
title: "Create Wallet transaction"
method: POST
path: "/wallets/{wallet_id}/wallet-transactions"
tags: ["Wallets"]
---

# Create Wallet transaction

`POST /wallets/{wallet_id}/wallet-transactions`

## Request

- Base URL: `https://api-m.sandbox.paypal.com`
- URL: `https://api-m.sandbox.paypal.com/wallets/{wallet_id}/wallet-transactions`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/api/oauth-proxy` scopes: `read`, `write`
- TypeScript: <https://skmtc.dev/paypal/apis/usage-based-billing-api/docs/wallets/:wallet_id/wallet-transactions/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `wallet_id` string, required

## Request body

- WalletTransactionRequest: Defines the request object to create a wallet transaction.
  - `type` 'TOPUP' | 'VOID', required: Type of the wallet transaction applied on the wallet. Supported types are TOPUP, VOID.
  - `paid_credits` string: Number of paid credits to be added. Applicable only to TOPUP type of transaction
  - `credits_to_void` string: Number of credits and Only for type VOID, this field need to be passed in request.
  - `granted_credits` string: Number of granted credits to be added. Applicable only to TOPUP type of transaction
  - `metadata` StringMap[]: List of key-value pair contains the metadata about the wallet transaction.
    - `key` string: Name of the key
    - `value` string: Value associated with the key

## Response `201`

Wallet transactions created successfully

- WalletTransactions: The get wallet transactions response contains list of wallet transactions for the specified wallet id.
  - `wallet_transactions` WalletTransaction[]: The list of wallet transactions for the specified wallet id
    - `wallet_transaction_id` string: Unique identifier for the wallet transaction
    - `wallet_id` string: Unique identifier for the wallet
    - `payment_status` 'PENDING' | 'SETTLED' | 'FAILED': The payment status of the wallet transaction. Possible values are `pending`, `settled` or `failed`.
    - `source` 'MANUAL' | 'INTERVAL' | 'THRESHOLD': The source field represents the origin or trigger of the wallet transaction. Possible values are `manual`, `interval`. `threshold`
    - `transaction_status` 'PURCHASED' | 'GRANTED' | 'VOIDED' | 'INVOICED': The transaction status of the wallet transaction. Possible values are `purchased` (with pending or settled status), `granted` (without invoice_id), `voided` or `invoiced`.
    - `transaction_type` 'INBOUND' | 'OUTBOUND': The type of transaction. Possible values are `inbound` (increasing the balance) or `outbound` (decreasing the balance).
    - `amount` object: Transaction amount involved in the specific wallet transaction.
      - `value` number, required: The amount value in the corresponding currency unit (e.g., two decimals for USD, no decimals for JPY).
      - `currency_code` string, required: Currency code in ISO 4217 format.
    - `credits` string: The number of credits used in the wallet transaction.
    - `settled_at` string, date-time: Date and time in ISO 8601 format.
    - `failed_at` string, date-time: Date and time in ISO 8601 format.
    - `created_at` string, date-time: Date and time in ISO 8601 format.
    - `metadata` StringMap[]: List of key-value pair contains the metadata about the wallet transaction.
      - `key` string: Name of the key
      - `value` string: Value associated with the key
  - `meta` object
    - `total_count` integer
    - `total_pages` integer
    - `current_page` integer
    - `next_page` integer: Next page.
    - `prev_page` integer: Previous page.

## Other responses

- `403`: Authorization failed due to insufficient permissions.
- `404`: Resource Not Found.
- `500`: Internal Server Error - An unexpected error occurred

---

[API](https://skmtc.dev/paypal/apis/usage-based-billing-api.md) - [All operations](https://skmtc.dev/paypal/apis/usage-based-billing-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paypal/apis/usage-based-billing-api/revisions/22fb46514ac4?raw)
