### HTTP Basic Authentication Setup (Python) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Python script shows how to make an HTTP GET request using the 'requests' library with Basic Authentication. It demonstrates how to pass your Base64 encoded API secret key in the 'Authorization' header. Ensure you have the 'requests' library installed (`pip install requests`). ```python import requests import base64 url = "https://bigflip.id/big_sandbox_api/v3/pwf/bill" secret_key = "YOUR_API_SECRET_KEY" auth_string = secret_key + ":" encoded_auth = base64.b64encode(auth_string.encode()).decode() headers = { "Accept": "application/json", "Authorization": f"Basic {encoded_auth}" } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code: {response.status_code}") print(response.text) ``` -------------------------------- ### HTTP Basic Authentication Setup (Java) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Java code snippet shows how to make an HTTP GET request using the standard `java.net.http` package with Basic Authentication. It demonstrates constructing the Authorization header with your Base64 encoded API secret key. This example assumes Java 11 or later. ```java import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.util.Base64; public class FlipAuth { public static void main(String[] args) throws Exception { String url = "https://bigflip.id/big_sandbox_api/v3/pwf/bill"; String secretKey = "YOUR_API_SECRET_KEY"; String auth = secretKey + ":"; byte[] encodedAuth = Base64.getEncoder().encode(auth.getBytes()); String authHeaderValue = "Basic " + new String(encodedAuth); HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(url)) .header("Accept", "application/json") .header("Authorization", authHeaderValue) .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` -------------------------------- ### HTTP Basic Authentication Setup (Rust) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Rust code example shows how to make an HTTP GET request using the 'reqwest' crate with Basic Authentication. It demonstrates how to set the 'Authorization' header with your Base64 encoded API secret key. Ensure you have the 'reqwest' and 'base64' crates added to your Cargo.toml. ```rust use reqwest::header; use base64::{encode}; #[tokio::main] async fn main() -> Result<(), reqwest::Error> { let url = "https://bigflip.id/big_sandbox_api/v3/pwf/bill"; let secret_key = "YOUR_API_SECRET_KEY"; let auth_string = format!("{}:", secret_key); let encoded_auth = encode(auth_string); let client = reqwest::Client::new(); let response = client.get(url) .header(header::ACCEPT, "application/json") .header(header::AUTHORIZATION, format!("Basic {}", encoded_auth)) .send() .await?; let body = response.text().await?; println!("{}", body); Ok(()) } ``` -------------------------------- ### HTTP Basic Authentication Setup (Curl) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This example demonstrates how to perform an HTTP GET request using curl with Basic Authentication. It includes the necessary headers, specifically the 'Authorization' header, which should contain your Base64 encoded API secret key. This is a common way to test API integrations from the command line. ```shell curl -X GET \ https://bigflip.id/big_sandbox_api/v3/pwf/bill \ -H 'Accept: application/json' \ -H 'Authorization: Basic YOUR_BASE64_ENCODED_SECRET_KEY' ``` -------------------------------- ### HTTP Basic Authentication Setup (JavaScript/Node.js) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This JavaScript example demonstrates how to make an HTTP GET request using Node.js with Basic Authentication. It utilizes the built-in 'https' module and shows how to construct the 'Authorization' header with your Base64 encoded API secret key. Note the warning about JavaScript's number limitations for 'link_id' and 'bill_link_id'. ```javascript const https = require('https'); const url = 'https://bigflip.id/big_sandbox_api/v3/pwf/bill'; const secretKey = 'YOUR_API_SECRET_KEY'; const authString = Buffer.from(secretKey + ':').toString('base64'); const options = { hostname: 'bigflip.id', port: 443, path: '/big_sandbox_api/v3/pwf/bill', method: 'GET', headers: { 'Accept': 'application/json', 'Authorization': `Basic ${authString}` } }; const req = https.request(options, (res) => { let data = ''; res.on('data', (chunk) => { data += chunk; }); res.on('end', () => { console.log(JSON.parse(data)); }); }).on('error', (err) => { console.error('Error: ' + err.message); }); req.end(); ``` -------------------------------- ### Get All Bill Response Schema and Example Source: https://docs.flip.id/docs/api/edit-bill-v-3 This snippet details the schema and provides an example for a successful 'Get All Bill' response. It includes fields like link_id, link_url, title, amount, and item_details. Note the upcoming change to the link_id format. ```json { "link_id": 2502091430251230000, "link_url": "flip.id/$companyname/#coffeetable", "title": "Coffee Table", "type": "SINGLE", "amount": 900000, "redirect_url": "https://someurl.com", "expired_date": "2022-12-30 15:50", "created_from": "API", "status": "ACTIVE", "step": "checkout", "is_address_required": false, "is_phone_number_required": false, "company_code": "companytest", "product_code": "coffee-table-6925", "reference_id": "MerchantRefId7359", "sub_merchant_code": "SUBMERCHANT001", "item_details": [ { "id": "SKU017", "name": "test product 17", "price": 5000, "quantity": 2, "desc": "product test", "image_url": "http://www.merchant.com/image17.png" } ] } ``` -------------------------------- ### C# HttpClient Basic Authentication Example Source: https://docs.flip.id/docs/api/check-settlement-report-status Example of making a GET request to the Flip ID API using HttpClient in C#. It includes setting the Accept header and the Authorization header with the base64 encoded secret key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://bigflip.id/big_sandbox_api"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Magento 2 Manual Installation Commands Source: https://docs.flip.id/docs/accept-payment/plugins/magento2 Commands to enable the Flip for Business module and upgrade Magento's setup. These commands are essential after copying the module files to the correct directory. ```bash bin/magento module:enable FlipForBusiness_Checkout bin/magento setup:upgrade bin/magento cache:flush ``` -------------------------------- ### HTTP Basic Authentication Setup in C# Source: https://docs.flip.id/docs/api/get-form-data Demonstrates how to set up an HttpClient in C# to make a GET request to the Flip ID API using Basic Authentication. It includes adding the Authorization header with the Base64 encoded secret key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://bigflip.id/big_sandbox_api/v2/international-disbursement/form-data"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ দ্র"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Making a GET Request to Flip ID API with C# Source: https://docs.flip.id/docs/api/get-international-transfer Example of how to make a GET request to the Flip ID API using HttpClient in C#. It includes setting the request URL, headers (Accept and Authorization), and handling the response. Ensure you have the correct API secret key for the Authorization header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://bigflip.id/big_sandbox_api/v2/international-disbursement/:transaction_id"); request.Headers.Add("Accept", "application/json; charset=UTF-8"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### HTTP Basic Authentication Setup (Go) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Go program demonstrates how to make an HTTP GET request with Basic Authentication. It utilizes the standard 'net/http' package and shows how to set the 'Authorization' header using your Base64 encoded API secret key. Error handling for the request is included. ```go package main import ( "encoding/base64" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://bigflip.id/big_sandbox_api/v3/pwf/bill" secretKey := "YOUR_API_SECRET_KEY" auth := "" + secretKey + ":" encodedAuth := base64.StdEncoding.EncodeToString([]byte(auth)) client := &http.Client{} req, err := http.NewRequest("GET", url, nil) if err != nil { fmt.Println("Error creating request:", err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Basic "+encodedAuth) resp, err := client.Do(req) if err != nil { fmt.Println("Error sending request:", err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println("Error reading response body:", err) return } fmt.Println(string(body)) } ``` -------------------------------- ### HTTP Basic Authentication Setup (C#) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This snippet shows how to set up an HttpClient in C# to make a GET request to the Flip ID API using Basic Authentication. It demonstrates adding the 'Accept' and 'Authorization' headers. The Authorization header value is a placeholder and should be replaced with your actual Base64 encoded secret key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://bigflip.id/big_sandbox_api/v3/pwf/bill"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Perform Authenticated API Requests Source: https://docs.flip.id/docs/international-transfer/integration Provides examples of using cURL to perform authenticated POST and GET requests. Includes headers for Authorization and the optional X-Signature for secure disbursement. ```bash curl -X POST 'https://bigflip.id/big_sandbox_api/v2/disbursement/bank-account-inquiry' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Authorization: Basic ' \ -H 'X-Signature: Your-Generated-Signature' \ -d 'account_number=5465327020' \ -d 'bank_code=bca' \ -d 'inquiry_key=your-unique-id-12344' ``` ```bash curl -L 'https://bigflip.id/big_sandbox_api/v2/international-disbursement/exchange-rates?country_iso_code=SGP&transaction_type=C2C' \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Authorization: Basic ' ``` -------------------------------- ### HTTP Basic Authentication Setup (Kotlin) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Kotlin code snippet shows how to make an HTTP GET request using the Ktor client with Basic Authentication. It demonstrates adding the 'Authorization' header with your Base64 encoded API secret key. Ensure you have the Ktor client dependencies added to your project. ```kotlin import io.ktor.client.HttpClient import io.ktor.client.request.* import io.ktor.client.statement.* import io.ktor.http.* import kotlinx.coroutines.runBlocking import java.util.Base64 fun main() = runBlocking { val client = HttpClient() val url = "https://bigflip.id/big_sandbox_api/v3/pwf/bill" val secretKey = "YOUR_API_SECRET_KEY" val authString = Base64.getEncoder().encodeToString("$secretKey:".toByteArray()) val response: HttpResponse = client.get(url) { headers { append(HttpHeaders.Accept, "application/json") append(HttpHeaders.Authorization, "Basic $authString") } } println(response.bodyAsText()) client.close() } ``` -------------------------------- ### Initiate Payment Request with C# Source: https://docs.flip.id/docs/api/staticva/generate-static-va Demonstrates how to send a POST request to the Flip payment gateway using HttpClient. It includes setting the required Authorization header and content type. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://flip-staging-domain/payment-gateway/static-va"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var content = new StringContent(string.Empty); content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### GET /websites/flip_id Source: https://docs.flip.id/docs/api/get-bill-v-3 Retrieves a list of all bills associated with a Flip ID website. Includes detailed schema information and examples for success and error responses. ```APIDOC ## GET /websites/flip_id ### Description Retrieves a list of all bills associated with a Flip ID website. This endpoint returns detailed information about each bill, including item specifics and status. ### Method GET ### Endpoint /websites/flip_id ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier for the bill. - **expired_date** (string) - Required - The expiration date of the bill in `YYYY-MM-DD HH:MM` format. ### Request Example ```json { "id": 2502091430251230000, "expired_date": "2022-12-30 15:50" } ``` ### Response #### Success Response (200) - **link_id** (integer) - The unique identifier for the bill link. - **link_url** (string) - The URL to the flip.id link. - **title** (string) - The title of the bill. - **type** (string) - The type of the bill (e.g., 'SINGLE'). - **amount** (integer) - The total amount of the bill. - **redirect_url** (string) - The URL to redirect to after payment. - **expired_date** (string) - The expiration date and time of the bill. - **created_from** (string) - Indicates how the bill was created (e.g., 'API'). - **status** (string) - The current status of the bill (e.g., 'ACTIVE'). - **step** (string) - The current step in the checkout process. - **is_address_required** (boolean) - Indicates if address is required for this bill. - **is_phone_number_required** (boolean) - Indicates if phone number is required for this bill. - **company_code** (string) - The company code associated with the bill. - **product_code** (string) - The product code for the item(s) in the bill. - **reference_id** (string) - A merchant-defined reference ID for the transaction. - **sub_merchant_code** (string) - The unique identifier for the sub-merchant, if applicable. - **item_details** (object[]) - An array of objects, where each object details an item in the bill. - **id** (string) - The unique identifier for the item. - **name** (string) - The name of the item. - **price** (integer) - The price of the item. - **quantity** (integer) - The quantity of the item. - **desc** (string) - A description of the item. - **image_url** (string) - The URL of the item's image. #### Response Example (Success) ```json { "link_id": 2502091430251230000, "link_url": "flip.id/$companyname/#coffeetable", "title": "Coffee Table", "type": "SINGLE", "amount": 900000, "redirect_url": "https://someurl.com", "expired_date": "2022-12-30 15:50", "created_from": "API", "status": "ACTIVE", "step": "checkout", "is_address_required": false, "is_phone_number_required": false, "company_code": "companytest", "product_code": "coffee-table-6925", "reference_id": "MerchantRefId7359", "sub_merchant_code": "SUBMERCHANT001", "item_details": [ { "id": "SKU017", "name": "test product 17", "price": 5000, "quantity": 2, "desc": "product test", "image_url": "http://www.merchant.com/image17.png" } ] } ``` #### Error Response (401 - Unauthorized) - **name** (string) - The error name (e.g., 'Unauthorized'). - **message** (string) - A message describing the error. - **status** (integer) - The HTTP status code (401). #### Response Example (401) ```json { "name": "Unauthorized", "message": "Your request was made with invalid credentials.", "status": 401 } ``` #### Error Response (422 - Validation Error) - **code** (string) - The error code (e.g., 'VALIDATION_ERROR'). - **errors** (object[]) - An array of error objects detailing validation failures. - **attribute** (string) - The attribute that caused the validation error. - **code** (integer) - The error code specific to the validation failure. - **message** (string) - A message describing the validation error. #### Response Example (422 - Missing Required Fields) ```json { "code": "VALIDATION_ERROR", "errors": [ { "attribute": "id", "code": 1043, "message": "Product Bill Link ID Not Found" }, { "attribute": "expired_date", "code": 1047, "message": "Param expired_date is invalid" } ] } ``` #### Response Example (422 - Missing ID Field) ```json { "code": "VALIDATION_ERROR", "errors": [ { "attribute": "id", "code": 1043, "message": "Param Bill Link ID is Not Found" } ] } ``` #### Response Example (422 - Missing Expired Date Field) ```json { "code": "VALIDATION_ERROR", "errors": [ { "attribute": "expired_date", "code": 1047, "message": "Param expired_date is invalid" } ] } ``` **Note on link_id format change**: The `link_id` field will change from 1-10 digits to exactly 19 digits on April 10, 2026. Ensure your systems are updated to handle BIGINT or VARCHAR types before this date. ``` -------------------------------- ### Agent Disbursement API Response Examples Source: https://docs.flip.id/docs/api/get-agent-disbursement-list Examples of JSON responses returned by the API. This includes the successful data retrieval schema, an unauthorized error response, and a validation error response. ```json { "id": 1234567890123456800, "user_id": 20, "amount": 10000, "status": "PENDING", "reason": "asd", "timestamp": "2017-08-28T14:32:47Z", "bank_code": "bni", "account_number": "1122333300", "recipient_name": "John Doe", "sender_bank": "bri", "remark": "some remark", "receipt": "", "time_served": "0000-00-00T00:00:00Z", "bundle_id": 0, "company_id": 7, "recipient_city": 391, "created_from": "API", "direction": "DOMESTIC_TRANSFER", "sender": "null", "fee": 1500, "beneficiary_email": "test@mail.com,user@mail.com", "idempotency_key": "idem-key-1", "is_virtual_account": false } ``` ```json { "name": "Unauthorized", "message": "Your request was made with invalid credentials.", "status": 401 } ``` ```json { "code": "VALIDATION_ERROR", "errors": [ { "attribute": "pagination", "code": 1032, "message": "Pagination should be a number and more than 0" } ] } ``` -------------------------------- ### HTTP Basic Authentication Setup in C# Source: https://docs.flip.id/docs/api/get-exchanges-rate This C# code demonstrates how to configure an HttpClient to make a GET request to the Flip ID API using HTTP Basic Authentication. It shows how to add the 'Accept' and 'Authorization' headers, with the Authorization header formatted according to Basic Auth standards using a pre-encoded secret key. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://bigflip.id/big_sandbox_api/v2/international-disbursement/exchange-rates"); request.Headers.Add("Accept", "application/json; charset=UTF-8"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# Implementation for Static VA Request Source: https://docs.flip.id/docs/api/staticva/get-static-va Example implementation using HttpClient in C# to perform a GET request to the static VA endpoint with Basic Authentication headers. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://flip-staging-domain/payment-gateway/static-va"); request.Headers.Add("Accept", "application/json"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### HTTP Basic Authentication Setup (PowerShell) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This PowerShell script demonstrates how to make an HTTP GET request with Basic Authentication using Invoke-RestMethod. It shows how to construct the 'Authorization' header with your Base64 encoded API secret key. This is suitable for automation and scripting tasks in Windows environments. ```powershell $url = "https://bigflip.id/big_sandbox_api/v3/pwf/bill" $secretKey = "YOUR_API_SECRET_KEY" $authString = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$secretKey:")) $headers = @{ "Accept" = "application/json" "Authorization" = "Basic $authString" } Invoke-RestMethod -Uri $url -Method Get -Headers $headers ``` -------------------------------- ### Get Country List - JSON Example Source: https://docs.flip.id/docs/api/get-country-list An example of the JSON response when successfully retrieving the country list. The response is an object where keys are country codes (strings) and values are country names (strings). ```json { "100000": "Afghanistan", "100002": "Albania", "100003": "Algeria/Aljazair", "100004": "America Samoa", "100005": "Andorra", "100006": "Angola", "100007": "Anguilla", "100008": "Antarctica", "100009": "Antigua And Barbuda", "100010": "Argentina", "100011": "Armenia" } ``` -------------------------------- ### HTTP Basic Authentication Setup (Ruby) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Ruby code snippet demonstrates how to make an HTTP GET request using the 'net/http' library with Basic Authentication. It shows how to construct the 'Authorization' header with your Base64 encoded API secret key. This is a standard approach for making HTTP requests in Ruby. ```ruby require 'net/http' require 'uri' require 'base64' uri = URI.parse("https://bigflip.id/big_sandbox_api/v3/pwf/bill") secret_key = "YOUR_API_SECRET_KEY" auth_string = "#{secret_key}:" encoded_auth = Base64.strict_encode64(auth_string) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true request = Net::HTTP::Get.new(uri.request_uri) request['Accept'] = 'application/json' request['Authorization'] = "Basic #{encoded_auth}" response = http.request(request) puts response.body ``` -------------------------------- ### KYC Status Callback Data Example (APPROVED) Source: https://docs.flip.id/docs/agent-money-transfer/int-agent-verification Example of the data payload received when a KYC submission is APPROVED. It includes agent details and timestamps. This data is sent as a URL-encoded string. ```url-encoded data=%7B%22agent_id%22%3A%201%2C%20%22agent_name%22%3A%20%22John%20Doe%22%2C%20%22kyc_status%22%3A%20%22APPROVED%22%2C%20%22rejected_reason_code%22%3A%20null%2C%20%22rejected_reason%22%3A%20null%2C%20%22created_at%22%3A%20%222022-02-18%2005%3A03%3A32%22%2C%20%22updated_at%22%3A%20%222022-02-18%2009%3A48%3A58%22%2C%20%22submitted_at%22%3A%20%222022-02-18%2009%3A50%3A32%22%2C%20%22verified_at%22%3A%20%222022-02-18%2010%3A01%3A00%22%7D&token=YOUR_VALIDATION_TOKEN_KEY ``` -------------------------------- ### Callback Configuration Source: https://docs.flip.id/docs/api/account-inquiry Guidelines for handling transaction callbacks from Flip for Business. ```APIDOC ## Callback Handling ### Description Flip for Business sends callbacks to your specified URL. Your server must return a 200 HTTP status code to acknowledge receipt. ### Requirements - **HTTP Status**: Must return 200 OK. - **Timeout**: Response must be received within 30 seconds. - **Retry Policy**: If the system receives a non-200 status or times out, it will retry 5 times with a 2-minute interval. ### Authentication - **Method**: Basic Authentication. - **Header**: `Authorization: Basic ` - **Format**: `Base64Encode("YourApiSecretKey" + ":")` ``` -------------------------------- ### Making HTTP GET Request with Basic Auth in Shell Source: https://docs.flip.id/docs/api/get-agent-disbursement This shell script example shows how to make a GET request to the Flip ID API using `curl`. It includes the necessary `Accept` and `Authorization` headers. Remember to replace `YOUR_BASE64_ENCODED_SECRET_KEY` with your actual API secret key encoded in Base64. ```shell API_URL="https://bigflip.id/big_sandbox_api/v2/agent-disbursements/:transaction_id" SECRET_KEY="YOUR_API_SECRET_KEY" # Replace with your actual secret key AUTH_STRING="$SECRET_KEY:" ENCODED_AUTH=$(echo -n "$AUTH_STRING" | base64) curl -X GET "$API_URL" \ -H "Accept: application/json; charset=UTF-8" \ -H "Authorization: Basic $ENCODED_AUTH" ``` -------------------------------- ### Making HTTP GET Request with Basic Auth using cURL Source: https://docs.flip.id/docs/api/get-agent-disbursement This example demonstrates how to make a GET request to the Flip ID API using the cURL command-line tool. It includes the necessary `Accept` and `Authorization` headers. Remember to replace `YOUR_BASE64_ENCODED_SECRET_KEY` with your actual API secret key encoded in Base64. ```curl curl -X GET \ 'https://bigflip.id/big_sandbox_api/v2/agent-disbursements/:transaction_id' \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Authorization: Basic YOUR_BASE64_ENCODED_SECRET_KEY' ``` -------------------------------- ### HTTP Basic Authentication Setup (Swift) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This Swift code snippet demonstrates how to make an HTTP GET request using URLSession with Basic Authentication. It shows how to construct the 'Authorization' header with your Base64 encoded API secret key. This is a standard way to handle network requests in iOS and macOS applications. ```swift import Foundation func getFlipData() { let url = URL(string: "https://bigflip.id/big_sandbox_api/v3/pwf/bill")! let secretKey = "YOUR_API_SECRET_KEY" let authString = "(secretKey):" let authData = authString.data(using: .utf8)!.base64EncodedString() var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue("Basic (authData)", forHTTPHeaderField: "Authorization") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error: \(error.localizedDescription)") return } if let httpResponse = response as? HTTPURLResponse { if (200...299).contains(httpResponse.statusCode) { if let data = data, let dataString = String(data: data, encoding: .utf8) { print(dataString) } } else { print("Request failed with status code: \(httpResponse.statusCode)") } } } task.resume() } getFlipData() ``` -------------------------------- ### Basic Authentication Setup for HTTP Requests (C#) Source: https://docs.flip.id/docs/api/create-b-2-b-international-transfer This C# code snippet demonstrates how to make a POST request using HttpClient, including setting the 'Authorization' header with Basic Authentication credentials. It targets the international disbursement API endpoint. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://bigflip.id/big_sandbox_api/v2/international-disbursement/create-with-attachment"); request.Headers.Add("Accept", "application/json; charset=UTF-8"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ "); var content = new StringContent(string.Empty); content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### KYC Status Callback Data Example (REJECTED) Source: https://docs.flip.id/docs/agent-money-transfer/int-agent-verification Example of the data payload received when a KYC submission is REJECTED. It includes agent details, rejection reason, and timestamps. This data is sent as a URL-encoded string. ```url-encoded data=%7B%22agent_id%22%3A%201%2C%20%22agent_name%22%3A%20%22John%20Doe%22%2C%20%22kyc_status%22%3A%20%22REJECTED%22%2C%20%22rejected_reason_code%22%3A%20%2217%22%2C%20%22rejected_reason%22%3A%20%22Part%20of%20the%20data%20on%20the%20photo%20ID%20card%20is%20missing%20so%20it%20can%E2%80%99t%20be%20read%20in%20its%20entirety%22%2C%20%22created_at%22%3A%20%222022-02-18%2005%3A03%3A32%22%2C%20%22updated_at%22%3A%20%222022-02-18%2009%3A48%3A58%22%2C%20%22submitted_at%22%3A%20null%2C%20%22verified_at%22%3A%20null%7D&token=YOUR_VALIDATION_TOKEN_KEY ``` -------------------------------- ### API Response Schemas Source: https://docs.flip.id/docs/api/kyc/get-list-of-countries Example JSON structures for successful country retrieval and error handling responses. ```json { "countries": [ { "id": 1, "name": "Indonesia" }, { "id": 2, "name": "Malaysia" } ] } ``` ```json { "errors": [ { "code": 401, "message": "Invalid Auth" } ] } ``` -------------------------------- ### Sample CURL for Accept Payment Callback Source: https://docs.flip.id/docs/accept-payment/direct-api/retail-integration This CURL command demonstrates how to simulate a POST request to a webhook URL for handling Flip's accept payment callback. It includes sample data and a validation token. ```shell curl -X POST 'https://your-domain-callback-url.com/flip/accept-payment/callback' \ -H 'Accept: application/json' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'data={"id":"FT1","bill_link":"flip.id/$/#","bill_link_id":2502091430251230005,"bill_title":"Cimol Goreng","reference_id": "MerchantRefId03","sender_name":"Jon Doe","sender_bank":"bni","sender_email":"email@email.com","amount":10000,"status":"SUCCESSFUL","sender_bank_type":"bank_account","created_at":"2021-11-29 10:10:10"}&token=YOUR_VALIDATION_TOKEN_KEY' ``` -------------------------------- ### Basic Authentication Setup for Flip ID API Source: https://docs.flip.id/docs/api/create-disbursement Demonstrates how to set up Basic Authentication for the Flip ID API. This involves constructing an Authorization header using a Base64 encoded secret key. The secret key is used as the username with an empty password. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://bigflip.id/big_sandbox_api/v3/disbursement"); request.Headers.Add("Accept", "application/json; charset=UTF-8"); request.Headers.Add("Authorization", "Basic PHVzZXJuYW1lPjo8cGFzc3dvcmQ+ উৎকর্ষ"); var content = new StringContent(string.Empty); content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded"); request.Content = content; var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Form Data - Success Response Example Source: https://docs.flip.id/docs/api/get-form-data A successful response from the 'Get Form Data' endpoint returns a JSON object containing various fields necessary for transaction creation. This includes country codes, currency codes, beneficiary relationships, source of funds, remittance purposes, bank details, and nationality information. ```JSON { "country_iso_code": "GBR", "currency_code": "GBP", "beneficiary_relationships": { "SELF": "Diri sendiri", "BROTHER": "Saudara laki-laki", "SISTER": "Saudara perempuan", "SON": "Anak laki-laki", "DAUGHTER": "Anak perempuan", "NEPHEW": "Keponakan laki-laki", "NIECE": "Keponakan perempuan", "FATHER": "Ayah", "MOTHER": "Ibu", "UNCLE": "Paman", "AUNT": "Bibi", "COUSIN": "Sepupu", "FATHER_IN_LAW": "Bapak mertua", "MOTHER_IN_LAW": "Ibu mertua", "BROTHER_IN_LAW": "Ipar laki-laki", "SISTER_IN_LAW": "Ipar perempuan", "GRAND_FATHER": "Kakek", "GRAND_MOTHER": "Nenek", "HUSBAND": "Suami", "WIFE": "Istri", "FRIEND": "Teman" }, "source_of_funds": { "BUSINESS": "Bisnis", "SALARY": "Gaji", "SAVINGS": "Tabungan", "GIFT": "Hadiah" }, "remittance_purposes": { "FAMILY_SUPPORT": "Bantuan keluarga", "SALARY_PAYMENT": "Pembayaran gaji" }, "banks": { "101": "Standard Chartered Bank", "102": "Bank Something" }, "special_identifiers": { "sort_code": "string" }, "regions": {}, "nationality_countries": { "iso_code": "AFG", "name": "Afghanistan", "country_code": "AF" } } ``` -------------------------------- ### HTTP Basic Authentication Setup (PHP) Source: https://docs.flip.id/docs/api/get-all-bill-v-3 This PHP code demonstrates how to make an HTTP GET request using cURL with Basic Authentication. It shows how to set the 'Authorization' header with your Base64 encoded API secret key. This is a common method for server-side API interactions in PHP. ```php ``` -------------------------------- ### GET /v2/disbursement/exchange-rates Source: https://docs.flip.id/docs/international-transfer/integration Retrieves current exchange rates, transfer fees, and corridor details for international transfers. ```APIDOC ## GET /v2/disbursement/exchange-rates ### Description Retrieves exchange rates and transfer details for specific destination countries and transaction types. ### Method GET ### Endpoint https://bigflip.id/v2/disbursement/exchange-rates ### Parameters #### Query Parameters - **country_iso_code** (string) - Required - ISO 3166 Alpha-3 country code (can be comma-separated). - **transaction_type** (string) - Required - Type of transaction (C2C, C2B, B2B, B2C). ### Request Example curl -L 'https://bigflip.id/big_sandbox_api/v2/international-disbursement/exchange-rates?country_iso_code=SGP&transaction_type=C2C' \ -H 'Accept: application/json; charset=UTF-8' \ -H 'Authorization: Basic ' ### Response #### Success Response (200) - **currency_code** (string) - Currency code. - **flip_exchange_rate** (number) - Current exchange rate. - **flip_transfer_fee** (number) - Applicable transfer fee. - **minimum_amount** (number) - Minimum transfer limit. - **maximum_amount** (number) - Maximum transfer limit. #### Response Example [ { "currency_code": "SGD", "country_iso_code": "SGP", "flip_exchange_rate": 11886.6, "flip_transfer_fee": 85000 } ] ```