@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Transaction Search
@base https://api-m.sandbox.paypal.com
@version 1.9
@auth OAuth2
@endpoints 2
@toc reporting(2)

@endpoint GET /v1/reporting/transactions
@desc List transactions
@required {start_date: str # Filters the transactions in the response by a start date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional., end_date: str # Filters the transactions in the response by an end date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days.}
@optional {transaction_id: str # Filters the transactions in the response by a PayPal transaction ID. A valid transaction ID is 17 characters long, except for an order ID, which is 19 characters long.Note: A transaction ID is not unique in the reporting system. The response can list two transactions with the same ID. One transaction can be balance affecting while the other is non-balance affecting., transaction_type: str # Filters the transactions in the response by a PayPal transaction event code. See [Transaction event codes](/docs/integration/direct/transaction-search/transaction-event-codes/)., transaction_status: str # Filters the transactions in the response by a PayPal transaction status code. Value is:Status&nbsp;codeDescriptionDPayPal or merchant rules denied the transaction.PThe transaction is pending. The transaction was created but waits for another payment process to complete, such as an ACH transaction, before the status changes to S.SThe transaction successfully completed without a denial and after any pending statuses.VA successful transaction was reversed and funds were refunded to the original sender., transaction_amount: str # Filters the transactions in the response by a gross transaction amount range. Specify the range as ` TO `, where `` is the lower limit of the gross PayPal transaction amount and `` is the upper limit of the gross transaction amount. Specify the amounts in lower denominations. For example, to search for transactions from $5.00 to $10.05, specify `[500 TO 1005]`.Note:The values must be URL encoded., transaction_currency: str # Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency., payment_instrument_type: str # Filters the transactions in the response by a payment instrument type. Value is either:CREDITCARD. Returns a direct credit card transaction with a corresponding value.DEBITCARD. Returns a debit card transaction with a corresponding value.If you omit this parameter, the API does not apply this filter., store_id: str # Filters the transactions in the response by a store ID., terminal_id: str # Filters the transactions in the response by a terminal ID., fields: str=transaction_info # Indicates which fields appear in the response. Value is a single field or a comma-separated list of fields. The transaction_info value returns only the transaction details in the response. To include all fields in the response, specify fields=all. Valid fields are:transaction_info. The transaction information. Includes the ID of the PayPal account of the payee, the PayPal-generated transaction ID, the PayPal-generated base ID, the PayPal reference ID type, the transaction event code, the date and time when the transaction was initiated and was last updated, the transaction amounts including the PayPal fee, any discounts, insurance, the transaction status, and other information about the transaction.payer_info. The payer information. Includes the PayPal customer account ID and the payer's email address, primary phone number, name, country code, address, and whether the payer is verified or unverified.shipping_info. The shipping information. Includes the recipient's name, the shipping method for this order, the shipping address for this order, and the secondary address associated with this order.auction_info. The auction information. Includes the name of the auction site, the auction site URL, the ID of the customer who makes the purchase in the auction, and the date and time when the auction closes.cart_info. The cart information. Includes an array of item details, whether the item amount or the shipping amount already includes tax, and the ID of the invoice for PayPal-generated invoices.incentive_info. An array of incentive detail objects. Each object includes the incentive, such as a special offer or coupon, the incentive amount, and the incentive program code that identifies a merchant loyalty or incentive program.store_info. The store information. Includes the ID of the merchant store and the terminal ID for the checkout stand in the merchant store., balance_affecting_records_only: str=Y # Indicates whether the response includes only balance-impacting transactions or all transactions. Value is either:Y. The default. The response includes only balance transactions.N. The response includes all transactions., page_size: int=100 # The number of items to return in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items. The combination of `page=2` and `page_size=20` returns the next 20 items., page: int=1 # The zero-relative start index of the entire list of items that are returned in the response. So, the combination of `page=1` and `page_size=20` returns the first 20 items.}
@returns(200) {transaction_details: [map], account_number: str, start_date: str(ppaas_date_time_v3), end_date: str(ppaas_date_time_v3), last_refreshed_datetime: str(ppaas_date_time_v3), page: int, total_items: int, total_pages: int, links: [map]} # A successful request returns the HTTP `200 OK` status code and a JSON response body that lists transactions .

@endpoint GET /v1/reporting/balances
@desc List all balances
@optional {as_of_time: str # List balances in the response at the date time provided, will return the last refreshed balance in the system when not provided., currency_code: str # Filters the transactions in the response by a [three-character ISO-4217 currency code](/api/rest/reference/currency-codes/) for the PayPal transaction currency.}
@returns(200) {balances: [map], account_id: str(ppaas_payer_id_v3), as_of_time: str(ppaas_date_time_v3), last_refresh_time: str(ppaas_date_time_v3)} # A successful request returns the HTTP `200 OK` status code and a JSON response body that lists balances .
@errors {400: The request is not well-formed, is syntactically incorrect, or violates schema., 403: Authorization failed due to insufficient permissions., 500: An internal server error occurred.}

@end
