### Fetch account metadata requests Source: https://docs.pagos.ai/network-tokenization/endpoint/account Examples of how to perform a GET request to retrieve account metadata using different programming languages. ```curl curl --request GET \ --url https://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account \ --header 'Authorization: Bearer ' \ --header 'x-merchant-id: ' ``` ```python import requests url = "https://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account" headers = { "x-merchant-id": "", "Authorization": "Bearer " } response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = { method: 'GET', headers: {'x-merchant-id': '', Authorization: 'Bearer '} }; fetch('https://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account", 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 ", "x-merchant-id: " ], ]); $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://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("x-merchant-id", "") 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://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account") .header("x-merchant-id", "") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://services.sandbox.pagosapi.com/toucan/tokens/{tokenRefId}/account") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["x-merchant-id"] = '' request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### BIN Continuity API Request Examples Source: https://docs.pagos.ai/bin-data-APIs/endpoint/continuity Examples of how to perform a GET request to the BIN continuity endpoint using various programming languages. ```curl curl --request GET \ --url https://parrot.sandbox.pagosapi.com/bins/continuity \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://parrot.sandbox.pagosapi.com/bins/continuity" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://parrot.sandbox.pagosapi.com/bins/continuity', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://parrot.sandbox.pagosapi.com/bins/continuity", 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; } ``` -------------------------------- ### Fetch BIN continuity data Source: https://docs.pagos.ai/bin-data-APIs/endpoint/continuity Examples of how to perform a GET request to the BIN continuity endpoint across various programming languages. ```bash curl --request GET \ --url https://parrot.sandbox.pagosapi.com/bins/continuity \ --header 'Authorization: Bearer ' ``` ```python import requests url = "https://parrot.sandbox.pagosapi.com/bins/continuity" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` ```javascript const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; fetch('https://parrot.sandbox.pagosapi.com/bins/continuity', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://parrot.sandbox.pagosapi.com/bins/continuity", 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://parrot.sandbox.pagosapi.com/bins/continuity" 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://parrot.sandbox.pagosapi.com/bins/continuity") .header("Authorization", "Bearer ") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://parrot.sandbox.pagosapi.com/bins/continuity") 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 ``` -------------------------------- ### GET /bins Source: https://docs.pagos.ai/bin-data-APIs/bin-data-api-overview Retrieves detailed information for a specific BIN/IIN. ```APIDOC ## GET /bins ### Description Retrieves card details including brand, type, and issuing bank for a provided 6-10 digit BIN/IIN. ### Method GET ### Endpoint https://parrot.prod.pagosapi.com/bins ### Parameters #### Query Parameters - **bin** (string) - Required - The 6-10 digit BIN/IIN to look up. ### Request Example curl --request GET \ --url 'https://parrot.prod.pagosapi.com/bins?bin=55630400' \ --header 'Authorization:Bearer ' ### Response #### Success Response (200) - **card** (object) - Contains details about the card including brand, type, product, bank, and country information. #### Response Example { "card": { "number": { "length": 16 }, "bin_min": "5563040000000000000", "bin_max": "5563049999999999999", "card_brand": "MASTERCARD", "type": "Credit", "prepaid": false, "product": { "product_id": "MCF", "product_name": "Mastercard Corporate Fleet Card" }, "bank": { "name": "CITIBANK N.A." }, "country": { "alpha2": "US", "numeric": "840", "name": "UNITED STATES OF AMERICA" }, "correlation_id": "eyJGaWxlSWQiOjI3NiwiVmVyc2lvbiI6NX0=" } } ``` -------------------------------- ### Retrieve BIN snapshot via Go Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use the net/http package to perform the GET request. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://parrot.sandbox.pagosapi.com/batch/files" 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)) } ``` -------------------------------- ### Retrieve BIN snapshot via Java Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use the Unirest library to perform the GET request. ```java HttpResponse response = Unirest.get("https://parrot.sandbox.pagosapi.com/batch/files") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### GET /batch/files Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Retrieves a snapshot CSV file containing all BINs. ```APIDOC ## GET /batch/files ### Description Retrieves a snapshot CSV file of all BINs. ### Method GET ### Endpoint https://parrot.sandbox.pagosapi.com/batch/files ### Response #### Success Response (200) - **type** (string) - The type of the file. - **name** (string) - The name of the file. - **url** (string) - The URL to download the file. - **changes** (object) - Summary of changes in the BIN data. #### Response Example [ { "type": "", "name": "", "url": "", "changes": { "bins_removed": 123, "bins_updated": 123, "bins_added": 123, "last_update_date": "", "sources": [ { "bins_total": 123, "source": "", "changes": { "percentage": "", "removed": 123, "updated": 123, "added": 123 } } ] } } ] ``` -------------------------------- ### Create a Disbursement Source: https://docs.pagos.ai/data-ingestion-api/endpoint/disbursements Examples for sending a POST request to the disbursements endpoint across various programming languages. ```curl curl --request POST \ --url https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements \ --header 'Content-Type: application/json' \ --data ' { "disbursement_id": "", "amount": 1, "currency": "", "created": "", "status": "", "pagos_codes": {}, "additional_data": { "merchant_account_id": "", "metadata": {} } } ' ``` ```python import requests url = "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements" payload = { "disbursement_id": "", "amount": 1, "currency": "", "created": "", "status": "", "pagos_codes": {}, "additional_data": { "merchant_account_id": "", "metadata": {} } } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) ``` ```javascript const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ disbursement_id: '', amount: 1, currency: '', created: '', status: '', pagos_codes: {}, additional_data: {merchant_account_id: '', metadata: {}} }) }; fetch('https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements", 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([ 'disbursement_id' => '', 'amount' => 1, 'currency' => '', 'created' => '', 'status' => '', 'pagos_codes' => [ ], 'additional_data' => [ 'merchant_account_id' => '', 'metadata' => [ ] ] ]), CURLOPT_HTTPHEADER => [ "Content-Type: application/json" ], ]); $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" "strings" "net/http" "io" ) func main() { url := "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements" payload := strings.NewReader("{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}") req, _ := http.NewRequest("POST", url, payload) 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)) } ``` ```java HttpResponse response = Unirest.post("https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements") .header("Content-Type", "application/json") .body("{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Retrieve BIN snapshot via Ruby Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use the Net::HTTP library to perform the GET request. ```ruby require 'uri' require 'net/http' url = URI("https://parrot.sandbox.pagosapi.com/batch/files") 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 ``` -------------------------------- ### GET /bins Source: https://docs.pagos.ai/bin-data-APIs/endpoint/single Retrieves information for a specific BIN. Supports optional enhanced attributes. ```APIDOC ## GET /bins ### Description Performs a lookup for a single BIN to retrieve card and issuer details. ### Method GET ### Endpoint /bins ### Parameters #### Query Parameters - **bin** (string) - Required - Bin number (6-10 digits) - **enhanced** (boolean) - Optional - Set to true for enhanced attributes ### Response #### Success Response (200) - **card** (object) - Detailed card information including brand, type, funding source, and issuer details. #### Error Responses - **403** - Client not enrolled in Parrot - **404** - BIN not found ``` -------------------------------- ### Create Dispute Record Source: https://docs.pagos.ai/data-ingestion-api/endpoint/disputes Examples for submitting dispute data to the Pagos API. ```bash curl --request POST \ --url https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disputes \ --header 'Content-Type: application/json' \ --data ' { "dispute_id": "", "amount": 1, "currency": "", "created": "", "transaction_id": "", "payment_method_details": { "payment_method_type": "", "card": { "attributes": { "network": "", "type": "", "bin": "", "issuer_bank": "", "issuer_country": "" } } }, "pagos_codes": {}, "amount_refunded": 1, "transaction_order_id": "", "dispute_response": { "status": "", "reason_code": "", "reason": "" }, "additional_data": { "merchant_account_id": "", "order_id": "", "acquirer_reference_number": "", "metadata": {} } } ' ``` ```python import requests url = "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disputes" payload = { "dispute_id": "", "amount": 1, "currency": "", "created": "", "transaction_id": "", "payment_method_details": { "payment_method_type": "", "card": { "attributes": { "network": "", "type": "", "bin": "", "issuer_bank": "", "issuer_country": "" } } }, "pagos_codes": {}, "amount_refunded": 1, "transaction_order_id": "", "dispute_response": { "status": "", "reason_code": "", "reason": "" }, "additional_data": { "merchant_account_id": "", "order_id": "", "acquirer_reference_number": "", "metadata": {} } } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) ``` ```javascript const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ dispute_id: '', amount: 1, currency: '', created: '', transaction_id: '', payment_method_details: { payment_method_type: '', card: { attributes: { network: '', type: '', bin: '', issuer_bank: '', issuer_country: '' } } }, pagos_codes: {}, amount_refunded: 1, transaction_order_id: '', dispute_response: {status: '', reason_code: '', reason: ''}, additional_data: { merchant_account_id: '', order_id: '', acquirer_reference_number: '', metadata: {} } }) }; fetch('https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disputes', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` -------------------------------- ### Retrieve BIN snapshot via Python Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use the requests library to perform a GET request for the BIN snapshot. ```python import requests url = "https://parrot.sandbox.pagosapi.com/batch/files" headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### BIN Lookup Response Source: https://docs.pagos.ai/bin-data-APIs/bin-data-api-testing Example JSON response returned by the BIN Data API in Test Mode. ```json { "card": { "number": { "length": 16 }, "bin_length": 6, "pagos_bin_length": 6, "bin_min": "4854270000000000000", "bin_max": "4854279999999999999", "pan_or_token": "pan", "virtual_card": null, "level2": false, "level3": false, "alm": false, "account_updater": true, "domestic_only": false, "gambling_blocked": false, "issuer_currency": "USD", "reloadable": false, "additional_card_brands": [ { "card_brand": "PULSE", "bin_max": "4854279999999999999", "bin_min": "4854270000000000000", "card_brand_product": null, "card_brand_bank_name": null, "ecom_enabled": true, "billpay_enabled": true } ], "card_brand": "VISA", "card_segment_type": "Business", "combo_card": null, "type": "Debit", "funding_source": "DEBIT", "prepaid": false, "product": { "product_id": "G", "product_name": "Visa Business" }, "bank": { "name": "SPACE COAST CREDIT UNION", "phone": null, "url": null, "clean_name": "Space Coast Credit Union" }, "country": { "alpha2": "US", "numeric": "840", "name": "UNITED STATES OF AMERICA" }, "authentication": { "authentication_required": false, "authentication_name": null }, "cost": { "interchange": { "regulated": false, "regulated_name": "GOVERNMENT EXEMPT INTERCHANGE FEE", "domestic": null, "inter": null, "intra": null, "notes": null } }, "networkfees": {}, "correlation_id": "eyJGaWxlSWQiOjIzMDc5LCJWZXJzaW9uIjoyNDAyfQ==", "issuer_supports_tokenization": null, "multi_account_access_indicator": "N", "shared_bin": false } } ``` -------------------------------- ### Example Webhook Message Source: https://docs.pagos.ai/account-updater/batch-webhooks A sample representation of a webhook message including the signature header and the JSON body. ```json { x-pagos-signature: t=1731326247,v1=K1dEDpPNgRiehBEZzyx1/mZYKjE0jrK3qkvklPqAG+g= body: { "type":"wh_job_created", "data":{ "job_id":23255, "timestamp":"2024-11-11T11:57:22.6315227Z", "merchant_id":"ae89c6af-dde7-4460-8a6f-bd64ec0826a6" } } } ``` -------------------------------- ### Create Disbursement Request Source: https://docs.pagos.ai/data-ingestion-api/endpoint/disbursements Examples of how to send a POST request to the disbursements endpoint across various programming languages. ```curl curl --request POST \ --url https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements \ --header 'Content-Type: application/json' \ --data ' { "disbursement_id": "", "amount": 1, "currency": "", "created": "", "status": "", "pagos_codes": {}, "additional_data": { "merchant_account_id": "", "metadata": {} } } ' ``` ```python import requests url = "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements" payload = { "disbursement_id": "", "amount": 1, "currency": "", "created": "", "status": "", "pagos_codes": {}, "additional_data": { "merchant_account_id": "", "metadata": {} } } headers = {"Content-Type": "application/json"} response = requests.post(url, json=payload, headers=headers) print(response.text) ``` ```javascript const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ disbursement_id: '', amount: 1, currency: '', created: '', status: '', pagos_codes: {}, additional_data: {merchant_account_id: '', metadata: {}} }) }; fetch('https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err)); ``` ```php "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements", 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([ 'disbursement_id' => '', 'amount' => 1, 'currency' => '', 'created' => '', 'status' => '', 'pagos_codes' => [ ], 'additional_data' => [ 'merchant_account_id' => '', 'metadata' => [ ] ] ]), CURLOPT_HTTPHEADER => [ "Content-Type: application/json" ], ]); $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" "strings" "net/http" "io" ) func main() { url := "https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements" payload := strings.NewReader("{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}") req, _ := http.NewRequest("POST", url, payload) 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)) } ``` ```java HttpResponse response = Unirest.post("https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements") .header("Content-Type", "application/json") .body("{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}") .asString(); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.sandbox.nest.pagosapi.com/v1/{account_id}/disbursements") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"disbursement_id\": \"\",\n \"amount\": 1,\n \"currency\": \"\",\n \"created\": \"\",\n \"status\": \"\",\n \"pagos_codes\": {},\n \"additional_data\": {\n \"merchant_account_id\": \"\",\n \"metadata\": {}\n }\n}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Enrichment API Request via cURL Source: https://docs.pagos.ai/data-ingestion-api/enrichment-api-overview Example of how to submit an enrichment request using the cURL command-line tool with authentication headers. ```bash curl --request POST \ --url https://api.sandbox.nest.pagosapi.com/v1/transactions/enrichment \ --header 'Authorization: Bearer XXX_YYY_ZZZ' \ --header 'Content-Type: application/json' \ --data '{ "transaction_id": "SQK3T3B6GSRZZCV5", "metadata": { "subscription_id": "s_9kBsm9XudQKhIKpJmNaG2J3zeCwshgtk" } }' ``` -------------------------------- ### BIN Data API response format Source: https://docs.pagos.ai/bin-data-APIs/bin-data-api-overview Example of the JSON object returned by the BIN Data API containing card and issuer details. ```json { "card": { "number": { "length": 16 }, "bin_min": "5563040000000000000", "bin_max": "5563049999999999999", "card_brand": "MASTERCARD", "type": "Credit", "prepaid": false, "product": { "product_id": "MCF", "product_name": "Mastercard Corporate Fleet Card" }, "bank": { "name": "CITIBANK N.A." }, "country": { "alpha2": "US", "numeric": "840", "name": "UNITED STATES OF AMERICA" }, "correlation_id": "eyJGaWxlSWQiOjI3NiwiVmVyc2lvbiI6NX0=" } } ``` -------------------------------- ### OpenAPI Specification for Single BIN Lookup Source: https://docs.pagos.ai/bin-data-APIs/endpoint/single Defines the GET /bins endpoint, including required parameters and response schemas for enhanced BIN data. ```yaml openapi: 3.0.1 info: title: Parrot API version: parrot-api servers: - url: https://parrot.sandbox.pagosapi.com - url: https://parrot.prod.pagosapi.com security: - bearerAuth: [] paths: /bins: get: tags: - Parrot API v3 summary: Single BIN lookup parameters: - name: enhanced in: query description: Set to true for enhanced attributes schema: type: boolean - name: bin in: query description: Bin number (6-10 digits) required: true schema: maxLength: 10 minLength: 6 pattern: ^\d+(\.\d+)?$ type: string responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/EnhancedBinApiResponse' application/json: schema: $ref: '#/components/schemas/EnhancedBinApiResponse' text/json: schema: $ref: '#/components/schemas/EnhancedBinApiResponse' '403': description: Client not enrolled in Parrot '404': description: BIN not found components: schemas: EnhancedBinApiResponse: type: object properties: card: $ref: '#/components/schemas/EnhancedCard' additionalProperties: false EnhancedCard: type: object properties: number: $ref: '#/components/schemas/Number' bin_length: type: integer format: int32 nullable: true pagos_bin_length: type: integer format: int32 nullable: true bin_min: type: string nullable: true bin_max: type: string nullable: true pan_or_token: type: string nullable: true virtual_card: type: boolean nullable: true level2: type: boolean nullable: true level3: type: boolean nullable: true alm: type: boolean nullable: true account_updater: type: boolean nullable: true domestic_only: type: boolean nullable: true gambling_blocked: type: boolean nullable: true issuer_currency: type: string nullable: true reloadable: type: boolean nullable: true additional_card_brands: type: array items: $ref: '#/components/schemas/AdditionalNetwork' nullable: true card_brand: type: string nullable: true card_segment_type: type: string nullable: true combo_card: type: string nullable: true type: type: string nullable: true funding_source: type: string nullable: true prepaid: type: boolean nullable: true product: $ref: '#/components/schemas/Product' bank: $ref: '#/components/schemas/Bank' country: $ref: '#/components/schemas/Country' authentication: $ref: '#/components/schemas/Authentication' cost: $ref: '#/components/schemas/Cost' networkfees: $ref: '#/components/schemas/Networkfees' correlation_id: type: string nullable: true issuer_supports_tokenization: type: boolean nullable: true multi_account_access_indicator: type: string nullable: true shared_bin: type: boolean flagged_for_delete_remaining_wks: type: integer format: int32 nullable: true description: >- Countdown in weeks until this BIN range is removed. Null when BIN is active. additionalProperties: false Number: type: object properties: length: type: integer format: int32 nullable: true additionalProperties: false AdditionalNetwork: type: object properties: card_brand: type: string nullable: true bin_max: type: string nullable: true bin_min: type: string nullable: true card_brand_product: type: string nullable: true card_brand_bank_name: type: string nullable: true ecom_enabled: type: boolean nullable: true billpay_enabled: type: boolean nullable: true ``` -------------------------------- ### Create Inquiry Job via Go Source: https://docs.pagos.ai/account-updater/endpoint/inquiries Uses the standard net/http package to perform a POST request. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://services.sandbox.pagosapi.com/loon/inquiries/jobs" payload := strings.NewReader("{\n \"content\": \"\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("x-merchant-id", "") req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "text/plain") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(string(body)) } ``` -------------------------------- ### GET /bins/continuity Source: https://docs.pagos.ai/bin-data-APIs/endpoint/continuity Retrieves historical lifecycle data for a BIN range. ```APIDOC ## GET /bins/continuity ### Description Provides historical lifecycle data for a BIN range, including status, first and last seen dates, and detailed card attributes. ### Method GET ### Endpoint https://parrot.sandbox.pagosapi.com/bins/continuity ### Response #### Success Response (200) - **continuity** (object) - The continuity data object containing BIN lifecycle details and card metadata. - **correlation_id** (string) - Unique identifier for the request. #### Response Example { "continuity": { "bin": "", "status": "", "first_seen_at": "", "last_seen_at": "", "days_active": 123, "card": { "card_brand": "", "type": "", "prepaid": true } }, "correlation_id": "" } ``` -------------------------------- ### GET /bins/continuity Source: https://docs.pagos.ai/bin-data-APIs/endpoint/continuity Retrieves historical lifecycle data for a BIN range. ```APIDOC ## GET /bins/continuity ### Description Provides historical lifecycle data for a BIN range. ### Method GET ### Endpoint https://parrot.sandbox.pagosapi.com/bins/continuity ``` -------------------------------- ### GET /healthcheck Source: https://docs.pagos.ai/data-ingestion-api/endpoint/healthcheck Checks the health status of the Pagos Ingestion API. ```APIDOC ## GET /healthcheck ### Description Checks the health status of the Pagos Ingestion API. ### Method GET ### Endpoint /healthcheck ### Response #### Success Response (200) - **status** (string) - Indicates the service is healthy. ``` -------------------------------- ### Retrieve BIN snapshot via cURL Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use this command to fetch the BIN snapshot file using cURL. ```bash curl --request GET \ --url https://parrot.sandbox.pagosapi.com/batch/files \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Retrieve BIN snapshot via PHP Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Use the cURL extension in PHP to fetch the BIN snapshot. ```php "https://parrot.sandbox.pagosapi.com/batch/files", 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; } ``` -------------------------------- ### GET /status Source: https://docs.pagos.ai/network-tokenization/testing Retrieves the current status and details of a token using its tokenRefId. ```APIDOC ## GET /status ### Description Retrieves the current status and details of a token using the tokenRefId returned during the tokenization process. ### Method GET ### Response #### Success Response (200) - **tokenRefId** (string) - The unique identifier for the token. - **expirationDate** (object) - The expiration details of the token. - **status** (string) - The current status of the token (e.g., active). - **cardNetworkName** (string) - The name of the card network. - **panLast4** (string) - The last four digits of the PAN. ### Response Example { "tokenRefId": "visa-8e9c3493ce9a2e299b7242b43254b625", "expirationDate": { "year": "2024", "month": "09" }, "status": "active", "cardNetworkName": "visa", "panLast4": "1100" } ``` -------------------------------- ### GET /batch/files Source: https://docs.pagos.ai/bin-data-APIs/endpoint/file-snapshot Retrieves a list of files with their associated metadata and download URLs. ```APIDOC ## GET /batch/files ### Description Retrieves a list of files available for download, including metadata about bin changes. ### Method GET ### Endpoint https://parrot.sandbox.pagosapi.com/batch/files ### Parameters #### Headers - **Authorization** (string) - Required - Format: `Bearer ` ### Response #### Success Response (200) - **type** (string) - File type - **name** (string) - File name - **url** (string) - Download URL - **changes** (object) - Object containing bin update statistics #### Response Example [ { "type": "", "name": "", "url": "", "changes": { "bins_removed": 123, "bins_updated": 123, "bins_added": 123, "last_update_date": "", "sources": [ { "bins_total": 123, "source": "", "changes": { "percentage": "", "removed": 123, "updated": 123, "added": 123 } } ] } } ] ``` -------------------------------- ### Create Inquiry Job via Net::HTTP (Ruby) Source: https://docs.pagos.ai/account-updater/endpoint/inquiries Uses the built-in Ruby Net::HTTP library to execute the request. ```ruby require 'uri' require 'net/http' url = URI("https://services.sandbox.pagosapi.com/loon/inquiries/jobs") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["x-merchant-id"] = '' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'text/plain' request.body = "{\n \"content\": \"\"\n}" response = http.request(request) puts response.read_body ```