curl \ -X POST \ -H 'Authorization: Bearer TURBO_API_KEY' \ https://api.tur.bo/payments/baddef<?php /* For this request to work please install guzzlehttp: curl -sS https://getcomposer.org/installer | php ./composer.phar require guzzlehttp/guzzle:^7.0 */ require 'vendor/autoload.php'; $api_url ='https://api.tur.bo'; $api_path='/payments/baddef'; $api_key ='TURBO_API_KEY'; $headers =array( 'Authorization'=>'Bearer '.$api_key ); try { $client=new GuzzleHttp\Client( array( 'headers'=> $headers ) ); $json =$client->request( 'POST', $api_url.$api_path )->getBody()->getContents(); echo $json; } catch( Exception $e ) { echo 'error = ',$e->getMessage(),"\n"; } ?>#!/usr/bin/python import requests import json api_url="https://api.tur.bo/payments/baddef" result=requests.post( api_url,headers={'Authorization':'Bearer TURBO_API_KEY'} ) print( json.dumps( result.json() ) )#!/usr/bin/env ruby require 'uri' require 'net/http' require 'net/https' api_url ="https://api.tur.bo/payments/baddef" api_key ='TURBO_API_KEY' uri =URI( api_url ) http =Net::HTTP.new( uri.host,uri.port ) http.use_ssl=true data ='' headers ={ 'Authorization'=>"Bearer #{api_key}" } result=http.post( uri.path,data,headers ) puts result.body
Response{ "error":false, "msg":"OK", "period": [], "api_path":"/payments", "total_results":1, "limit":25, "line_items":[{ "id":"abc123", "amount":"$1.00", "status":"pending", "qr":"https://api.tur.bo/images/abc123.png", "created":"2023-11-01 11:19:49", "convenience_fee":{"setting":null,"status":"disabled","value":null} }] }
| JSON response object | |
|---|---|
| Key | Value |
| error | true or false depending on if an error has occurred in the API request |
| msg | OK if all is well, otherwise will include descriptive error text |
| type | payment-detail |
| start | a timestamp in mm/dd/YYYY format. view all payments beginning from this date. end can be used in conjunction with this to create a custom date range |
| end | a timestamp in mm/dd/YYYY format. view all payments up to this date. start can be used in conjunction with this to create a custom date range |
| interval |
use interval to quickly view results using a friendly label. the currently supported labels are: today, yesterday, this_week, this_month, this_year, last_week, last_month, and last_year |
| total_results | total number of all results found |
| limit | number of results currently displayed |
| line_items[] | list of all payment links |
| line_items.id | payment link ID |
| line_items.amount | payment amount |
| line_items.status | payment status can be pending, completed, or refunded |
| line_items.url | the payment URL for this item |
| line_items.qr | URL where the QR code can be accessed |
| line_items.created | timestamp for QR code creation |
| line_items.convenience_fee[] | convenience fee settings |
| line_items.convenience_fee.setting | when convenience fee is enabled, setting can be flat or percentage |
| line_items.convenience_fee.status | status is enabled if convenience fee is on, and disabled when off |
| line_items.convenience_fee.value | the dollar amount charged |