Create
curl --request POST \
--url https://{defaultHost}/v1/payment_intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_intent": {
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"processor_type": "stripe"
}
}
'import requests
url = "https://{defaultHost}/v1/payment_intents"
payload = { "payment_intent": {
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"processor_type": "stripe"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_intent: {customer: '8be5a4ba-3ad8-4042-9469-40bf2b7535c5', processor_type: 'stripe'}
})
};
fetch('https://{defaultHost}/v1/payment_intents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/payment_intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_intent' => [
'customer' => '8be5a4ba-3ad8-4042-9469-40bf2b7535c5',
'processor_type' => 'stripe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/payment_intents"
payload := strings.NewReader("{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/payment_intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/payment_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "65e4d0c4-fb44-4a44-bc85-0ffcf3a0ecda",
"object": "payment_intent",
"amount": 0,
"currency": "usd",
"external_intent_id": "seti_ReHJBB6G997DCnc",
"live_mode": true,
"off_session": false,
"processor_data": {
"stripe": {
"account_id": "external_account_49",
"publishable_key": "pk_test_51KeWoQFugiAKLuJycCZesY1aYEzfauqW2SHSZSUj5xCorx7h7oZd5i6Vz2whx7Y5fMZr6WQQTeOoQEtaEnpk4fkB00dinySlbK",
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"type": "setup",
"payment_method_id": null
}
},
"processor_type": "stripe",
"reusable": true,
"status": "pending",
"checkout": null,
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"payment_method": null,
"platform_fee": null,
"service_fee": null,
"created_at": 1793796929,
"updated_at": 1793796929
}Payment Intents
Create
Creates a new payment intent.
POST
/
v1
/
payment_intents
Create
curl --request POST \
--url https://{defaultHost}/v1/payment_intents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"payment_intent": {
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"processor_type": "stripe"
}
}
'import requests
url = "https://{defaultHost}/v1/payment_intents"
payload = { "payment_intent": {
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"processor_type": "stripe"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payment_intent: {customer: '8be5a4ba-3ad8-4042-9469-40bf2b7535c5', processor_type: 'stripe'}
})
};
fetch('https://{defaultHost}/v1/payment_intents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{defaultHost}/v1/payment_intents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'payment_intent' => [
'customer' => '8be5a4ba-3ad8-4042-9469-40bf2b7535c5',
'processor_type' => 'stripe'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{defaultHost}/v1/payment_intents"
payload := strings.NewReader("{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{defaultHost}/v1/payment_intents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/payment_intents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_intent\": {\n \"customer\": \"8be5a4ba-3ad8-4042-9469-40bf2b7535c5\",\n \"processor_type\": \"stripe\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "65e4d0c4-fb44-4a44-bc85-0ffcf3a0ecda",
"object": "payment_intent",
"amount": 0,
"currency": "usd",
"external_intent_id": "seti_ReHJBB6G997DCnc",
"live_mode": true,
"off_session": false,
"processor_data": {
"stripe": {
"account_id": "external_account_49",
"publishable_key": "pk_test_51KeWoQFugiAKLuJycCZesY1aYEzfauqW2SHSZSUj5xCorx7h7oZd5i6Vz2whx7Y5fMZr6WQQTeOoQEtaEnpk4fkB00dinySlbK",
"client_secret": "seti_1Pgag7B7WZ01zgkWSgwGdb8Z_secret_QXg2AQLdBxJwtY51IkwvUaBVsnCqPSp",
"type": "setup",
"payment_method_id": null
}
},
"processor_type": "stripe",
"reusable": true,
"status": "pending",
"checkout": null,
"customer": "8be5a4ba-3ad8-4042-9469-40bf2b7535c5",
"payment_method": null,
"platform_fee": null,
"service_fee": null,
"created_at": 1793796929,
"updated_at": 1793796929
}Authorizations
Response
200 - application/json
Success
Expandable – The associated checkout ID.
Expandable – The associated customer ID.
Expandable – The associated payment method ID.
Expandable – The associated platform fee ID.
Expandable – The associated service fee ID.
Was this page helpful?