# CreatePaymentRequest

**amount**int32required

Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge 1.00 USD).

**Example:<!-- -->&#x20;**`110`

**currency**Payment-Currencyrequired

Three-letter [ISO currency code](https://en.wikipedia.org/wiki/ISO_4217), in uppercase. Must be a supported currency.

**Example:<!-- -->&#x20;**`EUR`

**orderId**Payment-OrderIdrequired

An order ID from your system. A unique identifier that can be used to reconcile the payment with your internal system.

**Example:<!-- -->&#x20;**`14379133960355`

**callbackUrl**Payment-CallbackUrl

The URL to which a payment result should be sent asynchronously.

**Example:<!-- -->&#x20;**`https://example.com/checkout/callback`

**completeUrl**Payment-CompleteUrl

The URL the customer will be directed to after transaction completed (successful or failed - except if `failUrl` is provided).

**Example:<!-- -->&#x20;**`https://example.com/checkout/complete`

**failUrl**Payment-FailUrl

The URL the customer will be directed to after transaction has failed, instead of `completeUrl` (used in hosted payment page). This allows to provide two different URLs for successful and failed payments.

**Example:<!-- -->&#x20;**`https://example.com/checkout/fail`

**cancelUrl**Payment-CancelUrl

The URL the customer will be directed to if they decide to cancel payment and return to your website (used in hosted payment page).

**Example:<!-- -->&#x20;**`https://example.com/checkout/cancel`

**paymentToken**Payment-PaymentToken

A payment token generated by monei.js [Components](https://docs.monei.com/monei-js/overview/) or a paymentToken [saved after a previous successful payment](https://docs.monei.com/guides/save-payment-method/). In case of the first one, you will also need to send the `sessionId` used to generate the token in the first place.

**Example:<!-- -->&#x20;**`7cc38b08ff471ccd313ad62b23b9f362b107560b`

**sessionId**Payment-SessionId

A unique identifier within your system that adds security to the payment process. You need to pass the same session ID as the one used on the frontend to initialize MONEI Component (if you needed to). This is required if a payment token (not permanent) was already generated in the frontend.

**Example:<!-- -->&#x20;**`39603551437913`

**generatePaymentToken**Payment-GeneratePaymentToken

If set to true a permanent token that represents a payment method used in the payment will be generated.

**Default value:<!-- -->&#x20;**`false`

**Example:<!-- -->&#x20;**`false`

**paymentMethod** <!-- -->object

An information about a payment method used for this payment. We recommend using `paymentToken` instead, as it is more secure way to pass sensitive payment information. Processing credit card information on your server requires [PCI DSS compliance](https://www.investopedia.com/terms/p/pci-compliance.asp).

**card** <!-- -->object

Details about the card used as payment method. If provided, MONEI will try to confirm the payment directly.

**number**string

The card number, as a string without any separators.

**cvc**string

Card security code.

**expMonth**string

Two-digit number representing the card's expiration month.

**expYear**string

Two-digit number representing the card's expiration year.

**cardholderName**CardholderName

The cardholder's name, as stated in the credit card.

**Example:<!-- -->&#x20;**`John Doe`

**cardholderEmail**CardholderEmail

The cardholder's email address.

**Example:<!-- -->&#x20;**`john.doe@monei.com`

**bizum** <!-- -->object

Details about the Bizum account used for this payment. If provided phone number is valid and registered in Bizum, MONEI will try to confirm the payment directly.

**phoneNumber**string

Phone number in E.164 format used to pay with `bizum`.

**Example:<!-- -->&#x20;**`null`

**allowedPaymentMethods**string\[]

An array of allowed payment methods (used in hosted payment page). Must be enabled payment methods.

| Enum Value  | Description                                                      |
| ----------- | ---------------------------------------------------------------- |
| alipay      | Alipay                                                           |
| card        | Card                                                             |
| bizum       | Bizum                                                            |
| paypal      | PayPal                                                           |
| mbway       | MB WAY                                                           |
| multibanco  | Multibanco                                                       |
| iDeal       | iDEAL                                                            |
| bancontact  | Bancontact                                                       |
| sofort      | SOFORT                                                           |
| trustly     | Trustly                                                          |
| sepa        | SEPA                                                             |
| klarna      | Klarna                                                           |
| giropay     | Giropay                                                          |
| eps         | EPS                                                              |
| blik        | BLIK                                                             |
| cardPresent | Card-present (in-person) payment captured at a physical terminal |
| googlePay   | Google Pay digital wallet                                        |
| applePay    | Apple Pay digital wallet                                         |
| clickToPay  | Click to Pay (card-network-hosted wallet)                        |
| srtp        | SEPA Request-to-Pay                                              |

**Example:<!-- -->&#x20;**`["card","bizum","paypal"]`

**transactionType**Payment-TransactionType

Controls when the funds will be captured.

| Enum Value | Description                                                                  |
| ---------- | ---------------------------------------------------------------------------- |
| SALE       | Automatically captures funds when the customer authorizes the payment        |
| AUTH       | Places a hold on funds without immediate capture, allowing for later capture |
| PAYOUT     | Sends funds to the customer                                                  |
| VERIF      | Verifies the payment method without placing a hold or capturing funds        |

**Possible values:** \[`SALE`, `AUTH`, `PAYOUT`, `VERIF`]

**Default value:<!-- -->&#x20;**`SALE`

**Example:<!-- -->&#x20;**`SALE`

**sequence** <!-- -->object

This field needs to be sent in order to mark the beginning of a sequence of payments (recurring/subscriptions, installments, and so). Specific configurations can be set in the inside properties (`recurring`).

**type**stringrequired

**Possible values:** \[`recurring`]

**Example:<!-- -->&#x20;**`recurring`

**recurring** <!-- -->object

Specific configurations for recurring payments. Will only be used when `sequence`.`type` is `recurring`.

**expiry**string

Date after which no further recurring payments will be performed. Must be formatted as `YYYYMMDD`.

**Default value:<!-- -->&#x20;**`*(The payment method or card expiration)*`

**Example:<!-- -->&#x20;**`20210630`

**frequency**int32

The minimum number of **days** between the different recurring payments.

**Default value:<!-- -->&#x20;**`25`

**Example:<!-- -->&#x20;**`30`

**storeId**Payment-StoreId

A unique identifier of the Store. If specified the payment is attached to this Store.

**Example:<!-- -->&#x20;**`e5f28150d9e8974c58ab5ec9c4a880f8734dcf05`

**pointOfSaleId**Payment-PointOfSaleId

A unique identifier of the Point of Sale. If specified the payment is attached to this Point of Sale. If there is a QR code attached to the same Point of Sale, this payment will be available by scanning the QR code.

**Example:<!-- -->&#x20;**`fb269cccfa0cc021f5d0b8eb1421646c696213e1`

**subscriptionId**Payment-SubscriptionId

A unique identifier of the Subscription. If specified the payment is attached to this Subscription.

**Example:<!-- -->&#x20;**`575bcd84-09fc-4a6e-8c4c-f88b8eb90bfa`

**autoRecover**Payment-AutoRecover

If set to `true`, the new payment will be automatically created when customer visits the payment link of the previously failed payment. Is automatically set to `true` if `completeUrl` is not provided.(set this value to `true` to create "Pay By Link" payments).

**Example:<!-- -->&#x20;**`false`

**description**Payment-Description

An arbitrary string attached to the payment. Often useful for displaying to users.

**Example:<!-- -->&#x20;**`Test Shop - #84370745531439`

**customer** <!-- -->object

**email**string

The customer's email address.

**Example:<!-- -->&#x20;**`john.doe@example.com`

**name**string

The customer's full name or business name.

**Example:<!-- -->&#x20;**`John Doe`

**phone**string

The customer's phone number in E.164 format.

**Example:<!-- -->&#x20;**`null`

**billingDetails** <!-- -->object

Billing information associated with the payment method at the time of the transaction.

**name**string

The customer's billing full name.

**Example:<!-- -->&#x20;**`John Doe`

**email**string

The customer's billing email address.

**Example:<!-- -->&#x20;**`john.doe@example.com`

**phone**string

The customer's billing phone number in E.164 format.

**Example:<!-- -->&#x20;**`null`

**company**string

Billing company name.

**Example:<!-- -->&#x20;**`null`

**taxId**string

Company tax ID.

**Example:<!-- -->&#x20;**`null`

**address** <!-- -->object

**country**Country

Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).

**Example:<!-- -->&#x20;**`ES`

**city**string

City, district, suburb, town, or village.

**Example:<!-- -->&#x20;**`Málaga`

**line1**string

Address line 1 (e.g., street, PO Box, or company name).

**Example:<!-- -->&#x20;**`Fake Street 123`

**line2**string

Address line 2 (e.g., apartment, suite, unit, or building).

**Example:<!-- -->&#x20;**`null`

**zip**string

ZIP or postal code.

**Example:<!-- -->&#x20;**`1234`

**state**string

State, county, province, or region.

**Example:<!-- -->&#x20;**`Málaga`

**shippingDetails** <!-- -->object

Shipping information associated with the payment.

**name**string

The shipping customer's full name.

**Example:<!-- -->&#x20;**`John Doe`

**email**string

The shipping customer's email address.

**Example:<!-- -->&#x20;**`john.doe@example.com`

**phone**string

The shipping customer's phone number in E.164 format.

**Example:<!-- -->&#x20;**`null`

**company**string

Name of the company where the shipment is going.

**Example:<!-- -->&#x20;**`null`

**taxId**string

Company tax ID.

**Example:<!-- -->&#x20;**`null`

**address** <!-- -->object

**country**Country

Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).

**Example:<!-- -->&#x20;**`ES`

**city**string

City, district, suburb, town, or village.

**Example:<!-- -->&#x20;**`Málaga`

**line1**string

Address line 1 (e.g., street, PO Box, or company name).

**Example:<!-- -->&#x20;**`Fake Street 123`

**line2**string

Address line 2 (e.g., apartment, suite, unit, or building).

**Example:<!-- -->&#x20;**`null`

**zip**string

ZIP or postal code.

**Example:<!-- -->&#x20;**`1234`

**state**string

State, county, province, or region.

**Example:<!-- -->&#x20;**`Málaga`

**sessionDetails** <!-- -->Payment-SessionDetails

Information related to the browsing session of the user who initiated the payment.

**ip**IP

The IP address where the operation originated.

**Example:<!-- -->&#x20;**`100.100.200.100`

**countryCode**Country

Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).

**Example:<!-- -->&#x20;**`ES`

**lang**Lang

Two-letter language code ([ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1)).

**Example:<!-- -->&#x20;**`es`

**deviceType**DeviceType

Device type, could be `desktop`, `mobile`, `smartTV`, `tablet`.

**Example:<!-- -->&#x20;**`desktop`

**deviceModel**DeviceModel

Information about the device used for the browser session (e.g., `iPhone`).

**Example:<!-- -->&#x20;**`null`

**browser**Browser

The browser used in this browser session (e.g., `Mobile Safari`).

**Example:<!-- -->&#x20;**`Chrome`

**browserVersion**BrowserVersion

The version for the browser session (e.g., `13.1.1`).

**Example:<!-- -->&#x20;**`83.0.4103.116`

**os**Os

Operation system (e.g., `iOS`).

**Example:<!-- -->&#x20;**`Mac OS`

**osVersion**OsVersion

Operation system version (e.g., `13.5.1`).

**Example:<!-- -->&#x20;**`10.15.4`

**source**Source

The source component from where the operation was generated (mostly for our SDK's).

**Example:<!-- -->&#x20;**`MONEI/PHP`

**sourceVersion**SourceVersion

The source component version from where the operation was generated (mostly for our SDK's).

**Example:<!-- -->&#x20;**`0.1.2`

**userAgent**UserAgent

Full user agent string of the browser session.

**Example:<!-- -->&#x20;**`Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...`

**browserAccept**BrowserAccept

Browser accept header.

**Example:<!-- -->&#x20;**`text/html,application/xhtml+xml,application/json`

**browserColorDepth**BrowserColorDepth

The color depth of the browser session (e.g., `24`).

**Example:<!-- -->&#x20;**`24`

**browserScreenHeight**BrowserScreenHeight

The screen height of the browser session (e.g., `1152`).

**Example:<!-- -->&#x20;**`1152`

**browserScreenWidth**BrowserScreenWidth

The screen width of the browser session (e.g., `2048`).

**Example:<!-- -->&#x20;**`2048`

**browserTimezoneOffset**BrowserTimezoneOffset

The timezone offset of the browser session (e.g., `-120`).

**Example:<!-- -->&#x20;**`-120`

**expireAt**int64

Payment expiration time.

**Example:<!-- -->&#x20;**`1663581391`

**metadata**object

A set of key-value pairs that you can attach to a resource. This can be useful for storing additional information about the resource in a structured format.

**Example:<!-- -->&#x20;**`{"systemId":"12345"}`

CreatePaymentRequest

```
{

  "amount": 110,

  "currency": "EUR",

  "orderId": "14379133960355",

  "callbackUrl": "https://example.com/checkout/callback",

  "completeUrl": "https://example.com/checkout/complete",

  "failUrl": "https://example.com/checkout/fail",

  "cancelUrl": "https://example.com/checkout/cancel",

  "paymentToken": "7cc38b08ff471ccd313ad62b23b9f362b107560b",

  "sessionId": "39603551437913",

  "generatePaymentToken": false,

  "paymentMethod": {

    "card": {

      "number": "string",

      "cvc": "string",

      "expMonth": "string",

      "expYear": "string",

      "cardholderName": "John Doe",

      "cardholderEmail": "john.doe@monei.com"

    },

    "bizum": {

      "phoneNumber": null

    }

  },

  "allowedPaymentMethods": [

    "card",

    "bizum",

    "paypal"

  ],

  "transactionType": "SALE",

  "sequence": {

    "type": "recurring",

    "recurring": {

      "expiry": "20210630",

      "frequency": 30

    }

  },

  "storeId": "e5f28150d9e8974c58ab5ec9c4a880f8734dcf05",

  "pointOfSaleId": "fb269cccfa0cc021f5d0b8eb1421646c696213e1",

  "subscriptionId": "575bcd84-09fc-4a6e-8c4c-f88b8eb90bfa",

  "autoRecover": false,

  "description": "Test Shop - #84370745531439",

  "customer": {

    "email": "john.doe@example.com",

    "name": "John Doe",

    "phone": null

  },

  "billingDetails": {

    "name": "John Doe",

    "email": "john.doe@example.com",

    "phone": null,

    "company": null,

    "taxId": null,

    "address": {

      "country": "ES",

      "city": "Málaga",

      "line1": "Fake Street 123",

      "line2": null,

      "zip": "1234",

      "state": "Málaga"

    }

  },

  "shippingDetails": {

    "name": "John Doe",

    "email": "john.doe@example.com",

    "phone": null,

    "company": null,

    "taxId": null,

    "address": {

      "country": "ES",

      "city": "Málaga",

      "line1": "Fake Street 123",

      "line2": null,

      "zip": "1234",

      "state": "Málaga"

    }

  },

  "sessionDetails": {

    "ip": "100.100.200.100",

    "countryCode": "ES",

    "lang": "es",

    "deviceType": "desktop",

    "deviceModel": null,

    "browser": "Chrome",

    "browserVersion": "83.0.4103.116",

    "os": "Mac OS",

    "osVersion": "10.15.4",

    "source": "MONEI/PHP",

    "sourceVersion": "0.1.2",

    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...",

    "browserAccept": "text/html,application/xhtml+xml,application/json",

    "browserColorDepth": "24",

    "browserScreenHeight": "1152",

    "browserScreenWidth": "2048",

    "browserTimezoneOffset": "-120"

  },

  "expireAt": 1663581391,

  "metadata": {

    "systemId": "12345"

  }

}
```
