curl --request POST \
--url https://sandbox.birrpay.io/v2/payment-methods/create-intent \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"metadata": {},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
}
'import requests
url = "https://sandbox.birrpay.io/v2/payment-methods/create-intent"
payload = {
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"metadata": {},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '12345_cus_01926c58bc6e77c09e809964e72af8c8',
metadata: {},
billing: {
address: {
city: 'New York',
line1: '123, King Street',
line2: 'Powelson Avenue',
line3: 'Bridgewater',
zip: '08807',
state: 'New York',
first_name: 'John',
last_name: 'Doe',
origin_zip: '08807'
},
phone: {number: '9123456789', country_code: '+1'},
email: '<string>'
}
})
};
fetch('https://sandbox.birrpay.io/v2/payment-methods/create-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://sandbox.birrpay.io/v2/payment-methods/create-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([
'customer_id' => '12345_cus_01926c58bc6e77c09e809964e72af8c8',
'metadata' => [
],
'billing' => [
'address' => [
'city' => 'New York',
'line1' => '123, King Street',
'line2' => 'Powelson Avenue',
'line3' => 'Bridgewater',
'zip' => '08807',
'state' => 'New York',
'first_name' => 'John',
'last_name' => 'Doe',
'origin_zip' => '08807'
],
'phone' => [
'number' => '9123456789',
'country_code' => '+1'
],
'email' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://sandbox.birrpay.io/v2/payment-methods/create-intent"
payload := strings.NewReader("{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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("https://sandbox.birrpay.io/v2/payment-methods/create-intent")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.birrpay.io/v2/payment-methods/create-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "12345_pm_01926c58bc6e77c09e809964e72af8c8",
"merchant_id": "merchant_1671528864",
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"payment_method_type": "card",
"network_transaction_id": "<string>",
"payment_method_subtype": "ach",
"recurring_enabled": true,
"created": "2023-01-18T11:04:09.922Z",
"last_used_at": "2024-02-24T11:04:09.922Z",
"payment_method_data": {
"card": {
"saved_to_locker": true,
"issuer_country": "AF",
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_network": "Visa",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"connector_tokens": [
{
"token": "pm_9UhMqBMEOooRIvJFFdeW",
"connector_token_request_reference_id": "<string>"
}
],
"network_token": {
"payment_method_data": {
"last4_digits": "4242",
"issuer_country": "AF",
"network_token_expiry_month": "05",
"network_token_expiry_year": "27",
"nick_name": "Card",
"card_holder_name": "John Doe",
"card_isin": "16712672",
"card_issuer": "Bank of America",
"card_network": "Visa",
"card_type": "Credit",
"saved_to_locker": true
}
},
"storage_type": "volatile",
"card_cvc_token_storage": {
"is_stored": true,
"expires_at": "2024-02-24T11:04:09.922Z"
}
}Payment Method - Create Intent
Creates a payment method for customer with billing information and other metadata.
curl --request POST \
--url https://sandbox.birrpay.io/v2/payment-methods/create-intent \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"metadata": {},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
}
'import requests
url = "https://sandbox.birrpay.io/v2/payment-methods/create-intent"
payload = {
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"metadata": {},
"billing": {
"address": {
"city": "New York",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customer_id: '12345_cus_01926c58bc6e77c09e809964e72af8c8',
metadata: {},
billing: {
address: {
city: 'New York',
line1: '123, King Street',
line2: 'Powelson Avenue',
line3: 'Bridgewater',
zip: '08807',
state: 'New York',
first_name: 'John',
last_name: 'Doe',
origin_zip: '08807'
},
phone: {number: '9123456789', country_code: '+1'},
email: '<string>'
}
})
};
fetch('https://sandbox.birrpay.io/v2/payment-methods/create-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://sandbox.birrpay.io/v2/payment-methods/create-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([
'customer_id' => '12345_cus_01926c58bc6e77c09e809964e72af8c8',
'metadata' => [
],
'billing' => [
'address' => [
'city' => 'New York',
'line1' => '123, King Street',
'line2' => 'Powelson Avenue',
'line3' => 'Bridgewater',
'zip' => '08807',
'state' => 'New York',
'first_name' => 'John',
'last_name' => 'Doe',
'origin_zip' => '08807'
],
'phone' => [
'number' => '9123456789',
'country_code' => '+1'
],
'email' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://sandbox.birrpay.io/v2/payment-methods/create-intent"
payload := strings.NewReader("{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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("https://sandbox.birrpay.io/v2/payment-methods/create-intent")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.birrpay.io/v2/payment-methods/create-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer_id\": \"12345_cus_01926c58bc6e77c09e809964e72af8c8\",\n \"metadata\": {},\n \"billing\": {\n \"address\": {\n \"city\": \"New York\",\n \"line1\": \"123, King Street\",\n \"line2\": \"Powelson Avenue\",\n \"line3\": \"Bridgewater\",\n \"zip\": \"08807\",\n \"state\": \"New York\",\n \"first_name\": \"John\",\n \"last_name\": \"Doe\",\n \"origin_zip\": \"08807\"\n },\n \"phone\": {\n \"number\": \"9123456789\",\n \"country_code\": \"+1\"\n },\n \"email\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "12345_pm_01926c58bc6e77c09e809964e72af8c8",
"merchant_id": "merchant_1671528864",
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"payment_method_type": "card",
"network_transaction_id": "<string>",
"payment_method_subtype": "ach",
"recurring_enabled": true,
"created": "2023-01-18T11:04:09.922Z",
"last_used_at": "2024-02-24T11:04:09.922Z",
"payment_method_data": {
"card": {
"saved_to_locker": true,
"issuer_country": "AF",
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_network": "Visa",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"connector_tokens": [
{
"token": "pm_9UhMqBMEOooRIvJFFdeW",
"connector_token_request_reference_id": "<string>"
}
],
"network_token": {
"payment_method_data": {
"last4_digits": "4242",
"issuer_country": "AF",
"network_token_expiry_month": "05",
"network_token_expiry_year": "27",
"nick_name": "Card",
"card_holder_name": "John Doe",
"card_isin": "16712672",
"card_issuer": "Bank of America",
"card_network": "Visa",
"card_type": "Credit",
"saved_to_locker": true
}
},
"storage_type": "volatile",
"card_cvc_token_storage": {
"is_stored": true,
"expires_at": "2024-02-24T11:04:09.922Z"
}
}Authorizations
Format: api-key=<api_key>
Use the API key created under your merchant account from the HyperSwitch dashboard. API key is used to authenticate API requests from your merchant server only. Don't expose this key on a website or embed it in a mobile application.
Body
The unique identifier of the customer.
32 - 64"12345_cus_01926c58bc6e77c09e809964e72af8c8"
You can specify up to 50 keys, with key names up to 40 characters long and values up to 500 characters long. Metadata is useful for storing additional, structured information on an object.
Show child attributes
Show child attributes
Response
Payment Method Intent Created
The unique identifier of the Payment method
"12345_pm_01926c58bc6e77c09e809964e72af8c8"
Unique identifier for a merchant
"merchant_1671528864"
The unique identifier of the customer.
32 - 64"12345_cus_01926c58bc6e77c09e809964e72af8c8"
Indicates the type of payment method. Eg: 'card', 'wallet', etc.
card, card_redirect, pay_later, wallet, bank_redirect, bank_transfer, crypto, bank_debit, reward, real_time_payment, upi, voucher, gift_card, open_banking, mobile_payment, network_token The network transaction ID provided by the card network during a Customer Initiated Transaction (CIT)
when setup_future_usage is set to off_session.
Indicates the sub type of payment method. Eg: 'google_pay' & 'apple_pay' for wallets.
ach, affirm, afterpay_clearpay, alfamart, ali_pay, ali_pay_hk, alma, amazon_pay, paysera, apple_pay, atome, bacs, bancontact_card, becs, benefit, bizum, blik, bluecode, boleto, bca_bank_transfer, bni_va, breadpay, bri_va, bhn_card_network, card_redirect, cimb_va, classic, credit, crypto_currency, cashapp, dana, danamon_va, debit, duit_now, efecty, eft, eps, flexiti, fps, evoucher, giropay, givex, google_pay, go_pay, gcash, ideal, interac, indomaret, klarna, kakao_pay, local_bank_redirect, mandiri_va, knet, mb_way, mobile_pay, momo, momo_atm, multibanco, online_banking_thailand, online_banking_czech_republic, online_banking_finland, online_banking_fpx, online_banking_poland, online_banking_slovakia, oxxo, pago_efectivo, permata_bank_transfer, open_banking_uk, pay_bright, payjustnow, paypal, paze, pix, pay_safe_card, przelewy24, prompt_pay, pse, qris, red_compra, red_pagos, samsung_pay, sepa, sepa_bank_transfer, sepa_guarenteed_debit, skrill, sofort, swish, touch_n_go, trustly, twint, upi_collect, upi_intent, upi_qr, vipps, viet_qr, venmo, walley, we_chat_pay, seven_eleven, lawson, mini_stop, family_mart, seicomart, pay_easy, local_bank_transfer, mifinity, open_banking_pis, direct_carrier_billing, instant_bank_transfer, instant_bank_transfer_finland, instant_bank_transfer_poland, revolut_pay, indonesian_bank_transfer, open_banking, network_token Indicates whether the payment method supports recurring payments. Optional.
true
A timestamp (ISO 8601 code) that determines when the payment method was created
"2023-01-18T11:04:09.922Z"
A timestamp (ISO 8601 code) that determines when the payment method was last used
"2024-02-24T11:04:09.922Z"
Show child attributes
Show child attributes
The connector token details if available
Show child attributes
Show child attributes
Show child attributes
Show child attributes
volatile, persistent Show child attributes
Show child attributes