Charge a card directly (server-to-server)
curl --request POST \
--url http://localhost:3001/api/v1/business/payment/charge \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"mpgsSessionId": "SESSION0002abcDEF",
"walletToken": {
"provider": "APPLE_PAY"
},
"breezeSessionId": "breeze_sess_abc123",
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...",
"browserDetails": {}
}
'import requests
url = "http://localhost:3001/api/v1/business/payment/charge"
payload = {
"mpgsSessionId": "SESSION0002abcDEF",
"walletToken": { "provider": "APPLE_PAY" },
"breezeSessionId": "breeze_sess_abc123",
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...",
"browserDetails": {}
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mpgsSessionId: 'SESSION0002abcDEF',
walletToken: {provider: 'APPLE_PAY'},
breezeSessionId: 'breeze_sess_abc123',
browser: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...',
browserDetails: {}
})
};
fetch('http://localhost:3001/api/v1/business/payment/charge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/business/payment/charge",
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([
'mpgsSessionId' => 'SESSION0002abcDEF',
'walletToken' => [
'provider' => 'APPLE_PAY'
],
'breezeSessionId' => 'breeze_sess_abc123',
'browser' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...',
'browserDetails' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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 := "http://localhost:3001/api/v1/business/payment/charge"
payload := strings.NewReader("{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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("http://localhost:3001/api/v1/business/payment/charge")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/business/payment/charge")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "<string>",
"status": "pending",
"amount": 123,
"currency": "<string>",
"transactionId": "<string>",
"paymentUrl": {},
"refundId": "<string>",
"requiresAction": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}Payments
Charge a card directly (server-to-server)
POST
/
api
/
v1
/
business
/
payment
/
charge
Charge a card directly (server-to-server)
curl --request POST \
--url http://localhost:3001/api/v1/business/payment/charge \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '
{
"mpgsSessionId": "SESSION0002abcDEF",
"walletToken": {
"provider": "APPLE_PAY"
},
"breezeSessionId": "breeze_sess_abc123",
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...",
"browserDetails": {}
}
'import requests
url = "http://localhost:3001/api/v1/business/payment/charge"
payload = {
"mpgsSessionId": "SESSION0002abcDEF",
"walletToken": { "provider": "APPLE_PAY" },
"breezeSessionId": "breeze_sess_abc123",
"browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...",
"browserDetails": {}
}
headers = {
"x-api-key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
mpgsSessionId: 'SESSION0002abcDEF',
walletToken: {provider: 'APPLE_PAY'},
breezeSessionId: 'breeze_sess_abc123',
browser: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...',
browserDetails: {}
})
};
fetch('http://localhost:3001/api/v1/business/payment/charge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3001",
CURLOPT_URL => "http://localhost:3001/api/v1/business/payment/charge",
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([
'mpgsSessionId' => 'SESSION0002abcDEF',
'walletToken' => [
'provider' => 'APPLE_PAY'
],
'breezeSessionId' => 'breeze_sess_abc123',
'browser' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...',
'browserDetails' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <x-api-key>"
],
]);
$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 := "http://localhost:3001/api/v1/business/payment/charge"
payload := strings.NewReader("{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<x-api-key>")
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("http://localhost:3001/api/v1/business/payment/charge")
.header("x-api-key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3001/api/v1/business/payment/charge")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mpgsSessionId\": \"SESSION0002abcDEF\",\n \"walletToken\": {\n \"provider\": \"APPLE_PAY\"\n },\n \"breezeSessionId\": \"breeze_sess_abc123\",\n \"browser\": \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ...\",\n \"browserDetails\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"paymentId": "<string>",
"status": "pending",
"amount": 123,
"currency": "<string>",
"transactionId": "<string>",
"paymentUrl": {},
"refundId": "<string>",
"requiresAction": {},
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "email must be an email",
"statusCode": 400,
"errors": {}
}
}Headers
Body
application/json
Hosted card-session id (SAQ-A) — the card was attached client-side, so no PAN transits your server.
Example:
"SESSION0002abcDEF"
Show child attributes
Show child attributes
Payer billing address. Optional — when omitted no billing country is sent to the card provider. Axra never substitutes a default: a fabricated country would be declared to the issuer that issued the card.
Show child attributes
Show child attributes
Breeze Risk JS SDK session id from the browser SDK (CIT charges)
Example:
"breeze_sess_abc123"
EMV-3DS2 payer user-agent string (device.browser)
Example:
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) ..."
EMV-3DS2 browser signals (device.browserDetails) for a 3DS2 challenge
⌘I
