# PayPal Initiate

This request initiates a PayPal transaction.
**Integration Methods:**
- Host Direct

See the [Integration Methods](/guides/quickstart#integration-methods) and [URLs Section](/guides/quickstart#urls) sections of the Development Quick Start guide for details regarding each processing option.

Endpoint: POST /paypal/initiate
Version: 1.7.68
Security: AccessToken

## Security:

  - `AccessToken` (unknown)
    apiKey in header AccessToken

## Header parameters:

  - `InterfaceVersion` (string, required)
    Refers to the version of the program or application that is sending requests to Shift4. The following special characters are not allowed:  $ % : ^ - ~ < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `InterfaceName` (string, required)
    Refers to the name of the program or application that is sending requests to Shift4. This should be the name of the program that you purchased or created. The following special characters are not allowed:  $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `CompanyName` (string, required)
    Refers to the vendor or partner that designed and certified the interface. The information you use in this field should match what Shift4 has on file or what was agreed upon in your Integration Plan. The following special characters are not allowed:  $ % : ^ - ~ ` < > , ? “ ” ‘ ’ { } [ ] \ + =

  - `AccessToken` (string, required)
    A security credential used to authenticate API requests and all [i4Go®](https://s4-myportal.s3.amazonaws.com/downloads/documentation/i4go/i4go%20technical%20reference%20guide.pdf) authorizeClient/preauthorizeClient requests. An Access Token is the alias for the merchant account and interface being used. The Access Token is required in all requests except an [Access Token Exchange](/apis/payments-platform-rest/openapi/credentials/accesstokenexchange) request, which generates an Access Token using an `authToken` and `clientGuid`.

## Request fields (application/json):

  - `amount` (object, required)

  - `amount.tax` (number, required)
    The amount of sales tax charged for a transaction. The tax amount is used by businesses to track tax expenses for accounting purposes. Identifying the tax amount also helps consumers understand the total amount that they were billed.  This field is part of Level 2 card data.
    Example: 15

  - `amount.total` (number, required)
    The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    Example: 160

  - `currencyCode` (string, required)
    Transaction currency code. See the [Currency Codes](/guides/appendices/currency-codes) section for details.
**Note: This is currently supported when processing for a merchant outside of the US and Canada. If processing for a US or Canadian merchant then this field will be ignored and the transaction will process in the merchant's configured currency.**
    Example: USD

  - `customer` (object, required)

  - `customer.addressLine1` (string, required)
    Cardholder’s street address exactly as it appears on their billing statement. This field is used in AVS.
    Example: 65 Easy St

  - `customer.city` (string, required)
    Customer address city.
    Example: Las Vegas

  - `customer.country` (string, required)
    2 character ISO Country Code. See the [ISO](https://www.iso.org/obp/ui/#search/code/) website for details.
    Example: US

  - `customer.emailAddress` (string, required)
    Customer email address.
    Example: john.smith@email.com

  - `customer.firstName` (string, required)
    Specifies a consumer’s first name. This field is used in AVS. If the interface sends this field, the value specified by the interface will be returned in the response, unless the API Option [USECARDNAME](/guides/appendices/api-options#usecardname) is included in the request and a Commerce Engine or UTG-controlled PIN pad is in use. If the interface does not send the `customer` object, the consumer's name will be returned in the `customer` object if the name is present in the card's EMV or track data.
    Example: John

  - `customer.lastName` (string, required)
    Specifies a consumer’s last name. This field is used in AVS. If the interface sends this field, the value specified by the interface will be returned in the response, unless the API Option [USECARDNAME](/guides/appendices/api-options#usecardname) is included in the request and a Commerce Engine or UTG-controlled PIN pad is in use. If the interface does not send the `customer` object, the consumer's name will be returned in the `customer` object if the name is present in the card's EMV or track data.
    Example: Smith

  - `customer.ipAddress` (string, required)
    Public source IP Address where the request originates, not the IP Address of the web server.
    Example: 63.57.84.101

  - `customer.phoneNumber` (string, required)
    Customer phone number
    Example: 3110001234

  - `customer.phoneCountry` (string, required)
    Country calling code of the phone number.
Required when sending `customer.phoneNumber`.
    Example: 1

  - `customer.region` (string, required)
    A level 2 country subdivision code according to ISO-3166-2.
    Example: NV

  - `customer.externalId` (string, required)
    Your external identifier for the Customer
    Example: OD-123

  - `customer.enrollDate` (string, required)
    Date of the user's first transaction in your system, regardless of payment  method used. The date and time must be passed in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm)
    Example: 2019-03-14T11:16:42.896-07:00

  - `dateTime` (string, required)
    The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm).
Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    Example: 2024-05-21T09:18:23.283-07:00

  - `sourceIp` (string, required)
    Public source IP Address where the request originates, not the IP Address of the web server.
    Example: 63.57.84.101

  - `transaction` (object, required)

  - `transaction.invoice` (string, required)
    10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway.
**Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.**
**For processing outside of the US and Canada alpha characters are allowed.**
    Example: 0510093358

  - `transaction.ota` (object)
    **Conditional: Utilize this object for Online Travel Agency transactions**

  - `transaction.ota.changeGuest` (string, required)
    Whether the guest (the person being served) is able to be changed. Fraudsters tend to pay for services that can change the guest.
    Enum: "Y", "N"

  - `transaction.ota.serviceEndDate` (string, required)
    OTA service end date  in YYYY-MM-DD format. A consumer booking a service such as a hotel for too many days elevates risk.
    Example: 2024-04-20

  - `transaction.ota.serviceStartDate` (string, required)
    OTA service start date in YYYY-MM-DD format. A service start date that is very close to the transaction date elevates risk.
    Example: 2024-04-18

  - `transaction.ota.startCity` (string, required)
    OTA start city.
    Example: Las Vegas

  - `transaction.ota.startCountry` (string, required)
    OTA start country in ISO 3166 Alpha-2 format.; for example, country where bus ticket was purchased.
    Example: US

  - `transaction.ota.startZipCode` (string, required)
    OTA start zip code.
    Example: 89134

  - `transaction.ota.type` (array, required)
    OTA transaction type array.
    Example: ["hotel","airline","trainticket"]

  - `transaction.vendorReference` (string, required)
    Optional field for information that can be searched in the merchant portal.
    Example: 12382-01

## Response 200:

  - `200` (unknown)
    Transaction was processed

## Response 200 fields (application/json):

  - `result` (array)

  - `result.amount` (object, required)

  - `result.amount.tax` (number, required)
    The amount of sales tax charged for a transaction. The tax amount is used by businesses to track tax expenses for accounting purposes. Identifying the tax amount also helps consumers understand the total amount that they were billed.  This field is part of Level 2 card data.
    Example: 15

  - `result.amount.total` (number, required)
    The amount being charged for a particular transaction. If other amount fields are sent, they must be included in the total amount. Amount cannot be zero.
    Example: 160

  - `result.dateTime` (string, required)
    The date and time in ISO 8601 format including the timezone offset (yyyy-mm-ddThh:mm:ss.nnn+hh:mm).
Must be sent as the local date/time of the merchant. For example, a request processed at a merchant in the Pacific time zone at 9:18am on April 15th 2021 would be sent as 2021-04-15T09:18:23.283-07:00
    Example: 2024-05-21T09:18:23.283-07:00

  - `result.payPal` (object, required)

  - `result.payPal.clientMetaDataId` (string)
    Identifier for completing risk check. Returned if `transaction.ota` is sent in the request.
    Example: 6f52ab38539f7e1037e8aa8e7b95407b

  - `result.payPal.clientToken` (string, required)
    A Base64 encoded string used to initialize client SDKs.
    Example: eyJ2ZXJzaW9uIjoyLCJhdXRob3JpemF0aW9uRmluZ2VycHJpbnQiOiJleUowZVhBaU9pSktWMVFpTENKaGJHY2lPaUpGVXpJMU5pSXNJbXRwWkNJNklqSXdNVGd3TkRJMk1UWXRjMkZ1WkdKdmVDSXNJbWx6Y3lJNkltaDBkSEJ6T2k4dllYQnBMbk5oYm1SaWIzZ3VZ…

  - `result.server` (object, required)

  - `result.server.name` (string, required)
    The name of the server that processed the request.
    Example: TM01CE

  - `result.transaction` (object, required)

  - `result.transaction.authSource` (string, required)
    In a response, a code returned by the processor to indicate which host issued the response.
| Value | Description |
|  --- | --- |
| E | Engine (Online) |
| O | Offline |
| A | APM (Online) |
| F | Payment Platform (Online) |
    Enum: "E", "O", "A", "F"

  - `result.transaction.invoice` (string, required)
    10-digit invoice number assigned by the interface to identify a transaction. An invoice number serves as a unique key that identifies a transaction within a batch in Shift4's Gateway.
**Note: For US and Canadian processing: Although the invoice number is sent as a JSON string it is a numeric value. No alpha characters are allowed.**
**For processing outside of the US and Canada alpha characters are allowed.**
    Example: 0510093358

  - `result.transaction.vendorReference` (string)
    Optional field for information that can be searched in the merchant portal.
    Example: 12382-01

