### List Customers Request Examples (Java, PHP, Python, C#, Go, Node.js, Ruby, Swift, Jquery, Javascript) Source: https://apidocs.culqi.com/index Code samples for listing customers using various programming languages. These examples demonstrate how to make a GET request to the /v2/customers endpoint with query and header parameters. Ensure you replace placeholder values with actual credentials and parameters. ```java HttpResponse response = Unirest.get("https://api.culqi.com/v2/customers?first_name=Richard&last_name=Hendricks&email=richard%40piedpiper.com&address=San%20Francisco%20Bay&address_city=Palo%20Alto&phone_number=3383478&country_code=PE&limit=50&before=cus_test_7lYOtONQ9LxcgJUW&after=cus_test_7lYOtOMM6LxcgJUW") .header("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59") .asString(); ``` -------------------------------- ### List Orders - Java Request Example Source: https://apidocs.culqi.com/index Example of how to list orders using the Culqi API with Java and the Unirest library. It demonstrates making a GET request with query and header parameters. ```java HttpResponse response = Unirest.get("https://api.culqi.com/v2/orders?amount=5000&min_amount=10000&max_amount=10000&creation_date=1476132639&creation_date_from=1476132639&creation_date_to=1476132639&state=created&limit=50&before=ord_test_7lYOtONQ9LxcgJUW&after=ord_test_7lYOtOMM6LxcgJUW") .header("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59") .asString(); ``` -------------------------------- ### Get Customer Request Sample (Java) Source: https://apidocs.culqi.com/index Example of how to make an HTTP GET request to retrieve customer information using the Unirest library in Java. It includes setting the authorization header for API authentication. ```java HttpResponse response = Unirest.get("https://api.culqi.com/v2/customers/cus_test_QDO81GT6Zaseewkp") .header("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59") .asString(); ``` -------------------------------- ### Get Subscription Request Samples (Go) Source: https://apidocs.culqi.com/index Go sample for making a GET request to retrieve subscription details using the net/http package. It includes the necessary authorization headers. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX", nil) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "Bearer sk_test_4eC39HqLyjWDarjt") resp, err := client.Do(req) if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Create Subscription Request Samples Source: https://apidocs.culqi.com/index Examples for creating a new subscription, which links a customer's card to a recurring payment plan. Includes payload and encrypted payload examples, along with code samples in multiple languages. ```json { "card_id": "string", "plan_id": "string", "tyc": true, "metadata": { } } ``` -------------------------------- ### Get Subscription Request Samples (Ruby) Source: https://apidocs.culqi.com/index Ruby sample using the 'net/http' library to make a GET request for subscription details. It includes the necessary authorization headers. ```ruby require 'net/http' require 'uri' uri = URI.parse("https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX") request = Net::HTTP::Get.new(uri) request["Authorization"] = "Bearer sk_test_4eC39HqLyjWDarjt" response = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') do |http| http.request(request) end puts response.body ``` -------------------------------- ### Get Subscription Request Samples (Javascript) Source: https://apidocs.culqi.com/index Javascript sample using the Fetch API to make a GET request for subscription details. It includes the necessary authorization headers. ```javascript const subscriptionId = 'sxn_test_XXXXXXXXXXXXXXXXXXX'; const url = `https://api.culqi.com/v2/recurrent/subscriptions/${subscriptionId}`; const token = 'Bearer sk_test_4eC39HqLyjWDarjt'; fetch(url, { method: 'GET', headers: { 'Authorization': token } }) .then(response => response.text()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Get Subscription Request Samples (Swift) Source: https://apidocs.culqi.com/index Swift sample using URLSession to make a GET request for subscription details. It includes the necessary authorization headers. ```swift import Foundation func getSubscription(subscriptionId: String) { guard let url = URL(string: "https://api.culqi.com/v2/recurrent/subscriptions/(subscriptionId)") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("Bearer sk_test_4eC39HqLyjWDarjt", forHTTPHeaderField: "Authorization") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let data = data { print(String(data: data, encoding: .utf8) ?? "No data") } } task.resume() } getSubscription(subscriptionId: "sxn_test_XXXXXXXXXXXXXXXXXXX") ``` -------------------------------- ### Authentication Example Source: https://apidocs.culqi.com/index This example demonstrates how to authenticate API requests using a Bearer Token. Ensure you replace 'sk_test_UTCQSGcXW8bCyU59' with your actual secret key. ```APIDOC ## POST /v2/charges ### Description This endpoint is used to create a charge. The example provided shows a basic request structure for creating a charge. ### Method POST ### Endpoint /v2/charges ### Parameters #### Query Parameters None #### Request Body - **amount** (integer) - Required - The amount to charge. - **currency_code** (string) - Required - The currency code (e.g., 'PEN'). - **email** (string) - Required - The customer's email address. - **source_data** (object) - Required - Contains details about the payment source. - **token_id** (string) - Required - The token ID generated from card details. - **merchant_pos_id** (string) - Optional - The merchant point of sale ID. ### Request Example ```json { "amount": 1000, "currency_code": "PEN", "email": "test@culqi.com", "source_data": { "token_id": "tk_test_abcdef1234567890" } } ``` ### Response #### Success Response (200) - **object** (string) - The type of object returned (e.g., 'charge'). - **id** (string) - The unique identifier for the charge. - **amount** (integer) - The charged amount. - **currency_code** (string) - The currency code. - **description** (string) - A description of the charge. - **state** (string) - The current state of the charge (e.g., 'approved', 'failed'). - **creation_date** (string) - The date and time the charge was created. - **authorizer_payment_code** (string) - The authorization code from the payment gateway. - **card_brand** (string) - The brand of the card used. - **card_number** (string) - The masked card number. #### Response Example ```json { "object": "charge", "id": "ch_abcdef1234567890", "amount": 1000, "currency_code": "PEN", "description": "Pago de prueba", "state": "approved", "creation_date": "2023-10-27T10:00:00.000Z", "authorizer_payment_code": "123456", "card_brand": "Visa", "card_number": "**** **** **** 1234" } ``` ### Authentication Example (cURL) ```bash curl --location --request POST 'https://api.culqi.com/v2/charges' \ --header 'Authorization: Bearer sk_test_UTCQSGcXW8bCyU59' \ --header 'Content-Type: application/json' \ --data-raw '{ "amount": 1000, "currency_code": "PEN", "email": "test@culqi.com", "source_data": { "token_id": "tk_test_abcdef1234567890" } }' ``` ``` -------------------------------- ### Get Subscription Request Samples (C#) Source: https://apidocs.culqi.com/index C# sample for making a GET request to retrieve subscription details using HttpClient. It includes the necessary authorization headers. ```csharp using System.Net.Http; using System.Threading.Tasks; public class SubscriptionClient { public async Task GetSubscriptionAsync(string subscriptionId) { using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("Authorization", "Bearer sk_test_4eC39HqLyjWDarjt"); var response = await client.GetAsync($"https://api.culqi.com/v2/recurrent/subscriptions/{subscriptionId}"); response.EnsureSuccessStatusCode(); return await response.Content.ReadAsStringAsync(); } } } ``` -------------------------------- ### Culqi API Charge Creation Request - Go Example Source: https://apidocs.culqi.com/index Example of how to construct and send a charge creation request to the Culqi API using Go. This snippet would typically involve using the net/http package to make a POST request. ```go // Go code for creating a charge would go here. // This would involve setting up request body and making an API call. ``` -------------------------------- ### Culqi API Response Headers Example Source: https://apidocs.culqi.com/index This snippet shows an example of the response headers returned by the Culqi API. These headers contain information such as the environment, tracking ID, API version, and content type. ```json "x-culqi-environment": "live", "x-culqi-tracking-id": "9283", "x-culqi-version": "17.01.89", "content-type": "application/json" ``` -------------------------------- ### Culqi API Charge Creation Request - C# Example Source: https://apidocs.culqi.com/index Example of how to construct and send a charge creation request to the Culqi API using C#. This snippet would typically involve using HttpClient to make a POST request. ```csharp // C# code for creating a charge would go here. // This would involve setting up request body and making an API call. ``` -------------------------------- ### Culqi API Charge Creation Request - Javascript Example Source: https://apidocs.culqi.com/index Example of how to construct and send a charge creation request to the Culqi API using plain Javascript (Fetch API). This snippet demonstrates making a POST request with a JSON body. ```javascript const url = 'https://api.culqi.com/v2/charges'; const apiKey = 'YOUR_API_KEY'; const payload = { "amount": "10000", "currency_code": "PEN", "email": "richard@piedpiper.com", "source_id": "tkn_test_0CjjdWhFpEAZlxlz", "capture": true, "antifraud_details": { "address": "Avenida Lima 1234", "address_city": "Lima", "country_code": "PE", "first_name": "culqi", "last_name": "core", "phone_number": "999777666" }, "metadata": { "documentNumber": "77723083" } }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` }, body: JSON.stringify(payload) }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => { console.log(data); }) .catch(error => { console.error('Error:', error); }); ``` -------------------------------- ### Create Subscription - Go Request Sample Source: https://apidocs.culqi.com/index Go code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.culqi.com/v2/recurrent/subscriptions/create" payload := map[string]interface{}{ "card_id": "string", "plan_id": "string", "tyc": true, "metadata": map[string]interface{}{} } jsonPayload, err := json.Marshal(payload) if err != nil { fmt.Println(err) return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonPayload)) if err != nil { fmt.Println(err) return } req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada") client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` -------------------------------- ### Create Plan Request Payload - Go Source: https://apidocs.culqi.com/index Example of creating a subscription plan using Go. This demonstrates constructing the JSON payload and making a POST request to the Culqi API. ```go package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://api.culqi.com/v2/recurrent/plans/create" planData := map[string]interface{}{ "name": "Plan de Prueba.", "short_name": "plan-de-prueba-001", "description": "Descripción Plan de Prueba", "amount": 5, "currency": "PEN", "interval_unit_time": 1, "interval_count": 1, "initial_cycles": map[string]interface{}{ "count": 0, "has_initial_charge": false, "amount": 0, "interval_unit_time": 1 }, "metadata": map[string]interface{}{ "DNI": 123456782 } } jsonBody, err := json.Marshal(planData) if err != nil { fmt.Printf("Error marshaling JSON: %v\n", err) return } req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody)) if err != nil { fmt.Printf("Error creating request: %v\n", err) return } req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer YOUR_SECRET_KEY") client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %v\n", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Printf("Error reading response body: %v\n", err) return } fmt.Printf("Status Code: %d\n", res.StatusCode) fmt.Printf("Response Body: %s\n", body) } ``` -------------------------------- ### Authentication Error Example (JSON) Source: https://apidocs.culqi.com/index This JSON object details an 'authentication_error'. It signifies that the authentication key used is invalid, providing a specific error code and a merchant message guiding the user to check their keys in the Culqi panel. ```json { "object": "error", "type": "authentication_error", "code": "DNGA0019", "merchant_message": "Código de comercio proporcionado inválido: AJVBX245. Revisa tus llaves correctas en tu panel Culqi (http://culqi.com/)." } ``` -------------------------------- ### List Events - Java Request Sample Source: https://apidocs.culqi.com/index This Java code snippet shows how to use the Unirest library to make an HTTP GET request to list events. It includes examples of various query parameters such as type, date filters, limit, and pagination. ```java HttpResponse response = Unirest.get("https://api.culqi.com/v2/events?type=charge.creation.succeeded%20(cargos%20exitosos)&creation_date=1476132639&creation_date_from=1476132639&creation_date_to=1476132639&limit=50&before=evt_test_7lYOtONQ9LxcgJUW&after=evt_test_7lYOtOMM6LxcgJUW") .header("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59") .asString(); ``` -------------------------------- ### Create Subscription - C# Request Sample Source: https://apidocs.culqi.com/index C# code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```csharp using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; public class SubscriptionCreator { public static async Task CreateSubscriptionAsync() { using (var client = new HttpClient()) { var url = "https://api.culqi.com/v2/recurrent/subscriptions/create"; var requestBody = new { card_id = "string", plan_id = "string", tyc = true, metadata = new object() }; var json = System.Text.Json.JsonSerializer.Serialize(requestBody); var content = new StringContent(json, Encoding.UTF8, "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada"); var response = await client.PostAsync(url, content); var responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } } } ``` -------------------------------- ### Get Subscription Request Samples (jQuery) Source: https://apidocs.culqi.com/index jQuery sample using $.ajax to make a GET request for subscription details. It includes the necessary authorization headers. ```javascript $.ajax({ url: "https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX", method: "GET", headers: { "Authorization": "Bearer sk_test_4eC39HqLyjWDarjt" }, success: function(response) { console.log(response); }, error: function(error) { console.error("Error:", error); } }); ``` -------------------------------- ### Create Subscription - Swift Request Sample Source: https://apidocs.culqi.com/index Swift code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```swift import Foundation func createSubscription() { guard let url = URL(string: "https://api.culqi.com/v2/recurrent/subscriptions/create") else { return } var request = URLRequest(url: url) request.httpMethod = "POST" request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.setValue("Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada", forHTTPHeaderField: "Authorization") let body: [String: Any] = [ "card_id": "string", "plan_id": "string", "tyc": true, "metadata": [:] ] request.httpBody = try? JSONSerialization.data(withJSONObject: body, options: []) let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { print(error?.localizedDescription ?? "No data") return } if let httpResponse = response as? HTTPURLResponse { print("Status code: \(httpResponse.statusCode)") } if let responseJSON = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] { print(responseJSON) } } task.resume() } createSubscription() ``` -------------------------------- ### Create Subscription - Java Request Sample Source: https://apidocs.culqi.com/index Java code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```java HttpResponse response = Unirest.post("https://api.culqi.com/v2/recurrent/subscriptions/create") .header("Content-Type", "application/json") .header("Authorization", "Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada") .body("{\"card_id\": \"string\", \"plan_id\": \"string\", \"tyc\": true, \"metadata\": { }}") .asString(); ``` -------------------------------- ### Create Subscription - Ruby Request Sample Source: https://apidocs.culqi.com/index Ruby code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```ruby require 'net/http' require 'uri' require 'json' uri = URI.parse('https://api.culqi.com/v2/recurrent/subscriptions/create') https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true request = Net::HTTP::Post.new(uri.request_uri) request['Content-Type'] = 'application/json' request['Authorization'] = 'Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada' request.body = { card_id: 'string', plan_id: 'string', tyc: true, metadata: {} }.to_json response = https.request(request) puts JSON.parse(response.body) ``` -------------------------------- ### Get Subscription Request Samples (Node.js) Source: https://apidocs.culqi.com/index Node.js sample using the 'node-fetch' library to make a GET request for subscription details. It includes the necessary authorization headers. ```javascript import fetch from 'node-fetch'; const subscriptionId = 'sxn_test_XXXXXXXXXXXXXXXXXXX'; const url = `https://api.culqi.com/v2/recurrent/subscriptions/${subscriptionId}`; const token = 'Bearer sk_test_4eC39HqLyjWDarjt'; fetch(url, { method: 'GET', headers: { 'Authorization': token } }) .then(response => response.text()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Create Subscription - Python Request Sample Source: https://apidocs.culqi.com/index Python code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```python import requests url = "https://api.culqi.com/v2/recurrent/subscriptions/create" headers = { "Content-Type": "application/json", "Authorization": "Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada" } payload = { "card_id": "string", "plan_id": "string", "tyc": True, "metadata": {} } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` -------------------------------- ### Create Subscription - Javascript Request Sample Source: https://apidocs.culqi.com/index Vanilla Javascript code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```javascript const url = 'https://api.culqi.com/v2/recurrent/subscriptions/create'; const apiKey = 'sk_test_UTCQSGcXW8bCyU59Llave_privada'; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}` }, body: JSON.stringify({ card_id: 'string', plan_id: 'string', tyc: true, metadata: {} }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Create Subscription - PHP Request Sample Source: https://apidocs.culqi.com/index PHP code sample for creating a subscription. This involves sending a POST request to the Culqi API with the necessary subscription details. ```php 'string', 'plan_id' => 'string', 'tyc' => true, 'metadata' => [] ])); $headers = array(); $headers[] = 'Content-Type: application/json'; $headers[] = 'Authorization: Bearer sk_test_UTCQSGcXW8bCyU59Llave_privada'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } curl_close($ch); ?> ``` -------------------------------- ### Get Subscription Request Samples (Python) Source: https://apidocs.culqi.com/index Python sample for making a GET request to retrieve subscription details using the requests library. It includes the necessary authorization headers. ```python import requests headers = { "Authorization": "Bearer sk_test_4eC39HqLyjWDarjt" } response = requests.get("https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX", headers=headers) print(response.text) ``` -------------------------------- ### Create Token API Request (Go) Source: https://apidocs.culqi.com/index Example of how to make a request to create a token using the Culqi API in Go. This code snippet demonstrates sending the necessary card information to the API endpoint. ```go // Go code for creating a token would go here. ``` -------------------------------- ### Get Subscription Request Samples (PHP) Source: https://apidocs.culqi.com/index PHP sample for making a GET request to retrieve subscription details from the Culqi API using cURL. It includes authorization headers. ```php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer sk_test_4eC39HqLyjWDarjt" ], ]); $response = curl_exec($curl); $err = curl_error($curl); c mengembangkan url_close($curl); ``` -------------------------------- ### Get Subscription Request Samples (Java) Source: https://apidocs.culqi.com/index Java sample for making a GET request to retrieve subscription details from the Culqi API. It uses the Unirest library for HTTP requests. ```java HttpResponse response = Unirest.get("https://api.culqi.com/v2/recurrent/subscriptions/sxn_test_XXXXXXXXXXXXXXXXXXX") .header("Authorization", "Bearer sk_test_4eC39HqLyjWDarjt") .asString(); ``` -------------------------------- ### Create Plan Request Payload - C# Source: https://apidocs.culqi.com/index Example of creating a subscription plan using C#. This shows how to construct the request body using HttpClient for the Culqi API. ```csharp using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Newtonsoft.Json; public class CreatePlan { public static async Task Main(string[] args) { var client = new HttpClient(); var url = "https://api.culqi.com/v2/recurrent/plans/create"; var planData = new { name = "Plan de Prueba.", short_name = "plan-de-prueba-001", description = "Descripción Plan de Prueba", amount = 5, currency = "PEN", interval_unit_time = 1, interval_count = 1, initial_cycles = new { count = 0, has_initial_charge = false, amount = 0, interval_unit_time = 1 }, metadata = new { DNI = 123456782 } }; var jsonContent = JsonConvert.SerializeObject(planData); var httpContent = new StringContent(jsonContent, Encoding.UTF8, "application/json"); client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_SECRET_KEY"); try { HttpResponseMessage response = await client.PostAsync(url, httpContent); response.EnsureSuccessStatusCode(); // Throw an exception if the status code is not 2xx string responseBody = await response.Content.ReadAsStringAsync(); Console.WriteLine(responseBody); } catch (HttpRequestException e) { Console.WriteLine($"Request error: {e.Message}"); } } } ``` -------------------------------- ### Customer Payload Example (JSON) Source: https://apidocs.culqi.com/index Example JSON payload for creating a customer. It includes fields for personal information and address details. This payload is used as input for customer creation requests. ```json { "first_name": "Richard", "last_name": "Hendricks", "email": "richard@piedpiper.com", "address": "San Francisco Bay Area", "address_city": "Palo Alto", "country_code": "US", "phone_number": "6505434800" } ``` -------------------------------- ### CULQI API Authentication Example (curl) Source: https://apidocs.culqi.com/index Example demonstrating how to authenticate API requests using a Bearer Token. This involves setting the 'Authorization' header with your secret key and specifying the 'Content-Type'. ```bash curl --location --request POST 'https://api.culqi.com/v2/charges' \ --header 'Authorization: Bearer sk_test_UTCQSGcXW8bCyU59' \ --header 'Content-Type: application/json' ```