Payments
Create checkout session
Stripe-style alias for POST /dev/v1/payments. Accepts amount, success_url, cancel_url, customer_email, and a single product descriptor; returns a session shape with id, url, and status. Internally delegates to the payments endpoint, so PSP orchestration, scopes, and webhook behavior are identical; Idempotency-Key replay is handled by this endpoint and returns the stored session response. For multi-item checkouts, build the cart on your side and call this endpoint with the aggregated amount.
POST
/
dev
/
v1
/
checkout
/
sessions
Create checkout session
curl --request POST \
--url https://api.shoppex.io/dev/v1/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "<string>",
"quantity": 2
},
"amount": 1.01,
"currency": "<string>",
"customer_email": "[email protected]",
"success_url": "<string>",
"cancel_url": "<string>",
"metadata": {},
"gateway": "<string>",
"gateways": [
"<string>"
],
"crypto_gateway": "<string>",
"confirmations": 2,
"customer_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {name: '<string>', quantity: 2},
amount: 1.01,
currency: '<string>',
customer_email: '[email protected]',
success_url: '<string>',
cancel_url: '<string>',
metadata: {},
gateway: '<string>',
gateways: ['<string>'],
crypto_gateway: '<string>',
confirmations: 2,
customer_id: '<string>'
})
};
fetch('https://api.shoppex.io/dev/v1/checkout/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/checkout/sessions"
payload = {
"product": {
"name": "<string>",
"quantity": 2
},
"amount": 1.01,
"currency": "<string>",
"customer_email": "[email protected]",
"success_url": "<string>",
"cancel_url": "<string>",
"metadata": {},
"gateway": "<string>",
"gateways": ["<string>"],
"crypto_gateway": "<string>",
"confirmations": 2,
"customer_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/checkout/sessions",
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([
'product' => [
'name' => '<string>',
'quantity' => 2
],
'amount' => 1.01,
'currency' => '<string>',
'customer_email' => '[email protected]',
'success_url' => '<string>',
'cancel_url' => '<string>',
'metadata' => [
],
'gateway' => '<string>',
'gateways' => [
'<string>'
],
'crypto_gateway' => '<string>',
'confirmations' => 2,
'customer_id' => '<string>'
]),
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://api.shoppex.io/dev/v1/checkout/sessions"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"<string>\",\n \"quantity\": 2\n },\n \"amount\": 1.01,\n \"currency\": \"<string>\",\n \"customer_email\": \"[email protected]\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"metadata\": {},\n \"gateway\": \"<string>\",\n \"gateways\": [\n \"<string>\"\n ],\n \"crypto_gateway\": \"<string>\",\n \"confirmations\": 2,\n \"customer_id\": \"<string>\"\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))
}{
"data": {
"id": "<string>",
"url": "<string>",
"status": "<string>",
"amount": 123,
"currency": "<string>",
"customer_email": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"created_at": 123,
"expires_at": "<string>",
"checkout_url": "<string>",
"session_id": "<string>",
"warnings": [
{
"code": "subscription_checkout_mismatch",
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Use your Shoppex API key in the Authorization header.
Body
application/jsonmultipart/form-datatext/plain
Show child attributes
Show child attributes
Required range:
x >= 0.01Required string length:
3Required range:
x >= 1Response
Successful response
Show child attributes
Show child attributes
Previous
Get paymentReturns a single developer payment. Session-backed gateways can include `checkout_url` and `session_id` when Shoppex created the provider session.
Next
⌘I
Create checkout session
curl --request POST \
--url https://api.shoppex.io/dev/v1/checkout/sessions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"product": {
"name": "<string>",
"quantity": 2
},
"amount": 1.01,
"currency": "<string>",
"customer_email": "[email protected]",
"success_url": "<string>",
"cancel_url": "<string>",
"metadata": {},
"gateway": "<string>",
"gateways": [
"<string>"
],
"crypto_gateway": "<string>",
"confirmations": 2,
"customer_id": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
product: {name: '<string>', quantity: 2},
amount: 1.01,
currency: '<string>',
customer_email: '[email protected]',
success_url: '<string>',
cancel_url: '<string>',
metadata: {},
gateway: '<string>',
gateways: ['<string>'],
crypto_gateway: '<string>',
confirmations: 2,
customer_id: '<string>'
})
};
fetch('https://api.shoppex.io/dev/v1/checkout/sessions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/checkout/sessions"
payload = {
"product": {
"name": "<string>",
"quantity": 2
},
"amount": 1.01,
"currency": "<string>",
"customer_email": "[email protected]",
"success_url": "<string>",
"cancel_url": "<string>",
"metadata": {},
"gateway": "<string>",
"gateways": ["<string>"],
"crypto_gateway": "<string>",
"confirmations": 2,
"customer_id": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/checkout/sessions",
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([
'product' => [
'name' => '<string>',
'quantity' => 2
],
'amount' => 1.01,
'currency' => '<string>',
'customer_email' => '[email protected]',
'success_url' => '<string>',
'cancel_url' => '<string>',
'metadata' => [
],
'gateway' => '<string>',
'gateways' => [
'<string>'
],
'crypto_gateway' => '<string>',
'confirmations' => 2,
'customer_id' => '<string>'
]),
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://api.shoppex.io/dev/v1/checkout/sessions"
payload := strings.NewReader("{\n \"product\": {\n \"name\": \"<string>\",\n \"quantity\": 2\n },\n \"amount\": 1.01,\n \"currency\": \"<string>\",\n \"customer_email\": \"[email protected]\",\n \"success_url\": \"<string>\",\n \"cancel_url\": \"<string>\",\n \"metadata\": {},\n \"gateway\": \"<string>\",\n \"gateways\": [\n \"<string>\"\n ],\n \"crypto_gateway\": \"<string>\",\n \"confirmations\": 2,\n \"customer_id\": \"<string>\"\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))
}{
"data": {
"id": "<string>",
"url": "<string>",
"status": "<string>",
"amount": 123,
"currency": "<string>",
"customer_email": "<string>",
"success_url": "<string>",
"cancel_url": "<string>",
"created_at": 123,
"expires_at": "<string>",
"checkout_url": "<string>",
"session_id": "<string>",
"warnings": [
{
"code": "subscription_checkout_mismatch",
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"doc_url": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}
}