### Go Example - GET Checkout Detail Source: https://docs.pagamerican.app/api-reference/checkouts/checkout-detail Go example using net/http to perform a GET request for checkout details. The code ignores errors; ensure your code handles them appropriately. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/checkouts/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Java Unirest Example - GET Checkout Detail Source: https://docs.pagamerican.app/api-reference/checkouts/checkout-detail Java example using the Unirest-HTTP library to fetch checkout details. Assumes Unirest is installed. ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/checkouts/{id}") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### Go HTTP example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases Go example using net/http to GET /api/v1/purchases. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/purchases" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Ruby Example - GET Checkout Detail Source: https://docs.pagamerican.app/api-reference/checkouts/checkout-detail Ruby example using net/http to perform a GET request for checkout details. Enables SSL for HTTPS, sets the Authorization header, and outputs the response body. ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/checkouts/{id}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Python Example - GET Checkout Detail Source: https://docs.pagamerican.app/api-reference/checkouts/checkout-detail Python requests example to fetch a checkout detail. Uses a simple GET request to the endpoint and prints the response text. Requires the requests library. ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/checkouts/{id}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Go: GET order detail Source: https://docs.pagamerican.app/api-reference/orders/order-detail Go example using the standard net/http package to fetch order details. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/orders/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Go HTTP request to get purchase details Source: https://docs.pagamerican.app/api-reference/purchases/purchase-detail Go example using net/http to fetch purchase details. Creates a GET request with the Authorization header and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/purchases/{id}" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### PHP Example - GET Checkout Detail Source: https://docs.pagamerican.app/api-reference/checkouts/checkout-detail PHP cURL example to fetch a checkout detail. Sets up a GET request with the Authorization header and prints the response or an error message. Requires PHP cURL extension. ```php "https://external-api-service.pagamerican.app/api/v1/checkouts/{id}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Python requests example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases Python example using the requests library to GET /api/v1/purchases. Prints the response text. ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/purchases" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Ruby Net::HTTP example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases Ruby example using Net::HTTP to GET /api/v1/purchases. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/purchases") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### List orders with Go net/http Source: https://docs.pagamerican.app/api-reference/orders/list-orders Go example using net/http to GET /api/v1/orders. Replace with your bearer token. Prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/orders" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### Java Unirest example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases Java example using Unirest to GET /api/v1/purchases. Returns an HttpResponse. ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/purchases") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### List offers with cURL, Go, Java, and Ruby Source: https://docs.pagamerican.app/api-reference/offers/list-offers Example requests to list offers using the external API service. Each snippet sends a GET request to the /api/v1/offers endpoint with the limit and page query parameters and an Authorization header containing a Bearer token. The PHP and Go examples print the response body or an error, while the Java and Ruby examples return the response directly. ```php "https://external-api-service.pagamerican.app/api/v1/offers?limit=1000&page=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/offers?limit=1000&page=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/offers?limit=1000&page=1") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/offers?limit=1000&page=1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Java Unirest to get purchase details Source: https://docs.pagamerican.app/api-reference/purchases/purchase-detail Java example using Unirest to fetch purchase details. Sends a GET request with the Authorization header and returns the response as a string. ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/purchases/{id}") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### JavaScript fetch example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases JavaScript example using fetch to GET /api/v1/purchases. Logs the JSON response or error. ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://external-api-service.pagamerican.app/api/v1/purchases', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Ruby: GET order detail Source: https://docs.pagamerican.app/api-reference/orders/order-detail Ruby example using Net::HTTP to fetch order details. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/orders/{id}") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Python requests to get purchase details Source: https://docs.pagamerican.app/api-reference/purchases/purchase-detail Python example using the requests library to fetch purchase details. Requires the requests package and a valid bearer token. ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/purchases/{id}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Python: GET order detail Source: https://docs.pagamerican.app/api-reference/orders/order-detail Python example using the requests library to fetch order details. Prints the raw response text. ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/orders/{id}" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### List orders with Ruby net/http Source: https://docs.pagamerican.app/api-reference/orders/list-orders Ruby example using net/http to GET /api/v1/orders. Replace with your bearer token. Prints the response body. ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/orders") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### List orders with Python requests Source: https://docs.pagamerican.app/api-reference/orders/list-orders Python example using the requests library to GET /api/v1/orders. Replace with your bearer token. Prints the response text. ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/orders" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### PHP cURL example Source: https://docs.pagamerican.app/api-reference/purchases/list-purchases PHP example using cURL to GET /api/v1/purchases. Handles errors and prints the response. ```php "https://external-api-service.pagamerican.app/api/v1/purchases", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Successful response example Source: https://docs.pagamerican.app/api-reference/products/list-products Example of a 200 response containing a list of products and pagination metadata. ```JSON { "data": [ { "productId": 898, "productUcode": "prd_01a000cf-a4b8-742c-9453-64c8a4a15399", "name": "EXAMPLE PRODUCT", "friendlyName": "Example Product", "status": "active", "supportEmail": "support@example.com", "paymentMethods": "credit_card,pix", "supplierId": 42, "supplierName": "Example Supplier", "externalId": "SKU-EXP-001", "updatedAt": "2026-08-20 11:00:00" } ], "meta": { "count": 14, "limit": 1000, "page": 1, "truncated": false } } ``` -------------------------------- ### List offers with Go Source: https://docs.pagamerican.app/api-reference/offers/list-offers Uses the net/http package to send a GET request and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/offers?limit=1000&page=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### GET /api/v1/checkouts Source: https://docs.pagamerican.app/api-reference/checkouts/list-checkouts This snippet documents the GET /api/v1/checkouts endpoint, including its purpose, parameters, request example, response schema, and error responses. ```APIDOC ## GET /api/v1/checkouts ### Description Lists checkout sessions in the window (by `loadedAt`). This endpoint is creator only. ### Method GET ### Endpoint https://external-api-service.pagamerican.app/api/v1/checkouts ### Parameters #### Query Parameters - **from** (string) - Optional - Start date for the window (format: YYYY-MM-DD). - **to** (string) - Optional - End date for the window (format: YYYY-MM-DD). - **updatedFrom** (string) - Optional - Start date for the update window (format: YYYY-MM-DD). - **updatedTo** (string) - Optional - End date for the update window (format: YYYY-MM-DD). - **limit** (integer) - Optional - Maximum number of records to return (default: 1000). - **page** (integer) - Optional - Page number for pagination (default: 1). #### Headers - **Authorization** (string) - Required - Bearer token. Your opaque API key (`pag_...`) sent directly as the Bearer token. There is no token/JWT exchange. ### Request Example ``` curl --request GET \ --url https://external-api-service.pagamerican.app/api/v1/checkouts \ --header 'Authorization: Bearer ' ``` ### Response #### Success Response (200) - **data** (array) - List of checkout objects. - **checkoutId** (string) - Unique identifier for the checkout. - **sessionId** (string) - Session identifier. - **purchaseType** (string) - Type of purchase (e.g., "front"). - **sessionMode** (string) - Mode of the session (e.g., "live"). - **checkoutVersion** (string) - Version of the checkout (e.g., "v2"). - **offerCode** (string) - Offer code. - **offerName** (string) - Offer name. - **productName** (string) - Product name. - **productId** (integer) - Product identifier. - **productSupportEmail** (string) - Support email for the product. - **paymentMethod** (string) - Payment method used (e.g., "credit_card"). - **cardBrand** (string) - Card brand (e.g., "visa"). - **lastDeclineCode** (string) - Last decline code, if any. - **customerName** (string) - Customer name. - **customerEmail** (string) - Customer email. - **customerPhone** (string) - Customer phone. - **shippingCity** (string) - Shipping city. - **shippingState** (string) - Shipping state. - **shippingCountry** (string) - Shipping country. - **amountTransaction** (integer) - Transaction amount. - **attemptCount** (integer) - Total number of attempts. - **attemptApprovedCount** (integer) - Number of approved attempts. - **attemptDeclinedCount** (integer) - Number of declined attempts. - **purchaseCount** (integer) - Number of purchases. - **orderId** (string) - Order identifier. - **isRecovered** (boolean) - Whether the checkout was recovered. - **loadedAt** (string) - Timestamp when the checkout was loaded. - **sessionInitializedAt** (string) - Timestamp when the session was initialized. - **firstAttemptAt** (string) - Timestamp of the first attempt. - **firstApprovedAt** (string) - Timestamp of the first approval. - **abandonedAt** (string) - Timestamp when abandoned, if any. - **purchasedAt** (string) - Timestamp when purchased. - **meta** (object) - Pagination and filter metadata. - **count** (integer) - Number of records returned. - **limit** (integer) - Limit used. - **page** (integer) - Current page. - **from** (string) - Start date used. - **to** (string) - End date used. - **updatedFrom** (string) - Start update date used. - **updatedTo** (string) - End update date used. - **truncated** (boolean) - Whether the results were truncated. #### Response Example ``` { "data": [ { "checkoutId": "chk_01a04083-beb7-71fc-b5a6-1b0091157d02", "sessionId": "sess_01a04083-9b21-7c1a", "purchaseType": "front", "sessionMode": "live", "checkoutVersion": "v2", "offerCode": "Z5Qls71x", "offerName": "EXAMPLE OFFER - x12", "productName": "EXAMPLE PRODUCT", "productId": 898, "productSupportEmail": "support@example.com", "paymentMethod": "credit_card", "cardBrand": "visa", "lastDeclineCode": "insufficient_funds", "customerName": "Jane Doe", "customerEmail": "jane.doe@example.com", "customerPhone": "(555) 000-0000", "shippingCity": "San Antonio", "shippingState": "TX", "shippingCountry": "US", "amountTransaction": 522, "attemptCount": 2, "attemptApprovedCount": 1, "attemptDeclinedCount": 1, "purchaseCount": 2, "orderId": "129156", "isRecovered": false, "loadedAt": "2026-08-26 23:58:10", "sessionInitializedAt": "2026-08-26 23:59:34", "firstAttemptAt": "2026-08-27 00:02:15", "firstApprovedAt": "2026-08-27 00:06:39", "abandonedAt": "", "purchasedAt": "2026-08-27 00:06:39" } ], "meta": { "count": 10, "limit": 1000, "page": 1, "from": "2026-09-01", "to": "2026-09-08", "updatedFrom": "2026-09-01", "updatedTo": "2026-09-08", "truncated": false } } ``` ### Error Responses #### 400 Bad Request - **error** (object) - Error details. - **code** (string) - Error code (e.g., "invalid_request"). - **message** (string) - Error message (e.g., "from must be before to"). - **correlation_id** (string) - Correlation ID for tracking. #### 401 Unauthorized - **error** (object) - Error details. - **code** (string) - Error code. - **message** (string) - Error message. - **correlation_id** (string) - Correlation ID. #### 403 Forbidden - **error** (object) - Error details. - **code** (string) - Error code. - **message** (string) - Error message. - **correlation_id** (string) - Correlation ID. #### 422 Unprocessable Entity - **error** (object) - Error details. - **code** (string) - Error code. - **message** (string) - Error message. - **correlation_id** (string) - Correlation ID. #### 429 Too Many Requests - **error** (object) - Error details. - **code** (string) - Error code. - **message** (string) - Error message. - **correlation_id** (string) - Correlation ID. #### Error Response Example ``` { "error": { "code": "invalid_request", "message": "from must be before to", "correlation_id": "a1b2c3d4-0000-0000-0000-000000000000" } } ``` ``` -------------------------------- ### Go HTTP request to list products Source: https://docs.pagamerican.app/api-reference/products/list-products Uses the net/http package to send a GET request with a Bearer token and prints the response body. ```Go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### List products with cURL, Python, JavaScript, PHP, Go, Java, and Ruby Source: https://docs.pagamerican.app/api-reference/products/list-products Send a GET request to the List products endpoint with the Authorization header set to 'Bearer '. The response is printed or logged. The URL includes query parameters limit=1000 and page=1. ```bash curl --request GET \ --url 'https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1' \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://external-api-service.pagamerican.app/api/v1/products?limit=1000&page=1") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Java (Unirest): GET order detail Source: https://docs.pagamerican.app/api-reference/orders/order-detail Java example using Unirest to fetch order details. Returns the response as a string. ```java HttpResponse response = Unirest.get("https://external-api-service.pagamerican.app/api/v1/orders/{id}") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### PHP: GET order detail Source: https://docs.pagamerican.app/api-reference/orders/order-detail PHP example using cURL to fetch order details. Handles errors and prints the response. ```php "https://external-api-service.pagamerican.app/api/v1/orders/{id}", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ``` -------------------------------- ### Successful response example Source: https://docs.pagamerican.app/api-reference/offers/list-offers Example successful response (200) containing an array of offers and pagination metadata. ```json { "data": [ { "offerId": 11030, "offerUcode": "off_01a00816-e538-7f93-9177-ac7ab9a1302c", "offerCode": "Z5Qls71x", "name": "EXAMPLE OFFER - x12", "friendlyName": "Example Product 12-pack", "offerType": "upsell", "sku": "UP1-EXAMPLE-PROD", "price": 228, "originalPrice": 348, "shippingPrice": 0, "status": "active", "productId": 898, "productName": "EXAMPLE PRODUCT", "funnelId": "fnl_01a0", "updatedAt": "2026-08-24 03:19:01" } ], "meta": { "count": 14, "limit": 1000, "page": 1, "truncated": false } } ``` -------------------------------- ### List chargebacks with Go Source: https://docs.pagamerican.app/api-reference/chargebacks/list-chargebacks Uses the net/http package to send a GET request and prints the response body. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://external-api-service.pagamerican.app/api/v1/chargebacks" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ```