# Creates a payment intent.

**POST** `/payment-intent`

Base URL: `https://api-sbx.pre.globalgetnet.com/dpy/web-checkout/v1`

Creates a payment intent from an e-commerce checkout.

## Authorization

- PROD (oauth2)
- PRE (oauth2)

## Body

Content type: `application/json`

- `order_id` (string)
  Order ID used for Merchant reconciliation
- `payment` (object)
  Data structure containing payment details.

  This field is required for standard payment flows. Must be omitted when `configurations.card_verification` is set to `true`.
  - `currency` (string<ISO-4217>, required)
    Currency code.

    The value is in the alpha-3 format defined in ISO 4217 (https://www.iso.org/iso-4217-currency-codes.html).
  - `amount` (integer, required)
    Purchase amount in integer format, where the last 2 digits represent the cents.

    For countries where cents do not apply, fill in the amount with 2 zeros to the right.

    Ex: $150, send `15000`.
- `product` (object[])
  Array of products included in the order.

  This field is required for standard payment flows. Must be omitted when `configurations.card_verification` is set to `true`.
  - `product_type` ("cash_carry" | "digital_content" | "digital_goods" | "digital_physical" | "gift_card" | "physical_goods" | "renew_subs" | "shareware" | "service")
    Product type
  - `title` (string, required)
    Product name
  - `description` (string)
    Product description
  - `value` (integer, required)
    Product value in integer format, where the last 2 digits represent the cents.

    For countries where cents do not apply, fill in the amount with 2 zeros to the right.

    Ex: $150, send `15000`
  - `quantity` (integer, required)
    Quantity of the product
- `customer` (object, required)
  Data structure containing customer details
  - `customer_id` (string, required)
    Customer ID.

    We recommend using the customer's document number (the same value provided in `document_number`) as the customer ID, for all countries. Provide only letters and numbers, without any special characters, separators or spaces (for example, a Chilean RUT `12345678-9` should be sent as `123456789`).

    For Brazil (BR), this value must correspond to a valid CPF. Using an invalid document may trigger fraud prevention flows that could block the payment.
  - `first_name` (string, required)
    Customer's first name
  - `last_name` (string, required)
    Customer's last name
  - `name` (string, required)
    Customer's full name
  - `email` (string<email>, required)
    Customer's email address
  - `document_type` (string, required)
    Type of the document used to identify the customer. The accepted value is country-specific:

    - Brazil (BR): `CPF` (individuals) or `CNPJ` (companies)
    - Argentina (AR): `DNI`
    - Chile (CL): `RUT`
    - Mexico (MX): `RFC`
    - Uruguay (UY): `CI`
    - Spain (ES): `DNI`
  - `document_number` (string, required)
    Document number used to identify the customer.

    For Brazil (BR), this field must contain a valid CPF. Using an invalid CPF may trigger fraud prevention flows that could block the payment.
  - `phone_number` (string)
    Customer's phone number
  - `gender` ("Female" | "Male" | "Intersex" | "Trans" | "Non-Conforming" | "Personal" | "Eunuch")
    Customer's gender
  - `checked_email` (boolean)
    Whether the customer's email address was verified by the seller when they registered with the store.

    The possible values are:
    - true = Email address was verified
    - false = Email address was not verified
  - `billing_address` (object, required)
    Data structure containing shipping address details
    - `street` (string, required)
      Name of a street or thoroughfare
    - `number` (string, required)
      Number that identifies the position of a building on a street
    - `complement` (string)
      Additional address information
    - `district` (string)
      Name of a district, for example, a part of a town or region
    - `city` (string)
      Name of a built-up area with defined boundaries and a local government.

      The value is based on the ISO 3166-2, according to the country defined within the address details.
    - `state` (string)
      Name of an organized political community or area forming a part of a federation.

      The value is based on the ISO 3166-2, according to the country defined within the address details.
    - `country` (string, required)
      Country code.

      The value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).
    - `postal_code` (string, required)
      Postal or ZIP code.

      The value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.
    - `reference` (string)
      Reference point details that can be used to help locate the address
- `shipping` (object)
  Data structure containing shipping details
  - `first_name` (string, required)
    Customer's first name
  - `last_name` (string, required)
    Customer's last name
  - `name` (string)
    Customer's full name
  - `phone_number` (string)
    Customer's phone number
  - `shipping_amount` (number)
    Shipping cost in integer format, where the last 2 digits represent the cents.

    For countries where cents do not apply, fill in the amount with 2 zeros to the right.

    Ex: $150, send `15000`
  - `address` (object, required)
    Data structure containing shipping address details
    - `street` (string, required)
      Name of a street or thoroughfare
    - `number` (string, required)
      Number that identifies the position of a building on a street
    - `complement` (string)
      Additional address information
    - `district` (string)
      Name of a district, for example, a part of a town or region
    - `city` (string)
      Name of a built-up area with defined boundaries and a local government.

      The value is based on the ISO 3166-2, according to the country defined within the address details.
    - `state` (string)
      Name of an organized political community or area forming a part of a federation.

      The value is based on the ISO 3166-2, according to the country defined within the address details.
    - `country` (string, required)
      Country code.

      The value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).
    - `postal_code` (string, required)
      Postal or ZIP code.

      The value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.
    - `reference` (string)
      Reference point details that can be used to help locate the address
- `pickup_store` (boolean)
  Whether the order is to be picked up by the customer
- `shipping_method` (string)
  Shipping method of the order.

  The value can be freely defined.
- `soft_descriptor` (string)
  Payment description that appears on the customer's receipt
- `dynamic_mcc` (integer)
  Merchant Category Code (MCC) for the transaction
- `additional_data` (object)
  Additional data for regional regulations and tax requirements.

  This field is used in specific countries to comply with local tax and regulatory requirements (e.g., Uruguay).
  - `rates` (object[])
    Tax rates applied to the transaction
    - `key` (string)
      Type of tax or rate being applied
    - `value` (integer)
      Tax amount in integer format (cents)
  - `regional_regulation_code` (string)
    Regional fiscal or regulatory code required by local authorities
- `configurations` (object)
  Additional configurations for the payment intent - **3ds, card_verification and preauthorization are not available for Argentina.**
  - `3ds` (boolean)
    Controls 3D Secure authentication.

    When set to `false`, the merchant forces the 3DS authentication flow to be skipped for this payment intent.
  - `preauthorization` (boolean)
    Indicates if the payment is a pre-authorization.

    When set to `true`, the payment will be pre-authorized and manual captures will be performed via API using the `payment_id` sent via webhook to the merchant.
  - `card_verification` (boolean)
    Indicates if this is a card verification flow.

    When set to `true`, the checkout flow will not process a payment but will verify the card and store it in the vault. A `card_id` will be sent via webhook to the merchant for future charges. This allows merchants without PCI compliance infrastructure to store cards in GetNet's vault without handling sensitive card data.

    Note: When this is `true`, the `payment` and `product` fields must be omitted from the request.
- `sub_merchant` (object)
  Data structure containing sub-merchant details.

  This field is used in marketplace scenarios where the payment is processed on behalf of a sub-merchant (e.g., a seller in a marketplace platform).
  - `identification_code` (string)
    Unique identification code for the sub-merchant
  - `document_type` (string)
    Type of document used to identify the sub-merchant
  - `document_number` (string)
    Document number used to identify the sub-merchant
  - `address` (object)
    Sub-merchant address details
    - `street` (string)
      Name of a street or thoroughfare
    - `number` (string)
      Number that identifies the position of a building on a street
    - `complement` (string)
      Additional address information
    - `district` (string)
      Name of a district
    - `city` (string)
      City name
    - `state` (string)
      State or province code
    - `country_code` (string)
      Country code.

      The value is based on the ISO 3166-1 alpha-2 or alpha-3 (https://www.iso.org/obp/ui/#search/code/).
    - `postal_code` (string)
      Postal or ZIP code

Example:

```json
{
  "order_id": "ORDER_123",
  "payment": {
    "currency": "USD",
    "amount": 12000
  },
  "product": [
    {
      "product_type": "digital_content",
      "title": "Toy car",
      "description": "Wooden toy car",
      "value": 1200,
      "quantity": 10
    }
  ],
  "customer": {
    "customer_id": "12345678912",
    "first_name": "John",
    "last_name": "Doe Smith",
    "name": "John Doe Smith",
    "email": "customer@email.com.br",
    "document_type": "CPF",
    "document_number": "12345678912",
    "phone_number": "5551999887766",
    "gender": "Male",
    "checked_email": {
      "type": "boolean",
      "default": false,
      "description": "Whether the customer's email address was verified by the seller when they registered with the store.\n\nThe possible values are:\n- true = Email address was verified\n- false = Email address was not verified",
      "example": false
    },
    "billing_address": {
      "type": "object",
      "description": "Data structure containing shipping address details",
      "required": [
        "street",
        "number",
        "country",
        "postal_code"
      ],
      "properties": {
        "street": {
          "type": "string",
          "description": "Name of a street or thoroughfare",
          "maxLength": 60,
          "example": "Av. Brasil"
        },
        "number": {
          "type": "string",
          "description": "Number that identifies the position of a building on a street",
          "maxLength": 10,
          "example": "1000"
        },
        "complement": {
          "type": "string",
          "description": "Additional address information",
          "maxLength": 60,
          "example": "Sala 1"
        },
        "district": {
          "type": "string",
          "description": "Name of a district, for example, a part of a town or region",
          "maxLength": 40,
          "example": "São Geraldo"
        },
        "city": {
          "type": "string",
          "description": "Name of a built-up area with defined boundaries and a local government.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
          "maxLength": 40,
          "example": "Porto Alegre"
        },
        "state": {
          "type": "string",
          "description": "Name of an organized political community or area forming a part of a federation.\n\nThe value is based on the ISO 3166-2, according to the country defined within the address details.",
          "maxLength": 20,
          "example": "RS"
        },
        "country": {
          "type": "string",
          "description": "Country code.\n\nThe value is based on the ISO 3166-1 alpha-2 (https://www.iso.org/obp/ui/#search/code/).",
          "maxLength": 2,
          "example": "BR"
        },
        "postal_code": {
          "type": "string",
          "description": "Postal or ZIP code.\n\nThe value consists of a group of letters and/or numbers that is added to a postal address to assist in sorting the mail.",
          "maxLength": 8,
          "example": "90230060"
        },
        "reference": {
          "type": "string",
          "description": "Reference point details that can be used to help locate the address",
          "maxLength": 80,
          "example": "Near the hospital"
        }
      }
    }
  },
  "shipping": {
    "first_name": "John",
    "last_name": "Doe Smith",
    "name": "John Doe Smith",
    "phone_number": "5551999887766",
    "shipping_amount": 3000,
    "address": {
      "street": "Av. Brasil",
      "number": "1000",
      "complement": "Sala 1",
      "district": "São Geraldo",
      "city": "Porto Alegre",
      "state": "RS",
      "country": "BR",
      "postal_code": "90230060",
      "reference": "Near the hospital"
    }
  },
  "pickup_store": true,
  "shipping_method": "PAC",
  "soft_descriptor": "Bread Store",
  "dynamic_mcc": 1000,
  "additional_data": {
    "rates": [
      {
        "key": "Iva",
        "value": 123
      }
    ],
    "regional_regulation_code": "17934"
  },
  "configurations": {
    "3ds": true,
    "preauthorization": false,
    "card_verification": false
  },
  "sub_merchant": {
    "identification_code": "SUB_12345",
    "document_type": "CNPJ",
    "document_number": "12345678000190",
    "address": {
      "street": "Rua das Flores",
      "number": "789",
      "complement": "Loja 2",
      "district": "Jardins",
      "city": "São Paulo",
      "state": "SP",
      "country_code": "BR",
      "postal_code": "01452000"
    }
  }
}
```

## Responses

### 201

Created.

Payment intent created successfully.

- `payment_intent_id` (string<uuidv4>, required)
  Unique payment intent ID
- `trade_name` (string, required)
  Seller's trade name displayed in the checkout
- `redirect_url` (string<uri>, required)
  URL to redirect the customer to complete the payment in the hosted checkout

Example:

```json
{
  "payment_intent_id": "ee0b7dd5-92da-4ef4-ad3b-0ba369ad0efe",
  "trade_name": "Smart Shop",
  "redirect_url": "https://checkout.getnet.com/hosted-web-checkout/eyJhbGciOiJSUzI1NiIs..."
}
```

### 400

Bad request.

Only required fields are validated.

- `code` (string, required)
  Unique alphanumeric human readable error code
- `message` (string, required)
  Brief summary of the reported issue
- `details` (object[])
  Array of errors.

  The object type varies depending on the error context.

Example:

```json
{
  "code": "guid_error",
  "message": "x-seller-id must be a valid guid",
  "details": "[ {\"property\": \"x-seller-id\", \"constraint\":\"guid\"}]"
}
```

### 401

Unauthorized

Example:

```json
"Invalid API Key"
```

### 403

Forbidden

- `code` (string)
  Unique alphanumeric human readable error code
- `message` (string, required)
  Brief summary of the reported issue
- `details` (object[])
  Array of errors.

  The object type varies depending on the error context.

Example:

```json
{
  "code": "validation_error",
  "message": "One or more fields failed validation",
  "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"
}
```

### 404

Not found

- `code` (string)
  Unique alphanumeric human readable error code
- `message` (string, required)
  Brief summary of the reported issue
- `details` (object[])
  Array of errors.

  The object type varies depending on the error context.

Example:

```json
{
  "code": "validation_error",
  "message": "One or more fields failed validation",
  "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"
}
```

### 422

Unprocessable entity.

Potential business error.

- `code` (string)
  Unique alphanumeric human readable error code
- `message` (string, required)
  Brief summary of the reported issue
- `details` (object[])
  Array of errors.

  The object type varies depending on the error context.

Example:

```json
{
  "code": "validation_error",
  "message": "One or more fields failed validation",
  "details": "[ {\"field\": \"amount\", \"error\": \"amount is required\"} ]"
}
```

### 500

Internal server error

- `message` (string, required)
  Brief summary of the reported issue
- `details` (object[])
  Array of errors.

  The object type varies depending on the error context.

Example:

```json
{
  "message": "Internal Server Error",
  "details": "[]"
}
```