Create Stripe payment intent
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1000,
"currency": "USD",
"customer": "cus_HRp23wXfXMqSao",
"confirm": false,
"off_session": false,
"payment_method": "pm_1Gsv4BFbKq2PvwXbl4XEl1O3",
"payment_method_types": [
"card"
],
"receipt_email": "joedoe@fabric.inc",
"setup_future_usage": "off_session",
"capture_method": "manual",
"application_fee_amount": 100,
"metadata": {
"orderId": "1234-1234-12345"
}
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent"
payload = {
"amount": 1000,
"currency": "USD",
"customer": "cus_HRp23wXfXMqSao",
"confirm": False,
"off_session": False,
"payment_method": "pm_1Gsv4BFbKq2PvwXbl4XEl1O3",
"payment_method_types": ["card"],
"receipt_email": "joedoe@fabric.inc",
"setup_future_usage": "off_session",
"capture_method": "manual",
"application_fee_amount": 100,
"metadata": { "orderId": "1234-1234-12345" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 1000,
currency: 'USD',
customer: 'cus_HRp23wXfXMqSao',
confirm: false,
off_session: false,
payment_method: 'pm_1Gsv4BFbKq2PvwXbl4XEl1O3',
payment_method_types: ['card'],
receipt_email: 'joedoe@fabric.inc',
setup_future_usage: 'off_session',
capture_method: 'manual',
application_fee_amount: 100,
metadata: {orderId: '1234-1234-12345'}
})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent', 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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent",
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([
'amount' => 1000,
'currency' => 'USD',
'customer' => 'cus_HRp23wXfXMqSao',
'confirm' => false,
'off_session' => false,
'payment_method' => 'pm_1Gsv4BFbKq2PvwXbl4XEl1O3',
'payment_method_types' => [
'card'
],
'receipt_email' => 'joedoe@fabric.inc',
'setup_future_usage' => 'off_session',
'capture_method' => 'manual',
'application_fee_amount' => 100,
'metadata' => [
'orderId' => '1234-1234-12345'
]
]),
CURLOPT_HTTPHEADER => [
"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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "pi_1GsyhzFbKq2PvwXbwAI3ZluI",
"object": "payment_intent",
"amount": 1000,
"amount_capturable": 0,
"amount_received": 0,
"application": "<string>",
"application_fee_amount": 123,
"canceled_at": "<string>",
"cancellation_reason": "<string>",
"capture_method": "manual",
"client_secret": "pi_1GsyhzFbKq2Pvw1bwAI3ZluI_secret_GKG6hcap7VCggeoqJICAqSsRW",
"confirmation_method": "automatic",
"created": 1591913835,
"currency": "usd",
"customer": "<string>",
"description": "<string>",
"invoice": "<string>",
"last_payment_error": "<string>",
"livemode": true,
"metadata": {},
"next_action": "<string>",
"on_behalf_of": "<string>",
"payment_method": "<string>",
"payment_method_options": {
"card": {
"installments": "<string>",
"network": "<string>",
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"receipt_email": "<string>",
"review": "<string>",
"setup_future_usage": "on_session",
"shipping": "<string>",
"source": "<string>",
"statement_descriptor": "<string>",
"statement_descriptor_suffix": "<string>",
"status": "requires_payment_method",
"transfer_data": "<string>",
"transfer_group": "<string>",
"charges": {
"object": "list",
"data": "<array>",
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_1GsyhzFbKq2PvwXbwAI3ZluI"
}
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Payments
Create Stripe payment intent
Create Stripe payment intent
POST
/
ext-stripe
/
payment-intent
Create Stripe payment intent
curl --request POST \
--url https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent \
--header 'Content-Type: application/json' \
--data '
{
"amount": 1000,
"currency": "USD",
"customer": "cus_HRp23wXfXMqSao",
"confirm": false,
"off_session": false,
"payment_method": "pm_1Gsv4BFbKq2PvwXbl4XEl1O3",
"payment_method_types": [
"card"
],
"receipt_email": "joedoe@fabric.inc",
"setup_future_usage": "off_session",
"capture_method": "manual",
"application_fee_amount": 100,
"metadata": {
"orderId": "1234-1234-12345"
}
}
'import requests
url = "https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent"
payload = {
"amount": 1000,
"currency": "USD",
"customer": "cus_HRp23wXfXMqSao",
"confirm": False,
"off_session": False,
"payment_method": "pm_1Gsv4BFbKq2PvwXbl4XEl1O3",
"payment_method_types": ["card"],
"receipt_email": "joedoe@fabric.inc",
"setup_future_usage": "off_session",
"capture_method": "manual",
"application_fee_amount": 100,
"metadata": { "orderId": "1234-1234-12345" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 1000,
currency: 'USD',
customer: 'cus_HRp23wXfXMqSao',
confirm: false,
off_session: false,
payment_method: 'pm_1Gsv4BFbKq2PvwXbl4XEl1O3',
payment_method_types: ['card'],
receipt_email: 'joedoe@fabric.inc',
setup_future_usage: 'off_session',
capture_method: 'manual',
application_fee_amount: 100,
metadata: {orderId: '1234-1234-12345'}
})
};
fetch('https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent', 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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent",
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([
'amount' => 1000,
'currency' => 'USD',
'customer' => 'cus_HRp23wXfXMqSao',
'confirm' => false,
'off_session' => false,
'payment_method' => 'pm_1Gsv4BFbKq2PvwXbl4XEl1O3',
'payment_method_types' => [
'card'
],
'receipt_email' => 'joedoe@fabric.inc',
'setup_future_usage' => 'off_session',
'capture_method' => 'manual',
'application_fee_amount' => 100,
'metadata' => [
'orderId' => '1234-1234-12345'
]
]),
CURLOPT_HTTPHEADER => [
"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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent"
payload := strings.NewReader("{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
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://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod01-apigw.{customer_name}.fabric.zone/ext-stripe/payment-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"customer\": \"cus_HRp23wXfXMqSao\",\n \"confirm\": false,\n \"off_session\": false,\n \"payment_method\": \"pm_1Gsv4BFbKq2PvwXbl4XEl1O3\",\n \"payment_method_types\": [\n \"card\"\n ],\n \"receipt_email\": \"joedoe@fabric.inc\",\n \"setup_future_usage\": \"off_session\",\n \"capture_method\": \"manual\",\n \"application_fee_amount\": 100,\n \"metadata\": {\n \"orderId\": \"1234-1234-12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "pi_1GsyhzFbKq2PvwXbwAI3ZluI",
"object": "payment_intent",
"amount": 1000,
"amount_capturable": 0,
"amount_received": 0,
"application": "<string>",
"application_fee_amount": 123,
"canceled_at": "<string>",
"cancellation_reason": "<string>",
"capture_method": "manual",
"client_secret": "pi_1GsyhzFbKq2Pvw1bwAI3ZluI_secret_GKG6hcap7VCggeoqJICAqSsRW",
"confirmation_method": "automatic",
"created": 1591913835,
"currency": "usd",
"customer": "<string>",
"description": "<string>",
"invoice": "<string>",
"last_payment_error": "<string>",
"livemode": true,
"metadata": {},
"next_action": "<string>",
"on_behalf_of": "<string>",
"payment_method": "<string>",
"payment_method_options": {
"card": {
"installments": "<string>",
"network": "<string>",
"request_three_d_secure": "automatic"
}
},
"payment_method_types": [
"card"
],
"receipt_email": "<string>",
"review": "<string>",
"setup_future_usage": "on_session",
"shipping": "<string>",
"source": "<string>",
"statement_descriptor": "<string>",
"statement_descriptor_suffix": "<string>",
"status": "requires_payment_method",
"transfer_data": "<string>",
"transfer_group": "<string>",
"charges": {
"object": "list",
"data": "<array>",
"has_more": false,
"total_count": 0,
"url": "/v1/charges?payment_intent=pi_1GsyhzFbKq2PvwXbwAI3ZluI"
}
}{
"code": "<string>",
"message": "<string>"
}{
"message": "Forbidden"
}{
"code": "<string>",
"message": "<string>"
}Headers
Example:
"0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k"
Body
application/json
Required range:
x >= 1Example:
1000
Required string length:
3Example:
"USD"
Example:
"cus_HRp23wXfXMqSao"
Example:
false
Example:
false
Example:
"pm_1Gsv4BFbKq2PvwXbl4XEl1O3"
Minimum array length:
1Available options:
card Example:
["card"]
Example:
"joedoe@fabric.inc"
Available options:
on_session, off_session Example:
"off_session"
Available options:
automatic, manual Example:
"manual"
Required range:
x >= 1Example:
100
Show child attributes
Show child attributes
Example:
{ "orderId": "1234-1234-12345" }
Response
Created stripe payment intent
Example:
"pi_1GsyhzFbKq2PvwXbwAI3ZluI"
Example:
"payment_intent"
Example:
1000
Example:
0
Example:
0
Example:
"manual"
Example:
"pi_1GsyhzFbKq2Pvw1bwAI3ZluI_secret_GKG6hcap7VCggeoqJICAqSsRW"
Example:
"automatic"
Example:
1591913835
Example:
"usd"
Show child attributes
Show child attributes
Example:
["card"]
Example:
"on_session"
Example:
"requires_payment_method"
Show child attributes
Show child attributes
Was this page helpful?
⌘I
