QR Code
Create a QR code containing a Turbo payment link.
Parameters
amount
required - the payment amount to be collected
reusable
optional - pass yes to allow the payment link to be used more than once, or no to only allow the payment link to be used a single time. by default payment links can be used more than once
reusable_limit
optional - when combined with reusable=yes, this sets a limit of how many times the payment link can be used. once the link has been paid this number of times, it can no longer be used. when reusable=no this option is ignored
domain
optional - the domain to be used in the payment link. defaults to
tur.bo. please see
Domains for a list of supported domains
success_url
optional - the URL to redirect to when payments are completed. if one isn't supplied, the default Turbo receipt page is shown
ach
optional - either yes or no if you'd like to provide customers the ability to pay using their bank. this doesn't prevent credit cards from still being used while paying, it simply presents paying by bank as a second option. defaults to no
branding
optional - sets a logo in the center of the QR code. supported values are:
none for no logo
id to show the unique payment ID
turbo to use the Turbo logo
logo to use your own logo, if one has been uploaded in the customer dashboard
name
optional - if set, adds a descriptive name above the QR code. useful for short product names, if name is too long it will be omitted
show_url
optional - either yes or no, to show the payment link as text below the QR code. defaults to yes
show_price
optional - either yes or no, to show the payment amount as text below the QR code. defaults to yes
curl \
-X POST \
-d api_key=TURBO_API_KEY \
-d amount=1.00 \
https://api.tur.bo/qr
<?php
$api_url ='https://api.tur.bo';
$api_path='/qr';
$api_key ='TURBO_API_KEY';
$amount =1.00;
$fields =array( 'api_key'=>$api_key,'amount'=>$amount );
$opts =array( 'form_params'=>$fields );
try {
$client =new GuzzleHttp\Client( array( 'base_uri'=>$api_url ) );
$response=$client->post( $api_path,$opts );
$json =$response->getBody();
echo $json;
}
catch( Exception $e ) {
echo 'error = ',$e->getMessage(),"\n";
}
?>
#!/usr/bin/python
import requests
import json
api_url="https://api.tur.bo/qr"
result=requests.post( api_url,data="api_key=TURBO_API_KEY&amount=1.00" )
print( json.dumps( result.json() ) )
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
api_url="https://api.tur.bo/qr"
uri =URI( api_url )
result =Net::HTTP.post_form( uri,'api_key'=>'TURBO_API_KEY','amount'=>'1.00' )
puts result.body
{
"ach":"no",
"amount":"1.00",
"api_path":"/qr",
"branding":"logo",
"created":1698859189,
"domain":"tur.bo",
"error":false,
"id":"abc123",
"metadata":[],
"msg":"OK",
"name":null,
"qr":"https://api.tur.bo/images/abc123.png",
"reusable":"yes",
"reusable_limit":null,
"show_link":"yes",
"show_name":"yes",
"show_price":"yes",
"status":"created",
"success_url":null,
"url":"https://tur.bo/abc123"
}
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 |
created |
timestamp for QR code creation |
amount |
payment amount to be collected |
type |
qr |
status |
created |
id |
ID of the QR code that can be used for looking up payment status |
url |
the payment URL for this item |
qr |
URL where the QR code can be accessed |
reusable |
defaults to yes which means the payment link can be used more than once |
reusable_limit |
when combined with reusable=yes, this sets a limit of how many times the payment link can be used |
domain |
the domain to be used in the payment link. defaults to tur.bo. please see Domains for a list of supported domains |
success_url |
the URL to redirect to when payments are completed. if one isn't supplied, the default Turbo receipt page is shown |
ach |
either yes or no if you'd like to provide customers the ability to pay using their bank. this doesn't prevent credit cards from still being used while paying, it simply presents paying by bank as a second option. defaults to no |
metadata |
a list of any extra fields passed to the Turbo API about the payment |
branding |
sets a logo in the center of the QR code. supported values are: none for no logo. id to show the unique payment ID. turbo to use the Turbo logo. logo to use your own logo, if one has been uploaded in the customer dashboard |
name |
if set, adds a descriptive name above the QR code. useful for short product names, if name is too long it will be omitted |
show_link |
either yes or no, to show the payment link as text below the QR code. defaults to yes |
show_price |
either yes or no, to show the payment amount as text below the QR code. defaults to yes |