---
title: "Initiate Pay by PayPal"
method: POST
path: "/v2/moneyins/paypal/init"
tags: ["MoneyIns | PayPal"]
---

# Initiate Pay by PayPal

`POST /v2/moneyins/paypal/init`

## Request

- Base URL: `https://ws.lemonway.fr/mb/env-name/prod/directkitrest`
- URL: `https://ws.lemonway.fr/mb/env-name/prod/directkitrest/v2/moneyins/paypal/init`
- Auth: none declared. Required headers: `Authorization`, `PSU-IP-Address`

Lets you integrate PayPal payments on your platform. The integration is implemented as a standard web page redirect to PayPal.com, it enables buyers to login to their accounts and make a payment to your organization.

## Headers

- `Authorization` string, required
- `PSU-Accept-Language` string
- `PSU-IP-Address` string, required
- `PSU-User-Agent` string

## Request body

- InitPayPalTransactionInput: Init PayPal transaction input
  - `redirections` Redirections, required: Redirection urls
    - `returnUrl` string, required: Return URL
    - `errorUrl` string, required: Error URl
    - `cancelUrl` string, required: Cancel URL
  - `transaction` Transaction, required: Transcation
    - `reference` string, required: Reference
    - `accountId` string, required: Account Id
    - `totalAmount` integer, required: Total Amount
    - `commissionAmount` integer, required: Commission Amount
    - `comment` string: Comment
    - `autoCommission` boolean: Auto Commission
    - `isPreAuth` boolean
    - `captureMode` 1 | 2: Specifies the capture mode for the payment: Automatic results in a Capture type, and Manual results in an Authorize type.<br/>1 = Automatic.<br/>2 = Manual.<br/>
  - `amountBreakdown` AmountBreakdown: The amount breakdown.
    - `totalItems` integer: The subtotal for all items.
    - `totalItemTaxes` integer: The total tax for all items.
    - `shipping` integer: The shipping fee for all items.
    - `handling` integer: The handling fee for all items.
    - `insurance` integer: The insurance fee for all items.
    - `shippingDiscount` integer: The shipping discount for all items.
    - `discount` integer: The discount for all items.
  - `delivery` Delivery: Delivery
    - `receiver` Receiver, required: Receiver
      - `fullName` string, required: Full name
    - `address` PaypalDeliveryAddress, required: Address
      - `country` string, required: ISO 3166-1 alpha-2
      - `city` string, required: City
      - `street` string, required: Number and street
      - `postCode` string, required: Postcode/ZIP
      - `state` string: Postcode/ZIP
  - `items` PurchaseItem[], required: Items
    - `merchantAccountId` string, required: Merchant account id
    - `description` string, required: Description
    - `quantity` integer, required: Quantity
    - `unitAmount` integer, required: Unit amount
    - `type` 1 | 2, required: Type<br/>1 = Physical.<br/>2 = Digital.<br/>
    - `taxAmount` integer: Tax amount
  - `riskData` object: Risk data

## Response `200`

OK

- InitPayPalTransactionOutput: Init PayPal transaction Output
  - `id` integer, required: Money-in Id
  - `redirectionUrl` string, required: Redirection Url
  - `payPalOrderId` string, required: PayPal Order Id
  - `error` Error
    - `code` integer
    - `message` string
    - `psp` PSP
      - `message` string: Get the Error Message from PSP

## Other responses

- `401`: Unauthorized
- `500`: InternalServerError

---

[API](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0.md) - [All operations](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0/llms.txt) - [OpenAPI document](https://skmtc.dev/lemonway/apis/lemonway-directkit-api-2-0/revisions/82551a0a77b8?raw)
