> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fluveo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fluveo.com/_mcp/server.

# Confirm Payment Intent

POST https://api.devfluveo.com/v1/payment_intents/{intent}/confirm
Content-Type: application/x-www-form-urlencoded

Test mode on a Brazilian (BRL) account: the dispute test PaymentMethods in payment_method (pm_card_createDispute and the rest of Stripe's dispute table) are refused with HTTP 400 invalid_request_error, code payment_method_not_available, param payment_method, before any payment is made. See the Testing guide.

Reference: https://docs.fluveo.com/api-reference/api-reference/confirm-payment-intent

## Authentication

- `Authorization` header (basic auth, required) — Standard Basic HTTP authentication. The username is the Fluveo secret key and the password must be empty, encoded as base64(api_key:).
- `Authorization` header (bearer token, required) — Bearer HTTP authentication. Allowed header: Authorization: Bearer \<api\_key>.

## Request

### Path parameters

- `intent` (string, required)

### Headers

- `Idempotency-Key` (string, optional) — Makes a POST safely retryable according to that operation's documented idempotency policy. The durable 24-hour journal applies only where the resource documentation explicitly claims it. Reusing a key with different parameters or another endpoint returns an idempotency error.

### Body (application/x-www-form-urlencoded)

This endpoint expects a PaymentIntentConfirm.

- `payment_method_data` (PaymentIntentPaymentMethodData, optional) — `type=pix` carries no data (the Pix instruction is issued server-side and read back through `next_action`).
- `payment_method_types` (list of enum, optional) — Payment method vocabulary honored at launch: `card` (default) or `pix` (BRL, automatic capture).
  - Allowed values: `card`, `pix`
- `receipt_email` (string, optional)
- `return_url` (string, optional)
- `setup_future_usage` (enum, optional)
  - Allowed values: `off_session`, `on_session`

## Response

### 200

Stripe-compatible response

- `amount` (integer, required)
- `amount_capturable` (integer, required)
- `amount_received` (integer, required)
- `application` (string, required, nullable)
- `application_fee_amount` (integer, required, nullable)
- `automatic_payment_methods` (PaymentIntentAutomaticPaymentMethods, required, nullable)
- `canceled_at` (integer, required, nullable)
- `cancellation_reason` (enum, required, nullable)
  - Allowed values: `abandoned`, `automatic`, `duplicate`, `expired`, `failed_invoice`, `fraudulent`, `requested_by_customer`, `void_invoice`
- `capture_method` (enum, required)
  - Allowed values: `automatic`, `automatic_async`, `manual`
- `client_secret` (string, required, nullable)
- `confirmation_method` (enum, required)
  - Allowed values: `automatic`, `manual`
- `created` (integer, required)
- `currency` (string, required)
- `customer` (PaymentIntentCustomer, required, nullable)
- `customer_account` (string, required, nullable)
- `description` (string, required, nullable)
- `excluded_payment_method_types` (list of enum, required, nullable)
  - Allowed values: `acss_debit`, `affirm`, `afterpay_clearpay`, `alipay`, `alma`, `amazon_pay`, `au_becs_debit`, `bacs_debit`, `bancontact`, `billie`, `bizum`, `blik`, `boleto`, `card`, `cashapp`, `crypto`, `customer_balance`, `eps`, `fpx`, `giropay`, `grabpay`, `ideal`, `kakao_pay`, `klarna`, `konbini`, `kr_card`, `mb_way`, `mobilepay`, `multibanco`, `naver_pay`, `nz_bank_account`, `oxxo`, `p24`, `pay_by_bank`, `payco`, `paynow`, `paypal`, `payto`, `pix`, `promptpay`, `revolut_pay`, `samsung_pay`, `satispay`, `scalapay`, `sepa_debit`, `sofort`, `sunbit`, `swish`, `twint`, `upi`, `us_bank_account`, `wechat_pay`, `zip`
- `id` (string, required) — Fluveo narrowing: not in upstream pin; truthful public id-prefix constraint: pi_.
- `last_payment_error` (PaymentIntentLastPaymentError, required, nullable)
- `latest_charge` (PaymentIntentLatestCharge, required, nullable)
- `livemode` (boolean, required)
- `managed_payments` (PaymentIntentManagedPayments, required, nullable)
- `metadata` (map from string to string, required)
- `next_action` (PaymentIntentNextAction, required, nullable) — Test-mode redirect action. `redirect_to_url.url` sends the customer to authenticate; after completion the customer is redirected to `redirect_to_url.return_url`.
- `object` (enum, required) — Fluveo narrowing annotation: truthful single-value public object constant.
  - Allowed values: `payment_intent`
- `on_behalf_of` (string, required, nullable)
- `payment_method` (PaymentIntentPaymentMethod, required, nullable)
- `payment_method_configuration_details` (PaymentIntentPaymentMethodConfigurationDetails, required, nullable)
- `payment_method_options` (PaymentIntentPaymentMethodOptions, required, nullable)
- `payment_method_types` (list of string, required)
- `processing` (PaymentIntentProcessing, required, nullable)
- `receipt_email` (string, required, nullable)
- `review` (string, required, nullable)
- `setup_future_usage` (enum, required, nullable)
  - Allowed values: `off_session`, `on_session`
- `shipping` (PaymentIntentShipping, required, nullable)
- `source` (string, required, nullable)
- `statement_descriptor` (string, required, nullable)
- `statement_descriptor_suffix` (string, required, nullable)
- `status` (enum, required)
  - Allowed values: `canceled`, `processing`, `requires_action`, `requires_capture`, `requires_confirmation`, `requires_payment_method`, `succeeded`
- `transfer_group` (string, required, nullable)
- `amount_details` (payment_flows_amount_details, optional)
- `hooks` (payment_flows_payment_intent_async_workflows, optional)
- `payment_details` (payment_flows_payment_details, optional)
- `presentment_details` (payment_flows_payment_intent_presentment_details, optional)
- `transfer_data` (PaymentIntentTransferData, optional, nullable)

## Types

### PaymentIntentPaymentMethodData

`type=pix` carries no data (the Pix instruction is issued server-side and read back through `next_action`).

- `type` (enum, required)
  - Allowed values: `pix`
- `billing_details` (PaymentIntentBillingDetails, optional) — Stripe's `billing_details` of the new card (ADR 0111): accepted only with `type=card` on a US Stripe Connect store's `confirm=true` create or merchant-key confirm of a PaymentIntent that holds no saved card; sent to Stripe on its PaymentMethod create, never on the PaymentIntent. Every other request with billing is refused `400` as before.

### PaymentIntentAutomaticPaymentMethods

- payment_flows_automatic_payment_methods_payment_intent: payment_flows_automatic_payment_methods_payment_intent

### PaymentIntentCustomer

- customer: customer
- deleted_customer: deleted_customer
- string

### PaymentIntentLastPaymentError

- `code` (enum, required)
  - Allowed values: `card_declined`
- `decline_code` (string, required)
- `message` (string, required)
- `type` (enum, required)
  - Allowed values: `card_error`

### PaymentIntentLatestCharge

- charge: charge
- string

### PaymentIntentManagedPayments

- smor_resource_managed_payments: smor_resource_managed_payments

### PaymentIntentNextAction

Test-mode redirect action. `redirect_to_url.url` sends the customer to authenticate; after completion the customer is redirected to `redirect_to_url.return_url`.

- `redirect_to_url` (PaymentIntentRedirectToUrl, required)
- `type` (enum, required)
  - Allowed values: `redirect_to_url`

### PaymentIntentPaymentMethod

- payment_method: payment_method
- string

### PaymentIntentPaymentMethodConfigurationDetails

- payment_method_config_biz_payment_method_configuration_details: payment_method_config_biz_payment_method_configuration_details

### PaymentIntentPaymentMethodOptions

- payment_intent_payment_method_options: payment_intent_payment_method_options

### PaymentIntentProcessing

- payment_intent_processing: payment_intent_processing

### PaymentIntentShipping

- shipping: shipping

### payment_flows_amount_details

### payment_flows_payment_intent_async_workflows

### payment_flows_payment_details

### payment_flows_payment_intent_presentment_details

- `presentment_amount` (integer, required)
- `presentment_currency` (string, required)

### PaymentIntentTransferData

- transfer_data: transfer_data

### PaymentIntentBillingDetails

Stripe's `billing_details` of the new card (ADR 0111): accepted only with `type=card` on a US Stripe Connect store's `confirm=true` create or merchant-key confirm of a PaymentIntent that holds no saved card; sent to Stripe on its PaymentMethod create, never on the PaymentIntent. Every other request with billing is refused `400` as before.

- `address` (PaymentIntentBillingDetailsAddress, optional)
- `email` (string, optional)
- `name` (string, optional)
- `phone` (string, optional)

### payment_flows_automatic_payment_methods_payment_intent

### customer

### deleted_customer

### charge

### smor_resource_managed_payments

### PaymentIntentRedirectToUrl

- `url` (string, required) — The URL you must redirect your customer to in order to authenticate the payment.
- `return_url` (string, optional, nullable) — If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. For payments processed through Stripe Connect, the redirect adds the `payment_intent`, `payment_intent_client_secret` and `redirect_status` URL query parameters. `redirect_status` is `succeeded`, `processing` or `failed`.

### payment_method

### payment_method_config_biz_payment_method_configuration_details

### payment_intent_payment_method_options

### payment_intent_processing

### shipping

### transfer_data

### PaymentIntentBillingDetailsAddress

- `city` (string, optional)
- `country` (string, optional)
- `line1` (string, optional)
- `line2` (string, optional)
- `postal_code` (string, optional)
- `state` (string, optional)

## Examples

**Request**

```json
{
  "return_url": "https://yourapp.example/checkout/return",
  "payment_method": "pm_card_visa"
}
```

**Response**

```json
{
  "amount": 4242,
  "amount_capturable": 0,
  "amount_received": 4242,
  "capture_method": "automatic",
  "created": 1769349712,
  "currency": "usd",
  "id": "pi_1A9e8AzB2xQRH9JfQu5N",
  "latest_charge": "ch_3R9k8AzB2xQRH9Jf",
  "livemode": false,
  "metadata": {},
  "object": "payment_intent",
  "payment_method_types": [
    "card"
  ],
  "status": "succeeded"
}
```

**SDK Code**

```python
import requests

url = "https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm"

payload = ""
headers = {
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, data=payload, headers=headers, auth=("<username>", "<password>"))

print(response.json())
```

```javascript
const url = 'https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm';
const credentials = btoa("<username>:<password>");

const options = {
  method: 'POST',
  headers: {
    Authorization: `Basic ${credentials}`,
    'Content-Type': 'application/x-www-form-urlencoded'
  },
  body: new URLSearchParams('')
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm"

	req, _ := http.NewRequest("POST", url, nil)

	req.SetBasicAuth("<username>", "<password>")
	req.Header.Add("Content-Type", "application/x-www-form-urlencoded")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.basic_auth("<username>", "<password>")
request["Content-Type"] = 'application/x-www-form-urlencoded'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm")
  .basicAuth("<username>", "<password>")
  .header("Content-Type", "application/x-www-form-urlencoded")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm', [
  'form_params' => null,
  'headers' => [
    'Content-Type' => 'application/x-www-form-urlencoded',
  ],
    'auth' => ['<username>', '<password>'],
]);

echo $response->getBody();
```

```csharp
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm");
client.Authenticator = new HttpBasicAuthenticator("<username>", "<password>");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let credentials = Data("<username>:<password>".utf8).base64EncodedString()

let headers = [
  "Authorization": "Basic \(credentials)",
  "Content-Type": "application/x-www-form-urlencoded"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.devfluveo.com/v1/payment_intents/pi_1A9e8AzB2xQRH9JfQu5N/confirm")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```