Overview
BlockChyp is a semi-integrated payment system that makes it easy to integrate card-present payment terminals with third party software. Usually this means on premise retail and restaurant point-of-sale systems, but it can mean just about anything ranging from cloud based point-of-sale to law and medical practice management systems.
Semi-Integrated?
Semi-Integrated is one of many payments industry nonsense terms. In payments lingo, a fully integrated system means that the payment terminal is a dumb peripheral and you handle all the authorization and network communication yourself. This puts you in PCI and Level 3 EMV certification scope. You don't want that. You want the terminal to talk directly to our gateway and the payment networks so your code never touches anything sensitive. The payments industry calls this approach semi-integrated because that obviously makes everything crystal clear.
Use Payment Hardware Like A Web Service
The idea behind BlockChyp is that you can interact with payment terminal hardware using the same techniques you're already used to for other services you consume. BlockChyp allows you to interact with terminal hardware using REST APIs.
But, of course, even REST APIs are too much work these days.
Most developers would rather type a quick command (like npm i @blockchyp/blockchyp-js
) or drop
a dependency snippet in their project somewhere, download a library and go.
That's how BlockChyp works.
Add one of our SDK libraries to your project and start running transactions, usually within minutes.
The SDKs deal with finding the terminals on your local network or via the cloud and handle all the security and network plumbing you'd have to otherwise build yourself.
Getting Started
To get started with BlockChyp sign up for a developer account on the BlockChyp Web Site and order a BlockChyp Developer Kit. The kit will include a fully functioning payment terminal along with contactless, chip, mag stripe, and gift test cards.
Next, examine the list of SDKs and Clients and follow the instructions for your technology ecosystem.
SDKs and Client Libraries
All supported BlockChyp SDKs are open source and hosted on Github. Binaries are distributed via all the usual package management systems for each platform. (Maven for Java, Nuget for C#, etc.)
Follow the link for your platform to Github and follow the instructions in the project README to download the libraries.
- .NET / C# SDK
- Go SDK
- Javascript SDK
- Java SDK
- PHP SDK
- Python SDK
- Ruby SDK
- iOS SDK (Swift/Objective-C)
What if my platform isn't listed?
Fear not, the Command Line Interface has you covered.
Y U No C++?
We left C/C++ off the SDK list because there are so many different ways to do REST APIs in C++. When you factor in Linux support, it's hard to create a C++ library in such a way that it's suitable for all C++ developers. We chickened out and hope you understand.
Command Line Interface
Support for nine of the most popular programming languages is pretty good, but it doesn't cover everybody. Believe it or not, we have some folks using all sorts of wild things like COBOL and Assembler and, of course, C++.
So we've developed an executable command line interface that any language can access as a shell command. It's also a good way to experiment with BlockChyp without writing any code.
Since Go compiles to native code with no extra runtime requirements, we built the CLI in Go and it's part of our open source Go SDK. The project includes additional build scripts that create Windows and Linux command line executables. We also distribute binaries over at Github if you're into that sort of thing.
Stuff You'll Need For Testing
Before you start developing an integration with BlockChyp, you'll need a terminal,
some test cards, a test merchant account, and some API credentials.
You'll also want to read a quick blurb about the test
transaction flag.
Test Terminals
Hopefully the suits already took care of ordering a Developer Kit for you.
If not, login to your developer account and order one. (And since you've
taken the trouble to read the docs, help yourself to promo code RTFM
and
take 20% off your developer kit.) The kit
includes a terminal, the necessary cabling, a set of test cards, and an official BlockChyp
Laptop Sticker. Display it with pride.
Test Cards
BlockChyp Developer Kits include four EMV test cards with a good mix of CVMs (customer verification methods) and card brands. A few of them are also dual interface, which means you can use them to run Contactless EMV tests.
We include MSR test cards for all four major card brands because mag stripes are still a thing. We also include three special mag stripe test cards you can use for simulating declines, partial authorizations, and network failures.
The highlight of every Developer Kit is a selection of BlockChyp test gift cards. These use our magical blockchain stuff. Instead of gift card numbers, our gift card system works by having the terminals sign transaction blocks with keys that are on the gift card's mag stripe. More on that later.
Standard Test Card Numbers
Because BlockChyp's focus is terminals, you'll want to use real plastic most of the time. But, for testing e-commerce and manually entered transactions, any valid test card numbers will work, but we recommend these...
Card Brand | Card Number | Cardholder Name | Expiration | CVV |
---|---|---|---|---|
VISA | 4111 1111 1111 1111 | RICHARD HENDRICKS | 12/2025 | 000 |
MC | 5105 1051 0510 5118 | JARED DUNN | 12/2025 | 000 |
AMEX | 3782 822463 10005 | PETER GREGORY | 12/2025 | 0000 |
DISC | 6011 1111 1111 1117 | ERLICH BACHMAN | 12/2025 | 000 |
Adverse Event Cards and Trigger Amounts
Because BlockChyp is compatible with reality, we make it easy to simulate bad things happening. The table below lists special card numbers and trigger amounts and what adverse events they simulate.
Event Type | Trigger Card | Trigger Amount | Notes |
---|---|---|---|
decline | 4111 1111 1111 1129 | 201.00 | |
error | 6011 0009 9013 9424 | 00.11 | |
fraud | 3714 496353 98431 | 66.00 | Sets the fraud probability flag |
partial-auth | 5105 1051 0510 5100 | 55.00 | Authorized Amount: $25.00 |
no-response | 4111 1111 1111 1137 | 72.00 | Returns no response. |
timeout | 5555 5555 5555 4444 | 68.00 | Gateway hangs for 30 seconds. |
Believe it or not, you can customize adverse events. If you don't like our standard trigger cards or trigger amounts, you can change them or add your own in the developer portal. You can even have different trigger cards and trigger amounts for different test merchant accounts. This means your QA people could have their own setup, which QA people tend to want.
Testing Unusual Error Conditions
There's a lot of chaos in a real world retail environment and things happen out there that can be very difficult to test in development environment. BlockChyp provides a number of special tricks and flags to assist with simulating unusual scenarios.
Store and Forward Transactions
To simulate a store and forward transaction, send any transactions to a test merchant account's terminal with an amount consisting of all sevens. For example, 7.77 or 77.77. This permits testing store and forward scenarios above and below the floor limit.
Terminal Connection Resets
BlockChyp terminals maintain a constant connection to the gateway. These connections are frequently reset as BlockChyp's systems adjust their capacity or if Internet connections in the field have issues. These connections are reset automatically, usually within seconds, but it's possible for these connections to reset in the middle of a transaction, which can disrupt the point-of-sale system's ability to receive a valid response, especially in Cloud Relay Mode.
BlockChyp has backup logic in place to minimize unexpected behavior in these conditions,
but it's still wise to test it. By adding the -resetConnection
flag to a test cloud
relay transaction, the terminal connection will be intentionally dropped in the middle of the corresponding
transaction. This gives developers the ability to test how the system will behave
in the worst case scenario. Note that if you run your terminals in local mode, these
connection resets will have little or no impact.
Simulating Post Auth Chip Rejections
Under the EMV standard it's possible for the chip to reject a transaction after
it's been authorized due to issuer specific rules, triggering an automatic
reversal. This is a tricky thing to simulate, so we've added a special
-chipRejection
flag that can force the terminal to behave as if the chip
rejected a transaction after authorization. The transaction will be authorized
and immediately reversed.
Simulating Out of Order Reversals
Transaction reversals normally work by instructing the gateway to reverse a transaction immediately after authorization. In shaky network conditions, it's possible that a reversal packet might arrive at the gateway before the original authorization.
If this possibility weren't properly accounted for, the point-of-sale system would think the transaction had been reversed since the reversal succeeded, while the original transaction would stand as authorized.
BlockChyp has systems in place to detect and correct for out of order reversals and
there's no special coding required to handle it on the part of point-of-sale developers,
but test transactions can be sent with an -outOfOrderReversal
flag that will force
a terminal transaction to send a reversal before it sends the authorization, so developers
can verify and test the behavior for themselves.
Enabling Asynchronous Auto-Reversals
Terminal triggered auto-reversals are synchronous by default, meaning that transaction API calls block until any auto-reversals are complete. This can cause transaction timeouts on shaky networks since auto-reversals are attempted five times with a fifteen second delay between attempts.
By sending an optional -asyncReversals
flag with a transaction, developers
can force auto-reversals to execute in a separate and asynchronous thread. This
is normally not desirable since it can hide the fact that a reversal even occurred
from the original API call.
Developers who use the -asyncReversals
flag should always verify the status
of transactions via the transaction status API shortly after the transaction
is completed or prior to batch closure.
Test Merchant Accounts
Once you have all the gear and test plastic, you'll need to create a test merchant account. Just login into the BlockChyp portal, expand Developer Tools and click Test Merchants. You'll be able to add a test merchant from there.
When you click on a test merchant, you'll notice you get a Merchant Tools section on your navigation just like live merchants. You can adjust merchant settings here and upload media to troll your peers with. You'll also notice a Test Settings button on the test merchant landing page. This allows access to restricted settings that you wouldn't have access to for live merchants, but might need to tweak for testing different scenarios.
Activating Terminals
Next, pair your terminal with the test merchant account by touching the terminal screen where it says "TOUCH TO ACTIVATE". Click ACTIVATE TERMINAL on the test merchant dashboard and enter the code you see on the terminal. Give the terminal a name and decide whether or not you'll be using the terminal in cloud relay mode. If your application is web based or won't be residing on the same network as the terminal, check the box. Otherwise, leave it be.
API Credentials
The final step before you can start coding is to generate API credentials. Just click the API CREDENTIALS button and generate a new set of credentials. You can have any number of unique credentials for a given merchant account. You can also lock them to protect them from accidental deletion or add some notes to remind yourself about how you might be using the credentials.
When you generate credentials, you get three things for the price of one click:
- API Key: This is a unique key that identifies a set of credentials.
- Bearer Token: A secure access token that gets passed over the network with every request. Keep this in a secure place.
- Signing Key: This is a special key used by the SDKs to create HMAC signatures for every request. You should also keep this in a secure place.
The Test Flag
Linux/Mac OS: ./blockchyp -type="charge" -terminal="Test Terminal" -amount="2.59" -test
Windows: blockchyp.exe -type="charge" -terminal="Test Terminal" -amount="2.59" -test
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true, //setting the test flag
TerminalName: "Test Terminal",
Amount: "55.00",
}
response, err := client.Charge(request)
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal", //setting the test flag
Amount = "55.00",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ChargeAsync(request);
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true); //setting the test flag
request.setTerminalName("Test Terminal");
request.setAmount("55.00");
// Send the request
AuthorizationResponse response = client.charge(request);
$request = [
'test' => true, //setting the test flag
'terminalName' => 'Test Terminal',
'amount' => '55.00',
];
$response = BlockChyp::charge($request);
The astute payment integration veterans among you may have noted that we don't ask you to put a Gateway URL anywhere in your configuration. You're welcome, but PCI "law" forbids processing test transactions on the same servers as live transactions.
For this reason, all test transactions must be flagged at test transactions. All sample code in this documentation will include the test flag because we assume you use the documentation while testing, but you'll need to remove it when you start running transactions for live merchants.
The sample code shows how you set the test flag on platforms.
Payment API
These are the core payment APIs used to execute and work with payment transactions in BlockChyp.
Charge
Charge Example:
Linux/Mac OS: ./blockchyp -test -cmd="charge" -terminal="Test Terminal" -amount="25.00"
Windows: ./blockchyp.exe -test -cmd="charge" -terminal="Test Terminal" -amount="25.00"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func chargeExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "55.00",
}
response, err := client.Charge(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "55.00",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ChargeAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class ChargeExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("55.00");
// Send the request
AuthorizationResponse response = client.charge(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '55.00',
];
$response = BlockChyp::charge($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
amount: '55.00'
}
response = blockchyp.charge(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "55.00",
}
# run the transaction.
response = client.charge(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.charge({
test: true,
terminalName: 'Test Terminal',
amount: '55.00',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "55.00"
[client chargeWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"authCode", [response objectForKey:@"authCode"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "55.00"
client.charge(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("authCode" + ": " + (response["authCode"] as? String).unsafelyUnwrapped)
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "052509",
"transactionId": "KJ3DPHULBAI6VOTSNSLM7WZLHE",
"transactionRef": "04781125618",
"transactionType": "charge",
"timestamp": "2020-04-30T18:28:10Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "25.00",
"authorizedAmount": "25.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "BDFD1A64620D9382",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"tsi": "6800",
"merchantName": "Test Merchant",
"applicationLabel": "VISA CREDIT",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "25.00",
"transactionType": "charge",
"entryMethod": "CHIP",
"cashBackAmount": "0.00",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Our most popular transaction executes a standard authorization and capture. This is the most basic of basic payment transactions, typically used in conventional retail.
Charge transactions can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is keylogging. If you use terminals for manual card entry, you'll bypass any keyloggers that might be maliciously running on the point-of-sale system.
Common Variations
- Gift Card Redemption: There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
- EBT: Set the
CardType
field toblockchyp.CardTypeEBT
to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined. - Cash Back: To enable cash back for debit transactions, set the
CashBack
field. If the card presented isn't a debit card, theCashBack
field will be ignored. - Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field with theCardType
field set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault inline with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details. - Cryptocurrency The
Cryptocurrency
field can be used to switch the standard present card screen to a cryptocurrency screen. The field value can beANY
to enable any supported cryptocurrency or a single currency code such asBTC
for Bitcoin.
Preauthorization
Preauthorization Example:
Linux/Mac OS: ./blockchyp -test -cmd="preauth" -terminal="Test Terminal" -amount="27.00"
Windows: ./blockchyp.exe -test -cmd="preauth" -terminal="Test Terminal" -amount="27.00"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func preauthExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "27.00",
}
response, err := client.Preauth(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "27.00",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.PreauthAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class PreauthExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("27.00");
// Send the request
AuthorizationResponse response = client.preauth(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '27.00',
];
$response = BlockChyp::preauth($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
amount: '27.00'
}
response = blockchyp.preauth(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "27.00",
}
# run the transaction.
response = client.preauth(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.preauth({
test: true,
terminalName: 'Test Terminal',
amount: '27.00',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "27.00"
[client preauthWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"authCode", [response objectForKey:@"authCode"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "27.00"
client.preauth(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("authCode" + ": " + (response["authCode"] as? String).unsafelyUnwrapped)
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "462305",
"transactionId": "KJ3DPHULBAI6VOTTNSLM7WZLHE",
"transactionRef": "22265850802",
"transactionType": "preauth",
"timestamp": "2020-04-30T18:36:21Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "27.00",
"authorizedAmount": "27.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "F1D11638D5A4C91D",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"tsi": "6800",
"merchantName": "Test Merchant",
"applicationLabel": "VISA CREDIT",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "27.00",
"transactionType": "preauth",
"entryMethod": "CHIP",
"cashBackAmount": "0.00",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
A preauthorization puts a hold on funds and must be captured later. This is used in scenarios where the final transaction amount might change. A common example is fine dining, where a tip adjustment is required before final settlement.
Another use case for preauthorization is e-commerce. Typically, an online order is preauthorized at the time of the order and then captured when the order ships.
Preauthorizations can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is key logging. If you use terminals for manual card entry, you'll bypass any key loggers that might be maliciously running on the point-of-sale system.
Cryptocurrency
Note that preauths are not supported for cryptocurrency.
Common Variations
- Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field withCardType
set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault in line with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
Capture Preauthorization
Capture Preauthorization Example:
Linux/Mac OS: ./blockchyp -test -cmd="capture" -tx="<ORIGINAL TRANSACTION ID>" -tip="5.00" -amount="32.00"
Windows: ./blockchyp.exe -test -cmd="capture" -tx="<ORIGINAL TRANSACTION ID>" -tip="5.00" -amount="32.00"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func captureExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CaptureRequest{
Test: true,
TransactionID: "<ORIGINAL TRANSACTION ID>",
Amount: "32.00",
}
response, err := client.Capture(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CaptureRequest request = new CaptureRequest
{
Test = true,
TransactionId = "<ORIGINAL TRANSACTION ID>",
Amount = "32.00",
};
// Run the transaction.
CaptureResponse response = await blockchyp.CaptureAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CaptureRequest;
import com.blockchyp.client.dto.CaptureResponse;
public class CaptureExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CaptureRequest request = new CaptureRequest();
request.setTest(true);
request.setTransactionId("<ORIGINAL TRANSACTION ID>");
request.setAmount("32.00");
// Send the request
CaptureResponse response = client.capture(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'transactionId' => '<ORIGINAL TRANSACTION ID>',
'amount' => '32.00',
];
$response = BlockChyp::capture($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
transactionId: '<ORIGINAL TRANSACTION ID>',
amount: '32.00'
}
response = blockchyp.capture(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"transactionId": "<ORIGINAL TRANSACTION ID>",
"amount": "32.00",
}
# run the transaction.
response = client.capture(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.capture({
test: true,
transactionId: '<ORIGINAL TRANSACTION ID>',
amount: '32.00',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["transactionId"] = "<ORIGINAL TRANSACTION ID>"
request["amount"] = "32.00"
[client captureWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["transactionId"] = "<ORIGINAL TRANSACTION ID>"
request["amount"] = "32.00"
client.capture(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "337092",
"transactionId": "KJ3DPHULBAI6VOTUNSLM7WZLHE",
"batchId": "KJ3DPFELBAI6VOTRNSLM7WZLHE",
"transactionType": "capture",
"timestamp": "2020-04-30T19:03:00Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "32.00",
"authorizedAmount": "32.00",
"remainingBalance": "",
"tipAmount": "5.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "",
"authorizedCashBackAmount": "",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"avsResponse": "",
"receiptSuggestions": {
"requestSignature": false,
"authorizedAmount": "",
"transactionType": ""
},
"customer": null
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to capture a previously approved preauthorization.
You'll need to make sure you pass in the Transaction ID returned by the original preauth transaction so we know which transaction we're capturing. If you want to capture the transaction for the exact amount of the preauth, the Transaction ID is all you need to pass in.
You can adjust the total if you need to by passing in a new amount
. We
also recommend you pass in updated amounts for tax
and tip
as it can
sometimes reduce your interchange fees. (Level II Processing, for example.)
Refund
Refund Example:
Linux/Mac OS: ./blockchyp -test -cmd="refund" -tx="<PREAUTH TRANSACTION ID>"
Windows: ./blockchyp.exe -test -cmd="refund" -tx="<PREAUTH TRANSACTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func refundExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.RefundRequest{
TransactionID: "<PREVIOUS TRANSACTION ID>",
// Optional amount for partial refunds.
Amount: "5.00",
}
response, err := client.Refund(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
RefundRequest request = new RefundRequest
{
TransactionId = "<PREVIOUS TRANSACTION ID>",
Amount = "5.00",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.RefundAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.RefundRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class RefundExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
RefundRequest request = new RefundRequest();
request.setTransactionId("<PREVIOUS TRANSACTION ID>");
request.setAmount("5.00");
// Send the request
AuthorizationResponse response = client.refund(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'transactionId' => '<PREVIOUS TRANSACTION ID>',
// Optional amount for partial refunds.
'amount' => '5.00',
];
$response = BlockChyp::refund($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
transactionId: '<PREVIOUS TRANSACTION ID>',
# Optional amount for partial refunds.
amount: '5.00'
}
response = blockchyp.refund(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"transactionId": "<PREVIOUS TRANSACTION ID>",
# Optional amount for partial refunds.
"amount": "5.00",
}
# run the transaction.
response = client.refund(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.refund({
transactionId: '<PREVIOUS TRANSACTION ID>',
// Optional amount for partial refunds.
amount: '5.00',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["transactionId"] = "<PREVIOUS TRANSACTION ID>"
request["amount"] = "5.00"
[client refundWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["transactionId"] = "<PREVIOUS TRANSACTION ID>"
request["amount"] = "5.00"
client.refund(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "778648",
"transactionId": "KJ3DPHULBAI6VOTVNSLM7WZLHE",
"batchId": "KJ3DPFELBAI6VOTRNSLM7WZLHE",
"transactionType": "refund",
"timestamp": "2020-04-30T20:14:38Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "",
"authorizedAmount": "27.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "",
"authorizedCashBackAmount": "",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"avsResponse": "",
"receiptSuggestions": {
"merchantName": "Test Merchant",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "27.00",
"transactionType": "refund",
"entryMethod": "CHIP"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
It's not ideal, but sometimes customers want their money back.
Our refund API allows you to confront this unpleasant reality by executing refunds in a few different scenarios.
The most fraud resistent method is to execute refunds in the context of a previous transaction. You should always keep track of the Transaction ID returned in a BlockChyp response. To refund the full amount of the previous transaction, just pass in the original Transaction ID with the refund requests.
Partial Refunds
For a partial refund, just pass in an amount along with the Transaction ID. The only rule is that the amount must be equal to or less than the original transaction. You can execute multiple partial refunds against the same original transaction as long as the total refunded amount doesn't exceed the original amount.
Tokenized Refunds
You can also use a token to execute a refund. Pass in a token instead of the Transaction ID and the desired refund amount.
Free Range Refunds
When you execute a refund without referencing a previous transaction, we call this a free range refund.
We don't recommend this type of refund, but it is permitted. If you absolutely insist on doing it, pass in a Terminal Name and an amount.
You can execute a manual or keyed refund by passing the ManualEntry
field
to a free range refund request.
Gift Card Refunds
Gift card refunds are allowed in the context of a previous transaction, but free range gift card refunds are not allowed. Use the gift card activation API if you need to add more funds to a gift card.
Store and Forward Support
Refunds are not permitted when a terminal falls back to store and forward mode.
Auto Voids
If a refund referencing a previous transaction is executed for the full amount before the original transaction's batch is closed, the refund is automatically converted to a void. This saves the merchant a little bit of money.
Cryptocurrency
Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Void
Void Example:
Linux/Mac OS: ./blockchyp -test -cmd="void" -tx="<PREAUTH TRANSACTION ID>"
Windows: ./blockchyp.exe -test -cmd="void" -tx="<PREAUTH TRANSACTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func voidExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.VoidRequest{
Test: true,
TransactionID: "<PREVIOUS TRANSACTION ID>",
}
response, err := client.Void(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
VoidRequest request = new VoidRequest
{
Test = true,
TransactionId = "<PREVIOUS TRANSACTION ID>",
};
// Run the transaction.
VoidResponse response = await blockchyp.VoidAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.VoidRequest;
import com.blockchyp.client.dto.VoidResponse;
public class VoidExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
VoidRequest request = new VoidRequest();
request.setTest(true);
request.setTransactionId("<PREVIOUS TRANSACTION ID>");
// Send the request
VoidResponse response = client.voidTx(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'transactionId' => '<PREVIOUS TRANSACTION ID>',
];
$response = BlockChyp::void($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
transactionId: '<PREVIOUS TRANSACTION ID>'
}
response = blockchyp.void(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"transactionId": "<PREVIOUS TRANSACTION ID>",
}
# run the transaction.
response = client.void(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.void({
test: true,
transactionId: '<PREVIOUS TRANSACTION ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["transactionId"] = "<PREVIOUS TRANSACTION ID>"
[client voidWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["transactionId"] = "<PREVIOUS TRANSACTION ID>"
client.void(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "537045",
"transactionId": "KJ3DPKELBAI6VOTYNSLM7WZLHE",
"batchId": "KJ3DPFELBAI6VOTRNSLM7WZLHE",
"transactionType": "void",
"timestamp": "2020-04-30T21:19:09Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"entryMethod": "CHIP",
"paymentType": "VISA",
"avsResponse": "",
"receiptSuggestions": {
"requestSignature": false,
"authorizedAmount": "",
"transactionType": ""
},
"customer": null
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Mistakes happen. If a transaction is made by mistake, you can void it with this API. All that's needed is to pass in a Transaction ID and execute the void before the original transaction's batch closes.
Voids work with EBT and gift card transactions with no additional parameters.
Cryptocurrency
Note that voids are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Time Out Reversal
Time Out Reversal Example:
Linux/Mac OS: ./blockchyp -test -cmd="reverse" -txRef="<LAST TRANSACTION REF>"
Windows: ./blockchyp.exe -test -cmd="reverse" -txRef="<LAST TRANSACTION REF>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func reverseExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
TransactionRef: "<LAST TRANSACTION REF>",
}
response, err := client.Reverse(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
TransactionRef = "<LAST TRANSACTION REF>",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ReverseAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class ReverseExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTransactionRef("<LAST TRANSACTION REF>");
// Send the request
AuthorizationResponse response = client.reverse(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'transactionRef' => '<LAST TRANSACTION REF>',
];
$response = BlockChyp::reverse($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
transactionRef: '<LAST TRANSACTION REF>'
}
response = blockchyp.reverse(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"transactionRef": "<LAST TRANSACTION REF>",
}
# run the transaction.
response = client.reverse(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.reverse({
transactionRef: '<LAST TRANSACTION REF>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["transactionRef"] = "<LAST TRANSACTION REF>"
[client reverseWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["transactionRef"] = "<LAST TRANSACTION REF>"
client.reverse(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "130621",
"transactionId": "KJ3DPMULBAI6VOTZNSLM7WZLHE",
"batchId": "KJ3DPFELBAI6VOTRNSLM7WZLHE",
"transactionRef": "YOURTXREF",
"transactionType": "reverse",
"timestamp": "2020-04-30T21:29:38Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "",
"authorizedAmount": "0.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "",
"authorizedCashBackAmount": "",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"avsResponse": "",
"receiptSuggestions": {
"merchantName": "Test Merchant",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "0.00",
"transactionType": "reverse",
"entryMethod": "CHIP",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Payment transactions require a stable network to function correctly and no network is stable all the time. Time out reversals are a great line of defense against accidentally double charging consumers when payments are retried during shaky network conditions.
We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out. If you don't receive a definitive response from BlockChyp, you can't be certain about whether or not the transaction went through.
The best practice in this situation is to send a time out reversal request. Time out reversals check for a transaction and void it if it exists.
The only caveat is that developers must use the transactionRef
property (txRef
for the CLI) when executing charge, preauth, and refund transactions.
The reason for this requirement is that if a system never receives a definitive response for a transaction, the system would never have received the BlockChyp generated Transaction ID. We have to fall back to Transaction Ref to identify a transaction.
Cryptocurrency
Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Gift Card Activation
Gift Card Activation Example:
Linux/Mac OS: ./blockchyp -test -cmd="gift-activate" -terminal="Test Terminal" -amount="50.00"
Windows: ./blockchyp.exe -test -cmd="gift-activate" -terminal="Test Terminal" -amount="50.00"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func giftActivateExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.GiftActivateRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "50.00",
}
response, err := client.GiftActivate(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
GiftActivateRequest request = new GiftActivateRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "50.00",
};
// Run the transaction.
GiftActivateResponse response = await blockchyp.GiftActivateAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.GiftActivateRequest;
import com.blockchyp.client.dto.GiftActivateResponse;
public class GiftActivateExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
GiftActivateRequest request = new GiftActivateRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("50.00");
// Send the request
GiftActivateResponse response = client.giftActivate(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '50.00',
];
$response = BlockChyp::giftActivate($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
amount: '50.00'
}
response = blockchyp.giftActivate(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "50.00",
}
# run the transaction.
response = client.gift_activate(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.giftActivate({
test: true,
terminalName: 'Test Terminal',
amount: '50.00',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "50.00"
[client giftActivateWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"amount", [response objectForKey:@"amount"])
NSLog(@"%@: %@", @"currentBalance", [response objectForKey:@"currentBalance"])
NSLog(@"%@: %@", @"publicKey", [response objectForKey:@"publicKey"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "50.00"
client.giftActivate(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("amount" + ": " + (response["amount"] as? String).unsafelyUnwrapped)
NSLog("currentBalance" + ": " + (response["currentBalance"] as? String).unsafelyUnwrapped)
NSLog("publicKey" + ": " + (response["publicKey"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "APPROVED",
"transactionId": "KJ3DPPELBAI6VOT4NSLM7WZLHE",
"transactionType": "gift_activate",
"timestamp": "2020-04-30T22:41:23Z",
"tickBlock": "000966828e6b196be72a480bf3a70e77c685262b6a4249b560ef770c8fb51eac",
"test": true,
"approved": true,
"amount": "50.00",
"currentBalance": "50.00",
"currencyCode": "USD",
"publicKey": "13TwUmBCg286Lw8N6EA3QgNu9LRerfhDcHwWKVSLnuNw9etWWfr",
"maskedPan": "************3904"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API activates or adds value to BlockChyp gift cards. Just pass in the terminal name and the amount to add to the card. Once the customer swipes their card, the terminal will use keys on the mag stripe to add value to the card.
You don't need to handle a new gift card activation or a gift card recharge any differently. The terminal firmware will figure out what to do on its own while also returning the new balance for the gift card.
This is the part of the system where BlockChyp's blockchain DNA comes closest to the surface. The BlockChyp gift card system doesn't really use gift card numbers. This means they can't be stolen.
BlockChyp identifies cards with an elliptic curve public key instead. Gift card transactions are actually blocks signed with those keys. This means there are no shared secrets sent over the network. To keep track of a BlockChyp gift card, hang on to the public key returned during gift card activation. That's the gift card's elliptic curve public key.
We sometimes print numbers on our gift cards, but these are actually decimal encoded hashes of a portion of the public key to make our gift cards seem normal to normies. They can be used for balance checks and play a lookup role in online gift card authorization, but are of little use beyond that.
Voids and Reversals
Gift card activations can be voided and reversed just like any other BlockChyp transaction. Use the Transaction ID or Transaction Ref to identify the gift activation transaction as you normally would for voiding or reversing a conventional payment transaction.
Importing Gift Cards
BlockChyp does have the ability to import gift card liability from conventional gift card platforms. Unfortunately, BlockChyp does not support activating cards on third party systems. However, you can import your outstanding gift cards and customers can swipe them on the terminals like BlockChyp's standard gift cards.
No special coding is required to access this feature. The gateway and terminal firmware handle everything for you.
Third Party Gift Card Networks
BlockChyp does not currently provide any native support for other gift card platforms beyond importing gift card liability. We do have a white listing system that can be used to support your own custom gift card implementations. We have a security review process before we can allow a BIN range to be white listed, so contact support@blockchyp.com if you need to white list a BIN range.
Balance
Balance Example:
Linux/Mac OS: ./blockchyp -test -cmd="balance" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="balance" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func balanceExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BalanceRequest{
Test: true,
TerminalName: "Test Terminal",
CardType: blockchyp.CardTypeEBT,
}
response, err := client.Balance(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BalanceRequest request = new BalanceRequest
{
Test = true,
TerminalName = "Test Terminal",
CardType = CardType.EBT,
};
// Run the transaction.
BalanceResponse response = await blockchyp.BalanceAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BalanceRequest;
import com.blockchyp.client.dto.BalanceResponse;
import com.blockchyp.client.dto.CardType;
public class BalanceExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BalanceRequest request = new BalanceRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setCardType(CardType.EBT);
// Send the request
BalanceResponse response = client.balance(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'cardType' => BlockChyp::CARD_TYPE_EBT,
];
$response = BlockChyp::balance($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
cardType: CardType::EBT
}
response = blockchyp.balance(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"cardType": blockchyp.CardType.EBT,
}
# run the transaction.
response = client.balance(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.balance({
test: true,
terminalName: 'Test Terminal',
cardType: BlockChyp.CardType.EBT,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["cardType"] = [NSNumber numberWithInt:CARD_TYPE_EBT]
[client balanceWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["cardType"] = [NSNumber numberWithInt:CARD_TYPE_EBT]
client.balance(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"transactionId": "KJ3DPMULBAI6VOT3NSLM7WZLHE",
"transactionType": "balance",
"timestamp": "",
"tickBlock": "0006bea9b77d4452be3e7979eaedd357d0da22cc0d1a85f6027176a2f00d0bea",
"test": true,
"paymentType": "BC_GIFT",
"maskedPan": "************3904",
"publicKey": "13TwUmBCg286Lw8N6EA3QgNu9LRerfhDcHwWKVSLnuNw9etWWfr",
"avsResponse": "",
"receiptSuggestions": {
"merchantName": "Test Merchant",
"requestSignature": false,
"maskedPan": "************3904",
"authorizedAmount": "",
"transactionType": "balance",
"entryMethod": "SWIPE"
},
"customer": null,
"remainingBalance": "50.00"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API checks a gift or EBT card balance.
Gift Card Balance Checks
For gift cards, pass in a terminal name and the customer will be prompted to swipe a card on that terminal. The remaining balance will be displayed briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.
EBT Balance Checks
All EBT transactions require a PIN, so to check an EBT card balance,
you need to pass in the ebt
flag just like you would for a normal EBT
charge transaction. The customer will be prompted to swipe their card and
enter a PIN code. If everything checks out, the remaining balance on the
card will be displayed on the terminal for the customer and returned with the API response.
Testing Gift Card Balance Checks
Test gift card balance checks work no differently than live gift cards. You must activate a test gift card first to test balance checks. Test gift cards are real blockchain cards that live on our parallel test blockchain.
Testing EBT Gift Card Balance Checks
All test EBT transactions assume a starting balance of $100.00. As a result, test EBT balance checks always return a balance of $100.00.
Close Batch
Close Batch Example:
Linux/Mac OS: ./blockchyp -test -cmd="close-batch"
Windows: ./blockchyp.exe -test -cmd="close-batch"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func closeBatchExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CloseBatchRequest{
Test: true,
}
response, err := client.CloseBatch(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CloseBatchRequest request = new CloseBatchRequest
{
Test = true,
};
// Run the transaction.
CloseBatchResponse response = await blockchyp.CloseBatchAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CloseBatchRequest;
import com.blockchyp.client.dto.CloseBatchResponse;
public class CloseBatchExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CloseBatchRequest request = new CloseBatchRequest();
request.setTest(true);
// Send the request
CloseBatchResponse response = client.closeBatch(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
];
$response = BlockChyp::closeBatch($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true
}
response = blockchyp.closeBatch(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
}
# run the transaction.
response = client.close_batch(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.closeBatch({
test: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
[client closeBatchWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
client.closeBatch(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"transactionId": "",
"batchId": "KJ3DPFELBAI6VOTRNSLM7WZLHE",
"transactionType": "",
"timestamp": "",
"tickBlock": "",
"test": true,
"currencyCode": "USD",
"capturedTotal": "55.00",
"openPreauths": "0.00"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API will close the merchant's batch if it's currently open.
By default, merchant batches will close automatically at 3 AM in their local time zone. The automatic batch closure time can be changed in the Merchant Profile or disabled completely.
If automatic batch closure is disabled, you'll need to use this API to close the batch manually.
Send Payment Link
Send Payment Link Example:
Linux/Mac OS: ./blockchyp -test -cmd="send-link" -displaySubtotal="327.00" -displayTax="16.35" -displayTotal="353.35" -lineItemId="1|2|3" -lineItemDescription="Hiking Boots|Camping Tent|Backpack" -lineItemQty="1|2|1" -lineItemPrice="120.00|160.00|70.00" -lineItemDiscountDescription="Member Discount|Member Discount|Member Discount" -lineItemDiscountAmount="10.00|5.00|8.00" -lineItemExtended="110.00|155.00|62.00" -desc="Thank you for your order. Your order will be ready in 20 minutes" -email="pgregory@raviga.com" -firstName="Peter" -lastName="Gregory" -amount="353.35" -orderRef="12345" -txRef="<TX REF>" -autoSend
Windows: ./blockchyp.exe -test -cmd="send-link" -displaySubtotal="327.00" -displayTax="16.35" -displayTotal="353.35" -lineItemId="1|2|3" -lineItemDescription="Hiking Boots|Camping Tent|Backpack" -lineItemQty="1|2|1" -lineItemPrice="120.00|160.00|70.00" -lineItemDiscountDescription="Member Discount|Member Discount|Member Discount" -lineItemDiscountAmount="10.00|5.00|8.00" -lineItemExtended="110.00|155.00|62.00" -desc="Thank you for your order. Your order will be ready in 20 minutes" -email="pgregory@raviga.com" -firstName="Peter" -lastName="Gregory" -amount="353.35" -orderRef="12345" -txRef="<TX REF>" -autoSend
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func sendPaymentLinkExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PaymentLinkRequest{
TransactionRef: "<TX REF>",
Amount: "199.99",
Description: "Widget",
Subject: "Widget invoice",
Transaction: &blockchyp.TransactionDisplayTransaction{
Subtotal: "195.00",
Tax: "4.99",
Total: "199.99",
Items: []*blockchyp.TransactionDisplayItem{
&blockchyp.TransactionDisplayItem{
Description: "Widget",
Price: "195.00",
Quantity: 1,
},
},
},
AutoSend: true,
Customer: blockchyp.Customer{
CustomerRef: "Customer reference string",
FirstName: "FirstName",
LastName: "LastName",
CompanyName: "Company Name",
EmailAddress: "notifications@blockchypteam.m8r.co",
SmsNumber: "(123) 123-1231",
},
}
response, err := client.SendPaymentLink(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PaymentLinkRequest request = new PaymentLinkRequest
{
TransactionRef = "<TX REF>",
Amount = "199.99",
Description = "Widget",
Subject = "Widget invoice",
Transaction = new TransactionDisplayTransaction
{
Subtotal = "195.00",
Tax = "4.99",
Total = "199.99",
Items = new List<TransactionDisplayItem>
{
new TransactionDisplayItem
{
Description = "Widget",
Price = "195.00",
Quantity = 1,
}
},
},
AutoSend = true,
Customer = new Customer
{
CustomerRef = "Customer reference string",
FirstName = "FirstName",
LastName = "LastName",
CompanyName = "Company Name",
EmailAddress = "notifications@blockchypteam.m8r.co",
SmsNumber = "(123) 123-1231",
},
};
// Run the transaction.
PaymentLinkResponse response = await blockchyp.SendPaymentLinkAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PaymentLinkRequest;
import com.blockchyp.client.dto.PaymentLinkResponse;
import com.blockchyp.client.dto.TransactionDisplayTransaction;
import com.blockchyp.client.dto.TransactionDisplayItem;
import com.blockchyp.client.dto.Customer;
public class SendPaymentLinkExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PaymentLinkRequest request = new PaymentLinkRequest();
request.setTransactionRef("<TX REF>");
request.setAmount("199.99");
request.setDescription("Widget");
request.setSubject("Widget invoice");
TransactionDisplayTransaction transaction = new TransactionDisplayTransaction();
transaction.setSubtotal("195.00");
transaction.setTax("4.99");
transaction.setTotal("199.99");
Collection items = new ArrayList();
TransactionDisplayItem items0 = new TransactionDisplayItem();
items0.setDescription("Widget");
items0.setPrice("195.00");
items0.setQuantity(1);
items.add(items0);
transaction.setItems(items);
request.setTransaction(transaction);
request.setAutoSend(true);
Customer customer = new Customer();
customer.setCustomerRef("Customer reference string");
customer.setFirstName("FirstName");
customer.setLastName("LastName");
customer.setCompanyName("Company Name");
customer.setEmailAddress("notifications@blockchypteam.m8r.co");
customer.setSmsNumber("(123) 123-1231");
request.setCustomer(customer);
// Send the request
PaymentLinkResponse response = client.sendPaymentLink(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'transactionRef' => '<TX REF>',
'amount' => '199.99',
'description' => 'Widget',
'subject' => 'Widget invoice',
'transaction' => [
'subtotal' => '195.00',
'tax' => '4.99',
'total' => '199.99',
'items' => [
[
'description' => 'Widget',
'price' => '195.00',
'quantity' => 1,
],
],
],
'autoSend' => true,
'customer' => [
'customerRef' => 'Customer reference string',
'firstName' => 'FirstName',
'lastName' => 'LastName',
'companyName' => 'Company Name',
'emailAddress' => 'notifications@blockchypteam.m8r.co',
'smsNumber' => '(123) 123-1231',
],
];
$response = BlockChyp::sendPaymentLink($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
transactionRef: '<TX REF>',
amount: '199.99',
description: 'Widget',
subject: 'Widget invoice',
transaction: {
subtotal: '195.00',
tax: '4.99',
total: '199.99',
items: [
{
description: 'Widget',
price: '195.00',
quantity: 1
}
]
},
autoSend: true,
customer: {
customerRef: 'Customer reference string',
firstName: 'FirstName',
lastName: 'LastName',
companyName: 'Company Name',
emailAddress: 'notifications@blockchypteam.m8r.co',
smsNumber: '(123) 123-1231'
}
}
response = blockchyp.sendPaymentLink(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"transactionRef": "<TX REF>",
"amount": "199.99",
"description": "Widget",
"subject": "Widget invoice",
"transaction": {
"subtotal": "195.00",
"tax": "4.99",
"total": "199.99",
"items": [
{
"description": "Widget",
"price": "195.00",
"quantity": 1,
},
],
},
"autoSend": True,
"customer": {
"customerRef": "Customer reference string",
"firstName": "FirstName",
"lastName": "LastName",
"companyName": "Company Name",
"emailAddress": "notifications@blockchypteam.m8r.co",
"smsNumber": "(123) 123-1231",
},
}
# run the transaction.
response = client.send_payment_link(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.sendPaymentLink({
transactionRef: '<TX REF>',
amount: '199.99',
description: 'Widget',
subject: 'Widget invoice',
transaction: {
subtotal: '195.00',
tax: '4.99',
total: '199.99',
items: [
{
description: 'Widget',
price: '195.00',
quantity: 1,
},
],
},
autoSend: true,
customer: {
customerRef: 'Customer reference string',
firstName: 'FirstName',
lastName: 'LastName',
companyName: 'Company Name',
emailAddress: 'notifications@blockchypteam.m8r.co',
smsNumber: '(123) 123-1231',
},
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["transactionRef"] = "<TX REF>"
request["amount"] = "199.99"
request["description"] = "Widget"
request["subject"] = "Widget invoice"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "195.00"
transaction["tax"] = "4.99"
transaction["total"] = "199.99"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Widget"
items1["price"] = "195.00"
items1["quantity"] = 1
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
request["autoSend"] = true
var customer: [String:Any] = [:]
customer["customerRef"] = "Customer reference string"
customer["firstName"] = "FirstName"
customer["lastName"] = "LastName"
customer["companyName"] = "Company Name"
customer["emailAddress"] = "notifications@blockchypteam.m8r.co"
customer["smsNumber"] = "(123) 123-1231"
request["customer"] = customer
[client sendPaymentLinkWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"url", [response objectForKey:@"url"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["transactionRef"] = "<TX REF>"
request["amount"] = "199.99"
request["description"] = "Widget"
request["subject"] = "Widget invoice"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "195.00"
transaction["tax"] = "4.99"
transaction["total"] = "199.99"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Widget"
items1["price"] = "195.00"
items1["quantity"] = 1
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
request["autoSend"] = true
var customer: [String:Any] = [:]
customer["customerRef"] = "Customer reference string"
customer["firstName"] = "FirstName"
customer["lastName"] = "LastName"
customer["companyName"] = "Company Name"
customer["emailAddress"] = "notifications@blockchypteam.m8r.co"
customer["smsNumber"] = "(123) 123-1231"
request["customer"] = customer
client.sendPaymentLink(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("url" + ": " + (response["url"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"linkCode": "JUC37V2V57337Q5FA7WWTK6GAQ",
"url": "https://test.blockchyp.com/pay/JUC37V2V57337Q5FA7WWTK6GAQ",
"customerId": "BUF36REL4QI6VBVHNSLM7WZLHE"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to send an invoice to a customer and capture payment via a BlockChyp hosted payment page.
If you set the autoSend
flag, BlockChyp will send a basic invoice email
to the customer for you that includes the payment link. If you'd rather have
more control over the look of the email message, you can omit the autoSend
flag and send the customer email yourself.
There are a lot of optional parameters for this API, but at a minimum
you'll need to pass in a total, customer name, and email address. (Unless
you use the cashier
flag.)
Customer Info
Unless you're using the cashier
flag, you must specify a customer; either by
creating a new customer record inline or passing in an existing Customer ID or Customer Ref.
Line Item Level Data
It's not strictly required, but we strongly recommend sending line item level detail with every request. It will make the invoice look more complete and the data format for line item level data is the exact same format used for terminal line item display, so the same code can be used to support both areas.
Descriptions
You can also provide a free form description or message to display near the bottom of the invoice. Usually this is some kind of thank you note or instruction.
Terms and Conditions
You can include long form contract language with a request and capture terms and conditions accepted at the same time payment is captured.
The interface is identical to that used for the terminal based Terms and
Conditions API in that you can pass in content directly via tcContent
or via
a preconfigured template via tcAlias
. The Terms and Conditions log will also be updated when
agreement acceptance is incorporated into a send link request.
Auto Send
BlockChyp does not send the email notification automatically. This safeguard prevents real
emails from going out when you may not expect them If you want BlockChyp to send the email
for you, just add the autoSend
flag with all requests.
Cryptocurrency
If the merchant is configured to support cryptocurrency transactions, the payment page will display additional UI widgets that allowing customers to switch to a crypto payment method.
Tokenization
Add the enroll
flag to a send link request to enroll the payment method
in the token vault.
Add the enrollOnly
flag to enroll the payment method in the token vault without any immediate payment taking place. The payment link will ask the user for their payment information and inform them that they will not be charged immediately, but that their payment may be used for future transactions.
Cashier Facing Card Entry
BlockChyp can be used to generate internal/cashier facing card entry pages as well. This is designed for situations where you might need to take a phone order and don't have an available terminal.
If you pass in the cashier
flag, no email will be sent and you'll be able to
load the link in a browser or iframe for payment entry. When the cashier
flag
is used, the autoSend
flag will be ignored.
Note that cryptocurrency is not supported for cashier facing payment entry.
Payment Notifications
When a customer successfully submits payment, the merchant will receive an email notifying them that the payment was received.
Real Time Callback Notifications
Email notifications are fine, but you may want your system to be informed
immediately whenever a payment event occurs. By using the optional callbackUrl
request
property, you can specify a URL to which the Authorization Response will be posted
every time the user submits a payment, whether approved or otherwise.
The response will be sent as a JSON encoded POST request and will be the exact same format as all BlockChyp charge and preauth transaction responses.
Status Polling
If real time callbacks aren't practical or necessary in your environment, you can always use the Payment Link Status API described futher on.
A common use case for the send link API with status polling is curbside pickup. You could have your system check the Payment Link Status when a customer arrives to ensure it's been paid without necessarily needing to create background threads to constantly poll for status updates.
Resend Payment Link
Resend Payment Link Example:
Linux/Mac OS: ./blockchyp -test -cmd="resend-link" -linkCode="<PAYMENT LINK CODE>"
Windows: ./blockchyp.exe -test -cmd="resend-link" -linkCode="<PAYMENT LINK CODE>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func resendPaymentLinkExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.ResendPaymentLinkRequest{
LinkCode: "<PAYMENT LINK CODE>",
}
response, err := client.ResendPaymentLink(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
ResendPaymentLinkRequest request = new ResendPaymentLinkRequest
{
LinkCode = "<PAYMENT LINK CODE>",
};
// Run the transaction.
ResendPaymentLinkResponse response = await blockchyp.ResendPaymentLinkAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.ResendPaymentLinkRequest;
import com.blockchyp.client.dto.ResendPaymentLinkResponse;
public class ResendPaymentLinkExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
ResendPaymentLinkRequest request = new ResendPaymentLinkRequest();
request.setLinkCode("<PAYMENT LINK CODE>");
// Send the request
ResendPaymentLinkResponse response = client.resendPaymentLink(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'linkCode' => '<PAYMENT LINK CODE>',
];
$response = BlockChyp::resendPaymentLink($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
linkCode: '<PAYMENT LINK CODE>'
}
response = blockchyp.resendPaymentLink(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"linkCode": "<PAYMENT LINK CODE>",
}
# run the transaction.
response = client.resend_payment_link(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.resendPaymentLink({
linkCode: '<PAYMENT LINK CODE>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["linkCode"] = "<PAYMENT LINK CODE>"
[client resendPaymentLinkWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["linkCode"] = "<PAYMENT LINK CODE>"
client.resendPaymentLink(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API will resend a previously created payment link. An error is returned if the payment link is expired, has been cancelled, or has already been paid.
Cancel Payment Link
Cancel Payment Link Example:
Linux/Mac OS: ./blockchyp -test -cmd="cancel-link" -linkCode="<PAYMENT LINK CODE>"
Windows: ./blockchyp.exe -test -cmd="cancel-link" -linkCode="<PAYMENT LINK CODE>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func cancelPaymentLinkExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CancelPaymentLinkRequest{
LinkCode: "<PAYMENT LINK CODE>",
}
response, err := client.CancelPaymentLink(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CancelPaymentLinkRequest request = new CancelPaymentLinkRequest
{
LinkCode = "<PAYMENT LINK CODE>",
};
// Run the transaction.
CancelPaymentLinkResponse response = await blockchyp.CancelPaymentLinkAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CancelPaymentLinkRequest;
import com.blockchyp.client.dto.CancelPaymentLinkResponse;
public class CancelPaymentLinkExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CancelPaymentLinkRequest request = new CancelPaymentLinkRequest();
request.setLinkCode("<PAYMENT LINK CODE>");
// Send the request
CancelPaymentLinkResponse response = client.cancelPaymentLink(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'linkCode' => '<PAYMENT LINK CODE>',
];
$response = BlockChyp::cancelPaymentLink($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
linkCode: '<PAYMENT LINK CODE>'
}
response = blockchyp.cancelPaymentLink(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"linkCode": "<PAYMENT LINK CODE>",
}
# run the transaction.
response = client.cancel_payment_link(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.cancelPaymentLink({
linkCode: '<PAYMENT LINK CODE>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["linkCode"] = "<PAYMENT LINK CODE>"
[client cancelPaymentLinkWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["linkCode"] = "<PAYMENT LINK CODE>"
client.cancelPaymentLink(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API cancels a payment link.
Payment Link Status
Payment Link Status Example:
Linux/Mac OS: ./blockchyp -test -cmd="payment-link-status" -linkCode="<PAYMENT LINK CODE>"
Windows: ./blockchyp.exe -test -cmd="payment-link-status" -linkCode="<PAYMENT LINK CODE>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func paymentLinkStatusExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PaymentLinkStatusRequest{
LinkCode: "<PAYMENT LINK CODE>",
}
response, err := client.PaymentLinkStatus(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PaymentLinkStatusRequest request = new PaymentLinkStatusRequest
{
LinkCode = "<PAYMENT LINK CODE>",
};
// Run the transaction.
PaymentLinkStatusResponse response = await blockchyp.PaymentLinkStatusAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PaymentLinkStatusRequest;
import com.blockchyp.client.dto.PaymentLinkStatusResponse;
public class PaymentLinkStatusExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PaymentLinkStatusRequest request = new PaymentLinkStatusRequest();
request.setLinkCode("<PAYMENT LINK CODE>");
// Send the request
PaymentLinkStatusResponse response = client.paymentLinkStatus(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'linkCode' => '<PAYMENT LINK CODE>',
];
$response = BlockChyp::paymentLinkStatus($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
linkCode: '<PAYMENT LINK CODE>'
}
response = blockchyp.paymentLinkStatus(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"linkCode": "<PAYMENT LINK CODE>",
}
# run the transaction.
response = client.payment_link_status(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.paymentLinkStatus({
linkCode: '<PAYMENT LINK CODE>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["linkCode"] = "<PAYMENT LINK CODE>"
[client paymentLinkStatusWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["linkCode"] = "<PAYMENT LINK CODE>"
client.paymentLinkStatus(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"linkCode": "WDFAU5UP5U46GLEZEJKZIZDAYA",
"merchantId": "3IKWRKY47YI65L7VAJBKYEIAAQ",
"customerId": "54QS64R23YI65BHNAJBKYEIAAU",
"transactionRef": "<TRANSACTION REF>",
"orderRef": "12345",
"amount": "353.35",
"description": "Thank you for your order. Your order will be ready in 20 minutes",
"expiration": "2023-10-13T20:12:46Z",
"dateCreated": "2023-08-14T20:12:46Z",
"transactionDetails": {
"subtotal": "327.00",
"tax": "16.35",
"total": "353.35",
"items": [
{
"id": "1",
"description": "Hiking Boots",
"price": "120.00",
"quantity": 1,
"extended": "110.00",
"unitCode": "",
"commodityCode": "",
"productCode": "",
"discounts": [
{
"description": "Member Discount",
"amount": "10.00"
}
]
},
{
"id": "2",
"description": "Camping Tent",
"price": "160.00",
"quantity": 2,
"extended": "155.00",
"unitCode": "",
"commodityCode": "",
"productCode": "",
"discounts": [
{
"description": "Member Discount",
"amount": "5.00"
}
]
},
{
"id": "3",
"description": "Backpack",
"price": "70.00",
"quantity": 1,
"extended": "62.00",
"unitCode": "",
"commodityCode": "",
"productCode": "",
"discounts": [
{
"description": "Member Discount",
"amount": "8.00"
}
]
}
]
},
"status": "Pending"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to check on the status of a payment link, including transaction data and the full history of attempted transactions.
This API is the preferred source of truth and best practice when you want to check on the status of a payment link (as opposed to Transaction Status). The Transaction Status API is not ideal because of ambiguity when there are multiple transactions associated with a single payment link.
You must pass the linkCode
value associated with the payment link. It is included in the response from BlockChyp when the payment link is originally created.
Transaction Status
Transaction Status Example:
Linux/Mac OS: ./blockchyp -test -cmd="tx-status" -tx="<TRANSACTION ID>"
Windows: ./blockchyp.exe -test -cmd="tx-status" -tx="<TRANSACTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func transactionStatusExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TransactionStatusRequest{
TransactionID: "<TRANSACTION ID>",
}
response, err := client.TransactionStatus(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TransactionStatusRequest request = new TransactionStatusRequest
{
TransactionId = "<TRANSACTION ID>",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.TransactionStatusAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TransactionStatusRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class TransactionStatusExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TransactionStatusRequest request = new TransactionStatusRequest();
request.setTransactionId("<TRANSACTION ID>");
// Send the request
AuthorizationResponse response = client.transactionStatus(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'transactionId' => '<TRANSACTION ID>',
];
$response = BlockChyp::transactionStatus($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
transactionId: '<TRANSACTION ID>'
}
response = blockchyp.transactionStatus(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"transactionId": "<TRANSACTION ID>",
}
# run the transaction.
response = client.transaction_status(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.transactionStatus({
transactionId: '<TRANSACTION ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["transactionId"] = "<TRANSACTION ID>"
[client transactionStatusWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"responseDescription", [response objectForKey:@"responseDescription"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["transactionId"] = "<TRANSACTION ID>"
client.transactionStatus(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("responseDescription" + ": " + (response["responseDescription"] as? String).unsafelyUnwrapped)
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"approved": true,
"authCode": "782472",
"transactionId": "GH7FEIUL64I6VILZNSLM7WZLHE",
"batchId": "GH7EWQUL64I6VILZNSLM7WZLHE",
"transactionRef": "MYTXREF",
"transactionType": "charge",
"timestamp": "2020-05-01T22:00:39Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "125.05",
"authorizedAmount": "125.05",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "",
"entryMethod": "KEYED",
"paymentType": "VISA",
"maskedPan": "************1111",
"cardHolder": "PETER GREGORY",
"avsResponse": "N",
"receiptSuggestions": {
"merchantName": "Test Merchant",
"merchantId": "BUF36EUL4QI6VBUZNSLM7WZLHE",
"requestSignature": false,
"maskedPan": "************1111",
"authorizedAmount": "125.05",
"transactionType": "charge",
"entryMethod": "KEYED"
},
"customer": {
"id": "BUF36REL4QI6VBVJNSLM7WZLHE",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "",
"emailAddress": "pgregory@raviga.com",
"smsNumber": "",
"paymentMethods": null
},
"whiteListedCard": null,
"storeAndForward": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API returns the current status for any transaction. You can lookup a transaction by its BlockChyp assigned Transaction ID or your own Transaction Ref.
You should always use globally unique Transaction Ref values, but in the event that you duplicate Transaction Refs, the most recent transaction matching your Transaction Ref is returned.
Cash Discount
Cash Discount Example:
Linux/Mac OS: ./blockchyp -test -cmd="cash-discount" -amount="100.00" -surcharge -cashDiscount
Windows: ./blockchyp.exe -test -cmd="cash-discount" -amount="100.00" -surcharge -cashDiscount
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func cashDiscountExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CashDiscountRequest{
Amount: "100.00",
CashDiscount: true,
Surcharge: true,
}
response, err := client.CashDiscount(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CashDiscountRequest request = new CashDiscountRequest
{
Amount = "100.00",
CashDiscount = true,
Surcharge = true,
};
// Run the transaction.
CashDiscountResponse response = await blockchyp.CashDiscountAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CashDiscountRequest;
import com.blockchyp.client.dto.CashDiscountResponse;
public class CashDiscountExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CashDiscountRequest request = new CashDiscountRequest();
request.setAmount("100.00");
request.setCashDiscount(true);
request.setSurcharge(true);
// Send the request
CashDiscountResponse response = client.cashDiscount(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'amount' => '100.00',
'cashDiscount' => true,
'surcharge' => true,
];
$response = BlockChyp::cashDiscount($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
amount: '100.00',
cashDiscount: true,
surcharge: true
}
response = blockchyp.cashDiscount(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"amount": "100.00",
"cashDiscount": True,
"surcharge": True,
}
# run the transaction.
response = client.cash_discount(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.cashDiscount({
amount: '100.00',
cashDiscount: true,
surcharge: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["amount"] = "100.00"
request["cashDiscount"] = true
request["surcharge"] = true
[client cashDiscountWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"amount", [response objectForKey:@"amount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["amount"] = "100.00"
request["cashDiscount"] = true
request["surcharge"] = true
client.cashDiscount(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("amount" + ": " + (response["amount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"currencyCode": "",
"amount": "100.00",
"taxExempt": false,
"surcharge": "3.81",
"cashDiscount": "3.81"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API calculates the surcharge, cash discount, and total amounts for cash transactions.
If you're using BlockChyp's cash discounting features, you can use this endpoint to ensure the numbers and receipts for true cash transactions are consistent with transactions processed by BlockChyp.
Batch History
Batch History Example:
Linux/Mac OS: ./blockchyp -test -cmd="batch-history" -maxResults="250" -startIndex="1"
Windows: ./blockchyp.exe -test -cmd="batch-history" -maxResults="250" -startIndex="1"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func batchHistoryExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BatchHistoryRequest{
MaxResults: 250,
StartIndex: 0,
}
response, err := client.BatchHistory(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BatchHistoryRequest request = new BatchHistoryRequest
{
MaxResults = 250,
StartIndex = 0,
};
// Run the transaction.
BatchHistoryResponse response = await blockchyp.BatchHistoryAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BatchHistoryRequest;
import com.blockchyp.client.dto.BatchHistoryResponse;
public class BatchHistoryExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BatchHistoryRequest request = new BatchHistoryRequest();
request.setMaxResults(250);
request.setStartIndex(0);
// Send the request
BatchHistoryResponse response = client.batchHistory(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'maxResults' => 250,
'startIndex' => 0,
];
$response = BlockChyp::batchHistory($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
maxResults: 250,
startIndex: 0
}
response = blockchyp.batchHistory(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"maxResults": 250,
"startIndex": 0,
}
# run the transaction.
response = client.batch_history(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.batchHistory({
maxResults: 250,
startIndex: 0,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["maxResults"] = 250
request["startIndex"] = 0
[client batchHistoryWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["maxResults"] = 250
request["startIndex"] = 0
client.batchHistory(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"startDate": "",
"endDate": "",
"batches": [
{
"batchId": "OPXQNZEUSAI6VL2FNSLM7WZLHE",
"capturedAmount": "146.44",
"open": true,
"openDate": "2020-05-12T20:45:28Z",
"closeDate": "0001-01-01T00:00:00Z"
},
{
"batchId": "OPXQNZEUSAI6VL2CNSLM7WZLHE",
"capturedAmount": "57.79",
"open": false,
"openDate": "2020-05-12T20:44:11Z",
"closeDate": "2020-05-12T20:45:00Z"
}
],
"maxResults": 250,
"startIndex": 0,
"totalResultCount": 2
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint allows developers to query the gateway for the merchant's batch history. The data will be returned in descending order of open date with the most recent batch returned first. The results will include basic information about the batch. Consider using the Batch Details API for more detail about a specific batch.
Limiting Results
This API will return a maximum of 250 results. Use the maxResults
property to
limit maximum results even further and use the startIndex
property to
page through results that span multiple queries.
For example, if you want the ten most recent batches, pass in a value of
10
for maxResults
. Also note that startIndex
is zero based. Use a value of 0
to
get the first batch in the dataset.
Filtering by Date Range
You can also filter results by date. Use the startDate
and endDate
properties to return only those batches opened between those dates.
You can use either startDate
and endDate
and you can use date filters
in conjunction with maxResults
and startIndex
Batch Details
Batch Details Example:
Linux/Mac OS: ./blockchyp -test -cmd="batch-details" -batchId="<BATCH ID>"
Windows: ./blockchyp.exe -test -cmd="batch-details" -batchId="<BATCH ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func batchDetailsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BatchDetailsRequest{
BatchID: "<BATCH ID>",
}
response, err := client.BatchDetails(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BatchDetailsRequest request = new BatchDetailsRequest
{
BatchId = "<BATCH ID>",
};
// Run the transaction.
BatchDetailsResponse response = await blockchyp.BatchDetailsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BatchDetailsRequest;
import com.blockchyp.client.dto.BatchDetailsResponse;
public class BatchDetailsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BatchDetailsRequest request = new BatchDetailsRequest();
request.setBatchId("<BATCH ID>");
// Send the request
BatchDetailsResponse response = client.batchDetails(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'batchId' => '<BATCH ID>',
];
$response = BlockChyp::batchDetails($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
batchId: '<BATCH ID>'
}
response = blockchyp.batchDetails(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"batchId": "<BATCH ID>",
}
# run the transaction.
response = client.batch_details(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.batchDetails({
batchId: '<BATCH ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["batchId"] = "<BATCH ID>"
[client batchDetailsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"capturedAmount", [response objectForKey:@"capturedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["batchId"] = "<BATCH ID>"
client.batchDetails(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("capturedAmount" + ": " + (response["capturedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"batchId": "OPXQNZEUSAI6VL2FNSLM7WZLHE",
"capturedAmount": "294.12",
"openPreauths": "0.00",
"totalVolume": "294.12",
"transactionCount": 5,
"giftCardsSold": "50.00",
"giftCardVolume": "12.00",
"expectedDeposit": "282.12",
"open": true,
"openDate": "2020-05-12T20:45:28Z",
"closeDate": "0001-01-01T00:00:00Z",
"volumeByTerminal": [
{
"terminalName": "POS1",
"serialNumber": "A18290030XXXX",
"terminalType": "LUXE8000",
"capturedAmount": "147.68",
"transactionCount": 2
},
{
"terminalName": "POS2",
"serialNumber": "A182700300XXXX",
"terminalType": "LUXE8000",
"capturedAmount": "146.44",
"transactionCount": 3
}
]
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows developers to pull down details for a specific batch, including captured volume, gift card activity, expected deposit, and captured volume broken down by terminal.
The only required request parameter is batchId
. Batch IDs are returned
with every transaction response and can be discovered using the Batch
History API.
Transaction History
Transaction History Example:
Linux/Mac OS: ./blockchyp -test -cmd="tx-history" -batchId="<BATCH ID>" -maxResults="10"
Windows: ./blockchyp.exe -test -cmd="tx-history" -batchId="<BATCH ID>" -maxResults="10"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func transactionHistoryExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TransactionHistoryRequest{
MaxResults: 10,
BatchID: "<BATCH ID>",
}
response, err := client.TransactionHistory(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TransactionHistoryRequest request = new TransactionHistoryRequest
{
MaxResults = 10,
BatchId = "<BATCH ID>",
};
// Run the transaction.
TransactionHistoryResponse response = await blockchyp.TransactionHistoryAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TransactionHistoryRequest;
import com.blockchyp.client.dto.TransactionHistoryResponse;
public class TransactionHistoryExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TransactionHistoryRequest request = new TransactionHistoryRequest();
request.setMaxResults(10);
request.setBatchId("<BATCH ID>");
// Send the request
TransactionHistoryResponse response = client.transactionHistory(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'maxResults' => 10,
'batchId' => '<BATCH ID>',
];
$response = BlockChyp::transactionHistory($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
maxResults: 10,
batchId: '<BATCH ID>'
}
response = blockchyp.transactionHistory(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"maxResults": 10,
"batchId": "<BATCH ID>",
}
# run the transaction.
response = client.transaction_history(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.transactionHistory({
maxResults: 10,
batchId: '<BATCH ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["maxResults"] = 10
request["batchId"] = "<BATCH ID>"
[client transactionHistoryWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["maxResults"] = 10
request["batchId"] = "<BATCH ID>"
client.transactionHistory(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"batchId": "",
"terminalName": "",
"startDate": "0001-01-01T00:00:00Z",
"endDate": "0001-01-01T00:00:00Z",
"maxResults": 2,
"startIndex": 0,
"totalResultCount": 7,
"transactions": [
{
"success": true,
"error": "",
"responseDescription": "",
"approved": true,
"authCode": "324858",
"transactionId": "OPXQN6EUSAI6VL2MNSLM7WZLHE",
"batchId": "OPXQNZEUSAI6VL2FNSLM7WZLHE",
"transactionRef": "88277082628",
"transactionType": "charge",
"timestamp": "2020-05-12T21:00:22Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "34.34",
"authorizedAmount": "34.34",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "",
"entryMethod": "CONTACTLESS EMV",
"paymentType": "AMEX",
"maskedPan": "***********1006",
"cardHolder": "UAT USA/Test Card 12",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A000000025010402",
"arqc": "B5D6F55680D4B628",
"iad": "06020103A02800",
"tvr": "8000008000",
"terminalId": "OPXQN3UUSAI6VL2JNSLM7WZLHE",
"merchantName": "Test Merchant",
"merchantId": "KUV2WLUURYI6VLFSNSLM7WZLHE",
"requestSignature": false,
"maskedPan": "***********1006",
"authorizedAmount": "34.34",
"transactionType": "charge",
"entryMethod": "CONTACTLESS EMV"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
},
{
"success": true,
"error": "",
"responseDescription": "",
"approved": true,
"authCode": "554632",
"transactionId": "OPXQN6EUSAI6VL2LNSLM7WZLHE",
"batchId": "OPXQNZEUSAI6VL2FNSLM7WZLHE",
"transactionRef": "00036850216",
"transactionType": "charge",
"timestamp": "2020-05-12T21:00:03Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "113.34",
"authorizedAmount": "113.34",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "07FC47906F51B4E9",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"terminalId": "OPXQN3UUSAI6VL2JNSLM7WZLHE",
"merchantName": "Test Merchant",
"merchantId": "KUV2WLUURYI6VLFSNSLM7WZLHE",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "113.34",
"transactionType": "charge",
"entryMethod": "CHIP"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
]
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint provides several different methods to sift through transaction history.
By default with no filtering properties, this endpoint will return the 250 most recent transactions.
Limiting Results
This API will return a maximum of 50 results in a single query. Use the maxResults
property
to limit maximum results even further and use the startIndex
property to
page through results that span multiple queries.
For example, if you want the ten most recent batches, pass in a value of
10
for maxResults
. Also note that startIndex
is zero based. Use a value of 0
to
get the first transaction in the dataset.
Filtering By Date Range
You can also filter results by date. Use the startDate
and endDate
properties to return only transactions run between those dates.
You can use either startDate
or endDate
and you can use date filters
in conjunction with maxResults
and startIndex
Filtering By Batch
To restrict results to a single batch, pass in the batchId
parameter.
Filtering By Terminal
To restrict results to those executed on a single terminal, pass in the terminal name.
Combining Filters
None of the above filters are mutually exclusive. You can combine any of the above properties in a single request to restrict transaction results to a narrower set of results.
Searching Transaction History
You can search transaction history by passing in search criteria with the
query
option. The search system will match the amount (requested and authorized),
last four of the card number, cardholder name, and the auth code.
Note that when search queries are used, terminalName or batch id filters are not supported.
List Queued Transactions
List Queued Transactions Example:
Linux/Mac OS: ./blockchyp -test -cmd="list-queue" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="list-queue" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func listQueuedTransactionsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.ListQueuedTransactionsRequest{
TerminalName: "Test Terminal",
}
response, err := client.ListQueuedTransactions(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
ListQueuedTransactionsRequest request = new ListQueuedTransactionsRequest
{
TerminalName = "Test Terminal",
};
// Run the transaction.
ListQueuedTransactionsResponse response = await blockchyp.ListQueuedTransactionsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.ListQueuedTransactionsRequest;
import com.blockchyp.client.dto.ListQueuedTransactionsResponse;
public class ListQueuedTransactionsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
ListQueuedTransactionsRequest request = new ListQueuedTransactionsRequest();
request.setTerminalName("Test Terminal");
// Send the request
ListQueuedTransactionsResponse response = client.listQueuedTransactions(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::listQueuedTransactions($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal'
}
response = blockchyp.listQueuedTransactions(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.list_queued_transactions(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.listQueuedTransactions({
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
[client listQueuedTransactionsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
client.listQueuedTransactions(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"transactionRefs": [
"a",
"b",
"c",
]
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Returns a list of transaction refs of transactions queued on a terminal. Details about the transactions can be retrieved using the Transaction Status API.
Delete Queued Transaction
Delete Queued Transaction Example:
Linux/Mac OS: ./blockchyp -test -cmd="delete-queue" -terminal="Test Terminal" -txRef="*"
Windows: ./blockchyp.exe -test -cmd="delete-queue" -terminal="Test Terminal" -txRef="*"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteQueuedTransactionExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.DeleteQueuedTransactionRequest{
TerminalName: "Test Terminal",
TransactionRef: "*",
}
response, err := client.DeleteQueuedTransaction(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
DeleteQueuedTransactionRequest request = new DeleteQueuedTransactionRequest
{
TerminalName = "Test Terminal",
TransactionRef = "*",
};
// Run the transaction.
DeleteQueuedTransactionResponse response = await blockchyp.DeleteQueuedTransactionAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.DeleteQueuedTransactionRequest;
import com.blockchyp.client.dto.DeleteQueuedTransactionResponse;
public class DeleteQueuedTransactionExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
DeleteQueuedTransactionRequest request = new DeleteQueuedTransactionRequest();
request.setTerminalName("Test Terminal");
request.setTransactionRef("*");
// Send the request
DeleteQueuedTransactionResponse response = client.deleteQueuedTransaction(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
'transactionRef' => '*',
];
$response = BlockChyp::deleteQueuedTransaction($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal',
transactionRef: '*'
}
response = blockchyp.deleteQueuedTransaction(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
"transactionRef": "*",
}
# run the transaction.
response = client.delete_queued_transaction(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteQueuedTransaction({
terminalName: 'Test Terminal',
transactionRef: '*',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
request["transactionRef"] = "*"
[client deleteQueuedTransactionWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
request["transactionRef"] = "*"
client.deleteQueuedTransaction(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Deletes one or all queued transactions from a terminal. If *
is passed as
a transaction ref, then the entire terminal queue will be cleared. An error is
returned if the passed transaction ref is not queued on the terminal.
Terminal API
These APIs support terminal management functions and additional terminal
features such as line item display, messages, and interactive prompts.
These features can be used to extend a point of sale system's functionality.
Terminal Ping
Terminal Ping Example:
Linux/Mac OS: ./blockchyp -test -cmd="ping" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="ping" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func pingExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PingRequest{
TerminalName: "Test Terminal",
}
response, err := client.Ping(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PingRequest request = new PingRequest
{
TerminalName = "Test Terminal",
};
// Run the transaction.
PingResponse response = await blockchyp.PingAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PingRequest;
import com.blockchyp.client.dto.PingResponse;
public class PingExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PingRequest request = new PingRequest();
request.setTerminalName("Test Terminal");
// Send the request
PingResponse response = client.ping(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::ping($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal'
}
response = blockchyp.ping(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.ping(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.ping({
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
[client pingWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
client.ping(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"transactionId": "",
"transactionType": "ping",
"timestamp": "",
"tickBlock": "",
"test": true
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This simple test transaction helps ensure good communication with a payment terminal and is usually the first test you'll run in development.
It tests communication with the terminal and returns a positive response if everything is okay. It works the same way in local or cloud relay mode.
If you get a positive response, you've successfully verified all of the following:
- The terminal is online.
- There is a valid route to the terminal.
- The API Credentials are valid.
Terminal Locate
Terminal Locate Example:
Linux/Mac OS: ./blockchyp -test -cmd="locate" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="locate" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func locateExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.LocateRequest{
TerminalName: "Test Terminal",
}
response, err := client.Locate(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
LocateRequest request = new LocateRequest
{
TerminalName = "Test Terminal",
};
// Run the transaction.
LocateResponse response = await blockchyp.LocateAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.LocateRequest;
import com.blockchyp.client.dto.LocateResponse;
public class LocateExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
LocateRequest request = new LocateRequest();
request.setTerminalName("Test Terminal");
// Send the request
LocateResponse response = client.locate(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::locate($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal'
}
response = blockchyp.locate(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.locate(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.locate({
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
[client locateWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
client.locate(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success":true,
"errorMessage":"",
"terminalName": "Test Terminal",
"cloudRelay": false,
"ipAddress": "127.0.0.1",
"publicKey": "11pJMoWkjq1dHZcQp1P6apTk7J3QsoD9rtYW877c3BfJhDr8ozf"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint returns a terminal's routing and location information.
The result will indicate whether or not the terminal is in cloud relay mode and will return the local IP address if the terminal is in local mode.
The terminal will also return the public key for the terminal.
Terminal Clear
Terminal Clear Example:
Linux/Mac OS: ./blockchyp -test -cmd="clear" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="clear" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func clearExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.ClearTerminalRequest{
Test: true,
TerminalName: "Test Terminal",
}
response, err := client.Clear(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
ClearTerminalRequest request = new ClearTerminalRequest
{
Test = true,
TerminalName = "Test Terminal",
};
// Run the transaction.
Acknowledgement response = await blockchyp.ClearAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.ClearTerminalRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class ClearExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
ClearTerminalRequest request = new ClearTerminalRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
// Send the request
Acknowledgement response = client.clear(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::clear($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal'
}
response = blockchyp.clear(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.clear(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.clear({
test: true,
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
[client clearWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
client.clear(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API interrupts whatever a terminal may be doing and returns it to the idle state.
Terminal Status
Terminal Status Example:
Linux/Mac OS: ./blockchyp -test -cmd="terminal-status" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="terminal-status" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func terminalStatusExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TerminalStatusRequest{
TerminalName: "Test Terminal",
}
response, err := client.TerminalStatus(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TerminalStatusRequest request = new TerminalStatusRequest
{
TerminalName = "Test Terminal",
};
// Run the transaction.
TerminalStatusResponse response = await blockchyp.TerminalStatusAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TerminalStatusRequest;
import com.blockchyp.client.dto.TerminalStatusResponse;
public class TerminalStatusExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TerminalStatusRequest request = new TerminalStatusRequest();
request.setTerminalName("Test Terminal");
// Send the request
TerminalStatusResponse response = client.terminalStatus(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::terminalStatus($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal'
}
response = blockchyp.terminalStatus(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.terminal_status(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.terminalStatus({
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
[client terminalStatusWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"idle", [response objectForKey:@"idle"])
NSLog(@"%@: %@", @"status", [response objectForKey:@"status"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
client.terminalStatus(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("idle" + ": " + (response["idle"] as? String).unsafelyUnwrapped)
NSLog("status" + ": " + (response["status"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"idle": false,
"cardInSlot": true,
"status": "charge",
"transactionRef": "MYTXREF",
"since": "2020-05-01T22:26:08.54243745Z"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API returns the current status of a payment terminal. This is typically used as a way to determine if the terminal is busy before sending a new transaction.
If the terminal is busy, idle
will be false and the status
field will return
a short string that indicates the transaction type currently in progress. The system
will also return the timestamp of the last status change in the since
field.
The cardInSlot
field in the response will indicates whether or not a card is currently in the card reader slot.
If the system is running a payment transaction and you wisely passed in a Transaction Ref, this API will also return the Transaction Ref of the in progress transaction.
The table below lists all possible status responses.
Status Code | Description |
---|---|
idle | The terminal is idle and ready for transactions. The default branding is being displayed. |
activate | The terminal is in the process of activating and pairing with the merchant account. |
balance | A balance check (EBT or Gift Card) is pending on the terminal. |
boolean-prompt | A boolean prompt (yes/no) operation is pending on the terminal. |
signature | A signature capture is pending. |
crypto | A cryptocurrency transaction is pending. |
enroll | A token vault enrollment operation is pending. |
gift-activate | A gift card activation operation is in progress. |
message | The terminal is displaying a custom message. |
charge | The terminal is executing a charge transaction. |
preauth | The terminal is executing a preauth transaction. |
refund | The terminal is executing a refund transaction. |
survey | The terminal is displaying post transaction survey questions. |
terms-and-conditions | The terminal is pending terms and conditions acceptance and signature. |
text-prompt | The terminal is awaiting response to a text input prompt. |
txdisplay | The terminal is displaying transaction and/or line item level details. |
Capture Signature
Capture Signature Example:
Linux/Mac OS: ./blockchyp -test -cmd="capture-signature" -terminal="Test Terminal" -sigFormat="png" -sigWidth="400" -sigFile="sig.png"
Windows: ./blockchyp.exe -test -cmd="capture-signature" -terminal="Test Terminal" -sigFormat="png" -sigWidth="400" -sigFile="sig.png"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func captureSignatureExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CaptureSignatureRequest{
TerminalName: "Test Terminal",
// file format for the signature image.
SigFormat: blockchyp.SignatureFormatPNG,
// width of the signature image in pixels.
SigWidth: 200,
}
response, err := client.CaptureSignature(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CaptureSignatureRequest request = new CaptureSignatureRequest
{
TerminalName = "Test Terminal",
SigFormat = SignatureFormat.PNG,
SigWidth = 200,
};
// Run the transaction.
CaptureSignatureResponse response = await blockchyp.CaptureSignatureAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CaptureSignatureRequest;
import com.blockchyp.client.dto.CaptureSignatureResponse;
import com.blockchyp.client.dto.SignatureFormat;
public class CaptureSignatureExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CaptureSignatureRequest request = new CaptureSignatureRequest();
request.setTerminalName("Test Terminal");
request.setSigFormat(SignatureFormat.PNG);
request.setSigWidth(200);
// Send the request
CaptureSignatureResponse response = client.captureSignature(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
// File format for the signature image.
'sigFormat' => BlockChyp::SIGNATURE_FORMAT_PNG,
// Width of the signature image in pixels.
'sigWidth' => 200,
];
$response = BlockChyp::captureSignature($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal',
# File format for the signature image.
sigFormat: SignatureFormat::PNG,
# Width of the signature image in pixels.
sigWidth: 200
}
response = blockchyp.captureSignature(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
# File format for the signature image.
"sigFormat": blockchyp.SignatureFormat.PNG,
# Width of the signature image in pixels.
"sigWidth": 200,
}
# run the transaction.
response = client.capture_signature(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.captureSignature({
terminalName: 'Test Terminal',
// File format for the signature image.
sigFormat: BlockChyp.SignatureFormat.PNG,
// Width of the signature image in pixels.
sigWidth: 200,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
request["sigFormat"] = SIGNATURE_FORMAT_PNG
request["sigWidth"] = 200
[client captureSignatureWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
request["sigFormat"] = SIGNATURE_FORMAT_PNG
request["sigWidth"] = 200
client.captureSignature(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint captures a written signature from the terminal and returns the image.
Unlike the Terms & Conditions API, this endpoint performs basic signature capture with no agreement display or signature archival.
Under the hood, signatures are captured in a proprietary vector format and
must be converted to a common raster format in order to be useful to most
applications. At a minimum, you must specify an image format using the
sigFormat
parameter. Currently, JPG and PNG are supported.
By default, images are returned in the JSON response as hex encoded binary.
You can redirect the binary image output to a file using the sigFile
parameter.
You can also scale the output image to your preferred width by
passing in a sigWidth
parameter. The image will be scaled to that
width, preserving the aspect ratio of the original image.
New Transaction Display
New Transaction Display Example:
Linux/Mac OS: ./blockchyp -test -cmd="display" -terminal="Test Terminal" -displaySubtotal="120.05" -displayTax="5.00" -displayTotal="125.05" -lineItemDescription="Leki Trekking Poles" -lineItemQty="1" -lineItemPrice="135.05" -lineItemDiscountDescription="Member Discount" -lineItemDiscountAmount="10.00" -lineItemExtended="120.05"
Windows: ./blockchyp.exe -test -cmd="display" -terminal="Test Terminal" -displaySubtotal="120.05" -displayTax="5.00" -displayTotal="125.05" -lineItemDescription="Leki Trekking Poles" -lineItemQty="1" -lineItemPrice="135.05" -lineItemDiscountDescription="Member Discount" -lineItemDiscountAmount="10.00" -lineItemExtended="120.05"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func newTransactionDisplayExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TransactionDisplayRequest{
Test: true,
TerminalName: "Test Terminal",
Transaction: &blockchyp.TransactionDisplayTransaction{
Subtotal: "60.00",
Tax: "5.00",
Total: "65.00",
Items: []*blockchyp.TransactionDisplayItem{
&blockchyp.TransactionDisplayItem{
Description: "Leki Trekking Poles",
Price: "35.00",
Quantity: 2,
Extended: "70.00",
Discounts: []*blockchyp.TransactionDisplayDiscount{
&blockchyp.TransactionDisplayDiscount{
Description: "memberDiscount",
Amount: "10.00",
},
},
},
},
},
}
response, err := client.NewTransactionDisplay(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TransactionDisplayRequest request = new TransactionDisplayRequest
{
Test = true,
TerminalName = "Test Terminal",
Transaction = new TransactionDisplayTransaction
{
Subtotal = "60.00",
Tax = "5.00",
Total = "65.00",
Items = new List<TransactionDisplayItem>
{
new TransactionDisplayItem
{
Description = "Leki Trekking Poles",
Price = "35.00",
Quantity = 2,
Extended = "70.00",
Discounts = new List<TransactionDisplayDiscount>
{
new TransactionDisplayDiscount
{
Description = "memberDiscount",
Amount = "10.00",
}
},
}
},
},
};
// Run the transaction.
Acknowledgement response = await blockchyp.NewTransactionDisplayAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TransactionDisplayRequest;
import com.blockchyp.client.dto.Acknowledgement;
import com.blockchyp.client.dto.TransactionDisplayTransaction;
import com.blockchyp.client.dto.TransactionDisplayItem;
import com.blockchyp.client.dto.TransactionDisplayDiscount;
public class NewTransactionDisplayExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TransactionDisplayRequest request = new TransactionDisplayRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
TransactionDisplayTransaction transaction = new TransactionDisplayTransaction();
transaction.setSubtotal("60.00");
transaction.setTax("5.00");
transaction.setTotal("65.00");
Collection items = new ArrayList();
TransactionDisplayItem items0 = new TransactionDisplayItem();
items0.setDescription("Leki Trekking Poles");
items0.setPrice("35.00");
items0.setQuantity(2);
items0.setExtended("70.00");
Collection discounts = new ArrayList();
TransactionDisplayDiscount discounts0 = new TransactionDisplayDiscount();
discounts0.setDescription("memberDiscount");
discounts0.setAmount("10.00");
discounts.add(discounts0);
items0.setDiscounts(discounts);
items.add(items0);
transaction.setItems(items);
request.setTransaction(transaction);
// Send the request
Acknowledgement response = client.newTransactionDisplay(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'transaction' => [
'subtotal' => '60.00',
'tax' => '5.00',
'total' => '65.00',
'items' => [
[
'description' => 'Leki Trekking Poles',
'price' => '35.00',
'quantity' => 2,
'extended' => '70.00',
'discounts' => [
[
'description' => 'memberDiscount',
'amount' => '10.00',
],
],
],
],
],
];
$response = BlockChyp::newTransactionDisplay($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
transaction: {
subtotal: '60.00',
tax: '5.00',
total: '65.00',
items: [
{
description: 'Leki Trekking Poles',
price: '35.00',
quantity: 2,
extended: '70.00',
discounts: [
{
description: 'memberDiscount',
amount: '10.00'
}
]
}
]
}
}
response = blockchyp.newTransactionDisplay(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"transaction": {
"subtotal": "60.00",
"tax": "5.00",
"total": "65.00",
"items": [
{
"description": "Leki Trekking Poles",
"price": "35.00",
"quantity": 2,
"extended": "70.00",
"discounts": [
{
"description": "memberDiscount",
"amount": "10.00",
},
],
},
],
},
}
# run the transaction.
response = client.new_transaction_display(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.newTransactionDisplay({
test: true,
terminalName: 'Test Terminal',
transaction: {
subtotal: '60.00',
tax: '5.00',
total: '65.00',
items: [
{
description: 'Leki Trekking Poles',
price: '35.00',
quantity: 2,
extended: '70.00',
discounts: [
{
description: 'memberDiscount',
amount: '10.00',
},
],
},
],
},
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "60.00"
transaction["tax"] = "5.00"
transaction["total"] = "65.00"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Leki Trekking Poles"
items1["price"] = "35.00"
items1["quantity"] = 2
items1["extended"] = "70.00"
var discounts = [Any]();
var discounts1: [String:Any] = [:]
discounts1["description"] = "memberDiscount"
discounts1["amount"] = "10.00"
discounts.append(discounts1)
items1["discounts"] = discounts
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
[client newTransactionDisplayWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "60.00"
transaction["tax"] = "5.00"
transaction["total"] = "65.00"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Leki Trekking Poles"
items1["price"] = "35.00"
items1["quantity"] = 2
items1["extended"] = "70.00"
var discounts = [Any]();
var discounts1: [String:Any] = [:]
discounts1["description"] = "memberDiscount"
discounts1["amount"] = "10.00"
discounts.append(discounts1)
items1["discounts"] = discounts
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
client.newTransactionDisplay(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API sends totals and line item level data to the terminal.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication
and rounding may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Update Transaction Display
Update Transaction Display Example:
Linux/Mac OS: ./blockchyp -test -cmd="display" -terminal="Test Terminal" -displaySubtotal="120.05" -displayTax="5.00" -displayTotal="125.05" -lineItemDescription="Leki Trekking Poles" -lineItemQty="1" -lineItemPrice="135.05" -lineItemDiscountDescription="Member Discount" -lineItemDiscountAmount="10.00" -lineItemExtended="120.05"
Windows: ./blockchyp.exe -test -cmd="display" -terminal="Test Terminal" -displaySubtotal="120.05" -displayTax="5.00" -displayTotal="125.05" -lineItemDescription="Leki Trekking Poles" -lineItemQty="1" -lineItemPrice="135.05" -lineItemDiscountDescription="Member Discount" -lineItemDiscountAmount="10.00" -lineItemExtended="120.05"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateTransactionDisplayExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TransactionDisplayRequest{
Test: true,
TerminalName: "Test Terminal",
Transaction: &blockchyp.TransactionDisplayTransaction{
Subtotal: "60.00",
Tax: "5.00",
Total: "65.00",
Items: []*blockchyp.TransactionDisplayItem{
&blockchyp.TransactionDisplayItem{
Description: "Leki Trekking Poles",
Price: "35.00",
Quantity: 2,
Extended: "70.00",
Discounts: []*blockchyp.TransactionDisplayDiscount{
&blockchyp.TransactionDisplayDiscount{
Description: "memberDiscount",
Amount: "10.00",
},
},
},
},
},
}
response, err := client.UpdateTransactionDisplay(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TransactionDisplayRequest request = new TransactionDisplayRequest
{
Test = true,
TerminalName = "Test Terminal",
Transaction = new TransactionDisplayTransaction
{
Subtotal = "60.00",
Tax = "5.00",
Total = "65.00",
Items = new List<TransactionDisplayItem>
{
new TransactionDisplayItem
{
Description = "Leki Trekking Poles",
Price = "35.00",
Quantity = 2,
Extended = "70.00",
Discounts = new List<TransactionDisplayDiscount>
{
new TransactionDisplayDiscount
{
Description = "memberDiscount",
Amount = "10.00",
}
},
}
},
},
};
// Run the transaction.
Acknowledgement response = await blockchyp.UpdateTransactionDisplayAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TransactionDisplayRequest;
import com.blockchyp.client.dto.Acknowledgement;
import com.blockchyp.client.dto.TransactionDisplayTransaction;
import com.blockchyp.client.dto.TransactionDisplayItem;
import com.blockchyp.client.dto.TransactionDisplayDiscount;
public class UpdateTransactionDisplayExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TransactionDisplayRequest request = new TransactionDisplayRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
TransactionDisplayTransaction transaction = new TransactionDisplayTransaction();
transaction.setSubtotal("60.00");
transaction.setTax("5.00");
transaction.setTotal("65.00");
Collection items = new ArrayList();
TransactionDisplayItem items0 = new TransactionDisplayItem();
items0.setDescription("Leki Trekking Poles");
items0.setPrice("35.00");
items0.setQuantity(2);
items0.setExtended("70.00");
Collection discounts = new ArrayList();
TransactionDisplayDiscount discounts0 = new TransactionDisplayDiscount();
discounts0.setDescription("memberDiscount");
discounts0.setAmount("10.00");
discounts.add(discounts0);
items0.setDiscounts(discounts);
items.add(items0);
transaction.setItems(items);
request.setTransaction(transaction);
// Send the request
Acknowledgement response = client.updateTransactionDisplay(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'transaction' => [
'subtotal' => '60.00',
'tax' => '5.00',
'total' => '65.00',
'items' => [
[
'description' => 'Leki Trekking Poles',
'price' => '35.00',
'quantity' => 2,
'extended' => '70.00',
'discounts' => [
[
'description' => 'memberDiscount',
'amount' => '10.00',
],
],
],
],
],
];
$response = BlockChyp::updateTransactionDisplay($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
transaction: {
subtotal: '60.00',
tax: '5.00',
total: '65.00',
items: [
{
description: 'Leki Trekking Poles',
price: '35.00',
quantity: 2,
extended: '70.00',
discounts: [
{
description: 'memberDiscount',
amount: '10.00'
}
]
}
]
}
}
response = blockchyp.updateTransactionDisplay(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"transaction": {
"subtotal": "60.00",
"tax": "5.00",
"total": "65.00",
"items": [
{
"description": "Leki Trekking Poles",
"price": "35.00",
"quantity": 2,
"extended": "70.00",
"discounts": [
{
"description": "memberDiscount",
"amount": "10.00",
},
],
},
],
},
}
# run the transaction.
response = client.update_transaction_display(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateTransactionDisplay({
test: true,
terminalName: 'Test Terminal',
transaction: {
subtotal: '60.00',
tax: '5.00',
total: '65.00',
items: [
{
description: 'Leki Trekking Poles',
price: '35.00',
quantity: 2,
extended: '70.00',
discounts: [
{
description: 'memberDiscount',
amount: '10.00',
},
],
},
],
},
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "60.00"
transaction["tax"] = "5.00"
transaction["total"] = "65.00"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Leki Trekking Poles"
items1["price"] = "35.00"
items1["quantity"] = 2
items1["extended"] = "70.00"
var discounts = [Any]();
var discounts1: [String:Any] = [:]
discounts1["description"] = "memberDiscount"
discounts1["amount"] = "10.00"
discounts.append(discounts1)
items1["discounts"] = discounts
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
[client updateTransactionDisplayWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
var transaction: [String:Any] = [:]
transaction["subtotal"] = "60.00"
transaction["tax"] = "5.00"
transaction["total"] = "65.00"
var items = [Any]();
var items1: [String:Any] = [:]
items1["description"] = "Leki Trekking Poles"
items1["price"] = "35.00"
items1["quantity"] = 2
items1["extended"] = "70.00"
var discounts = [Any]();
var discounts1: [String:Any] = [:]
discounts1["description"] = "memberDiscount"
discounts1["amount"] = "10.00"
discounts.append(discounts1)
items1["discounts"] = discounts
items.append(items1)
transaction["items"] = items
request["transaction"] = transaction
client.updateTransactionDisplay(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
Similar to New Transaction Display, this variant allows developers to update line item level data currently being displayed on the terminal.
This feature is designed for situations where you want to update the terminal display as items are scanned. You'll only have to send information to the terminal that's changed, which usually means the new line item and updated totals.
If the terminal is not in line item display mode and you invoke this endpoint, the first invocation will behave like a New Transaction Display call.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication and rounding
may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Display Message
Display Message Example:
Linux/Mac OS: ./blockchyp -test -cmd="message" -terminal="Test Terminal" -message="Thank you for your business."
Windows: ./blockchyp.exe -test -cmd="message" -terminal="Test Terminal" -message="Thank you for your business."
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func messageExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MessageRequest{
Test: true,
TerminalName: "Test Terminal",
Message: "Thank you for your business.",
}
response, err := client.Message(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MessageRequest request = new MessageRequest
{
Test = true,
TerminalName = "Test Terminal",
Message = "Thank you for your business.",
};
// Run the transaction.
Acknowledgement response = await blockchyp.MessageAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MessageRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class MessageExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MessageRequest request = new MessageRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setMessage("Thank you for your business.");
// Send the request
Acknowledgement response = client.message(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'message' => 'Thank you for your business.',
];
$response = BlockChyp::message($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
message: 'Thank you for your business.'
}
response = blockchyp.message(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"message": "Thank you for your business.",
}
# run the transaction.
response = client.message(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.message({
test: true,
terminalName: 'Test Terminal',
message: 'Thank you for your business.',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["message"] = "Thank you for your business."
[client messageWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["message"] = "Thank you for your business."
client.message(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API displays a message on the payment terminal.
Just specify the target terminal and the message using the message
parameter.
Boolean Prompt
Boolean Prompt Example:
Linux/Mac OS: ./blockchyp -test -cmd="boolean-prompt" -terminal="Test Terminal" -prompt="Would you like to become a member?"
Windows: ./blockchyp.exe -test -cmd="boolean-prompt" -terminal="Test Terminal" -prompt="Would you like to become a member?"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func booleanPromptExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BooleanPromptRequest{
Test: true,
TerminalName: "Test Terminal",
Prompt: "Would you like to become a member?",
YesCaption: "Yes",
NoCaption: "No",
}
response, err := client.BooleanPrompt(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BooleanPromptRequest request = new BooleanPromptRequest
{
Test = true,
TerminalName = "Test Terminal",
Prompt = "Would you like to become a member?",
YesCaption = "Yes",
NoCaption = "No",
};
// Run the transaction.
BooleanPromptResponse response = await blockchyp.BooleanPromptAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BooleanPromptRequest;
import com.blockchyp.client.dto.BooleanPromptResponse;
public class BooleanPromptExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BooleanPromptRequest request = new BooleanPromptRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setPrompt("Would you like to become a member?");
request.setYesCaption("Yes");
request.setNoCaption("No");
// Send the request
BooleanPromptResponse response = client.booleanPrompt(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'prompt' => 'Would you like to become a member?',
'yesCaption' => 'Yes',
'noCaption' => 'No',
];
$response = BlockChyp::booleanPrompt($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
prompt: 'Would you like to become a member?',
yesCaption: 'Yes',
noCaption: 'No'
}
response = blockchyp.booleanPrompt(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"prompt": "Would you like to become a member?",
"yesCaption": "Yes",
"noCaption": "No",
}
# run the transaction.
response = client.boolean_prompt(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.booleanPrompt({
test: true,
terminalName: 'Test Terminal',
prompt: 'Would you like to become a member?',
yesCaption: 'Yes',
noCaption: 'No',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["prompt"] = "Would you like to become a member?"
request["yesCaption"] = "Yes"
request["noCaption"] = "No"
[client booleanPromptWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"response", [response objectForKey:@"response"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["prompt"] = "Would you like to become a member?"
request["yesCaption"] = "Yes"
request["noCaption"] = "No"
client.booleanPrompt(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("response" + ": " + (response["response"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"response": true
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to answer a yes or no question.
You can specify the question or prompt with the prompt
parameter and
the response is returned in the response
field.
This can be used for a number of use cases including starting a loyalty enrollment workflow or customer facing suggestive selling prompts.
Custom Captions
You can optionally override the "YES" and "NO" button captions by
using the yesCaption
and noCaption
request parameters.
Text Prompt
Text Prompt Example:
Linux/Mac OS: ./blockchyp -test -cmd="text-prompt" -terminal="Test Terminal" -promptType="phone"
Windows: ./blockchyp.exe -test -cmd="text-prompt" -terminal="Test Terminal" -promptType="phone"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func textPromptExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TextPromptRequest{
Test: true,
TerminalName: "Test Terminal",
// Type of prompt. Can be 'email', 'phone', 'customer-number', or 'rewards-number'.
PromptType: blockchyp.PromptTypeEmail,
}
response, err := client.TextPrompt(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TextPromptRequest request = new TextPromptRequest
{
Test = true,
TerminalName = "Test Terminal",
PromptType = PromptType.Email,
};
// Run the transaction.
TextPromptResponse response = await blockchyp.TextPromptAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TextPromptRequest;
import com.blockchyp.client.dto.TextPromptResponse;
import com.blockchyp.client.dto.PromptType;
public class TextPromptExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TextPromptRequest request = new TextPromptRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setPromptType(PromptType.EMAIL);
// Send the request
TextPromptResponse response = client.textPrompt(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
// Type of prompt. Can be 'email', 'phone', 'customer-number', or
// 'rewards-number'.
'promptType' => BlockChyp::PROMPT_TYPE_EMAIL,
];
$response = BlockChyp::textPrompt($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
# Type of prompt. Can be 'email', 'phone', 'customer-number', or
# 'rewards-number'.
promptType: PromptType::EMAIL
}
response = blockchyp.textPrompt(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
# Type of prompt. Can be 'email', 'phone', 'customer-number', or
# 'rewards-number'.
"promptType": blockchyp.PromptType.EMAIL,
}
# run the transaction.
response = client.text_prompt(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.textPrompt({
test: true,
terminalName: 'Test Terminal',
// Type of prompt. Can be 'email', 'phone', 'customer-number', or
// 'rewards-number'.
promptType: BlockChyp.PromptType.EMAIL,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["promptType"] = PROMPT_TYPE_EMAIL
[client textPromptWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"response", [response objectForKey:@"response"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["promptType"] = PROMPT_TYPE_EMAIL
client.textPrompt(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("response" + ": " + (response["response"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"response": "9136488888"
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to enter numeric or alphanumeric data.
Due to PCI rules, free-form prompts are not permitted when the response could be any valid string. The reason for this is that a malicious developer (not you, of course) could use text prompts to ask the customer to input a card number or PIN code.
This means that instead of providing a prompt, you provide a promptType
instead.
The prompt types currently supported are listed below:
- phone: Captures a phone number.
- email: Captures an email address.
- first-name: Captures a first name.
- last-name: Captures a last name.
- customer-number: Captures a customer number.
- rewards-number: Captures a rewards number.
You can specify the prompt with the promptType
parameter and
the response is returned in the response
field.
List Terminals
List Terminals Example:
Linux/Mac OS: ./blockchyp -cmd="list-terminals"
Windows: ./blockchyp.exe -cmd="list-terminals"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func terminalsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TerminalProfileRequest{}
response, err := client.Terminals(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TerminalProfileRequest request = new TerminalProfileRequest
{
};
// Run the transaction.
TerminalProfileResponse response = await blockchyp.TerminalsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TerminalProfileRequest;
import com.blockchyp.client.dto.TerminalProfileResponse;
public class TerminalsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TerminalProfileRequest request = new TerminalProfileRequest();
// Send the request
TerminalProfileResponse response = client.terminals(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::terminals($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.terminals(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.terminals(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.terminals({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client terminalsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.terminals(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"results": [
{
"id": "HKLVQNWVNAI6ZDIYVTPEQAAREI",
"ipAddress": "192.168.55.115",
"terminalName": "Test Terminal",
"terminalType": "LUXE8000",
"terminalTypeDisplayString": "Equinox Luxe 8500i",
"blockChypFirmwareVersion": "1.18.1-466.20211119173638git7eef201",
"cloudBased": false,
"publicKey": "11tchWXtVzRVa836UBgmRhLmVJETN4zc8A7TsuobPco88zm1gSf",
"serialNumber": "A1724003000070",
"online": true,
"since": "41m25s",
"totalMemory": 225576,
"totalStorage": 194830336,
"availableMemory": 118440,
"availableStorage": 104386560,
"usedMemory": 107136,
"usedStorage": 90443776,
"brandingPreview": "",
"groupId": "",
"groupName": ""
}
]
}
- API Credential Types: Merchant & Partner
- Required Role: Terminal Management
This API returns details about terminals associated with a merchant account.
Status and resource information is returned for all terminals along with a preview of the current branding image displayed on the terminal
Deactivate Terminal
Deactivate Terminal Example:
Linux/Mac OS: ./blockchyp -cmd="deactivate-terminal" -terminalId="<TERMINAL ID>"
Windows: ./blockchyp.exe -cmd="deactivate-terminal" -terminalId="<TERMINAL ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deactivateTerminalExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TerminalDeactivationRequest{
TerminalID: "<TERMINAL ID>",
}
response, err := client.DeactivateTerminal(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TerminalDeactivationRequest request = new TerminalDeactivationRequest
{
TerminalId = "<TERMINAL ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeactivateTerminalAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TerminalDeactivationRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeactivateTerminalExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TerminalDeactivationRequest request = new TerminalDeactivationRequest();
request.setTerminalId("<TERMINAL ID>");
// Send the request
Acknowledgement response = client.deactivateTerminal(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalId' => '<TERMINAL ID>',
];
$response = BlockChyp::deactivateTerminal($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalId: '<TERMINAL ID>'
}
response = blockchyp.deactivateTerminal(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalId": "<TERMINAL ID>",
}
# run the transaction.
response = client.deactivate_terminal(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deactivateTerminal({
terminalId: '<TERMINAL ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalId"] = "<TERMINAL ID>"
[client deactivateTerminalWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalId"] = "<TERMINAL ID>"
client.deactivateTerminal(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant & Partner
- Required Role: Terminal Management
This API deactivates a payment terminal.
If the terminal exists and is currently online, it will be removed from the merchant's terminal inventory. The terminal will be remotely cleared and factory reset.
Activate Terminal
Activate Terminal Example:
Linux/Mac OS: ./blockchyp -cmd="activate-terminal" -terminalName="Test Terminal" -code="<ACTIVATION CODE>"
Windows: ./blockchyp.exe -cmd="activate-terminal" -terminalName="Test Terminal" -code="<ACTIVATION CODE>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func activateTerminalExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TerminalActivationRequest{
TerminalName: "Test Terminal",
ActivationCode: "<ACTIVATION CODE>",
}
response, err := client.ActivateTerminal(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TerminalActivationRequest request = new TerminalActivationRequest
{
TerminalName = "Test Terminal",
ActivationCode = "<ACTIVATION CODE>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.ActivateTerminalAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TerminalActivationRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class ActivateTerminalExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TerminalActivationRequest request = new TerminalActivationRequest();
request.setTerminalName("Test Terminal");
request.setActivationCode("<ACTIVATION CODE>");
// Send the request
Acknowledgement response = client.activateTerminal(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
'activationCode' => '<ACTIVATION CODE>',
];
$response = BlockChyp::activateTerminal($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal',
activationCode: '<ACTIVATION CODE>'
}
response = blockchyp.activateTerminal(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
"activationCode": "<ACTIVATION CODE>",
}
# run the transaction.
response = client.activate_terminal(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.activateTerminal({
terminalName: 'Test Terminal',
activationCode: '<ACTIVATION CODE>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
request["activationCode"] = "<ACTIVATION CODE>"
[client activateTerminalWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
request["activationCode"] = "<ACTIVATION CODE>"
client.activateTerminal(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant & Partner
- Required Role: Terminal Management
This API activates a payment terminal.
If successful, the payment terminal will restart, generate new encryption keys, and download any active branding assets for the merchant account it's been added to.
Activation requests require an activation code and a unique terminal name. All terminal names must be unique across a merchant account.
Optional Parameters
- merchantId: For partner scoped API credentials, a merchant ID is required. For merchant scoped API credentials, the merchant ID is implicit and cannot be overridden.
- cloudRelay: Activates the terminal in cloud relay mode.
Reboot Terminal
Reboot Terminal Example:
Linux/Mac OS: ./blockchyp -test -cmd="reboot" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="reboot" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func rebootExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PingRequest{
TerminalName: "Test Terminal",
}
response, err := client.Reboot(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PingRequest request = new PingRequest
{
TerminalName = "Test Terminal",
};
// Run the transaction.
Acknowledgement response = await blockchyp.RebootAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PingRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class RebootExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PingRequest request = new PingRequest();
request.setTerminalName("Test Terminal");
// Send the request
Acknowledgement response = client.reboot(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::reboot($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
terminalName: 'Test Terminal'
}
response = blockchyp.reboot(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.reboot(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.reboot({
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["terminalName"] = "Test Terminal"
[client rebootWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["terminalName"] = "Test Terminal"
client.reboot(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API reboots the terminal.
Terms & Conditions API
Developers can use BlockChyp to display and capture acceptance of contracts or agreements related to transactions. These agreements can be any long-form contract ranging from rental agreements to HIPPA disclosures.
There are two basic approaches to terms and conditions capture. Merchants can store contract templates in BlockChyp or they can send the full agreement text as part of every API call. The right approach will largely depend on whether or not the system being integrated with BlockChyp already has a mechanism for organizing and managing agreements. For systems that already have this feature built in, it's probably not necessary to use Terms and Conditions.
When agreements are displayed on a terminal, the consumer can scroll through and read the entire agreement, and provide a signature. Results are returned as part of the API response, but BlockChyp also stores a record of the agreement including the signature image, timestamp, and the full text of the agreement that was agreed to.
The Terms and Conditions Log APIs can be used to search and retrieve acceptance records. Those records can also be linked to a transaction if a transaction id is provided with the original API request.
Terms & Conditions Capture
Terms & Conditions Capture Example:
Linux/Mac OS: ./blockchyp -test -cmd="tc" -terminal="Test Terminal" -tcName="HIPPA Disclosure" -tcContent="Loreum Ipsum..."
Windows: ./blockchyp.exe -test -cmd="tc" -terminal="Test Terminal" -tcName="HIPPA Disclosure" -tcContent="Loreum Ipsum..."
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func termsAndConditionsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsRequest{
Test: true,
TerminalName: "Test Terminal",
// Alias for a Terms and Conditions template configured in the BlockChyp dashboard.
TCAlias: "hippa",
// Name of the contract or document if not using an alias.
TCName: "HIPPA Disclosure",
// Full text of the contract or disclosure if not using an alias.
TCContent: "Full contract text",
// file format for the signature image.
SigFormat: blockchyp.SignatureFormatPNG,
// width of the signature image in pixels.
SigWidth: 200,
// Whether or not a signature is required. Defaults to true.
SigRequired: true,
}
response, err := client.TermsAndConditions(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsRequest request = new TermsAndConditionsRequest
{
Test = true,
TerminalName = "Test Terminal",
TcAlias = "hippa",
TcName = "HIPPA Disclosure",
TcContent = "Full contract text",
SigFormat = SignatureFormat.PNG,
SigWidth = 200,
SigRequired = true,
};
// Run the transaction.
TermsAndConditionsResponse response = await blockchyp.TermsAndConditionsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsRequest;
import com.blockchyp.client.dto.TermsAndConditionsResponse;
import com.blockchyp.client.dto.SignatureFormat;
public class TermsAndConditionsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsRequest request = new TermsAndConditionsRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setTcAlias("hippa");
request.setTcName("HIPPA Disclosure");
request.setTcContent("Full contract text");
request.setSigFormat(SignatureFormat.PNG);
request.setSigWidth(200);
request.setSigRequired(true);
// Send the request
TermsAndConditionsResponse response = client.termsAndConditions(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
// Alias for a Terms and Conditions template configured in the BlockChyp
// dashboard.
'tcAlias' => 'hippa',
// Name of the contract or document if not using an alias.
'tcName' => 'HIPPA Disclosure',
// Full text of the contract or disclosure if not using an alias.
'tcContent' => 'Full contract text',
// File format for the signature image.
'sigFormat' => BlockChyp::SIGNATURE_FORMAT_PNG,
// Width of the signature image in pixels.
'sigWidth' => 200,
// Whether or not a signature is required. Defaults to true.
'sigRequired' => true,
];
$response = BlockChyp::termsAndConditions($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
# Alias for a Terms and Conditions template configured in the BlockChyp
# dashboard.
tcAlias: 'hippa',
# Name of the contract or document if not using an alias.
tcName: 'HIPPA Disclosure',
# Full text of the contract or disclosure if not using an alias.
tcContent: 'Full contract text',
# File format for the signature image.
sigFormat: SignatureFormat::PNG,
# Width of the signature image in pixels.
sigWidth: 200,
# Whether or not a signature is required. Defaults to true.
sigRequired: true
}
response = blockchyp.termsAndConditions(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
# Alias for a Terms and Conditions template configured in the BlockChyp
# dashboard.
"tcAlias": "hippa",
# Name of the contract or document if not using an alias.
"tcName": "HIPPA Disclosure",
# Full text of the contract or disclosure if not using an alias.
"tcContent": "Full contract text",
# File format for the signature image.
"sigFormat": blockchyp.SignatureFormat.PNG,
# Width of the signature image in pixels.
"sigWidth": 200,
# Whether or not a signature is required. Defaults to true.
"sigRequired": True,
}
# run the transaction.
response = client.terms_and_conditions(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.termsAndConditions({
test: true,
terminalName: 'Test Terminal',
// Alias for a Terms and Conditions template configured in the BlockChyp
// dashboard.
tcAlias: 'hippa',
// Name of the contract or document if not using an alias.
tcName: 'HIPPA Disclosure',
// Full text of the contract or disclosure if not using an alias.
tcContent: 'Full contract text',
// File format for the signature image.
sigFormat: BlockChyp.SignatureFormat.PNG,
// Width of the signature image in pixels.
sigWidth: 200,
// Whether or not a signature is required. Defaults to true.
sigRequired: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
request["tcAlias"] = "hippa"
request["tcName"] = "HIPPA Disclosure"
request["tcContent"] = "Full contract text"
request["sigFormat"] = SIGNATURE_FORMAT_PNG
request["sigWidth"] = 200
request["sigRequired"] = true
[client termsAndConditionsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"sig", [response objectForKey:@"sig"])
NSLog(@"%@: %@", @"sigFile", [response objectForKey:@"sigFile"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["tcAlias"] = "hippa"
request["tcName"] = "HIPPA Disclosure"
request["tcContent"] = "Full contract text"
request["sigFormat"] = SIGNATURE_FORMAT_PNG
request["sigWidth"] = 200
request["sigRequired"] = true
client.termsAndConditions(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("sig" + ": " + (response["sig"] as? String).unsafelyUnwrapped)
NSLog("sigFile" + ": " + (response["sigFile"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"test": true
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API allows you to prompt a customer to accept a legal agreement on the terminal and (usually) capture their signature.
Content for the agreement can be specified in two ways. You can reference a previously configured T&C template or pass in the full agreement text with every request.
Using Templates
If your application doesn't keep track of agreements you can leverage BlockChyp's
template system. You can create any number of T&C Templates in the merchant dashboard
and pass in the tcAlias
flag to specify which one should display.
Raw Content
If your system keeps track of the agreement language or executes complicated merging
and rendering logic, you can bypass our template system and pass in the full text with
every transaction. Use tcName
to pass in the agreement name and tcContent
to
pass in the contract text. Note that only plain text is supported.
Bypassing Signatures
Signature images are captured by default. If for some reason this doesn't fit your
use case and you'd like to capture acceptance without actually capturing a signature image, set
the disableSignature
flag in the request.
Terms & Conditions Log
Every time a user accepts an agreement on the terminal, the signature image (if captured), will be uploaded to the gateway. The image will also be added to the log along with the full text of the agreement. This preserves the historical record in the event that standard agreements or templates change over time.
Associating Agreements with Transactions
To associate a Terms & Conditions log entry with a transaction, just pass in the Transaction ID or Transaction Ref for the associated transaction.
List Templates
List Templates Example:
Linux/Mac OS: ./blockchyp -cmd="tc-templates"
Windows: ./blockchyp.exe -cmd="tc-templates"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcTemplatesExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsTemplateRequest{}
response, err := client.TCTemplates(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest
{
};
// Run the transaction.
TermsAndConditionsTemplateResponse response = await blockchyp.TcTemplatesAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsTemplateRequest;
import com.blockchyp.client.dto.TermsAndConditionsTemplateResponse;
public class TcTemplatesExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest();
// Send the request
TermsAndConditionsTemplateResponse response = client.tcTemplates(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::tcTemplates($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.tcTemplates(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.tc_templates(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcTemplates({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client tcTemplatesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.tcTemplates(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"results": [
{
"success": true,
"error": "",
"responseDescription": "",
"id": "TVZ5W6G23MI6ZCIUVTPEQAAREI",
"alias": "HIPPA",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet."
}
]
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API returns all terms and conditions templates associated with a merchant account.
Get Template
Get Template Example:
Linux/Mac OS: ./blockchyp -cmd="tc-templates" -templateId="<TEMPLATE ID>"
Windows: ./blockchyp.exe -cmd="tc-templates" -templateId="<TEMPLATE ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcTemplateExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsTemplateRequest{
TemplateID: "<TEMPLATE ID>",
}
response, err := client.TCTemplate(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest
{
TemplateId = "<TEMPLATE ID>",
};
// Run the transaction.
TermsAndConditionsTemplate response = await blockchyp.TcTemplateAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsTemplateRequest;
import com.blockchyp.client.dto.TermsAndConditionsTemplate;
public class TcTemplateExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest();
request.setTemplateId("<TEMPLATE ID>");
// Send the request
TermsAndConditionsTemplate response = client.tcTemplate(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'templateId' => '<TEMPLATE ID>',
];
$response = BlockChyp::tcTemplate($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
templateId: '<TEMPLATE ID>'
}
response = blockchyp.tcTemplate(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"templateId": "<TEMPLATE ID>",
}
# run the transaction.
response = client.tc_template(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcTemplate({
templateId: '<TEMPLATE ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["templateId"] = "<TEMPLATE ID>"
[client tcTemplateWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["templateId"] = "<TEMPLATE ID>"
client.tcTemplate(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "JPREGGW24II6ZLRZVTPEQAAREI",
"alias": "HIPPA",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet."
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API returns as single terms and conditions template.
Update Template
Update Template Example:
Linux/Mac OS: ./blockchyp -cmd="update-tc-template" -tcAlias="HIPPA" -tcName="HIPPA Disclosure" -tcContent="Lorem Ipsum"
Windows: ./blockchyp.exe -cmd="update-tc-template" -tcAlias="HIPPA" -tcName="HIPPA Disclosure" -tcContent="Lorem Ipsum"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcUpdateTemplateExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsTemplate{
Alias: "HIPPA",
Name: "HIPPA Disclosure",
Content: "Lorem ipsum dolor sit amet.",
}
response, err := client.TCUpdateTemplate(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsTemplate request = new TermsAndConditionsTemplate
{
Alias = "HIPPA",
Name = "HIPPA Disclosure",
Content = "Lorem ipsum dolor sit amet.",
};
// Run the transaction.
TermsAndConditionsTemplate response = await blockchyp.TcUpdateTemplateAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsTemplate;
import com.blockchyp.client.dto.TermsAndConditionsTemplate;
public class TcUpdateTemplateExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsTemplate request = new TermsAndConditionsTemplate();
request.setAlias("HIPPA");
request.setName("HIPPA Disclosure");
request.setContent("Lorem ipsum dolor sit amet.");
// Send the request
TermsAndConditionsTemplate response = client.tcUpdateTemplate(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'alias' => 'HIPPA',
'name' => 'HIPPA Disclosure',
'content' => 'Lorem ipsum dolor sit amet.',
];
$response = BlockChyp::tcUpdateTemplate($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
alias: 'HIPPA',
name: 'HIPPA Disclosure',
content: 'Lorem ipsum dolor sit amet.'
}
response = blockchyp.tcUpdateTemplate(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"alias": "HIPPA",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet.",
}
# run the transaction.
response = client.tc_update_template(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcUpdateTemplate({
alias: 'HIPPA',
name: 'HIPPA Disclosure',
content: 'Lorem ipsum dolor sit amet.',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["alias"] = "HIPPA"
request["name"] = "HIPPA Disclosure"
request["content"] = "Lorem ipsum dolor sit amet."
[client tcUpdateTemplateWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["alias"] = "HIPPA"
request["name"] = "HIPPA Disclosure"
request["content"] = "Lorem ipsum dolor sit amet."
client.tcUpdateTemplate(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "TVZ5W6G23MI6ZCIUVTPEQAAREI",
"alias": "HIPPA",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet."
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API updates or creates a terms and conditions template.
Terms and conditions templates are fairly simple and essentially consist of a name, content, and alias.
The name is the caption that will be displayed at the top of the screen. The alias is a code or short description that will be used in subsequence API calls to refer to the template.
Content is the full text of the contract or agreement. Currently, no special formatting or merge behavior is supported. Only plain text is supported.
Delete Template
Delete Template Example:
Linux/Mac OS: ./blockchyp -cmd="delete-tc-template" -templateId="<TEMPLATE ID>"
Windows: ./blockchyp.exe -cmd="delete-tc-template" -templateId="<TEMPLATE ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcDeleteTemplateExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsTemplateRequest{
TemplateID: "<TEMPLATE ID>",
}
response, err := client.TCDeleteTemplate(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest
{
TemplateId = "<TEMPLATE ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.TcDeleteTemplateAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsTemplateRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class TcDeleteTemplateExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsTemplateRequest request = new TermsAndConditionsTemplateRequest();
request.setTemplateId("<TEMPLATE ID>");
// Send the request
Acknowledgement response = client.tcDeleteTemplate(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'templateId' => '<TEMPLATE ID>',
];
$response = BlockChyp::tcDeleteTemplate($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
templateId: '<TEMPLATE ID>'
}
response = blockchyp.tcDeleteTemplate(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"templateId": "<TEMPLATE ID>",
}
# run the transaction.
response = client.tc_delete_template(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcDeleteTemplate({
templateId: '<TEMPLATE ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["templateId"] = "<TEMPLATE ID>"
[client tcDeleteTemplateWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["templateId"] = "<TEMPLATE ID>"
client.tcDeleteTemplate(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API deletes a terms and conditions template.
If a template is deleted, its alias can be reused and any previous Terms & Conditions log entry derived from the template being deleted is fully preserved since log entries always include a complete independent copy of the agreement text.
Terms & Conditions Log
Terms & Conditions Log Example:
Linux/Mac OS: ./blockchyp -cmd="tc-log" -logEntryId="<LOG ENTRY ID>"
Windows: ./blockchyp.exe -cmd="tc-log" -logEntryId="<LOG ENTRY ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcLogExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsLogRequest{
LogEntryID: "<LOG ENTRY ID>",
}
response, err := client.TCLog(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsLogRequest request = new TermsAndConditionsLogRequest
{
LogEntryId = "<LOG ENTRY ID>",
};
// Run the transaction.
TermsAndConditionsLogResponse response = await blockchyp.TcLogAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsLogRequest;
import com.blockchyp.client.dto.TermsAndConditionsLogResponse;
public class TcLogExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsLogRequest request = new TermsAndConditionsLogRequest();
request.setLogEntryId("<LOG ENTRY ID>");
// Send the request
TermsAndConditionsLogResponse response = client.tcLog(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'logEntryId' => '<LOG ENTRY ID>',
];
$response = BlockChyp::tcLog($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
logEntryId: '<LOG ENTRY ID>'
}
response = blockchyp.tcLog(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"logEntryId": "<LOG ENTRY ID>",
}
# run the transaction.
response = client.tc_log(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcLog({
logEntryId: '<LOG ENTRY ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["logEntryId"] = "<LOG ENTRY ID>"
[client tcLogWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["logEntryId"] = "<LOG ENTRY ID>"
client.tcLog(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"transactionId": "",
"maxResults": 250,
"startIndex": 0,
"resultCount": 1,
"results": [
{
"success": true,
"error": "",
"responseDescription": "",
"id": "DMFNCJG3NMI6ZEUAVTPEQAAREI",
"terminalId": "5WXL5MW23AI6ZJYWVTPEQAAREI",
"terminalName": "Test Terminal",
"test": true,
"timestamp": "05/24/2022 10:09:54 AM",
"transactionRef": "",
"transactionId": "",
"alias": "",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum ullamcorper id urna quis pulvinar. Pellentesque vestibulum justo ac nulla consectetur tristique. Suspendisse arcu arcu, viverra vel luctus non, dapibus vitae augue. Aenean ac volutpat purus. Curabitur in lacus nisi. Nam vel sagittis eros. Curabitur faucibus ut nisl in pulvinar. Nunc egestas, orci ut porttitor tempus, ante mauris pellentesque ex, nec feugiat purus arcu ac metus. Cras sodales ornare lobortis. Aenean lacinia ultricies purus quis pharetra. Cras vestibulum nulla et magna eleifend eleifend. Nunc nibh dolor, malesuada ut suscipit vitae, bibendum quis dolor. Phasellus ultricies ex vitae dolor malesuada, vel dignissim neque accumsan.",
"contentLeader": "Lorem ipsum dolor sit amet, cons...",
"hasSignature": true,
"signature": ""
}
]
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API allows developers to search and sort through terms and conditions log entries.
The default API call with no parameters will return the last 250 log entries in descending order.
Optional parameters can be used to filter and query the data set.
- transactionId: If provided, returns only those log entries associated with a specific transactions. Paging and date filters are ignored if this parameter is used.
- maxResults: The max number of results to return in a single page. Defaults to 250 and 250 is the maximum value.
- startIndex The zero based start index of results within the full result set to return. Used to advance pages. For example, if the page size is 10 and you wish to return the second page of results, send a startIndex of 10.
- startDate: An optional start date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
- endDate: An optional end date for results provided as an ISO 8601 timestamp. (e.g. 2022-05-24T13:51:38+00:00)
Terms & Conditions Details
Terms & Conditions Details Example:
Linux/Mac OS: ./blockchyp -cmd="tc-entry" -logEntryId="<ENTRY ID>"
Windows: ./blockchyp.exe -cmd="tc-entry" -logEntryId="<ENTRY ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tcEntryExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TermsAndConditionsLogRequest{
LogEntryID: "<ENTRY ID>",
}
response, err := client.TCEntry(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TermsAndConditionsLogRequest request = new TermsAndConditionsLogRequest
{
LogEntryId = "<ENTRY ID>",
};
// Run the transaction.
TermsAndConditionsLogEntry response = await blockchyp.TcEntryAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TermsAndConditionsLogRequest;
import com.blockchyp.client.dto.TermsAndConditionsLogEntry;
public class TcEntryExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TermsAndConditionsLogRequest request = new TermsAndConditionsLogRequest();
request.setLogEntryId("<ENTRY ID>");
// Send the request
TermsAndConditionsLogEntry response = client.tcEntry(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'logEntryId' => '<ENTRY ID>',
];
$response = BlockChyp::tcEntry($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
logEntryId: '<ENTRY ID>'
}
response = blockchyp.tcEntry(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"logEntryId": "<ENTRY ID>",
}
# run the transaction.
response = client.tc_entry(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tcEntry({
logEntryId: '<ENTRY ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["logEntryId"] = "<ENTRY ID>"
[client tcEntryWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["logEntryId"] = "<ENTRY ID>"
client.tcEntry(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "PXQOBEG3NMI6ZKGUVTPEQAAREI",
"terminalId": "5WXL5MW23AI6ZJYWVTPEQAAREI",
"terminalName": "Test Terminal",
"test": true,
"timestamp": "05/24/2022 10:12:26 AM",
"transactionRef": "",
"transactionId": "",
"alias": "",
"name": "HIPPA Disclosure",
"content": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"contentLeader": "Lorem ipsum dolor sit amet, cons...",
"hasSignature": true,
"sigFormat": "PNG",
"signature": "iVBORw0KGgoAAAANSUhEUgAAAyAAAADcCAIAAAAHqlLAAAAdJklEQVR4nOz..."
}
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API returns details for a single terms and conditions log entry. The logEntryId
of the record to be returned is the only required parameter.
The signature image is returned as Base 64 encoded binary in the image format specified by the sigFormat
field.
The default format is PNG.
Token API
BlockChyp supports saved payments and recurring payments through the use of tokens. Tokens can be created via the Enroll API or the web tokenizer. Once created, these tokens can be used for subsequent payments or associated with customer records as saved payment methods.
Tokens are limited to a single merchant by default, but can be shared across an organization for multi-location merchants by special arrangement with BlockChyp. Contact your BlockChyp rep to setup token sharing.
Enroll
Enroll Example:
Linux/Mac OS: ./blockchyp -test -cmd="enroll" -terminal="Test Terminal"
Windows: ./blockchyp.exe -test -cmd="enroll" -terminal="Test Terminal"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func enrollExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.EnrollRequest{
Test: true,
TerminalName: "Test Terminal",
}
response, err := client.Enroll(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
EnrollRequest request = new EnrollRequest
{
Test = true,
TerminalName = "Test Terminal",
};
// Run the transaction.
EnrollResponse response = await blockchyp.EnrollAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.EnrollRequest;
import com.blockchyp.client.dto.EnrollResponse;
public class EnrollExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
EnrollRequest request = new EnrollRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
// Send the request
EnrollResponse response = client.enroll(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
];
$response = BlockChyp::enroll($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal'
}
response = blockchyp.enroll(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
}
# run the transaction.
response = client.enroll(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.enroll({
test: true,
terminalName: 'Test Terminal',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = "Test Terminal"
[client enrollWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"token", [response objectForKey:@"token"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
client.enroll(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("token" + ": " + (response["token"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "727291",
"transactionId": "KJ3DPKELBAI6VOTWNSLM7WZLHE",
"transactionRef": "64614152008",
"transactionType": "enroll",
"timestamp": "2020-04-30T20:49:26Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"token": "EKROTO2K5BCQJT4I555LQJLMWA",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "3404F82DA10F3FF5",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"tsi": "6800",
"merchantName": "Test Merchant",
"applicationLabel": "VISA CREDIT",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "",
"transactionType": "enroll",
"entryMethod": "CHIP"
},
"customer": null
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to tokenize and enroll a payment method in the token vault. You can also pass in customer information and associate the payment method with a customer record.
A token is returned in the response that can be used in subsequent charge, preauth, and refund transactions.
Gift Cards and EBT
Gift Cards and EBT cards cannot be tokenized.
E-Commerce Tokens
The tokens returned by the enroll API and the e-commerce web tokenizer are the same tokens and can be used interchangeably.
Token Metadata
Token Metadata Example:
Linux/Mac OS: ./blockchyp -test -cmd="token-metadata" -token="<TOKEN>"
Windows: ./blockchyp.exe -test -cmd="token-metadata" -token="<TOKEN>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func tokenMetadataExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.TokenMetadataRequest{
Token: "<TOKEN>",
}
response, err := client.TokenMetadata(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
TokenMetadataRequest request = new TokenMetadataRequest
{
Token = "<TOKEN>",
};
// Run the transaction.
TokenMetadataResponse response = await blockchyp.TokenMetadataAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.TokenMetadataRequest;
import com.blockchyp.client.dto.TokenMetadataResponse;
public class TokenMetadataExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
TokenMetadataRequest request = new TokenMetadataRequest();
request.setToken("<TOKEN>");
// Send the request
TokenMetadataResponse response = client.tokenMetadata(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'token' => '<TOKEN>',
];
$response = BlockChyp::tokenMetadata($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
token: '<TOKEN>'
}
response = blockchyp.tokenMetadata(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"token": "<TOKEN>",
}
# run the transaction.
response = client.token_metadata(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.tokenMetadata({
token: '<TOKEN>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["token"] = "<TOKEN>"
[client tokenMetadataWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["token"] = "<TOKEN>"
client.tokenMetadata(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"token": {
"token": "N2DTGDSSZNBAX7GT5HBZPHIOWA",
"maskedPan": "************4111",
"expiryMonth": "12",
"expiryYear": "12",
"paymentType": "MC",
"customers": [
{
"id": "XK4LRURF6II6ZB7UVTPEQAAREI",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "Raviga Capital",
"emailAddress": "",
"smsNumber": "",
"paymentMethods": null
},
{
"id": "XK4LRXBF6II6ZB7WVTPEQAAREI",
"customerRef": "",
"firstName": "Laurie",
"lastName": "Bream",
"companyName": "Bream Hall",
"emailAddress": "",
"smsNumber": "",
"paymentMethods": null
}
]
}
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API retrieves status and metadata information about a token, including any links to customer records.
This will also return any customer records related to the card behind the token. If the underlying card has been tokenized multiple times, all customers related to the card will be returned, even if those customer associations are related to other tokens.
Link Token
Link Token Example:
Linux/Mac OS: ./blockchyp -test -cmd="link-token" -token="<TOKEN>" -customerId="<CUSTOMER ID>"
Windows: ./blockchyp.exe -test -cmd="link-token" -token="<TOKEN>" -customerId="<CUSTOMER ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func linkTokenExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.LinkTokenRequest{
Token: "<TOKEN>",
CustomerID: "<CUSTOMER ID>",
}
response, err := client.LinkToken(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
LinkTokenRequest request = new LinkTokenRequest
{
Token = "<TOKEN>",
CustomerId = "<CUSTOMER ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.LinkTokenAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.LinkTokenRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class LinkTokenExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
LinkTokenRequest request = new LinkTokenRequest();
request.setToken("<TOKEN>");
request.setCustomerId("<CUSTOMER ID>");
// Send the request
Acknowledgement response = client.linkToken(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'token' => '<TOKEN>',
'customerId' => '<CUSTOMER ID>',
];
$response = BlockChyp::linkToken($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
token: '<TOKEN>',
customerId: '<CUSTOMER ID>'
}
response = blockchyp.linkToken(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"token": "<TOKEN>",
"customerId": "<CUSTOMER ID>",
}
# run the transaction.
response = client.link_token(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.linkToken({
token: '<TOKEN>',
customerId: '<CUSTOMER ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["token"] = "<TOKEN>"
request["customerId"] = "<CUSTOMER ID>"
[client linkTokenWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["token"] = "<TOKEN>"
request["customerId"] = "<CUSTOMER ID>"
client.linkToken(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API links a payment token with a customer record. Usually this would only be needed to reverse a previous unlink operation.
Unlink Token
Unlink Token Example:
Linux/Mac OS: ./blockchyp -test -cmd="unlink-token" -token="<TOKEN>" -customerId="<CUSTOMER ID>"
Windows: ./blockchyp.exe -test -cmd="unlink-token" -token="<TOKEN>" -customerId="<CUSTOMER ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func unlinkTokenExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.UnlinkTokenRequest{
Token: "<TOKEN>",
CustomerID: "<CUSTOMER ID>",
}
response, err := client.UnlinkToken(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
UnlinkTokenRequest request = new UnlinkTokenRequest
{
Token = "<TOKEN>",
CustomerId = "<CUSTOMER ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.UnlinkTokenAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.UnlinkTokenRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class UnlinkTokenExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
UnlinkTokenRequest request = new UnlinkTokenRequest();
request.setToken("<TOKEN>");
request.setCustomerId("<CUSTOMER ID>");
// Send the request
Acknowledgement response = client.unlinkToken(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'token' => '<TOKEN>',
'customerId' => '<CUSTOMER ID>',
];
$response = BlockChyp::unlinkToken($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
token: '<TOKEN>',
customerId: '<CUSTOMER ID>'
}
response = blockchyp.unlinkToken(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"token": "<TOKEN>",
"customerId": "<CUSTOMER ID>",
}
# run the transaction.
response = client.unlink_token(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.unlinkToken({
token: '<TOKEN>',
customerId: '<CUSTOMER ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["token"] = "<TOKEN>"
request["customerId"] = "<CUSTOMER ID>"
[client unlinkTokenWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["token"] = "<TOKEN>"
request["customerId"] = "<CUSTOMER ID>"
client.unlinkToken(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API removes a payment token link from a customer record.
This will remove links between the customer record and all tokens for the same underlying card.
Delete Token
Delete Token Example:
Linux/Mac OS: ./blockchyp -test -cmd="delete-token" -token="<TOKEN>"
Windows: ./blockchyp.exe -test -cmd="delete-token" -token="<TOKEN>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteTokenExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.DeleteTokenRequest{
Token: "<TOKEN>",
}
response, err := client.DeleteToken(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
DeleteTokenRequest request = new DeleteTokenRequest
{
Token = "<TOKEN>",
};
// Run the transaction.
DeleteTokenResponse response = await blockchyp.DeleteTokenAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.DeleteTokenRequest;
import com.blockchyp.client.dto.DeleteTokenResponse;
public class DeleteTokenExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
DeleteTokenRequest request = new DeleteTokenRequest();
request.setToken("<TOKEN>");
// Send the request
DeleteTokenResponse response = client.deleteToken(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'token' => '<TOKEN>',
];
$response = BlockChyp::deleteToken($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
token: '<TOKEN>'
}
response = blockchyp.deleteToken(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"token": "<TOKEN>",
}
# run the transaction.
response = client.delete_token(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteToken({
token: '<TOKEN>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["token"] = "<TOKEN>"
[client deleteTokenWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["token"] = "<TOKEN>"
client.deleteToken(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API deletes a payment token from the gateway. Tokens are automatically deleted if they have not been used for a year.
Customer API
These APIs allow developers to create and manage customer records in BlockChyp. Developers who wish to use BlockChyp for tokenized recurring payments can use tokens directly if they have their own customer management system. However, BlockChyp provides additional tools for managing customers and keeping track of a customer's saved payment tokens.
In addition, if customer features are used, BlockChyp can detect a payment method associated with an existing customer, and return customer data with payment transactions. This can be used as a passive method to detect repeat customers.
Update Customer
Update Customer Example:
Linux/Mac OS: ./blockchyp -test -cmd="update-customer" -firstName="Peter" -lastName="Gregory" -companyName="Raviga Capital" -email="peter@raviga.capital" -sms="9136488888"
Windows: ./blockchyp.exe -test -cmd="update-customer" -firstName="Peter" -lastName="Gregory" -companyName="Raviga Capital" -email="peter@raviga.capital" -sms="9136488888"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateCustomerExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.UpdateCustomerRequest{
Customer: blockchyp.Customer{
ID: "<CUSTOMER ID>",
CustomerRef: "Customer reference string",
FirstName: "FirstName",
LastName: "LastName",
CompanyName: "Company Name",
EmailAddress: "notifications@blockchypteam.m8r.co",
SmsNumber: "(123) 123-1231",
},
}
response, err := client.UpdateCustomer(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
UpdateCustomerRequest request = new UpdateCustomerRequest
{
Customer = new Customer
{
Id = "<CUSTOMER ID>",
CustomerRef = "Customer reference string",
FirstName = "FirstName",
LastName = "LastName",
CompanyName = "Company Name",
EmailAddress = "notifications@blockchypteam.m8r.co",
SmsNumber = "(123) 123-1231",
},
};
// Run the transaction.
CustomerResponse response = await blockchyp.UpdateCustomerAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.UpdateCustomerRequest;
import com.blockchyp.client.dto.CustomerResponse;
import com.blockchyp.client.dto.Customer;
public class UpdateCustomerExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
UpdateCustomerRequest request = new UpdateCustomerRequest();
Customer customer = new Customer();
customer.setId("<CUSTOMER ID>");
customer.setCustomerRef("Customer reference string");
customer.setFirstName("FirstName");
customer.setLastName("LastName");
customer.setCompanyName("Company Name");
customer.setEmailAddress("notifications@blockchypteam.m8r.co");
customer.setSmsNumber("(123) 123-1231");
request.setCustomer(customer);
// Send the request
CustomerResponse response = client.updateCustomer(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'customer' => [
'id' => '<CUSTOMER ID>',
'customerRef' => 'Customer reference string',
'firstName' => 'FirstName',
'lastName' => 'LastName',
'companyName' => 'Company Name',
'emailAddress' => 'notifications@blockchypteam.m8r.co',
'smsNumber' => '(123) 123-1231',
],
];
$response = BlockChyp::updateCustomer($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
customer: {
id: '<CUSTOMER ID>',
customerRef: 'Customer reference string',
firstName: 'FirstName',
lastName: 'LastName',
companyName: 'Company Name',
emailAddress: 'notifications@blockchypteam.m8r.co',
smsNumber: '(123) 123-1231'
}
}
response = blockchyp.updateCustomer(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"customer": {
"id": "<CUSTOMER ID>",
"customerRef": "Customer reference string",
"firstName": "FirstName",
"lastName": "LastName",
"companyName": "Company Name",
"emailAddress": "notifications@blockchypteam.m8r.co",
"smsNumber": "(123) 123-1231",
},
}
# run the transaction.
response = client.update_customer(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateCustomer({
customer: {
id: '<CUSTOMER ID>',
customerRef: 'Customer reference string',
firstName: 'FirstName',
lastName: 'LastName',
companyName: 'Company Name',
emailAddress: 'notifications@blockchypteam.m8r.co',
smsNumber: '(123) 123-1231',
},
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
var customer: [String:Any] = [:]
customer["id"] = "<CUSTOMER ID>"
customer["customerRef"] = "Customer reference string"
customer["firstName"] = "FirstName"
customer["lastName"] = "LastName"
customer["companyName"] = "Company Name"
customer["emailAddress"] = "notifications@blockchypteam.m8r.co"
customer["smsNumber"] = "(123) 123-1231"
request["customer"] = customer
[client updateCustomerWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"customer", [response objectForKey:@"customer"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
var customer: [String:Any] = [:]
customer["id"] = "<CUSTOMER ID>"
customer["customerRef"] = "Customer reference string"
customer["firstName"] = "FirstName"
customer["lastName"] = "LastName"
customer["companyName"] = "Company Name"
customer["emailAddress"] = "notifications@blockchypteam.m8r.co"
customer["smsNumber"] = "(123) 123-1231"
request["customer"] = customer
client.updateCustomer(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("customer" + ": " + (response["customer"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"customer": {
"id": "P7UV23UOEII6VJCUAJBKYEIAAI",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "Raviga Capital",
"emailAddress": "peter@raviga.capital",
"smsNumber": "9136488888",
"paymentMethods": null
}
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API adds or updates a customer record.
If you pass in customer information including firstName
, lastName
, email
,
or sms
without any Customer ID or Customer Ref, a new record will
be created.
If you pass in customerRef
and customerId
, the customer record will be updated
if it exists.
Customer Ref
The customerRef
field is optional, but highly recommended as this allows you
to use your own customer identifiers instead of storing BlockChyp's Customer IDs
in your systems.
Creating Customer Records With Payment Transactions
If you have customer information available at the time a payment transaction is executed, you can pass all the same customer information directly into a payment transaction. BlockChyp will create a customer record at the same time payment is captured. The advantage of this approach is that the customer's payment card is automatically associated with the customer record in a single step. If the customer uses the payment card in the future, the customer data will automatically be returned. You won't need to ask the customer to provide any additional information.
Retrieve Customer
Retrieve Customer Example:
Linux/Mac OS: ./blockchyp -test -cmd="get-customer" -customerId="<CUSTOMER ID>"
Windows: ./blockchyp.exe -test -cmd="get-customer" -customerId="<CUSTOMER ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func customerExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CustomerRequest{
CustomerID: "<CUSTOMER ID>",
}
response, err := client.Customer(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CustomerRequest request = new CustomerRequest
{
CustomerId = "<CUSTOMER ID>",
};
// Run the transaction.
CustomerResponse response = await blockchyp.CustomerAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CustomerRequest;
import com.blockchyp.client.dto.CustomerResponse;
public class CustomerExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CustomerRequest request = new CustomerRequest();
request.setCustomerId("<CUSTOMER ID>");
// Send the request
CustomerResponse response = client.customer(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'customerId' => '<CUSTOMER ID>',
];
$response = BlockChyp::customer($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
customerId: '<CUSTOMER ID>'
}
response = blockchyp.customer(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"customerId": "<CUSTOMER ID>",
}
# run the transaction.
response = client.customer(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.customer({
customerId: '<CUSTOMER ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["customerId"] = "<CUSTOMER ID>"
[client customerWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"customer", [response objectForKey:@"customer"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["customerId"] = "<CUSTOMER ID>"
client.customer(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("customer" + ": " + (response["customer"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"customer": {
"id": "P7UV23UOEII6VJCUAJBKYEIAAI",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "Raviga Capital",
"emailAddress": "peter@raviga.capital",
"smsNumber": "9136488888",
"paymentMethods": [
{
"token": "JFDODVEUTFIXIKG5G4NWQFLKV4",
"maskedPan": "************0010",
"expiryMonth": "12",
"expiryYear": "22",
"paymentType": "VISA"
}
]
}
}
- API Credential Types: Merchant
- Required Role: Payment API Access
With this API, you can retrieve detailed information about a customer record, including saved payment methods if available.
Customers can be looked up by customerId
or customerRef
.
Search Customer
Search Customer Example:
Linux/Mac OS: ./blockchyp -test -cmd="search-customer" -query="Peter"
Windows: ./blockchyp.exe -test -cmd="search-customer" -query="Peter"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func customerSearchExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.CustomerSearchRequest{
Query: "(123) 123-1234",
}
response, err := client.CustomerSearch(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
CustomerSearchRequest request = new CustomerSearchRequest
{
Query = "(123) 123-1234",
};
// Run the transaction.
CustomerSearchResponse response = await blockchyp.CustomerSearchAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.CustomerSearchRequest;
import com.blockchyp.client.dto.CustomerSearchResponse;
public class CustomerSearchExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
CustomerSearchRequest request = new CustomerSearchRequest();
request.setQuery("(123) 123-1234");
// Send the request
CustomerSearchResponse response = client.customerSearch(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'query' => '(123) 123-1234',
];
$response = BlockChyp::customerSearch($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
query: '(123) 123-1234'
}
response = blockchyp.customerSearch(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"query": "(123) 123-1234",
}
# run the transaction.
response = client.customer_search(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.customerSearch({
query: '(123) 123-1234',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["query"] = "(123) 123-1234"
[client customerSearchWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
NSLog(@"%@: %@", @"customers", [response objectForKey:@"customers"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["query"] = "(123) 123-1234"
client.customerSearch(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
NSLog("customers" + ": " + (response["customers"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"customers": [
{
"id": "EWEMCMDO2YI6VHR6AJBKYEIAAM",
"customerRef": "",
"firstName": "Peter",
"lastName": "Pan",
"companyName": "Lost Boys",
"emailAddress": "peter@blockchyp.com",
"smsNumber": "",
"paymentMethods": null
},
{
"id": "P7UV23UOEII6VJCUAJBKYEIAAI",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "Raviga Capital",
"emailAddress": "peter@raviga.capital",
"smsNumber": "9136488888",
"paymentMethods": null
}
]
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API searches the customer database and returns matching results.
Use query
to pass in a search string and the system will return all results whose
first or last names contain the query string.
Delete Customer
Delete Customer Example:
Linux/Mac OS: ./blockchyp -test -cmd="delete-customer" -customerId="<CUSTOMER ID>"
Windows: ./blockchyp.exe -test -cmd="delete-customer" -customerId="<CUSTOMER ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteCustomerExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.DeleteCustomerRequest{
CustomerID: "<CUSTOMER ID>",
}
response, err := client.DeleteCustomer(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
DeleteCustomerRequest request = new DeleteCustomerRequest
{
CustomerId = "<CUSTOMER ID>",
};
// Run the transaction.
DeleteCustomerResponse response = await blockchyp.DeleteCustomerAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.DeleteCustomerRequest;
import com.blockchyp.client.dto.DeleteCustomerResponse;
public class DeleteCustomerExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
DeleteCustomerRequest request = new DeleteCustomerRequest();
request.setCustomerId("<CUSTOMER ID>");
// Send the request
DeleteCustomerResponse response = client.deleteCustomer(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'customerId' => '<CUSTOMER ID>',
];
$response = BlockChyp::deleteCustomer($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
customerId: '<CUSTOMER ID>'
}
response = blockchyp.deleteCustomer(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"customerId": "<CUSTOMER ID>",
}
# run the transaction.
response = client.delete_customer(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteCustomer({
customerId: '<CUSTOMER ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["customerId"] = "<CUSTOMER ID>"
[client deleteCustomerWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["customerId"] = "<CUSTOMER ID>"
client.deleteCustomer(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
}
- API Credential Types: Merchant
- Required Role: Payment API Access
This API deletes a customer record.
Survey API
These APIs are used to work with post-transaction surveys and survey data.
Merchants can optionally configure scaled (1-5) or yes/no questions that can be presented to consumers after every approved Charge and Preauth transaction. Surveys do not require any custom programming and merchants can simply configure them without the point-of-sale system needing any additional customization.
However, these APIs allow point-of-sale or third-party system developers to integrate survey question configuration or result visualization into their own systems.
List Questions
List Questions Example:
Linux/Mac OS: ./blockchyp -cmd="survey-questions"
Windows: ./blockchyp.exe -cmd="survey-questions"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func surveyQuestionsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SurveyQuestionRequest{}
response, err := client.SurveyQuestions(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SurveyQuestionRequest request = new SurveyQuestionRequest
{
};
// Run the transaction.
SurveyQuestionResponse response = await blockchyp.SurveyQuestionsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SurveyQuestionRequest;
import com.blockchyp.client.dto.SurveyQuestionResponse;
public class SurveyQuestionsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SurveyQuestionRequest request = new SurveyQuestionRequest();
// Send the request
SurveyQuestionResponse response = client.surveyQuestions(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::surveyQuestions($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.surveyQuestions(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.survey_questions(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.surveyQuestions({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client surveyQuestionsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.surveyQuestions(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"results": [
{
"success": false,
"error": "",
"responseDescription": "",
"id": "OXTTEBWWXYI6ZJFEVTPEQAAREI",
"ordinal": 0,
"enabled": true,
"questionText": "Would you shop here again?",
"questionType": "yes_no",
"responses": null
}
]
}
- API Credential Types: Merchant
- Required Role: Survey Management
This API returns all survey questions in the order in which they would be presented on the terminal.
All questions are returned, whether enabled or disabled.
Question Details
Question Details Example:
Linux/Mac OS: ./blockchyp -cmd="survey-question" -questionId="<QUESTION ID>"
Windows: ./blockchyp.exe -cmd="survey-question" -questionId="<QUESTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func surveyQuestionExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SurveyQuestionRequest{
QuestionID: "<QUESTION ID>",
}
response, err := client.SurveyQuestion(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SurveyQuestionRequest request = new SurveyQuestionRequest
{
QuestionId = "<QUESTION ID>",
};
// Run the transaction.
SurveyQuestion response = await blockchyp.SurveyQuestionAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SurveyQuestionRequest;
import com.blockchyp.client.dto.SurveyQuestion;
public class SurveyQuestionExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SurveyQuestionRequest request = new SurveyQuestionRequest();
request.setQuestionId("<QUESTION ID>");
// Send the request
SurveyQuestion response = client.surveyQuestion(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'questionId' => '<QUESTION ID>',
];
$response = BlockChyp::surveyQuestion($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
questionId: '<QUESTION ID>'
}
response = blockchyp.surveyQuestion(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"questionId": "<QUESTION ID>",
}
# run the transaction.
response = client.survey_question(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.surveyQuestion({
questionId: '<QUESTION ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["questionId"] = "<QUESTION ID>"
[client surveyQuestionWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["questionId"] = "<QUESTION ID>"
client.surveyQuestion(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "OXTTEBWWXYI6ZJFEVTPEQAAREI",
"ordinal": 0,
"enabled": true,
"questionText": "Are you there?",
"questionType": "yes_no",
"responses": null
}
- API Credential Types: Merchant
- Required Role: Survey Management
This API returns a single survey question with response data. questionId
is required.
Update Question
Update Question Example:
Linux/Mac OS: ./blockchyp -cmd="update-survey-question" -questionId="<QUESTION ID>" -questionType="yes_no" -ordinal="1" -enabled -questionText="Would you shop here again?"
Windows: ./blockchyp.exe -cmd="update-survey-question" -questionId="<QUESTION ID>" -questionType="yes_no" -ordinal="1" -enabled -questionText="Would you shop here again?"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateSurveyQuestionExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SurveyQuestion{
ID: "<QUESTION ID>",
Ordinal: 1,
QuestionText: "Would you shop here again?",
QuestionType: "yes_no",
Enabled: true,
}
response, err := client.UpdateSurveyQuestion(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SurveyQuestion request = new SurveyQuestion
{
Id = "<QUESTION ID>",
Ordinal = 1,
QuestionText = "Would you shop here again?",
QuestionType = "yes_no",
Enabled = true,
};
// Run the transaction.
SurveyQuestion response = await blockchyp.UpdateSurveyQuestionAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SurveyQuestion;
import com.blockchyp.client.dto.SurveyQuestion;
public class UpdateSurveyQuestionExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SurveyQuestion request = new SurveyQuestion();
request.setId("<QUESTION ID>");
request.setOrdinal(1);
request.setQuestionText("Would you shop here again?");
request.setQuestionType("yes_no");
request.setEnabled(true);
// Send the request
SurveyQuestion response = client.updateSurveyQuestion(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'id' => '<QUESTION ID>',
'ordinal' => 1,
'questionText' => 'Would you shop here again?',
'questionType' => 'yes_no',
'enabled' => true,
];
$response = BlockChyp::updateSurveyQuestion($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
id: '<QUESTION ID>',
ordinal: 1,
questionText: 'Would you shop here again?',
questionType: 'yes_no',
enabled: true
}
response = blockchyp.updateSurveyQuestion(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"id": "<QUESTION ID>",
"ordinal": 1,
"questionText": "Would you shop here again?",
"questionType": "yes_no",
"enabled": True,
}
# run the transaction.
response = client.update_survey_question(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateSurveyQuestion({
id: '<QUESTION ID>',
ordinal: 1,
questionText: 'Would you shop here again?',
questionType: 'yes_no',
enabled: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["id"] = "<QUESTION ID>"
request["ordinal"] = 1
request["questionText"] = "Would you shop here again?"
request["questionType"] = "yes_no"
request["enabled"] = true
[client updateSurveyQuestionWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["id"] = "<QUESTION ID>"
request["ordinal"] = 1
request["questionText"] = "Would you shop here again?"
request["questionType"] = "yes_no"
request["enabled"] = true
client.updateSurveyQuestion(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "JUQEMPW3QUI6ZAK7VTPEQAAREI",
"ordinal": 0,
"enabled": false,
"questionText": "Would you shop here again?",
"questionType": "yes_no",
"responses": null
}
- API Credential Types: Merchant
- Required Role: Survey Management
This API updates or creates survey questions. questionText
and questionType
are required
fields. The following values are valid for questionType
.
- yes_no: Use for simple yes or no questions.
- scaled: Displays the question with buttons that allow the customer to respond with values from 1 through 5.
Questions are disabled by default. Pass in enabled
to enable a question.
The ordinal
field is used to control the sequence of questions when multiple questions are enabled. We recommend keeping
the number of questions minimal.
Delete Question
Delete Question Example:
Linux/Mac OS: ./blockchyp -cmd="delete-survey-question" -questionId="<QUESTION ID>"
Windows: ./blockchyp.exe -cmd="delete-survey-question" -questionId="<QUESTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteSurveyQuestionExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SurveyQuestionRequest{
QuestionID: "<QUESTION ID>",
}
response, err := client.DeleteSurveyQuestion(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SurveyQuestionRequest request = new SurveyQuestionRequest
{
QuestionId = "<QUESTION ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeleteSurveyQuestionAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SurveyQuestionRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeleteSurveyQuestionExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SurveyQuestionRequest request = new SurveyQuestionRequest();
request.setQuestionId("<QUESTION ID>");
// Send the request
Acknowledgement response = client.deleteSurveyQuestion(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'questionId' => '<QUESTION ID>',
];
$response = BlockChyp::deleteSurveyQuestion($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
questionId: '<QUESTION ID>'
}
response = blockchyp.deleteSurveyQuestion(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"questionId": "<QUESTION ID>",
}
# run the transaction.
response = client.delete_survey_question(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteSurveyQuestion({
questionId: '<QUESTION ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["questionId"] = "<QUESTION ID>"
[client deleteSurveyQuestionWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["questionId"] = "<QUESTION ID>"
client.deleteSurveyQuestion(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant
- Required Role: Survey Management
This API deletes a survey question. questionId
is a required parameter.
Survey Results
Survey Results Example:
Linux/Mac OS: ./blockchyp -cmd="survey-results" -questionId="<QUESTION ID>"
Windows: ./blockchyp.exe -cmd="survey-results" -questionId="<QUESTION ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func surveyResultsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SurveyResultsRequest{
QuestionID: "<QUESTION ID>",
}
response, err := client.SurveyResults(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SurveyResultsRequest request = new SurveyResultsRequest
{
QuestionId = "<QUESTION ID>",
};
// Run the transaction.
SurveyQuestion response = await blockchyp.SurveyResultsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SurveyResultsRequest;
import com.blockchyp.client.dto.SurveyQuestion;
public class SurveyResultsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SurveyResultsRequest request = new SurveyResultsRequest();
request.setQuestionId("<QUESTION ID>");
// Send the request
SurveyQuestion response = client.surveyResults(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'questionId' => '<QUESTION ID>',
];
$response = BlockChyp::surveyResults($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
questionId: '<QUESTION ID>'
}
response = blockchyp.surveyResults(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"questionId": "<QUESTION ID>",
}
# run the transaction.
response = client.survey_results(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.surveyResults({
questionId: '<QUESTION ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["questionId"] = "<QUESTION ID>"
[client surveyResultsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["questionId"] = "<QUESTION ID>"
client.surveyResults(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "OXTTEBWWXYI6ZJFEVTPEQAAREI",
"ordinal": 0,
"enabled": true,
"questionText": "Are you there?",
"questionType": "yes_no",
"transactionCount": 200,
"responseCount": 100,
"responseRate": 0.5,
"responses": [
{
"answerKey": "0",
"answerDescription": "No",
"responseCount": 50,
"responsePercentage": 0.5,
"averageTransaction": 45.56
},
{
"answerKey": "1",
"answerDescription": "Yes",
"responseCount": 50,
"responsePercentage": 0.5,
"averageTransaction": 23.45
}
]
}
- API Credential Types: Merchant
- Required Role: Survey Management
This API returns survey results for a single question.
The results returned include the response rate, which is the percentage of transactions after which the consumer provided an answer.
The responses
array breaks down the results by answer, providing the total number of responses,
the answer's percentage of the total, and the average transaction amount associated with a specific
answer.
By default, all results based on all responses are returned. However, developers may optionally provide
startDate
and endDate
parameters to return only responses provided between certain dates.
startDate
and endDate
can be provided in MM/DD/YYYY or YYYY-MM-DD format.
Media and Branding API
BlockChyp has a sophisticated terminal media and branding control platform. Terminals can be configured to display logos, images, videos, and slide shows when a terminal is idle. Branding assets can be configured at the partner, organization, and merchant level with fine-grained hour-by-hour schedules, if desired.
Conceptually, all branding and media start with the media library. Merchants, Partners, and Organizations can upload images or video and build branding assets from uploaded media.
Slide shows can combine images from the media library into a timed loop of repeating images.
Branding Assets can then be used to combine media or slide shows with priority and timing rules to create what we call the Terminal Branding Stack.
We call a group of branding assets the Terminal Branding Stack because there are implicit rules about which branding assets take priority. For example, a merchant with no branding assets configured will inherit the branding rules from any organization to which the merchant may belong. If the merchant doesn't belong to an organization or the organization has no branding rules configured, then the system will defer to branding defaults established by the point-of-sale or software partner that owns the merchant.
This feature enables partners and organizations (multi-store operators and large national chains) to configure branding for potentially thousands of terminals from a single interface.
Terminal Branding can also be configured at the individual terminal level and a merchant's terminal fleet can be broken into groups and branding configured at the group level. Branding configured at the terminal level will always override branding from any higher level group.
The order of priority for the Terminal Branding Stack is given below.
- Terminal
- Terminal Group
- Merchant
- Organization (Region, Chain, etc)
- Partner
- BlockChyp Default Logo
Media Library
Media Library Example:
Linux/Mac OS: ./blockchyp -cmd="media"
Windows: ./blockchyp.exe -cmd="media"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func mediaExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MediaRequest{}
response, err := client.Media(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MediaRequest request = new MediaRequest
{
};
// Run the transaction.
MediaLibraryResponse response = await blockchyp.MediaAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MediaRequest;
import com.blockchyp.client.dto.MediaLibraryResponse;
public class MediaExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MediaRequest request = new MediaRequest();
// Send the request
MediaLibraryResponse response = client.media(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::media($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.media(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.media(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.media({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client mediaWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.media(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"maxResults": 0,
"startIndex": 0,
"resultCount": 1,
"results": [
{
"success": true,
"error": "",
"responseDescription": "",
"id": "DEQZQ3GXAAI6ZJNQVTPEQAAREI",
"originalFile": "aviato.png",
"fileUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/4QZ2I4QYIMI6TPHVAJBKYEIAA4/MR4VSDPP6SHJFZQXEYAYJJ5KCI/MR4VSDPP6SHJFZQXEYAYJJ5KCI.png",
"thumbnailUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/4QZ2I4QYIMI6TPHVAJBKYEIAA4/MR4VSDPP6SHJFZQXEYAYJJ5KCI/MR4VSDPP6SHJFZQXEYAYJJ5KCI_t.png",
"video": false
}
]
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns the entire media library associated with the API Credentials (Merchant, Partner, or Organization). The media library results will include the ID used to reference a media asset in slide shows and branding assets along with the full file url and thumbnail.
Upload Media
Upload Media Example:
Linux/Mac OS: ./blockchyp -cmd="upload-media" -file="aviato.png"
Windows: ./blockchyp.exe -cmd="upload-media" -file="aviato.png"
package main
import (
"fmt"
"log"
"os"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func uploadMediaExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.UploadMetadata{
FileName: "aviato.png",
FileSize: 18843,
UploadID: "<RANDOM ID>",
}
file, err := os.Open("filename.png")
if err != nil {
log.Fatal(err)
}
response, err := client.UploadMedia(request, file)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
UploadMetadata request = new UploadMetadata
{
FileName = "aviato.png",
FileSize = 18843,
UploadId = "<RANDOM ID>",
};
// Run the transaction.
FileStream inStream = new FileStream("filename.png", FileMode.Open, FileAccess.Read);
MediaMetadata response = await blockchyp.UploadMediaAsync(request, inStream);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.UploadMetadata;
import com.blockchyp.client.dto.MediaMetadata;
public class UploadMediaExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
UploadMetadata request = new UploadMetadata();
request.setFileName("aviato.png");
request.setFileSize(18843);
request.setUploadId("<RANDOM ID>");
// Send the request
InputStream inStream = new FileInputStream(new File("aviato.png"));
MediaMetadata response = client.uploadMedia(request, inStream);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'fileName' => 'aviato.png',
'fileSize' => 18843,
'uploadId' => '<RANDOM ID>',
];
$file = file_get_contents('aviato.png');
$response = BlockChyp::uploadMedia($request, $file);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
fileName: 'aviato.png',
fileSize: 18843,
uploadId: '<RANDOM ID>'
}
file = File.open("aviato.png")
content = file.read
response = blockchyp.uploadMedia(request, content)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"fileName": "aviato.png",
"fileSize": 18843,
"uploadId": "<RANDOM ID>",
}
# run the transaction.
f = open("aviato.png", "rb")
content = f.read()
response = client.upload_media(request, content)
f.close()
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
var fs = require('fs');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
let content = fs.readFileSync('aviato.png');
client.uploadMedia({
fileName: 'aviato.png',
fileSize: 18843,
uploadId: '<RANDOM ID>',
}, content)
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["fileName"] = "aviato.png"
request["fileSize"] = 18843
request["uploadId"] = "<RANDOM ID>"
NSData *content = [NSData dataWithContentsOfFile:@"aviato.png"];
[client uploadMediaWithRequest:request content:content handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["fileName"] = "aviato.png"
request["fileSize"] = 18843
request["uploadId"] = "<RANDOM ID>"
var content = Data(contentsOfFile: "aviato.png")
client.uploadMedia(withRequest: request, content: content, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "DEQZQ3GXAAI6ZJNQVTPEQAAREI",
"originalFile": "aviato.png",
"fileUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/4QZ2I4QYIMI6TPHVAJBKYEIAA4/MR4VSDPP6SHJFZQXEYAYJJ5KCI/MR4VSDPP6SHJFZQXEYAYJJ5KCI.png",
"thumbnailUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/4QZ2I4QYIMI6TPHVAJBKYEIAA4/MR4VSDPP6SHJFZQXEYAYJJ5KCI/MR4VSDPP6SHJFZQXEYAYJJ5KCI_t.png",
"video": false
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API supports media library uploads. The operation of this API works slightly differently depending on the SDK platform. In all cases, the intent is to allow the file's binary to be passed into the SDK using the lowest level I/O primitive possible in order to support situations where developers aren't working with literal files. It might be (and usually is) more convenient to work with buffers, raw bytes, or streams.
For example, the Go implementation accepts an io.Reader
and the Java implementation accepts a
java.io.InputStream
. The CLI does accept a literal File URL via the -file
command line parameter.
The following file formats are accepted as valid uploads:
- .png
- .jpg
- .jpeg
- .gif
- .mov
- .mpg
- .mp4
- .mpeg
The UploadMetadata object allows developers to pass additional metadata about the upload including
fileName
, fileSize
, and uploadId
.
None of these values are required, but providing them can unlock some additional functionality relating to
media uploads. fileName
will be used to record the original file name in the media library. fileSize
and uploadId
are used to support upload status tracking, which is especially useful for large video file
uploads.
The fileSize
should be the file's full size in bytes.
The uploadId
value can be any random string. This is the value you'll use to check the status of an upload
via the Upload Status API. This API will return information needed to drive progress feedback on uploads and
return video transcoding information.
Upload Status
Upload Status Example:
Linux/Mac OS: ./blockchyp -cmd="upload-status" -uploadId="<UPLOAD ID>"
Windows: ./blockchyp.exe -cmd="upload-status" -uploadId="<UPLOAD ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func uploadStatusExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.UploadStatusRequest{
UploadID: "<UPLOAD ID>",
}
response, err := client.UploadStatus(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
UploadStatusRequest request = new UploadStatusRequest
{
UploadId = "<UPLOAD ID>",
};
// Run the transaction.
UploadStatus response = await blockchyp.UploadStatusAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.UploadStatusRequest;
import com.blockchyp.client.dto.UploadStatus;
public class UploadStatusExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
UploadStatusRequest request = new UploadStatusRequest();
request.setUploadId("<UPLOAD ID>");
// Send the request
UploadStatus response = client.uploadStatus(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'uploadId' => '<UPLOAD ID>',
];
$response = BlockChyp::uploadStatus($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
uploadId: '<UPLOAD ID>'
}
response = blockchyp.uploadStatus(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"uploadId": "<UPLOAD ID>",
}
# run the transaction.
response = client.upload_status(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.uploadStatus({
uploadId: '<UPLOAD ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["uploadId"] = "<UPLOAD ID>"
[client uploadStatusWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["uploadId"] = "<UPLOAD ID>"
client.uploadStatus(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "907b56aa-dba6-11ec-be29-acde48001122",
"mediaId": "VMDFUFG3UII6ZNZEVTPEQAAREI",
"fileSize": 56529,
"uploadedAmount": 56529,
"status": "Done",
"complete": true,
"processing": false,
"percentage": 100,
"thumbnailLocation": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/7A2G33EJCIK2JPQA4EBQI3EDSI/7A2G33EJCIK2JPQA4EBQI3EDSI_t.png"
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns status and progress information about in progress or recently completed uploads.
Before calling this API, developers must first start a file upload with fileSize
and uploadId
parameters.
The data structure returned will include the file size, number of bytes uploaded, a narrative status
and flags indicating whether or not the upload is complete or post upload processing is in progress.
If the upload is completed, the ID assigned to the media asset and a link to the thumbnail image will
also be returned.
Get Media Asset
Get Media Asset Example:
Linux/Mac OS: ./blockchyp -cmd="media-asset" -mediaId="<MEDIA ASSET ID>"
Windows: ./blockchyp.exe -cmd="media-asset" -mediaId="<MEDIA ASSET ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func mediaAssetExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MediaRequest{
MediaID: "<MEDIA ASSET ID>",
}
response, err := client.MediaAsset(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MediaRequest request = new MediaRequest
{
MediaId = "<MEDIA ASSET ID>",
};
// Run the transaction.
MediaMetadata response = await blockchyp.MediaAssetAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MediaRequest;
import com.blockchyp.client.dto.MediaMetadata;
public class MediaAssetExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MediaRequest request = new MediaRequest();
request.setMediaId("<MEDIA ASSET ID>");
// Send the request
MediaMetadata response = client.mediaAsset(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'mediaId' => '<MEDIA ASSET ID>',
];
$response = BlockChyp::mediaAsset($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
mediaId: '<MEDIA ASSET ID>'
}
response = blockchyp.mediaAsset(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"mediaId": "<MEDIA ASSET ID>",
}
# run the transaction.
response = client.media_asset(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.mediaAsset({
mediaId: '<MEDIA ASSET ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["mediaId"] = "<MEDIA ASSET ID>"
[client mediaAssetWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["mediaId"] = "<MEDIA ASSET ID>"
client.mediaAsset(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "6Z2LQRW3VUI6ZMI5VTPEQAAREI",
"originalFile": "aviato.png",
"fileUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/3D623QCUI664P5K7TTXJ5SSMDI/3D623QCUI664P5K7TTXJ5SSMDI.png",
"thumbnailUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/HMYKFCIJUOSDEAU4HQD6ZOKQ24/HMYKFCIJUOSDEAU4HQD6ZOKQ24_t.png",
"video": false
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns a detailed media asset. The data returned includes the exact same media information returned by the full media library endpoint, including fully qualified URLs pointing to the original media file and the thumbnail.
Delete Media Asset
Delete Media Asset Example:
Linux/Mac OS: ./blockchyp -cmd="delete-media" -mediaId="<MEDIA ASSET ID>"
Windows: ./blockchyp.exe -cmd="delete-media" -mediaId="<MEDIA ASSET ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteMediaAssetExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MediaRequest{
MediaID: "<MEDIA ASSET ID>",
}
response, err := client.DeleteMediaAsset(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MediaRequest request = new MediaRequest
{
MediaId = "<MEDIA ASSET ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeleteMediaAssetAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MediaRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeleteMediaAssetExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MediaRequest request = new MediaRequest();
request.setMediaId("<MEDIA ASSET ID>");
// Send the request
Acknowledgement response = client.deleteMediaAsset(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'mediaId' => '<MEDIA ASSET ID>',
];
$response = BlockChyp::deleteMediaAsset($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
mediaId: '<MEDIA ASSET ID>'
}
response = blockchyp.deleteMediaAsset(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"mediaId": "<MEDIA ASSET ID>",
}
# run the transaction.
response = client.delete_media_asset(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteMediaAsset({
mediaId: '<MEDIA ASSET ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["mediaId"] = "<MEDIA ASSET ID>"
[client deleteMediaAssetWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["mediaId"] = "<MEDIA ASSET ID>"
client.deleteMediaAsset(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API deletes a media asset. Note that a media asset cannot be deleted if it is in use in a slide show or in the terminal branding stack.
List Slide Shows
List Slide Shows Example:
Linux/Mac OS: ./blockchyp -cmd="slide-shows"
Windows: ./blockchyp.exe -cmd="slide-shows"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func slideShowsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SlideShowRequest{}
response, err := client.SlideShows(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SlideShowRequest request = new SlideShowRequest
{
};
// Run the transaction.
SlideShowResponse response = await blockchyp.SlideShowsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SlideShowRequest;
import com.blockchyp.client.dto.SlideShowResponse;
public class SlideShowsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SlideShowRequest request = new SlideShowRequest();
// Send the request
SlideShowResponse response = client.slideShows(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::slideShows($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.slideShows(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.slide_shows(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.slideShows({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client slideShowsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.slideShows(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"maxResults": 1,
"startIndex": 0,
"resultCount": 1,
"results": [
{
"timeout": 0,
"test": false,
"success": true,
"error": "",
"responseDescription": "",
"id": "2XIVCRHBFII6ZGMRAJBKYEIAAM",
"name": "Test Slide Show",
"delay": 5,
"slides": null
}
]
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns all slide shows.
Note that slide level data is not returned with this API. Use the Get Slide Show API to get slide level detail.
Get Slide Show
Get Slide Show Example:
Linux/Mac OS: ./blockchyp -cmd="slide-show" -slideShowId="<SLIDE SHOW ID>"
Windows: ./blockchyp.exe -cmd="slide-show" -slideShowId="<SLIDE SHOW ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func slideShowExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SlideShowRequest{
SlideShowID: "<SLIDE SHOW ID>",
}
response, err := client.SlideShow(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SlideShowRequest request = new SlideShowRequest
{
SlideShowId = "<SLIDE SHOW ID>",
};
// Run the transaction.
SlideShow response = await blockchyp.SlideShowAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SlideShowRequest;
import com.blockchyp.client.dto.SlideShow;
public class SlideShowExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SlideShowRequest request = new SlideShowRequest();
request.setSlideShowId("<SLIDE SHOW ID>");
// Send the request
SlideShow response = client.slideShow(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'slideShowId' => '<SLIDE SHOW ID>',
];
$response = BlockChyp::slideShow($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
slideShowId: '<SLIDE SHOW ID>'
}
response = blockchyp.slideShow(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"slideShowId": "<SLIDE SHOW ID>",
}
# run the transaction.
response = client.slide_show(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.slideShow({
slideShowId: '<SLIDE SHOW ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["slideShowId"] = "<SLIDE SHOW ID>"
[client slideShowWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["slideShowId"] = "<SLIDE SHOW ID>"
client.slideShow(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "YLUES3G4LMI6ZNOWVTPEQAAREI",
"name": "Test Slide Show",
"delay": 5,
"slides": [
{
"mediaId": "YLUESOW4LMI6ZNOWVTPEQAAREI",
"ordinal": 0,
"thumbnailUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/QSLIXT2UNV77JGEGSNZDPAJYQU/QSLIXT2UNV77JGEGSNZDPAJYQU_t.png"
}
]
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns a single slide show. Slide level detail is returned with the fully qualified thumbnail URL for each slide.
slideShowId
is the only required parameter.
Update Slide Show
Update Slide Show Example:
Linux/Mac OS: ./blockchyp -cmd="update-slide-show" -mediaId="<LIST OF MEDIA IDs>" -name="Test Slide Show" -delay=5
Windows: ./blockchyp.exe -cmd="update-slide-show" -mediaId="<LIST OF MEDIA IDs>" -name="Test Slide Show" -delay=5
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateSlideShowExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SlideShow{
Name: "Test Slide Show",
Delay: 5,
Slides: []*blockchyp.Slide{
&blockchyp.Slide{
MediaID: "<MEDIA ID>",
},
},
}
response, err := client.UpdateSlideShow(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SlideShow request = new SlideShow
{
Name = "Test Slide Show",
Delay = 5,
Slides = new List<Slide>
{
new Slide
{
MediaId = "<MEDIA ID>",
}
},
};
// Run the transaction.
SlideShow response = await blockchyp.UpdateSlideShowAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SlideShow;
import com.blockchyp.client.dto.SlideShow;
import com.blockchyp.client.dto.Slide;
public class UpdateSlideShowExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SlideShow request = new SlideShow();
request.setName("Test Slide Show");
request.setDelay(5);
Collection slides = new ArrayList();
Slide slides0 = new Slide();
slides0.setMediaId("<MEDIA ID>");
slides.add(slides0);
request.setSlides(slides);
// Send the request
SlideShow response = client.updateSlideShow(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'name' => 'Test Slide Show',
'delay' => 5,
'slides' => [
[
'mediaId' => '<MEDIA ID>',
],
],
];
$response = BlockChyp::updateSlideShow($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
name: 'Test Slide Show',
delay: 5,
slides: [
{
mediaId: '<MEDIA ID>'
}
]
}
response = blockchyp.updateSlideShow(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"name": "Test Slide Show",
"delay": 5,
"slides": [
{
"mediaId": "<MEDIA ID>",
},
],
}
# run the transaction.
response = client.update_slide_show(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateSlideShow({
name: 'Test Slide Show',
delay: 5,
slides: [
{
mediaId: '<MEDIA ID>',
},
],
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["name"] = "Test Slide Show"
request["delay"] = 5
var slides = [Any]();
var slides1: [String:Any] = [:]
slides1["mediaId"] = "<MEDIA ID>"
slides.append(slides1)
request["slides"] = slides
[client updateSlideShowWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["name"] = "Test Slide Show"
request["delay"] = 5
var slides = [Any]();
var slides1: [String:Any] = [:]
slides1["mediaId"] = "<MEDIA ID>"
slides.append(slides1)
request["slides"] = slides
client.updateSlideShow(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "YLUES3G4LMI6ZNOWVTPEQAAREI",
"name": "Test Slide Show",
"delay": 5,
"slides": [
{
"mediaId": "YLUESOW4LMI6ZNOWVTPEQAAREI",
"ordinal": 0,
"thumbnailUrl": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/QSLIXT2UNV77JGEGSNZDPAJYQU/QSLIXT2UNV77JGEGSNZDPAJYQU_t.png"
}
]
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API updates or creates a slide show. name
, delay
and slides
are required.
The slides property is an array of slides. The Slide data structure has ordinal and thumbnail URL fields,
but these are not required when updating or creating a slide show. Only the mediaId
field is required
when updating or creating a slide show.
When using the CLI, slides can be specified by sending a comma-separated list of media ids via the -mediaId
parameter.
Delete Slide Show
Delete Slide Show Example:
Linux/Mac OS: ./blockchyp -cmd="delete-slide-show" -slideShowId="<SLIDE SHOW ID>"
Windows: ./blockchyp.exe -cmd="delete-slide-show" -slideShowId="<SLIDE SHOW ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteSlideShowExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.SlideShowRequest{
SlideShowID: "<SLIDE SHOW ID>",
}
response, err := client.DeleteSlideShow(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
SlideShowRequest request = new SlideShowRequest
{
SlideShowId = "<SLIDE SHOW ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeleteSlideShowAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.SlideShowRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeleteSlideShowExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
SlideShowRequest request = new SlideShowRequest();
request.setSlideShowId("<SLIDE SHOW ID>");
// Send the request
Acknowledgement response = client.deleteSlideShow(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'slideShowId' => '<SLIDE SHOW ID>',
];
$response = BlockChyp::deleteSlideShow($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
slideShowId: '<SLIDE SHOW ID>'
}
response = blockchyp.deleteSlideShow(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"slideShowId": "<SLIDE SHOW ID>",
}
# run the transaction.
response = client.delete_slide_show(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteSlideShow({
slideShowId: '<SLIDE SHOW ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["slideShowId"] = "<SLIDE SHOW ID>"
[client deleteSlideShowWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["slideShowId"] = "<SLIDE SHOW ID>"
client.deleteSlideShow(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API deletes a slide show slideShowId
is the only required parameter.
Terminal Branding
Terminal Branding Example:
Linux/Mac OS: ./blockchyp -cmd="terminal-branding"
Windows: ./blockchyp.exe -cmd="terminal-branding"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func terminalBrandingExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BrandingAssetRequest{}
response, err := client.TerminalBranding(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BrandingAssetRequest request = new BrandingAssetRequest
{
};
// Run the transaction.
BrandingAssetResponse response = await blockchyp.TerminalBrandingAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BrandingAssetRequest;
import com.blockchyp.client.dto.BrandingAssetResponse;
public class TerminalBrandingExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BrandingAssetRequest request = new BrandingAssetRequest();
// Send the request
BrandingAssetResponse response = client.terminalBranding(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::terminalBranding($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.terminalBranding(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.terminal_branding(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.terminalBranding({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client terminalBrandingWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.terminalBranding(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"ownerId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"ownerType": "merchant",
"ownerName": "Test Merchant",
"levelName": "Merchant",
"narrativeTime": "Visible Now",
"activeAsset": {
"id": "MPFZTVGXYQI6ZCOVVTPEQAAREI",
"ownerId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"terminalId": "",
"terminalGroupId": "",
"merchantId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"organizationId": "",
"partnerId": "",
"slideShowId": "",
"mediaId": "QGPDOJGXQ4I6ZBAAVTPEQAAREI",
"padded": true,
"startDate": "",
"endDate": "",
"daysOfWeek": [],
"startTime": "",
"endTime": "",
"ordinal": 5,
"enabled": true,
"preview": false,
"userId": "",
"userName": "",
"thumbnail": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/UEX46TRTVGPM4STIXH3RLBVOSA/UEX46TRTVGPM4STIXH3RLBVOSA_t.png",
"lastModified": "",
"notes": "API CREATED",
"editable": true,
"assetType": "Image",
"ownerType": "merchant",
"ownerTypeCaption": "Merchant",
"ownerName": "Test Merchant",
"previewImage": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/UEX46TRTVGPM4STIXH3RLBVOSA/UEX46TRTVGPM4STIXH3RLBVOSA_t.png",
"narrativeEffectiveDates": "All Dates",
"narrativeDisplayPeriod": "Always",
"timeout": 0
},
"results": [
{
"id": "47BCQTGXU4I6ZD2MVTPEQAAREI",
"ownerId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"terminalId": "",
"terminalGroupId": "",
"merchantId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"organizationId": "",
"partnerId": "",
"slideShowId": "",
"mediaId": "47BCQLWXU4I6ZD2AVTPEQAAREI",
"padded": false,
"startDate": "",
"endDate": "",
"daysOfWeek": [
5
],
"startTime": "",
"endTime": "",
"ordinal": 2,
"enabled": true,
"preview": false,
"userId": "",
"userName": "",
"thumbnail": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/LJT6WBMY3AV7UDR3TXDXWKXFRE_luxe_preview.gif",
"lastModified": "",
"notes": "",
"editable": true,
"assetType": "Video",
"ownerType": "merchant",
"ownerTypeCaption": "Merchant",
"ownerName": "Test Merchant",
"previewImage": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/EXY6PQPFKYZ4SCYKQK5DCQY2ZA_luxe_preview.mp4",
"narrativeEffectiveDates": "All Dates",
"narrativeDisplayPeriod": "Fri ",
"timeout": 0
}
]
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API returns the full branding stack for a given API scope in the order of priority.
Consumers of this API should pay special attention to the editable
field. This field indicates whether or
not a branding asset is read-only from the perspective of a particular API Credential scope.
The thumbnail
and previewImage
attributes can be used to support building user interfaces for
managing the branding stack. previewImage
differs from thumbnail
in that the preview image is
intended to show how an asset would actually look when displayed on the terminal.
activeAsset
returns the asset that is currently visible on the terminal.
Update Branding Asset
Update Branding Asset Example:
Linux/Mac OS: ./blockchyp -cmd="update-branding-asset" -json="<JSON ENCODED BRANDING ASSET>"
Windows: ./blockchyp.exe -cmd="update-branding-asset" -json="<JSON ENCODED BRANDING ASSET>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateBrandingAssetExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BrandingAsset{
MediaID: "<MEDIA ID>",
Padded: true,
Ordinal: 10,
StartDate: "01/06/2021",
StartTime: "14:00",
EndDate: "11/05/2024",
EndTime: "16:00",
Notes: "Test Branding Asset",
Preview: false,
Enabled: true,
}
response, err := client.UpdateBrandingAsset(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BrandingAsset request = new BrandingAsset
{
MediaId = "<MEDIA ID>",
Padded = true,
Ordinal = 10,
StartDate = "01/06/2021",
StartTime = "14:00",
EndDate = "11/05/2024",
EndTime = "16:00",
Notes = "Test Branding Asset",
Preview = false,
Enabled = true,
};
// Run the transaction.
BrandingAsset response = await blockchyp.UpdateBrandingAssetAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BrandingAsset;
import com.blockchyp.client.dto.BrandingAsset;
public class UpdateBrandingAssetExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BrandingAsset request = new BrandingAsset();
request.setMediaId("<MEDIA ID>");
request.setPadded(true);
request.setOrdinal(10);
request.setStartDate("01/06/2021");
request.setStartTime("14:00");
request.setEndDate("11/05/2024");
request.setEndTime("16:00");
request.setNotes("Test Branding Asset");
request.setPreview(false);
request.setEnabled(true);
// Send the request
BrandingAsset response = client.updateBrandingAsset(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'mediaId' => '<MEDIA ID>',
'padded' => true,
'ordinal' => 10,
'startDate' => '01/06/2021',
'startTime' => '14:00',
'endDate' => '11/05/2024',
'endTime' => '16:00',
'notes' => 'Test Branding Asset',
'preview' => false,
'enabled' => true,
];
$response = BlockChyp::updateBrandingAsset($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
mediaId: '<MEDIA ID>',
padded: true,
ordinal: 10,
startDate: '01/06/2021',
startTime: '14:00',
endDate: '11/05/2024',
endTime: '16:00',
notes: 'Test Branding Asset',
preview: false,
enabled: true
}
response = blockchyp.updateBrandingAsset(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"mediaId": "<MEDIA ID>",
"padded": True,
"ordinal": 10,
"startDate": "01/06/2021",
"startTime": "14:00",
"endDate": "11/05/2024",
"endTime": "16:00",
"notes": "Test Branding Asset",
"preview": False,
"enabled": True,
}
# run the transaction.
response = client.update_branding_asset(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateBrandingAsset({
mediaId: '<MEDIA ID>',
padded: true,
ordinal: 10,
startDate: '01/06/2021',
startTime: '14:00',
endDate: '11/05/2024',
endTime: '16:00',
notes: 'Test Branding Asset',
preview: false,
enabled: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["mediaId"] = "<MEDIA ID>"
request["padded"] = true
request["ordinal"] = 10
request["startDate"] = "01/06/2021"
request["startTime"] = "14:00"
request["endDate"] = "11/05/2024"
request["endTime"] = "16:00"
request["notes"] = "Test Branding Asset"
request["preview"] = false
request["enabled"] = true
[client updateBrandingAssetWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["mediaId"] = "<MEDIA ID>"
request["padded"] = true
request["ordinal"] = 10
request["startDate"] = "01/06/2021"
request["startTime"] = "14:00"
request["endDate"] = "11/05/2024"
request["endTime"] = "16:00"
request["notes"] = "Test Branding Asset"
request["preview"] = false
request["enabled"] = true
client.updateBrandingAsset(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "KCSZJAG4PII6ZE73VTPEQAAREI",
"ownerId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"terminalId": "",
"terminalGroupId": "",
"merchantId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"organizationId": "",
"partnerId": "",
"slideShowId": "",
"mediaId": "KCSZI3G4PII6ZE7YVTPEQAAREI",
"padded": true,
"startDate": "2021-01-06",
"endDate": "2024-11-05",
"daysOfWeek": [],
"startTime": "14:00",
"endTime": "16:00",
"ordinal": 7,
"enabled": true,
"preview": false,
"userId": "",
"userName": "",
"thumbnail": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/O67KRLGPIKGVLLQWDN2ZJWIXME/O67KRLGPIKGVLLQWDN2ZJWIXME_t.png",
"lastModified": "",
"notes": "Test Branding Asset",
"editable": true,
"assetType": "Image",
"ownerType": "merchant",
"ownerTypeCaption": "Merchant",
"ownerName": "Gangster Test Merchant",
"previewImage": "https://s3-us-west-2.amazonaws.com/blockchyp-prod-media/media/WY2ZBQWRFEI6ZE6FVTPEQAAREI/O67KRLGPIKGVLLQWDN2ZJWIXME/O67KRLGPIKGVLLQWDN2ZJWIXME_t.png",
"narrativeEffectiveDates": "01/06/2021 through 11/05/2024",
"narrativeDisplayPeriod": "14:00 Through 16:00",
"timeout": 0
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API updates or creates a single Branding Asset.
Branding Assets represent a single element of the terminal branding stack. A Branding Asset can be a video or image,
in which case a mediaId
referencing an asset from the media library must be provided. A Branding Asset can also
be a slide show, in which case slideShowId
must be provided. Branding Assets must have a valid mediaId
or a valid
slideShowId
. The optional notes
field can be used to provide short notes and descriptions for a Branding asset.
Visibility Flags
In order for a Branding Asset to be visible on a terminal, the enabled
flag must be set to true and the preview
must be turned off. preview
is intended to show how a proposed Branding Asset will behave
without pushing it to live terminals. The Publish button in the BlockChyp merchant portal effectively turns
the preview
setting off.
Order and Sequencing
The ordinal
field is used to specify priority for a Branding Asset. Assets with a higher value for ordinal
will be prioritized first.
Padding Images
For plain images, it's sometimes helpful to add margins to images. This is especially helpful with logos
or any image file rendered without any white space or margins between the image content and edge of the image file.
Set the padded
flag to true if you'd like BlockChyp to auto apply margins when displaying an image on
the terminal.
Scheduling
By default, a Branding Asset placed on top of the Branding Stack, if it's enabled
and not in preview
mode, will immediately be displayed on the terminal round the clock.
Branding Assets can be scheduled with effective start and stop dates for seasonal campaigns. These assets can also be scheduled for specific times of day and specific days of the week.
- startDate: Optional date after which the Branding Asset is eligible for display. Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
- endDate: Optional date before which the Branding Asset is eligible for display. Can be provided in MM/DD/YYYY or YYYY-MM-DD format.
- startTime Optional time of day after which the branding asset is eligible for display. Must be provided in 24 hour time: HH:MM.
- endTime Optional time of day before which the branding asset is eligible for display. Must be provided in 24 hour time format: HH:MM
- daysOfWeek For branding assets that should only be displayed on certain days of the week, this field is an array of day of the week constants. (Constants vary by SDK platform.)
Read Only Fields
The Branding Asset data structure has a number of read only fields that are returned when Branding Assets are retrieved. But these fields are ignored when you try to send them as part of an update. These are derived or calculated fields and are helpful for displaying branding assets in a management user interface, but cannot be changed via an API call.
These fields are:
- ownerId
- merchantId
- organizationId
- partnerId
- userId
- userName
- thumbnail
- lastModified
- editable
- assetType
- ownerType
- ownerTypeCaption
- previewImage
- narrativeEffectiveDates
- narrativeDisplayPeriod
Delete Branding Asset
Delete Branding Asset Example:
Linux/Mac OS: ./blockchyp -cmd="delete-branding-asset" -assetId="<BRANDING ASSET ID>"
Windows: ./blockchyp.exe -cmd="delete-branding-asset" -assetId="<BRANDING ASSET ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteBrandingAssetExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.BrandingAssetRequest{
AssetID: "<BRANDING ASSET ID>",
}
response, err := client.DeleteBrandingAsset(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
BrandingAssetRequest request = new BrandingAssetRequest
{
AssetId = "<BRANDING ASSET ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeleteBrandingAssetAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.BrandingAssetRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeleteBrandingAssetExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
BrandingAssetRequest request = new BrandingAssetRequest();
request.setAssetId("<BRANDING ASSET ID>");
// Send the request
Acknowledgement response = client.deleteBrandingAsset(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'assetId' => '<BRANDING ASSET ID>',
];
$response = BlockChyp::deleteBrandingAsset($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
assetId: '<BRANDING ASSET ID>'
}
response = blockchyp.deleteBrandingAsset(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"assetId": "<BRANDING ASSET ID>",
}
# run the transaction.
response = client.delete_branding_asset(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteBrandingAsset({
assetId: '<BRANDING ASSET ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["assetId"] = "<BRANDING ASSET ID>"
[client deleteBrandingAssetWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["assetId"] = "<BRANDING ASSET ID>"
client.deleteBrandingAsset(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Media Management
This API deletes a Branding Asset from the branding stack.
Note that deleting a Branding Asset does not delete the underlying media from the media library or slide show from the slide show library.
Merchant API
These APIs allow partners to manage and configure their merchant portfolios.
Use of these APIs (other than the Merchant Profile API) requires partner scoped API credentials with special roles and permissions that may require a special arrangement with BlockChyp.
For example, Partners usually can't board merchants directly, but must board merchants using the standard underwriting process via offer codes and invitations.
Merchant Profile
Merchant Profile Example:
Linux/Mac OS: ./blockchyp -test -cmd="merchant-profile"
Windows: ./blockchyp.exe -test -cmd="merchant-profile"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func merchantProfileExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantProfileRequest{}
response, err := client.MerchantProfile(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantProfileRequest request = new MerchantProfileRequest
{
};
// Run the transaction.
MerchantProfileResponse response = await blockchyp.MerchantProfileAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantProfileRequest;
import com.blockchyp.client.dto.MerchantProfileResponse;
public class MerchantProfileExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantProfileRequest request = new MerchantProfileRequest();
// Send the request
MerchantProfileResponse response = client.merchantProfile(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::merchantProfile($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.merchantProfile(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.merchant_profile(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.merchantProfile({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client merchantProfileWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.merchantProfile(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"timeout": 0,
"test": true,
"merchantId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"companyName": "Test Merchant",
"dbaName": "Test Merchant",
"contactName": "",
"contactNumber": "",
"locationName": "",
"storeNumber": "",
"partnerRef": "",
"timeZone": "America/New_York",
"batchCloseTime": "03:00",
"terminalUpdateTime": "03:00",
"autoBatchClose": true,
"disableBatchEmails": false,
"pinEnabled": false,
"cashBackEnabled": false,
"storeAndForwardEnabled": true,
"partialAuthEnabled": false,
"splitBankAccountsEnabled": false,
"storeAndForwardFloorLimit": "50.00",
"publicKey": "112cB2d5obZ2dFdLNWY4rZ1e62ppU7RRV7QMDbgmERYkt1DYLg2L",
"status": "active",
"cashDiscountEnabled": false,
"surveyTimeout": 90,
"cooldownTimeout": 30,
"tipEnabled": false,
"promptForTip": false,
"tipDefaults": [
"15%",
"20%",
"25%"
],
"cashbackPresets": [
"1.00",
"10.00",
"20.00",
"50.00"
],
"ebtEnabled": true,
"freeRangeRefundsEnabled": false,
"pinBypassEnabled": true,
"giftCardsDisabled": false,
"tcDisabled": false,
"digitalSignaturesEnabled": true,
"digitalSignatureReversal": false,
"billingAddress": {
"address1": "1060 West Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60613",
"countryCode": "USA",
"latitude": 41.942329564,
"longitude": -87.65333072
},
"shippingAddress": {
"address1": "1060 West Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60613",
"countryCode": "USA",
"latitude": 41.942329564,
"longitude": -87.65333072
},
"visa": true,
"masterCard": true,
"amex": true,
"discover": true,
"jcb": false,
"unionPay": false,
"contactlessEmv": true,
"manualEntryEnabled": false,
"manualEntryPromptZip": false,
"manualEntryPromptStreetNumber": false,
"gatewayOnly": false
}
- API Credential Types: Merchant
- Required Role: Payment API Access
The API returns detailed metadata about the merchant's configuration, including basic identity information, terminal settings, store and forward settings, and bank account information for merchants that support split settlement.
Some of these fields can be updated via the Update Merchant API, but many of these fields are controlled by underwriting and cannot be altered outside of the underwriting and risk processes.
Merchant Descriptive Fields
The following fields are basic descriptive fields that can be used to describe and identify merchants.
- companyName: The merchant's official corporate entity name.
- dbaName: The business's DBA (doing business as) name.
- contactName: Name of the merchant's primary control contact.
- contactNumber: Primary control contact's phone number.
- locationName: Optional location name for multi-location operators.
- storeNumber: Optional store number for multi-location operators.
- partnerRef: Optional reference number partners can add to a merchant record. Usually the partner's own identifier for the merchant.
- timeZone: Unix style local time zone for the merchant. Example: America/New_York.
- publicKey: Read only field. The merchant's blockchain public key. Generated and assigned when a merchant account is first created.
- billingAddress: Address for billing and written correspondence.
- shippingAddress: Physical shipping address. Usually the actual street address of the business.
- status: Current status of the merchant account.
- tcDisabled: Disables all terms and conditions features in the merchant dashboard. Used to hide the feature if a partner has not chosen to support it.
- gatewayOnly: Indicates that a merchant has been boarded in gateway only mode. Not common.
Batch and Terminal Settings
The following fields are used to control batch closure and high level terminal configuration.
- batchCloseTime: Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time. Defaults to 3 AM.
- autoBatchClose: Flag the determines whether or not batches will automatically close. Defaults to true.
- disableBatchEmails: Flag that optionally turns off automatic batch closure notification emails.
- cooldownTimeout: The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal. After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
- surveyTimeout: The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
- pinEnabled: Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs. Will be ignored if terminals are not injected with the proper encryption keys.
- pinBypassEnabled: Enable pin bypass for debit transactions.
- cashBackEnabled: Enables cash back for debit transactions.
- cashbackPresets: An array of four default values for cashback amounts when cashback is enabled.
- storeAndForwardEnabled: Enables automatic store and forward during network outages. Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
- storeAndForwardFloorLimit: Maximum dollar value of a store and forward transaction.
- ebtEnabled: Enables EBT (SNAP) on BlockChyp terminals.
- tipEnabled: Enables tips entry on the terminal.
- promptForTip: If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
- tipDefaults: An array of exactly three percentages that will be used to calculate default tip amounts.
- giftCardsDisabled: Disables BlockChyp gift cards. Normally only used if the merchant is using an alternate gift card system.
- digitalSignaturesEnabled: Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
- digitalSignatureReversal: Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
- manualEntryEnabled: Enables manual card entry.
- manualEntryPromptZip: Requires zip code based address verification for manual card entry.
- manualEntryPromptStreetNumber: Requires street/address based verification for manual card entry.
Card Brand and Transaction Settings
- freeRangeRefundsEnabled: Enables direct refunds that do not reference a previous transaction.
- partialAuthEnabled: Indicates that partial authorizations (usually for gift card support) are enabled.
- splitBankAccountsEnabled: Used for law firm merchants only.
- contactlessEmv: Enables contactless/tap transactions on a terminal. Defaults to true.
- visa: Enables Visa transactions.
- masterCard: Enables MasterCard transactions.
- amex: Enables American Express transactions.
- discover: Enables Discover transactions.
- jcb: Enables JCB (Japan Card Bureau) transactions.
- unionPay: Enables China UnionPay transactions.
Get Merchants
Get Merchants Example:
Linux/Mac OS: ./blockchyp -test -cmd="get-merchants" -test
Windows: ./blockchyp.exe -test -cmd="get-merchants" -test
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func getMerchantsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.GetMerchantsRequest{
Test: true,
}
response, err := client.GetMerchants(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
GetMerchantsRequest request = new GetMerchantsRequest
{
Test = true,
};
// Run the transaction.
GetMerchantsResponse response = await blockchyp.GetMerchantsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.GetMerchantsRequest;
import com.blockchyp.client.dto.GetMerchantsResponse;
public class GetMerchantsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
GetMerchantsRequest request = new GetMerchantsRequest();
request.setTest(true);
// Send the request
GetMerchantsResponse response = client.getMerchants(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
];
$response = BlockChyp::getMerchants($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true
}
response = blockchyp.getMerchants(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
}
# run the transaction.
response = client.get_merchants(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.getMerchants({
test: true,
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
[client getMerchantsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
client.getMerchants(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"test": true,
"maxResults": 250,
"startIndex": 0,
"resultCount": 1,
"merchants": [
{
"success": true,
"error": "",
"responseDescription": "",
"timeout": 0,
"test": true,
"merchantId": "WY2ZBQWRFEI6ZE6FVTPEQAAREI",
"companyName": "Test Merchant",
"dbaName": "Test Merchant",
"contactName": "",
"contactNumber": "",
"locationName": "",
"storeNumber": "",
"partnerRef": "",
"timeZone": "America/New_York",
"batchCloseTime": "03:00",
"terminalUpdateTime": "03:00",
"autoBatchClose": true,
"disableBatchEmails": false,
"pinEnabled": false,
"cashBackEnabled": false,
"storeAndForwardEnabled": true,
"partialAuthEnabled": false,
"splitBankAccountsEnabled": false,
"storeAndForwardFloorLimit": "50.00",
"publicKey": "112cB2d5obZ2dFdLNWY4rZ1e62ppU7RRV7QMDbgmERYkt1DYLg2L",
"status": "active",
"cashDiscountEnabled": false,
"surveyTimeout": 90,
"cooldownTimeout": 30,
"tipEnabled": false,
"promptForTip": false,
"tipDefaults": [
"15%",
"20%",
"25%"
],
"cashbackPresets": [
"1.00",
"10.00",
"20.00",
"50.00"
],
"ebtEnabled": true,
"freeRangeRefundsEnabled": false,
"pinBypassEnabled": true,
"giftCardsDisabled": false,
"tcDisabled": false,
"digitalSignaturesEnabled": true,
"digitalSignatureReversal": false,
"billingAddress": {
"address1": "1060 West Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60613",
"countryCode": "USA",
"latitude": 41.942329564,
"longitude": -87.65333072
},
"shippingAddress": {
"address1": "1060 West Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60613",
"countryCode": "USA",
"latitude": 41.942329564,
"longitude": -87.65333072
},
"visa": true,
"masterCard": true,
"amex": true,
"discover": true,
"jcb": false,
"unionPay": false,
"contactlessEmv": true,
"manualEntryEnabled": false,
"manualEntryPromptZip": false,
"manualEntryPromptStreetNumber": false,
"gatewayOnly": false
}
]
}
- API Credential Types: Partner & Organization
- Required Role: Merchant Management
This is a partner or organization level API that can be used to return the merchant portfolio.
Live merchants are returned by default. Use the test
flag to return only test merchants. The
results returned include detailed settings including underwriting controlled flags.
A maximum of 250 merchants are returned by default. For large merchant portfolios, the maxResults
and startIndex
field can be used to reduce the page size and page through multiple pages of results.
Update Merchant
Update Merchant Example:
Linux/Mac OS: ./blockchyp -test -cmd="update-merchant" -json="{JSON ENCODED MERCHANT PROFILE}"
Windows: ./blockchyp.exe -test -cmd="update-merchant" -json="{JSON ENCODED MERCHANT PROFILE}"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func updateMerchantExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantProfile{
MerchantID: "<MERCHANT ID>",
Test: true,
DBAName: "Test Merchant",
CompanyName: "Test Merchant",
BillingAddress: blockchyp.Address{
Address1: "1060 West Addison",
City: "Chicago",
StateOrProvince: "IL",
PostalCode: "60613",
},
}
response, err := client.UpdateMerchant(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantProfile request = new MerchantProfile
{
MerchantId = "<MERCHANT ID>",
Test = true,
DbaName = "Test Merchant",
CompanyName = "Test Merchant",
BillingAddress = new Address
{
Address1 = "1060 West Addison",
City = "Chicago",
StateOrProvince = "IL",
PostalCode = "60613",
},
};
// Run the transaction.
MerchantProfileResponse response = await blockchyp.UpdateMerchantAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantProfile;
import com.blockchyp.client.dto.MerchantProfileResponse;
import com.blockchyp.client.dto.Address;
public class UpdateMerchantExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantProfile request = new MerchantProfile();
request.setMerchantId("<MERCHANT ID>");
request.setTest(true);
request.setDbaName("Test Merchant");
request.setCompanyName("Test Merchant");
Address billingAddress = new Address();
billingAddress.setAddress1("1060 West Addison");
billingAddress.setCity("Chicago");
billingAddress.setStateOrProvince("IL");
billingAddress.setPostalCode("60613");
request.setBillingAddress(billingAddress);
// Send the request
MerchantProfileResponse response = client.updateMerchant(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'merchantId' => '<MERCHANT ID>',
'test' => true,
'dbaName' => 'Test Merchant',
'companyName' => 'Test Merchant',
'billingAddress' => [
'address1' => '1060 West Addison',
'city' => 'Chicago',
'stateOrProvince' => 'IL',
'postalCode' => '60613',
],
];
$response = BlockChyp::updateMerchant($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
merchantId: '<MERCHANT ID>',
test: true,
dbaName: 'Test Merchant',
companyName: 'Test Merchant',
billingAddress: {
address1: '1060 West Addison',
city: 'Chicago',
stateOrProvince: 'IL',
postalCode: '60613'
}
}
response = blockchyp.updateMerchant(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"merchantId": "<MERCHANT ID>",
"test": True,
"dbaName": "Test Merchant",
"companyName": "Test Merchant",
"billingAddress": {
"address1": "1060 West Addison",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60613",
},
}
# run the transaction.
response = client.update_merchant(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.updateMerchant({
merchantId: '<MERCHANT ID>',
test: true,
dbaName: 'Test Merchant',
companyName: 'Test Merchant',
billingAddress: {
address1: '1060 West Addison',
city: 'Chicago',
stateOrProvince: 'IL',
postalCode: '60613',
},
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["merchantId"] = "<MERCHANT ID>"
request["test"] = true
request["dbaName"] = "Test Merchant"
request["companyName"] = "Test Merchant"
var billingaddress: [String:Any] = [:]
billingaddress["address1"] = "1060 West Addison"
billingaddress["city"] = "Chicago"
billingaddress["stateOrProvince"] = "IL"
billingaddress["postalCode"] = "60613"
request["billingAddress"] = billingaddress
[client updateMerchantWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["merchantId"] = "<MERCHANT ID>"
request["test"] = true
request["dbaName"] = "Test Merchant"
request["companyName"] = "Test Merchant"
var billingaddress: [String:Any] = [:]
billingaddress["address1"] = "1060 West Addison"
billingaddress["city"] = "Chicago"
billingaddress["stateOrProvince"] = "IL"
billingaddress["postalCode"] = "60613"
request["billingAddress"] = billingaddress
client.updateMerchant(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"timeout": 0,
"test": true,
"merchantId": "J4XHM7G5DYI6ZHX4VTPEQAAREI",
"companyName": "Test Merchant",
"dbaName": "Test Merchant",
"contactName": "",
"contactNumber": "",
"locationName": "",
"storeNumber": "",
"partnerRef": "",
"timeZone": "America/New_York",
"batchCloseTime": "03:00",
"terminalUpdateTime": "03:00",
"autoBatchClose": true,
"disableBatchEmails": false,
"pinEnabled": false,
"cashBackEnabled": false,
"storeAndForwardEnabled": true,
"partialAuthEnabled": false,
"splitBankAccountsEnabled": false,
"storeAndForwardFloorLimit": "50.00",
"publicKey": "13k85PDxfBpA6NwuZF8F4UDZ9RH8zf15iYnEoMgshz61g1zGPso",
"status": "active",
"cashDiscountEnabled": false,
"surveyTimeout": 90,
"cooldownTimeout": 30,
"tipEnabled": false,
"promptForTip": false,
"tipDefaults": [
"15%",
"20%",
"25%"
],
"cashbackPresets": [
"1.00",
"10.00",
"20.00",
"50.00"
],
"ebtEnabled": true,
"freeRangeRefundsEnabled": false,
"pinBypassEnabled": true,
"giftCardsDisabled": false,
"tcDisabled": false,
"digitalSignaturesEnabled": true,
"digitalSignatureReversal": false,
"billingAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"shippingAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"visa": true,
"masterCard": true,
"amex": true,
"discover": true,
"jcb": false,
"unionPay": false,
"contactlessEmv": true,
"manualEntryEnabled": false,
"manualEntryPromptZip": false,
"manualEntryPromptStreetNumber": false,
"gatewayOnly": false,
"bankAccounts": null
}
- API Credential Types: Merchant, Partner, & Organization
- Required Role: Merchant Management
This API can be used to update or create merchant accounts.
Merchant scoped API credentials can be used to update merchant account settings.
Partner scoped API credentials can be used to update merchants, create new test merchants or board new gateway merchants.
Merchant Descriptive Fields
The following fields are basic descriptive fields that can be used to describe and identify merchants.
- companyName: The merchant's official corporate entity name.
- dbaName: The businesses DBA (doing business as) name.
- contactName: Name of the merchant's primary control contact.
- contactNumber: Primary control contact's phone number.
- locationName: Optional location name for multi location operators.
- storeNumber: Optional store number for multi location operators.
- partnerRef: Optional reference number partners can add to a merchant record. Usually the partner's own identifier for the merchant.
- timeZone: Unix style local time zone for the merchant. Example: America/New_York.
- publicKey: Read only field. The merchant's blockchain public key. Generated and assigned when a merchant account is first created.
- billingAddress: Address for billing and written correspondence.
- shippingAddress: Physical shipping address. Usually the actual street address of the business.
- status: Current status of the merchant account.
- tcDisabled: Disables all terms and conditions features in the merchant dashboard. Used to hide the feature if a partner has not chosen to support it.
- gatewayOnly: Indicates that a merchant has been boarded in gateway only mode. Not common.
Batch and Terminal Settings
The following fields are used to control batch closure and high level terminal configuration.
- batchCloseTime: Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time. Defaults to 3 AM.
- autoBatchClose: Flag the determines whether or not batches will automatically close. Defaults to true.
- disableBatchEmails: Flag that optionally turns off automatic batch closure notification emails.
- cooldownTimeout: The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal. After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
- surveyTimeout: The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
- pinEnabled: Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs. Will be ignored if terminals are not injected with the proper encryption keys.
- pinBypassEnabled: Enable pin bypass for debit transactions.
- cashBackEnabled: Enables cash back for debit transactions.
- cashbackPresets: An array of four default values for cashback amounts when cashback is enabled.
- storeAndForwardEnabled: Enables automatic store and forward during network outages. Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
- storeAndForwardFloorLimit: Maximum dollar value of a store and forward transaction.
- ebtEnabled: Enables EBT (SNAP) on BlockChyp terminals.
- tipEnabled: Enables tips entry on the terminal.
- promptForTip: If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
- tipDefaults: An array of exactly three percentages that will be used to calculate default tip amounts.
- giftCardsDisabled: Disables BlockChyp gift cards. Normally only used if the merchant is using an alternate gift card system.
- digitalSignaturesEnabled: Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
- digitalSignatureReversal: Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
- manualEntryEnabled: Enables manual card entry.
- manualEntryPromptZip: Requires zip code based address verification for manual card entry.
- manualEntryPromptStreetNumber: Requires street/address based verification for manual card entry.
Card Brand and Transaction Settings
- freeRangeRefundsEnabled: Enables direct refunds that do not reference a previous transaction.
- partialAuthEnabled: Indicates that partial authorizations (usually for gift card support) are enabled.
- splitBankAccountsEnabled: Used for law firm merchants only.
- contactlessEmv: Enables contactless/tap transactions on a terminal. Defaults to true.
- visa: Enables Visa transactions.
- masterCard: Enables MasterCard transactions.
- amex: Enables American Express transactions.
- discover: Enables Discover transactions.
- jcb: Enables JCB (Japan Card Bureau) transactions.
- unionPay: Enables China UnionPay transactions.
Merchant Users
Merchant Users Example:
Linux/Mac OS: ./blockchyp -cmd="merchant-users" -merchantId="<MERCHANT ID>"
Windows: ./blockchyp.exe -cmd="merchant-users" -merchantId="<MERCHANT ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func merchantUsersExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantProfileRequest{
MerchantID: "<MERCHANT ID>",
}
response, err := client.MerchantUsers(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantProfileRequest request = new MerchantProfileRequest
{
MerchantId = "<MERCHANT ID>",
};
// Run the transaction.
MerchantUsersResponse response = await blockchyp.MerchantUsersAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantProfileRequest;
import com.blockchyp.client.dto.MerchantUsersResponse;
public class MerchantUsersExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantProfileRequest request = new MerchantProfileRequest();
request.setMerchantId("<MERCHANT ID>");
// Send the request
MerchantUsersResponse response = client.merchantUsers(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'merchantId' => '<MERCHANT ID>',
];
$response = BlockChyp::merchantUsers($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
merchantId: '<MERCHANT ID>'
}
response = blockchyp.merchantUsers(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"merchantId": "<MERCHANT ID>",
}
# run the transaction.
response = client.merchant_users(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.merchantUsers({
merchantId: '<MERCHANT ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["merchantId"] = "<MERCHANT ID>"
[client merchantUsersWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["merchantId"] = "<MERCHANT ID>"
client.merchantUsers(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"test": false,
"results": [
{
"test": false,
"id": "WY2ZBQWRFEI6ZE6GVTPEQAAREI",
"firstName": "Aaron",
"lastName": "Anderson",
"email": "doublea@drinkhomicide.com",
"status": "Active",
"type": "user",
"roles": [
"STDPARTNER"
],
"locked": false
}
]
}
- API Credential Types: Partner & Organization
- Required Role: Merchant Management
This API returns all users and pending invites associated with a merchant account including any assigned role codes.
Invite Merchant User
Invite Merchant User Example:
Linux/Mac OS: ./blockchyp -cmd="invite-merchant-user" -email="elon@twitter.com"
Windows: ./blockchyp.exe -cmd="invite-merchant-user" -email="elon@twitter.com"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func inviteMerchantUserExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.InviteMerchantUserRequest{
Email: "Email address for the invite",
}
response, err := client.InviteMerchantUser(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
InviteMerchantUserRequest request = new InviteMerchantUserRequest
{
Email = "Email address for the invite",
};
// Run the transaction.
Acknowledgement response = await blockchyp.InviteMerchantUserAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.InviteMerchantUserRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class InviteMerchantUserExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
InviteMerchantUserRequest request = new InviteMerchantUserRequest();
request.setEmail("Email address for the invite");
// Send the request
Acknowledgement response = client.inviteMerchantUser(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'email' => 'Email address for the invite',
];
$response = BlockChyp::inviteMerchantUser($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
email: 'Email address for the invite'
}
response = blockchyp.inviteMerchantUser(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"email": "Email address for the invite",
}
# run the transaction.
response = client.invite_merchant_user(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.inviteMerchantUser({
email: 'Email address for the invite',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["email"] = "Email address for the invite"
[client inviteMerchantUserWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["email"] = "Email address for the invite"
client.inviteMerchantUser(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Partner & Organization
- Required Role: Merchant Management
Invites a new user to join a merchant account. email
, firstName
, and lastName
are required.
The user will be sent an invite email with steps for creating a BlockChyp account and linking it to a merchant account. If the user already has a BlockChyp user account, the new user signup wil be skipped and the existing user account will be linked to the merchant account.
Developers can optionally restrict the user's access level by sending one or more role codes. Otherwise, the user will be given the default merchant user role. (STDMERCHANT)
Add Test Merchant
Add Test Merchant Example:
Linux/Mac OS: ./blockchyp -test -cmd="add-test-merchant" -dbaName="Test Merchant" -companyName="Test Merchant"
Windows: ./blockchyp.exe -test -cmd="add-test-merchant" -dbaName="Test Merchant" -companyName="Test Merchant"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func addTestMerchantExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AddTestMerchantRequest{
DBAName: "DBA Name",
CompanyName: "Corporate Entity Name",
}
response, err := client.AddTestMerchant(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AddTestMerchantRequest request = new AddTestMerchantRequest
{
DbaName = "DBA Name",
CompanyName = "Corporate Entity Name",
};
// Run the transaction.
MerchantProfileResponse response = await blockchyp.AddTestMerchantAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AddTestMerchantRequest;
import com.blockchyp.client.dto.MerchantProfileResponse;
public class AddTestMerchantExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AddTestMerchantRequest request = new AddTestMerchantRequest();
request.setDbaName("DBA Name");
request.setCompanyName("Corporate Entity Name");
// Send the request
MerchantProfileResponse response = client.addTestMerchant(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'dbaName' => 'DBA Name',
'companyName' => 'Corporate Entity Name',
];
$response = BlockChyp::addTestMerchant($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
dbaName: 'DBA Name',
companyName: 'Corporate Entity Name'
}
response = blockchyp.addTestMerchant(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"dbaName": "DBA Name",
"companyName": "Corporate Entity Name",
}
# run the transaction.
response = client.add_test_merchant(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.addTestMerchant({
dbaName: 'DBA Name',
companyName: 'Corporate Entity Name',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["dbaName"] = "DBA Name"
request["companyName"] = "Corporate Entity Name"
[client addTestMerchantWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["dbaName"] = "DBA Name"
request["companyName"] = "Corporate Entity Name"
client.addTestMerchant(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"timeout": 0,
"test": true,
"merchantId": "J4XHM7G5DYI6ZHX4VTPEQAAREI",
"companyName": "Test Merchant",
"dbaName": "Test Merchant",
"contactName": "",
"contactNumber": "",
"locationName": "",
"storeNumber": "",
"partnerRef": "",
"timeZone": "America/New_York",
"batchCloseTime": "03:00",
"terminalUpdateTime": "03:00",
"autoBatchClose": true,
"disableBatchEmails": false,
"pinEnabled": false,
"cashBackEnabled": false,
"storeAndForwardEnabled": true,
"partialAuthEnabled": false,
"splitBankAccountsEnabled": false,
"storeAndForwardFloorLimit": "50.00",
"publicKey": "13k85PDxfBpA6NwuZF8F4UDZ9RH8zf15iYnEoMgshz61g1zGPso",
"status": "active",
"cashDiscountEnabled": false,
"surveyTimeout": 90,
"cooldownTimeout": 30,
"tipEnabled": false,
"promptForTip": false,
"tipDefaults": [
"15%",
"20%",
"25%"
],
"cashbackPresets": [
"1.00",
"10.00",
"20.00",
"50.00"
],
"ebtEnabled": true,
"freeRangeRefundsEnabled": false,
"pinBypassEnabled": true,
"giftCardsDisabled": false,
"tcDisabled": false,
"digitalSignaturesEnabled": true,
"digitalSignatureReversal": false,
"billingAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"shippingAddress": {
"address1": "",
"address2": "",
"city": "",
"stateOrProvince": "",
"postalCode": "",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"visa": true,
"masterCard": true,
"amex": true,
"discover": true,
"jcb": false,
"unionPay": false,
"contactlessEmv": true,
"manualEntryEnabled": false,
"manualEntryPromptZip": false,
"manualEntryPromptStreetNumber": false,
"gatewayOnly": false,
"bankAccounts": null
}
- API Credential Types: Partner
- Required Role: Merchant Management
This is a partner level API that can be used to create test merchant accounts. This creates a basic test merchant with default settings.
Settings can be changed by using the Update Merchant API.
Delete Test Merchant
Delete Test Merchant Example:
Linux/Mac OS: ./blockchyp -cmd="delete-test-merchant" -merchantId="<MERCHANT ID>"
Windows: ./blockchyp.exe -cmd="delete-test-merchant" -merchantId="<MERCHANT ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func deleteTestMerchantExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantProfileRequest{
MerchantID: "<MERCHANT ID>",
}
response, err := client.DeleteTestMerchant(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantProfileRequest request = new MerchantProfileRequest
{
MerchantId = "<MERCHANT ID>",
};
// Run the transaction.
Acknowledgement response = await blockchyp.DeleteTestMerchantAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantProfileRequest;
import com.blockchyp.client.dto.Acknowledgement;
public class DeleteTestMerchantExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantProfileRequest request = new MerchantProfileRequest();
request.setMerchantId("<MERCHANT ID>");
// Send the request
Acknowledgement response = client.deleteTestMerchant(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'merchantId' => '<MERCHANT ID>',
];
$response = BlockChyp::deleteTestMerchant($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
merchantId: '<MERCHANT ID>'
}
response = blockchyp.deleteTestMerchant(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"merchantId": "<MERCHANT ID>",
}
# run the transaction.
response = client.delete_test_merchant(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.deleteTestMerchant({
merchantId: '<MERCHANT ID>',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["merchantId"] = "<MERCHANT ID>"
[client deleteTestMerchantWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["merchantId"] = "<MERCHANT ID>"
client.deleteTestMerchant(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": ""
}
- API Credential Types: Partner
- Required Role: Merchant Management
This partner API can be used to delete unused test merchant accounts. merchantId
is a required parameter.
Partner API
These partner only APIs give ISV partners advanced reporting and tools for managing their portfolio.
Most of the APIs below are for portfolio reporting and range from basic partner commission statements to individual statements with all underlying card brand data.
We also provide a pricing policy API that enables partners to pull down the current pricing rules in force for any merchant in their portfolio.
Retrieve Pricing Policy
Retrieve Pricing Policy Example:
Linux/Mac OS: ./blockchyp -test -cmd="pricing-policy" -merchantId="<ID>"
Windows: ./blockchyp.exe -test -cmd="pricing-policy" -merchantId="<ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func pricingPolicyExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PricingPolicyRequest{}
response, err := client.PricingPolicy(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PricingPolicyRequest request = new PricingPolicyRequest
{
};
// Run the transaction.
PricingPolicyResponse response = await blockchyp.PricingPolicyAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PricingPolicyRequest;
import com.blockchyp.client.dto.PricingPolicyResponse;
public class PricingPolicyExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PricingPolicyRequest request = new PricingPolicyRequest();
// Send the request
PricingPolicyResponse response = client.pricingPolicy(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::pricingPolicy($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.pricingPolicy(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.pricing_policy(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.pricingPolicy({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client pricingPolicyWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.pricingPolicy(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "W5JCGFVVXAI6ZE6K700KYEIAAI",
"partnerId": "Y5F3U5NQMII6ZBSUA700YEIAAU",
"merchantId": "W5JC7000VXAI6ZE6KAJBKYEIAAI",
"enabled": true,
"timestamp": "2022-04-06T17:17:29Z",
"description": "Credit: 5 cents + 10 pts Debit:",
"policyType": "interchange",
"partnerMarkupSplit": "25%",
"standardFlatRate": {
"buyRate": "0.015%",
"current": "0%",
"limit": "0%"
},
"debitFlatRate": {
"buyRate": "0.015%",
"current": "0%",
"limit": "0%"
},
"ecommerceFlatRate": {
"buyRate": "0.015%",
"current": "0%",
"limit": "0%"
},
"keyedFlatRate": {
"buyRate": "0.015%",
"current": "0%",
"limit": "0%"
},
"premiumFlatRate": {
"buyRate": "0.12%",
"current": "0%",
"limit": "0%"
},
"standardInterchangeMarkup": {
"buyRate": "0.015%",
"current": "0.1%",
"limit": "0%"
},
"debitInterchangeMarkup": {
"buyRate": "0.015%",
"current": "0.1%",
"limit": "0%"
},
"ecommerceInterchangeMarkup": {
"buyRate": "0.02%",
"current": "0.1%",
"limit": "0%"
},
"keyedInterchangeMarkup": {
"buyRate": "0.02%",
"current": "0.1%",
"limit": "0%"
},
"premiumInterchangeMarkup": {
"buyRate": "0.12%",
"current": "0.2%",
"limit": "0%"
},
"standardTransactionFee": {
"buyRate": "0.02",
"current": "0.05",
"limit": "0.00"
},
"debitTransactionFee": {
"buyRate": "0.02",
"current": "0.05",
"limit": "0.00"
},
"ecommerceTransactionFee": {
"buyRate": "0.02",
"current": "0.05",
"limit": "0.00"
},
"keyedTransactionFee": {
"buyRate": "0.02",
"current": "0.05",
"limit": "0.00"
},
"premiumTransactionFee": {
"buyRate": "0.07",
"current": "0.10",
"limit": "0.00"
},
"ebtTransactionFee": {
"buyRate": "0.065",
"current": "0.10",
"limit": "0.00"
},
"monthlyFee": {
"buyRate": "5.00",
"current": "10.00",
"limit": "0.00"
},
"annualFee": {
"buyRate": "0.00",
"current": "0.00",
"limit": "0.00"
},
"chargebackFee": {
"buyRate": "12.00",
"current": "20.00",
"limit": "0.00"
},
"avsFee": {
"buyRate": "0.00",
"current": "0.00",
"limit": "0.00"
},
"batchFee": {
"buyRate": "0.07",
"current": "0.08",
"limit": "0.00"
},
"voiceAuthFee": {
"buyRate": "0.75",
"current": "1.00",
"limit": "0.00"
},
"accountSetupFee": {
"buyRate": "0.00",
"current": "0.00",
"limit": "0.00"
}
}
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and merchantId
is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the id
parameter.
Buy rates for interchange plus and fixed rate pricing are always returned, but only the pricing related to the pricing model type (flat rate or interchange plus) are actually used in fee calculation.
Each pricing level returns three values: buyRate
, current
, and limit
. The actual price the merchant will pay is
given in the current
field. The other values reflect the contract minimum (buyRate
) and maximum (limit
) range
the partner can use when changing prices.
Partner Statements
Partner Statements Example:
Linux/Mac OS: ./blockchyp -test -cmd="partner-statements"
Windows: ./blockchyp.exe -test -cmd="partner-statements"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func partnerStatementsExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PartnerStatementListRequest{}
response, err := client.PartnerStatements(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PartnerStatementListRequest request = new PartnerStatementListRequest
{
};
// Run the transaction.
PartnerStatementListResponse response = await blockchyp.PartnerStatementsAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PartnerStatementListRequest;
import com.blockchyp.client.dto.PartnerStatementListResponse;
public class PartnerStatementsExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PartnerStatementListRequest request = new PartnerStatementListRequest();
// Send the request
PartnerStatementListResponse response = client.partnerStatements(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::partnerStatements($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.partnerStatements(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.partner_statements(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.partnerStatements({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client partnerStatementsWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.partnerStatements(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"statements": [
{
"id": "SCH34K3JAEI65EJNAJBKYEIAAI",
"statementDate": "2023-10-23T20:14:06Z",
"totalVolume": 548483.05,
"totalVolumeFormatted": "548,483.05",
"transactionCount": 12175,
"partnerCommission": 395.15,
"partnerCommissionFormatted": "395.15",
"status": "paid"
},
{
"id": "4ZIRR72NQQI65BU7AJBKYEIAAI",
"statementDate": "2023-09-08T16:20:57Z",
"totalVolume": 513166.46,
"totalVolumeFormatted": "513,166.46",
"transactionCount": 12341,
"partnerCommission": 386.99,
"partnerCommissionFormatted": "386.99",
"status": "paid"
},
{
"id": "2BRDQHRS6MI65F7UAJBKYEIAAQ",
"statementDate": "2023-08-04T21:02:42Z",
"totalVolume": 680464.72,
"totalVolumeFormatted": "680,464.72",
"transactionCount": 17125,
"partnerCommission": 639.18,
"partnerCommissionFormatted": "639.18",
"status": "paid"
}
]
}
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters (startDate
and endDate
) can filter statements to a specific date range.
The list of statements returns basic information about statements like volume, transaction count, and commissions earned.
Use the id
returned with each statement summary with the Partner Statement Detail API to pull down full details.
Partner Statement Detail
Partner Statement Detail Example:
Linux/Mac OS: ./blockchyp -test -cmd="partner-statement-detail" -id="<STATEMENT_ID>"
Windows: ./blockchyp.exe -test -cmd="partner-statement-detail" -id="<STATEMENT_ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func partnerStatementDetailExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PartnerStatementDetailRequest{}
response, err := client.PartnerStatementDetail(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PartnerStatementDetailRequest request = new PartnerStatementDetailRequest
{
};
// Run the transaction.
PartnerStatementDetailResponse response = await blockchyp.PartnerStatementDetailAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PartnerStatementDetailRequest;
import com.blockchyp.client.dto.PartnerStatementDetailResponse;
public class PartnerStatementDetailExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PartnerStatementDetailRequest request = new PartnerStatementDetailRequest();
// Send the request
PartnerStatementDetailResponse response = client.partnerStatementDetail(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::partnerStatementDetail($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.partnerStatementDetail(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.partner_statement_detail(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.partnerStatementDetail({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client partnerStatementDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.partnerStatementDetail(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "SCH34K3J7005EJNAJBKYEIAAI",
"partnerId": "Y5F3U5NQ7006ZBSUAJBKYEIAAU",
"partnerName": "Demo Partner, Inc.",
"statementDate": "2023-10-23T20:14:06Z",
"totalVolume": 548483.05,
"totalVolumeFormatted": "548,483.05",
"transactionCount": 12175,
"partnerCommission": 395.15,
"partnerCommissionFormatted": "395.15",
"partnerCommissionsOnVolume": 0.0007,
"partnerCommissionsOnVolumeFormatted": "0.07%",
"status": "paid",
"lineItems": [
{
"id": "UV7DEJLR4AI65OUEAJBKYEIAAM",
"invoiceId": "UV7DEJLR4A700OUEAJBKYEIAAM",
"totalFees": 8058.21,
"totalFeesFormatted": "8,058.21",
"totalFeesOnVolume": 0.0166,
"totalFeesOnVolumeFormatted": "1.66%",
"merchantId": "W5JCF4700I6ZE6KAJBKYEIAAI",
"merchantName": "Taco Tuesday, Inc.",
"dbaName": "Don Juaquin's",
"statementDate": "2023-09-30T04:28:21Z",
"volume": 486611.83,
"volumeFormatted": "486,611.83",
"transactionCount": 9628,
"interchange": 6175.64,
"interchangeFormatted": "6,175.64",
"interchangeOnVolume": 0.0127,
"interchangeOnVolumeFormatted": "1.27%",
"assessments": 653.05,
"assessmentsFormatted": "653.05",
"assessmentsOnVolume": 0.0013,
"assessmentsOnVolumeFormatted": "0.13%",
"partnerCommission": 332.88,
"partnerCommissionFormatted": "332.88",
"buyRate": 569.85,
"buyRateFormatted": "569.85",
"hardCosts": 215.83,
"hardCostsFormatted": "215.83"
},
{
"id": "UV7LJ4LR4AI65OUEAJBKYEIAAM",
"invoiceId": "UV7DEJLR4A700OUEAJBKYEIAAM",
"totalFees": 1237.88,
"totalFeesFormatted": "1,237.88",
"totalFeesOnVolume": 0.02,
"totalFeesOnVolumeFormatted": "2%",
"merchantId": "EINES7004I6ZDWLAJBKYEIAAM",
"merchantName": "Kneaders",
"dbaName": "Kneaders",
"statementDate": "2023-09-30T04:28:17Z",
"volume": 61871.22,
"volumeFormatted": "61,871.22",
"transactionCount": 2547,
"interchange": 887.84,
"interchangeFormatted": "887.84",
"interchangeOnVolume": 0.0143,
"interchangeOnVolumeFormatted": "1.43%",
"assessments": 81.65,
"assessmentsFormatted": "81.65",
"assessmentsOnVolume": 0.0013,
"assessmentsOnVolumeFormatted": "0.13%",
"partnerCommission": 62.27,
"partnerCommissionFormatted": "62.27",
"buyRate": 130.66,
"buyRateFormatted": "130.66",
"hardCosts": 54.7,
"hardCostsFormatted": "54.70"
},
{
"id": "UV7WP6LR4AI65OUEAJBKYEIAAM",
"invoiceId": "UV7DEJLR4A700OUEAJBKYEIAAM",
"totalFees": 5,
"totalFeesFormatted": "5.00",
"totalFeesOnVolume": 0,
"totalFeesOnVolumeFormatted": "0%",
"merchantId": "2IHUDFHI7006ZKK3AJBKYEIAAQ",
"merchantName": "DP Cheesesteaks",
"dbaName": "DP Cheesesteaks",
"statementDate": "2023-09-30T04:28:53Z",
"volume": 0,
"volumeFormatted": "0.00",
"transactionCount": 0,
"interchange": 0,
"interchangeFormatted": "0.00",
"interchangeOnVolume": 0,
"interchangeOnVolumeFormatted": "0%",
"assessments": 0,
"assessmentsFormatted": "0.00",
"assessmentsOnVolume": 0,
"assessmentsOnVolumeFormatted": "0%",
"partnerCommission": 0,
"partnerCommissionFormatted": "0.00",
"buyRate": 5,
"buyRateFormatted": "5.00",
"hardCosts": 0,
"hardCostsFormatted": "0.00"
}
],
"adjustments": [],
"disbursements": [
{
"id": "CP7VPK3STQI65OUEAJBKYEIAAM",
"timestamp": "2023-10-24T19:08:11Z",
"transactionType": "charge",
"paymentType": "ACH",
"maskedPan": "*****0000",
"pending": false,
"approved": true,
"responseDescription": "",
"amount": 395.15,
"amountFormatted": "395.15"
}
]
}
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns detailed information about a specific partner statement. Aggregate data is returned along with line item level data for each underlying merchant statement.
Use the merchant invoice id with the Merchant Statement Detail API and the Partner Commission Breakdown API to get the merchant statement and the card brand fee cost breakdown respectively.
Merchant Invoices
Merchant Invoices Example:
Linux/Mac OS: ./blockchyp -test -cmd="merchant-invoices" -merchantId="<ID>"
Windows: ./blockchyp.exe -test -cmd="merchant-invoices" -merchantId="<ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func merchantInvoicesExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantInvoiceListRequest{}
response, err := client.MerchantInvoices(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantInvoiceListRequest request = new MerchantInvoiceListRequest
{
};
// Run the transaction.
MerchantInvoiceListResponse response = await blockchyp.MerchantInvoicesAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantInvoiceListRequest;
import com.blockchyp.client.dto.MerchantInvoiceListResponse;
public class MerchantInvoicesExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantInvoiceListRequest request = new MerchantInvoiceListRequest();
// Send the request
MerchantInvoiceListResponse response = client.merchantInvoices(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::merchantInvoices($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.merchantInvoices(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.merchant_invoices(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.merchantInvoices({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client merchantInvoicesWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.merchantInvoices(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"invoices": [
{
"id": "YXIYN627JEI65FBWAJBKYEIAAQ",
"dateCreated": "2023-09-30T04:28:21Z",
"grandTotal": 8058.21,
"grandTotalFormatted": "8,058.21",
"status": "paid",
"invoiceType": "statement",
"paid": true
},
{
"id": "OEXJSDSIPII65NU4AJBKYEIAAM",
"dateCreated": "2023-09-01T03:48:48Z",
"grandTotal": 7623.67,
"grandTotalFormatted": "7,623.67",
"status": "paid",
"invoiceType": "statement",
"paid": true
},
{
"id": "IC2W2YBQDYI65OGFAJBKYEIAAY",
"dateCreated": "2023-08-01T03:48:23Z",
"grandTotal": 7927.52,
"grandTotalFormatted": "7,927.52",
"status": "paid",
"invoiceType": "statement",
"paid": true
}
]
}
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters (startDate
and endDate
) can filter statements to a specific date range.
The list of statements returns basic information about statements like volume, transaction count, and commissions earned.
Use the id
returned with each statement summary with the Partner Statement Detail API to pull down full details.
Merchant Invoice Detail
Merchant Invoice Detail Example:
Linux/Mac OS: ./blockchyp -test -cmd="merchant-invoice-detail" -invoiceId="<STATEMENT_ID>"
Windows: ./blockchyp.exe -test -cmd="merchant-invoice-detail" -invoiceId="<STATEMENT_ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func merchantInvoiceDetailExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.MerchantInvoiceDetailRequest{}
response, err := client.MerchantInvoiceDetail(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
MerchantInvoiceDetailRequest request = new MerchantInvoiceDetailRequest
{
};
// Run the transaction.
MerchantInvoiceDetailResponse response = await blockchyp.MerchantInvoiceDetailAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.MerchantInvoiceDetailRequest;
import com.blockchyp.client.dto.MerchantInvoiceDetailResponse;
public class MerchantInvoiceDetailExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
MerchantInvoiceDetailRequest request = new MerchantInvoiceDetailRequest();
// Send the request
MerchantInvoiceDetailResponse response = client.merchantInvoiceDetail(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::merchantInvoiceDetail($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.merchantInvoiceDetail(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.merchant_invoice_detail(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.merchantInvoiceDetail({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client merchantInvoiceDetailWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.merchantInvoiceDetail(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "",
"id": "YXIYN627JEI6700WAJBKYEIAAQ",
"merchantId": "W5JCF4NVX700ZE6KAJBKYEIAAI",
"corporateName": "Improv Olympic",
"dbaName": "Improv Olympic",
"dateCreated": "2023-09-30T04:28:21Z",
"status": "paid",
"invoiceType": "statement",
"pricingType": "interchange",
"paid": true,
"grandTotal": 8058.21,
"grandTotalFormatted": "8,058.21",
"subtotal": 8058.21,
"subotalFormatted": "8,058.21",
"taxTotal": 0,
"taxTotalFormatted": "0.00",
"shippingCost": 0,
"shippingCostFormatted": "0.00",
"balanceDue": 0,
"balanceDueFormatted": "0.00",
"shippingAddress": {
"address1": "1060 W Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60446",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"billingAddress": {
"address1": "1060 W Addison",
"address2": "",
"city": "Chicago",
"stateOrProvince": "IL",
"postalCode": "60446",
"countryCode": "",
"latitude": 0,
"longitude": 0
},
"lineItems": [
{
"id": "SIRMMLDU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Interchange Fees",
"explanation": "These are fees the credit card brands charge. Seems fair. They work hard on those logos.",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 6175.64,
"priceExtendedFormatted": "6,175.64",
"lineItems": [
{
"id": "SKHU4WTU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Visa",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 2247.73,
"priceExtendedFormatted": "2,247.73",
"lineItems": [
{
"id": "SISHUOTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS Electronic",
"explanation": "",
"transactionCount": 7,
"volume": 149.85,
"volumeFormatted": "149.85",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.011,
"transactionPercentageFormatted": "1.1%",
"price": 1.6400000000000001,
"priceFormatted": "149.85 @ 1.1%",
"priceExtended": 1.6400000000000001,
"priceExtendedFormatted": "1.64",
"lineItems": null
},
{
"id": "SISR7RTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS Credit Voucher Non PT Credit",
"explanation": "",
"transactionCount": -1,
"volume": -122.64,
"volumeFormatted": "-122.64",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0176,
"transactionPercentageFormatted": "1.76%",
"price": -2.16,
"priceFormatted": "-122.64 @ 1.76%",
"priceExtended": -2.16,
"priceExtendedFormatted": "-2.16",
"lineItems": null
},
{
"id": "SITGU4DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS CPS Retail Check Debit",
"explanation": "",
"transactionCount": 395,
"volume": 16704.31,
"volumeFormatted": "16,704.31",
"perTransactionFee": 0.15,
"perTransactionFeeFormatted": "0.15",
"transactionPercentage": 0.008,
"transactionPercentageFormatted": "0.8%",
"price": 192.9,
"priceFormatted": "$16,704.31 @ 0.8%\n395 x $0.15",
"priceExtended": 192.9,
"priceExtendedFormatted": "192.90",
"lineItems": null
},
{
"id": "SITVVLDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS CPS Small Ticket Debit",
"explanation": "",
"transactionCount": 108,
"volume": 1029.89,
"volumeFormatted": "1,029.89",
"perTransactionFee": 0.04,
"perTransactionFeeFormatted": "0.04",
"transactionPercentage": 0.0155,
"transactionPercentageFormatted": "1.55%",
"price": 20.29,
"priceFormatted": "$1,029.89 @ 1.55%\n108 x $0.04",
"priceExtended": 20.29,
"priceExtendedFormatted": "20.29",
"lineItems": null
},
{
"id": "SIUB74DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Tr1 Prod 2",
"explanation": "",
"transactionCount": 3,
"volume": 50.23,
"volumeFormatted": "50.23",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.019,
"transactionPercentageFormatted": "1.9%",
"price": 1.26,
"priceFormatted": "$50.23 @ 1.9%\n3 x $0.10",
"priceExtended": 1.26,
"priceExtendedFormatted": "1.26",
"lineItems": null
},
{
"id": "SIUOC7TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS US Corporate Card - Card Present",
"explanation": "",
"transactionCount": 1,
"volume": 92.43,
"volumeFormatted": "92.43",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.025,
"transactionPercentageFormatted": "2.5%",
"price": 2.41,
"priceFormatted": "$92.43 @ 2.5%\n1 x $0.10",
"priceExtended": 2.41,
"priceExtendedFormatted": "2.41",
"lineItems": null
},
{
"id": "SIU3E4DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS US Purchasing Card - Card Present",
"explanation": "",
"transactionCount": 2,
"volume": 108.21,
"volumeFormatted": "108.21",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.025,
"transactionPercentageFormatted": "2.5%",
"price": 2.9,
"priceFormatted": "$108.21 @ 2.5%\n2 x $0.10",
"priceExtended": 2.9,
"priceExtendedFormatted": "2.90",
"lineItems": null
},
{
"id": "SIVFAGDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS InterReg Corporate",
"explanation": "",
"transactionCount": 1,
"volume": 66.89,
"volumeFormatted": "66.89",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.02,
"transactionPercentageFormatted": "2%",
"price": 1.34,
"priceFormatted": "66.89 @ 2%",
"priceExtended": 1.34,
"priceExtendedFormatted": "1.34",
"lineItems": null
},
{
"id": "SIVVLHTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Purchase Retail Prepaid",
"explanation": "",
"transactionCount": 17,
"volume": 405.08,
"volumeFormatted": "405.08",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0215,
"transactionPercentageFormatted": "2.15%",
"price": 10.41,
"priceFormatted": "$405.08 @ 2.15%\n17 x $0.10",
"priceExtended": 10.41,
"priceExtendedFormatted": "10.41",
"lineItems": null
},
{
"id": "SIWYH6TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Tr4 Prod 2",
"explanation": "",
"transactionCount": 14,
"volume": 2233.69,
"volumeFormatted": "2,233.69",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.022,
"transactionPercentageFormatted": "2.2%",
"price": 50.54,
"priceFormatted": "$2,233.69 @ 2.2%\n14 x $0.10",
"priceExtended": 50.54,
"priceExtendedFormatted": "50.54",
"lineItems": null
},
{
"id": "SIXRNITU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Tr 5 Prod 2",
"explanation": "",
"transactionCount": 9,
"volume": 5741.09,
"volumeFormatted": "5,741.09",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0225,
"transactionPercentageFormatted": "2.25%",
"price": 130.08,
"priceFormatted": "$5,741.09 @ 2.25%\n9 x $0.10",
"priceExtended": 130.08,
"priceExtendedFormatted": "130.08",
"lineItems": null
},
{
"id": "SIYFMIDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS VT Product 2",
"explanation": "",
"transactionCount": 135,
"volume": 7432.45,
"volumeFormatted": "7,432.45",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0151,
"transactionPercentageFormatted": "1.51%",
"price": 125.74,
"priceFormatted": "$7,432.45 @ 1.51%\n135 x $0.10",
"priceExtended": 125.74,
"priceExtendedFormatted": "125.74",
"lineItems": null
},
{
"id": "SIYSIJDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS VTR Product 2",
"explanation": "",
"transactionCount": 77,
"volume": 5828.89,
"volumeFormatted": "5,828.89",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0165,
"transactionPercentageFormatted": "1.65%",
"price": 103.82,
"priceFormatted": "$5,828.89 @ 1.65%\n77 x $0.10",
"priceExtended": 103.82,
"priceExtendedFormatted": "103.82",
"lineItems": null
},
{
"id": "SIZWGEDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS VIN Product 2",
"explanation": "",
"transactionCount": 462,
"volume": 25098.56,
"volumeFormatted": "25,098.56",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0165,
"transactionPercentageFormatted": "1.65%",
"price": 460.15,
"priceFormatted": "$25,098.56 @ 1.65%\n462 x $0.10",
"priceExtended": 460.15,
"priceExtendedFormatted": "460.15",
"lineItems": null
},
{
"id": "SJJE3QDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS Premium Card",
"explanation": "",
"transactionCount": 2,
"volume": 118.17,
"volumeFormatted": "118.17",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.018,
"transactionPercentageFormatted": "1.8%",
"price": 2.13,
"priceFormatted": "118.17 @ 1.8%",
"priceExtended": 2.13,
"priceExtendedFormatted": "2.13",
"lineItems": null
},
{
"id": "SJJYHNTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS InterReg Super Premium",
"explanation": "",
"transactionCount": 1,
"volume": 20.06,
"volumeFormatted": "20.06",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0197,
"transactionPercentageFormatted": "1.97%",
"price": 0.4,
"priceFormatted": "20.06 @ 1.97%",
"priceExtended": 0.4,
"priceExtendedFormatted": "0.40",
"lineItems": null
},
{
"id": "SJKTHFTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Tr2 Prod 2",
"explanation": "",
"transactionCount": 47,
"volume": 2525.34,
"volumeFormatted": "2,525.34",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0205,
"transactionPercentageFormatted": "2.05%",
"price": 56.54,
"priceFormatted": "$2,525.34 @ 2.05%\n47 x $0.10",
"priceExtended": 56.54,
"priceExtendedFormatted": "56.54",
"lineItems": null
},
{
"id": "SJK22MDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Tr3 Prod 2",
"explanation": "",
"transactionCount": 13,
"volume": 1178.42,
"volumeFormatted": "1,178.42",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.021,
"transactionPercentageFormatted": "2.1%",
"price": 26.04,
"priceFormatted": "$1,178.42 @ 2.1%\n13 x $0.10",
"priceExtended": 26.04,
"priceExtendedFormatted": "26.04",
"lineItems": null
},
{
"id": "SJLW7HTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS InterReg Regulated Debit",
"explanation": "",
"transactionCount": 1,
"volume": 17.83,
"volumeFormatted": "17.83",
"perTransactionFee": 0.22,
"perTransactionFeeFormatted": "0.22",
"transactionPercentage": 0.0005,
"transactionPercentageFormatted": "0.05%",
"price": 0.23,
"priceFormatted": "$17.83 @ 0.05%\n1 x $0.22",
"priceExtended": 0.23,
"priceExtendedFormatted": "0.23",
"lineItems": null
},
{
"id": "SJMGLVDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS CPS Small Ticket Pp",
"explanation": "",
"transactionCount": 59,
"volume": 521.88,
"volumeFormatted": "521.88",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.016,
"transactionPercentageFormatted": "1.6%",
"price": 11.3,
"priceFormatted": "$521.88 @ 1.6%\n59 x $0.05",
"priceExtended": 11.3,
"priceExtendedFormatted": "11.30",
"lineItems": null
},
{
"id": "SJMTTIDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS CPS Small Ticket Regulated",
"explanation": "",
"transactionCount": 704,
"volume": 6734.91,
"volumeFormatted": "6,734.91",
"perTransactionFee": 0.22,
"perTransactionFeeFormatted": "0.22",
"transactionPercentage": 0.0005,
"transactionPercentageFormatted": "0.05%",
"price": 158.76,
"priceFormatted": "$6,734.91 @ 0.05%\n704 x $0.22",
"priceExtended": 158.76,
"priceExtendedFormatted": "158.76",
"lineItems": null
},
{
"id": "SJNANPTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS US Regulated Debit",
"explanation": "",
"transactionCount": 3228,
"volume": 168064.33,
"volumeFormatted": "168,064.33",
"perTransactionFee": 0.22,
"perTransactionFeeFormatted": "0.22",
"transactionPercentage": 0.0005,
"transactionPercentageFormatted": "0.05%",
"price": 794.27,
"priceFormatted": "$168,064.33 @ 0.05%\n3,228 x $0.22",
"priceExtended": 794.27,
"priceExtendedFormatted": "794.27",
"lineItems": null
},
{
"id": "SJNUHRTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS CPS Retail Pp",
"explanation": "",
"transactionCount": 147,
"volume": 5200.96,
"volumeFormatted": "5,200.96",
"perTransactionFee": 0.15,
"perTransactionFeeFormatted": "0.15",
"transactionPercentage": 0.0115,
"transactionPercentageFormatted": "1.15%",
"price": 81.9,
"priceFormatted": "$5,200.96 @ 1.15%\n147 x $0.15",
"priceExtended": 81.9,
"priceExtendedFormatted": "81.90",
"lineItems": null
},
{
"id": "SJN6L3DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "VS Business Card CP Debit",
"explanation": "",
"transactionCount": 21,
"volume": 748.4,
"volumeFormatted": "748.40",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.017,
"transactionPercentageFormatted": "1.7%",
"price": 14.84,
"priceFormatted": "$748.40 @ 1.7%\n21 x $0.10",
"priceExtended": 14.84,
"priceExtendedFormatted": "14.84",
"lineItems": null
}
]
},
{
"id": "SKIIHRDU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Mastercard",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 1886.79,
"priceExtendedFormatted": "1,886.79",
"lineItems": [
{
"id": "SJOJH2DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Merit III Credit",
"explanation": "",
"transactionCount": 53,
"volume": 2880.67,
"volumeFormatted": "2,880.67",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0165,
"transactionPercentageFormatted": "1.65%",
"price": 52.81,
"priceFormatted": "$2,880.67 @ 1.65%\n53 x $0.10",
"priceExtended": 52.81,
"priceExtendedFormatted": "52.81",
"lineItems": null
},
{
"id": "SJOUL7TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Corporate Data Rate 1",
"explanation": "",
"transactionCount": 17,
"volume": 741.57,
"volumeFormatted": "741.57",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0265,
"transactionPercentageFormatted": "2.65%",
"price": 21.32,
"priceFormatted": "$741.57 @ 2.65%\n17 x $0.10",
"priceExtended": 21.32,
"priceExtendedFormatted": "21.32",
"lineItems": null
},
{
"id": "SJPBD4DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Commercial Rate 1 Large Market",
"explanation": "",
"transactionCount": 14,
"volume": 1254.57,
"volumeFormatted": "1,254.57",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.027,
"transactionPercentageFormatted": "2.7%",
"price": 35.29,
"priceFormatted": "$1,254.57 @ 2.7%\n14 x $0.10",
"priceExtended": 35.29,
"priceExtendedFormatted": "35.29",
"lineItems": null
},
{
"id": "SJPG3PDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Enhanced Merit III Base",
"explanation": "",
"transactionCount": 170,
"volume": 8911.28,
"volumeFormatted": "8,911.28",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.018,
"transactionPercentageFormatted": "1.8%",
"price": 177.26,
"priceFormatted": "$8,911.28 @ 1.8%\n170 x $0.10",
"priceExtended": 177.26,
"priceExtendedFormatted": "177.26",
"lineItems": null
},
{
"id": "SJPRT5TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Merit III Debit",
"explanation": "",
"transactionCount": 236,
"volume": 7732.66,
"volumeFormatted": "7,732.66",
"perTransactionFee": 0.15,
"perTransactionFeeFormatted": "0.15",
"transactionPercentage": 0.0105,
"transactionPercentageFormatted": "1.05%",
"price": 116.64,
"priceFormatted": "$7,732.66 @ 1.05%\n236 x $0.15",
"priceExtended": 116.64,
"priceExtendedFormatted": "116.64",
"lineItems": null
},
{
"id": "SJREIKDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "MC Consumer Credit Refund Group 4",
"explanation": "",
"transactionCount": -1,
"volume": -50.16,
"volumeFormatted": "-50.16",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0175,
"transactionPercentageFormatted": "1.75%",
"price": -0.88,
"priceFormatted": "-50.16 @ 1.75%",
"priceExtended": -0.88,
"priceExtendedFormatted": "-0.88",
"lineItems": null
},
{
"id": "SJRYUBDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC World Merit III",
"explanation": "",
"transactionCount": 122,
"volume": 8218.31,
"volumeFormatted": "8,218.31",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.019,
"transactionPercentageFormatted": "1.9%",
"price": 168.41,
"priceFormatted": "$8,218.31 @ 1.9%\n122 x $0.10",
"priceExtended": 168.41,
"priceExtendedFormatted": "168.41",
"lineItems": null
},
{
"id": "SJSGDEDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC World Elite Merit III",
"explanation": "",
"transactionCount": 368,
"volume": 27357.29,
"volumeFormatted": "27,357.29",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.023,
"transactionPercentageFormatted": "2.3%",
"price": 666,
"priceFormatted": "$27,357.29 @ 2.3%\n368 x $0.10",
"priceExtended": 666,
"priceExtendedFormatted": "666.00",
"lineItems": null
},
{
"id": "SJTCAKTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Business Level 4 Data Rate I",
"explanation": "",
"transactionCount": 1,
"volume": 33.44,
"volumeFormatted": "33.44",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0295,
"transactionPercentageFormatted": "2.95%",
"price": 1.09,
"priceFormatted": "$33.44 @ 2.95%\n1 x $0.10",
"priceExtended": 1.09,
"priceExtendedFormatted": "1.09",
"lineItems": null
},
{
"id": "SJTQI7DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Business Level 1 Data Rate I",
"explanation": "",
"transactionCount": 1,
"volume": 45.68,
"volumeFormatted": "45.68",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0265,
"transactionPercentageFormatted": "2.65%",
"price": 1.31,
"priceFormatted": "$45.68 @ 2.65%\n1 x $0.10",
"priceExtended": 1.31,
"priceExtendedFormatted": "1.31",
"lineItems": null
},
{
"id": "SJUXIZDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Business Level 5 Data Rate I",
"explanation": "",
"transactionCount": 2,
"volume": 77.86,
"volumeFormatted": "77.86",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.03,
"transactionPercentageFormatted": "3%",
"price": 2.5300000000000002,
"priceFormatted": "$77.86 @ 3%\n2 x $0.10",
"priceExtended": 2.5300000000000002,
"priceExtendedFormatted": "2.53",
"lineItems": null
},
{
"id": "SJVBZ7DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Merit 3 Prepaid",
"explanation": "",
"transactionCount": 54,
"volume": 1187.43,
"volumeFormatted": "1,187.43",
"perTransactionFee": 0.15,
"perTransactionFeeFormatted": "0.15",
"transactionPercentage": 0.0115,
"transactionPercentageFormatted": "1.15%",
"price": 21.75,
"priceFormatted": "$1,187.43 @ 1.15%\n54 x $0.15",
"priceExtended": 21.75,
"priceExtendedFormatted": "21.75",
"lineItems": null
},
{
"id": "SJVTOGDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Small Ticket Card Present",
"explanation": "",
"transactionCount": 3,
"volume": 11.56,
"volumeFormatted": "11.56",
"perTransactionFee": 0.02,
"perTransactionFeeFormatted": "0.02",
"transactionPercentage": 0.0165,
"transactionPercentageFormatted": "1.65%",
"price": 0.24,
"priceFormatted": "$11.56 @ 1.65%\n3 x $0.02",
"priceExtended": 0.24,
"priceExtendedFormatted": "0.24",
"lineItems": null
},
{
"id": "SJWPPWDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC World Small Ticket Card Present",
"explanation": "",
"transactionCount": 1,
"volume": 4.45,
"volumeFormatted": "4.45",
"perTransactionFee": 0.02,
"perTransactionFeeFormatted": "0.02",
"transactionPercentage": 0.019,
"transactionPercentageFormatted": "1.9%",
"price": 0.1,
"priceFormatted": "$4.45 @ 1.9%\n1 x $0.02",
"priceExtended": 0.1,
"priceExtendedFormatted": "0.10",
"lineItems": null
},
{
"id": "SJW6HSDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC World Elite Small Ticket Card Present",
"explanation": "",
"transactionCount": 8,
"volume": 29.06,
"volumeFormatted": "29.06",
"perTransactionFee": 0.02,
"perTransactionFeeFormatted": "0.02",
"transactionPercentage": 0.023,
"transactionPercentageFormatted": "2.3%",
"price": 0.84,
"priceFormatted": "$29.06 @ 2.3%\n8 x $0.02",
"priceExtended": 0.84,
"priceExtendedFormatted": "0.84",
"lineItems": null
},
{
"id": "SJXDSVDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "MC Consumer Rate 2-Card Present Core",
"explanation": "",
"transactionCount": 8,
"volume": 409.93,
"volumeFormatted": "409.93",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.011,
"transactionPercentageFormatted": "1.1%",
"price": 4.52,
"priceFormatted": "409.93 @ 1.1%",
"priceExtended": 4.52,
"priceExtendedFormatted": "4.52",
"lineItems": null
},
{
"id": "SJXRIZDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC High Value Merit III Base 1",
"explanation": "",
"transactionCount": 43,
"volume": 5656.44,
"volumeFormatted": "5,656.44",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.023,
"transactionPercentageFormatted": "2.3%",
"price": 134.42,
"priceFormatted": "$5,656.44 @ 2.3%\n43 x $0.10",
"priceExtended": 134.42,
"priceExtendedFormatted": "134.42",
"lineItems": null
},
{
"id": "SKCCGGDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC Business Level 2 Data Rate I",
"explanation": "",
"transactionCount": 1,
"volume": 530.87,
"volumeFormatted": "530.87",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.028,
"transactionPercentageFormatted": "2.8%",
"price": 14.96,
"priceFormatted": "$530.87 @ 2.8%\n1 x $0.10",
"priceExtended": 14.96,
"priceExtendedFormatted": "14.96",
"lineItems": null
},
{
"id": "SKCWQXTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "MC US Cons Regulated POS Debit w/Fraud Adj",
"explanation": "",
"transactionCount": 1956,
"volume": 75924.61,
"volumeFormatted": "75,924.61",
"perTransactionFee": 0.22,
"perTransactionFeeFormatted": "0.22",
"transactionPercentage": 0.0005,
"transactionPercentageFormatted": "0.05%",
"price": 468.18,
"priceFormatted": "$75,924.61 @ 0.05%\n1,956 x $0.22",
"priceExtended": 468.18,
"priceExtendedFormatted": "468.18",
"lineItems": null
}
]
},
{
"id": "SKIQSIDU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "American Express",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 418.89,
"priceExtendedFormatted": "418.89",
"lineItems": [
{
"id": "SKC6Z2DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "AM Retail Tier 1",
"explanation": "",
"transactionCount": 106,
"volume": 3483.88,
"volumeFormatted": "3,483.88",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.016,
"transactionPercentageFormatted": "1.6%",
"price": 66.31,
"priceFormatted": "$3,483.88 @ 1.6%\n106 x $0.10",
"priceExtended": 66.31,
"priceExtendedFormatted": "66.31",
"lineItems": null
},
{
"id": "SKDHTWDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "AM Retail Tier 2",
"explanation": "",
"transactionCount": 50,
"volume": 9545.76,
"volumeFormatted": "9,545.76",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0195,
"transactionPercentageFormatted": "1.95%",
"price": 191.15,
"priceFormatted": "$9,545.76 @ 1.95%\n50 x $0.10",
"priceExtended": 191.15,
"priceExtendedFormatted": "191.15",
"lineItems": null
},
{
"id": "SKDQXDDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "AM Retail Tier 3",
"explanation": "",
"transactionCount": 3,
"volume": 6693.79,
"volumeFormatted": "6,693.79",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.024,
"transactionPercentageFormatted": "2.4%",
"price": 160.95,
"priceFormatted": "$6,693.79 @ 2.4%\n3 x $0.10",
"priceExtended": 160.95,
"priceExtendedFormatted": "160.95",
"lineItems": null
},
{
"id": "SKEOQ5TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "AM Prepaid Tier 1",
"explanation": "",
"transactionCount": 1,
"volume": 27.85,
"volumeFormatted": "27.85",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0135,
"transactionPercentageFormatted": "1.35%",
"price": 0.48,
"priceFormatted": "$27.85 @ 1.35%\n1 x $0.10",
"priceExtended": 0.48,
"priceExtendedFormatted": "0.48",
"lineItems": null
}
]
},
{
"id": "SKJSGITU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Discover",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 462.86,
"priceExtendedFormatted": "462.86",
"lineItems": [
{
"id": "SKFJMHDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS PSL Retail Rewards",
"explanation": "",
"transactionCount": 191,
"volume": 10693.91,
"volumeFormatted": "10,693.91",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0172,
"transactionPercentageFormatted": "1.72%",
"price": 203.06,
"priceFormatted": "$10,693.91 @ 1.72%\n191 x $0.10",
"priceExtended": 203.06,
"priceExtendedFormatted": "203.06",
"lineItems": null
},
{
"id": "SKFQRGTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS PSL Retail DB",
"explanation": "",
"transactionCount": 24,
"volume": 821.15,
"volumeFormatted": "821.15",
"perTransactionFee": 0.16,
"perTransactionFeeFormatted": "0.16",
"transactionPercentage": 0.011,
"transactionPercentageFormatted": "1.1%",
"price": 12.89,
"priceFormatted": "$821.15 @ 1.1%\n24 x $0.16",
"priceExtended": 12.89,
"priceExtendedFormatted": "12.89",
"lineItems": null
},
{
"id": "SKGB6HTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS Commercial Electronic Submission Level",
"explanation": "",
"transactionCount": 39,
"volume": 2271.61,
"volumeFormatted": "2,271.61",
"perTransactionFee": 0.15,
"perTransactionFeeFormatted": "0.15",
"transactionPercentage": 0.0245,
"transactionPercentageFormatted": "2.45%",
"price": 61.5,
"priceFormatted": "$2,271.61 @ 2.45%\n39 x $0.15",
"priceExtended": 61.5,
"priceExtendedFormatted": "61.50",
"lineItems": null
},
{
"id": "SKGRGQTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS PSL - Retail Prepaid",
"explanation": "",
"transactionCount": 2,
"volume": 83.57,
"volumeFormatted": "83.57",
"perTransactionFee": 0.16,
"perTransactionFeeFormatted": "0.16",
"transactionPercentage": 0.0112,
"transactionPercentageFormatted": "1.12%",
"price": 1.25,
"priceFormatted": "$83.57 @ 1.12%\n2 x $0.16",
"priceExtended": 1.25,
"priceExtendedFormatted": "1.25",
"lineItems": null
},
{
"id": "SKGXGCTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS PSL Retail PR",
"explanation": "",
"transactionCount": 36,
"volume": 10176.1,
"volumeFormatted": "10,176.10",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0174,
"transactionPercentageFormatted": "1.74%",
"price": 180.69,
"priceFormatted": "$10,176.10 @ 1.74%\n36 x $0.10",
"priceExtended": 180.69,
"priceExtendedFormatted": "180.69",
"lineItems": null
},
{
"id": "SKHFGVTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "DS Retail (Premium Plus)",
"explanation": "",
"transactionCount": 3,
"volume": 140.99,
"volumeFormatted": "140.99",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0225,
"transactionPercentageFormatted": "2.25%",
"price": 3.4699999999999998,
"priceFormatted": "$140.99 @ 2.25%\n3 x $0.10",
"priceExtended": 3.4699999999999998,
"priceExtendedFormatted": "3.47",
"lineItems": null
}
]
},
{
"id": "SKKAFETU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Debit",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 1159.37,
"priceExtendedFormatted": "1,159.37",
"lineItems": [
{
"id": "SI2EVDDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Visa Signature Preferred Product 2",
"explanation": "",
"transactionCount": 627,
"volume": 49779.42,
"volumeFormatted": "49,779.42",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.021,
"transactionPercentageFormatted": "2.1%",
"price": 1108,
"priceFormatted": "$49,779.42 @ 2.1%\n627 x $0.10",
"priceExtended": 1108,
"priceExtendedFormatted": "1,108.00",
"lineItems": null
},
{
"id": "SI3AFIDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Visa VIQ Product 2",
"explanation": "",
"transactionCount": 22,
"volume": 1942.96,
"volumeFormatted": "1,942.96",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.021,
"transactionPercentageFormatted": "2.1%",
"price": 42.98,
"priceFormatted": "$1,942.96 @ 2.1%\n22 x $0.10",
"priceExtended": 42.98,
"priceExtendedFormatted": "42.98",
"lineItems": null
},
{
"id": "SJSOWBTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Commercial Data Rate 1 Level 3",
"explanation": "",
"transactionCount": 12,
"volume": 252.5,
"volumeFormatted": "252.50",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.0285,
"transactionPercentageFormatted": "2.85%",
"price": 8.39,
"priceFormatted": "$252.50 @ 2.85%\n12 x $0.10",
"priceExtended": 8.39,
"priceExtendedFormatted": "8.39",
"lineItems": null
}
]
}
]
},
{
"id": "SKKVUUTU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Other Passthrough Fees",
"explanation": "These are other bank and card brand fees we have no control over.",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 657.56,
"priceExtendedFormatted": "657.56",
"lineItems": [
{
"id": "SKPZ7PDU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Visa",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 404.3,
"priceExtendedFormatted": "404.30",
"lineItems": [
{
"id": "SKLL5WDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS-IAF",
"explanation": "",
"transactionCount": 13,
"volume": 454.15,
"volumeFormatted": "454.15",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0045,
"transactionPercentageFormatted": "0.45%",
"price": 2.05,
"priceFormatted": "454.15 @ 0.45%",
"priceExtended": 2.05,
"priceExtendedFormatted": "2.05",
"lineItems": null
},
{
"id": "SKLXH4DU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS-ASSMNT CREDIT",
"explanation": "",
"transactionCount": 1414,
"volume": 102098.64,
"volumeFormatted": "102,098.64",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0014,
"transactionPercentageFormatted": "0.14%",
"price": 142.96,
"priceFormatted": "102,098.64 @ 0.14%",
"priceExtended": 142.96,
"priceExtendedFormatted": "142.96",
"lineItems": null
},
{
"id": "SKMDZ5DU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "VS-ASSMNT DEBIT",
"explanation": "",
"transactionCount": 4689,
"volume": 199695.61,
"volumeFormatted": "199,695.61",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0013,
"transactionPercentageFormatted": "0.13%",
"price": 259.29,
"priceFormatted": "199,695.61 @ 0.13%",
"priceExtended": 259.29,
"priceExtendedFormatted": "259.29",
"lineItems": null
}
]
},
{
"id": "SKRPJKTU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Mastercard",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 186.8,
"priceExtendedFormatted": "186.80",
"lineItems": [
{
"id": "SKMPSADU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "MC-ACQ Brnd Vol ABV",
"explanation": "",
"transactionCount": 4,
"volume": 8898.36,
"volumeFormatted": "8,898.36",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0014,
"transactionPercentageFormatted": "0.14%",
"price": 12.46,
"priceFormatted": "8,898.36 @ 0.14%",
"priceExtended": 12.46,
"priceExtendedFormatted": "12.46",
"lineItems": null
},
{
"id": "SKM43CTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "MC-ACQ Brand Volume",
"explanation": "",
"transactionCount": 3066,
"volume": 132361.82,
"volumeFormatted": "132,361.82",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0013,
"transactionPercentageFormatted": "0.13%",
"price": 171.88,
"priceFormatted": "132,361.82 @ 0.13%",
"priceExtended": 171.88,
"priceExtendedFormatted": "171.88",
"lineItems": null
},
{
"id": "SKNRYJTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "MC-CRBDR - Domestic",
"explanation": "",
"transactionCount": 8,
"volume": 409.93,
"volumeFormatted": "409.93",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.006,
"transactionPercentageFormatted": "0.6%",
"price": 2.46,
"priceFormatted": "409.93 @ 0.6%",
"priceExtended": 2.46,
"priceExtendedFormatted": "2.46",
"lineItems": null
}
]
},
{
"id": "SKSBLWDU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "American Express",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 32.6,
"priceExtendedFormatted": "32.60",
"lineItems": [
{
"id": "SKN3NYDU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "AM-AM USASSMNTFEE",
"explanation": "",
"transactionCount": 160,
"volume": 19751.28,
"volumeFormatted": "19,751.28",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.00165,
"transactionPercentageFormatted": "0.165%",
"price": 32.6,
"priceFormatted": "19,751.28 @ 0.165%",
"priceExtended": 32.6,
"priceExtendedFormatted": "32.60",
"lineItems": null
}
]
},
{
"id": "SMF43VTU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Discover",
"explanation": "",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 33.86,
"priceExtendedFormatted": "33.86",
"lineItems": [
{
"id": "SKPDDGTU6MI65KNZTYA4RH54WI",
"lineType": "volume",
"productId": "",
"quantity": 1,
"description": "DS-DS Assessment",
"explanation": "",
"transactionCount": 295,
"volume": 24187.33,
"volumeFormatted": "24,187.33",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0.0014,
"transactionPercentageFormatted": "0.14%",
"price": 33.86,
"priceFormatted": "24,187.33 @ 0.14%",
"priceExtended": 33.86,
"priceExtendedFormatted": "33.86",
"lineItems": null
}
]
}
]
},
{
"id": "SMHGCITU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "BlockChyp Fees",
"explanation": "These are the fees BlockChyp collects. We use them to keep the office stocked with La Croix and board games.",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 1215.01,
"priceExtendedFormatted": "1,215.01",
"lineItems": [
{
"id": "SMJQHPDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-VS",
"explanation": "",
"transactionCount": 1320,
"volume": 90021.36,
"volumeFormatted": "90,021.36",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 156.02,
"priceFormatted": "$90,021.36 @ 0.1%\n1,320 x $0.05",
"priceExtended": 156.02,
"priceExtendedFormatted": "156.02",
"lineItems": null
},
{
"id": "SMKSOWTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-VD",
"explanation": "",
"transactionCount": 4630,
"volume": 198012.1,
"volumeFormatted": "198,012.10",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 573.04,
"priceFormatted": "$198,012.10 @ 0.1%\n4,630 x $0.081",
"priceExtended": 573.04,
"priceExtendedFormatted": "573.04",
"lineItems": null
},
{
"id": "SMK3YBTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-VB",
"explanation": "",
"transactionCount": 90,
"volume": 11996.3,
"volumeFormatted": "11,996.30",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 16.5,
"priceFormatted": "$11,996.30 @ 0.1%\n90 x $0.05",
"priceExtended": 16.5,
"priceExtendedFormatted": "16.50",
"lineItems": null
},
{
"id": "SMLH33TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-MC",
"explanation": "",
"transactionCount": 765,
"volume": 52950.24,
"volumeFormatted": "52,950.24",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 91.2,
"priceFormatted": "$52,950.24 @ 0.1%\n765 x $0.05",
"priceExtended": 91.2,
"priceExtendedFormatted": "91.20",
"lineItems": null
},
{
"id": "SMLR3FDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-MD",
"explanation": "",
"transactionCount": 2220,
"volume": 84571.84,
"volumeFormatted": "84,571.84",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 264.39,
"priceFormatted": "$84,571.84 @ 0.1%\n2,220 x $0.081",
"priceExtended": 264.39,
"priceExtendedFormatted": "264.39",
"lineItems": null
},
{
"id": "SMME3BTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-MB",
"explanation": "",
"transactionCount": 30,
"volume": 2181.55,
"volumeFormatted": "2,181.55",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 3.68,
"priceFormatted": "$2,181.55 @ 0.1%\n30 x $0.05",
"priceExtended": 3.68,
"priceExtendedFormatted": "3.68",
"lineItems": null
},
{
"id": "SMMO77DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-AM",
"explanation": "",
"transactionCount": 159,
"volume": 19723.43,
"volumeFormatted": "19,723.43",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.002,
"transactionPercentageFormatted": "0.2%",
"price": 55.35,
"priceFormatted": "$19,723.43 @ 0.2%\n159 x $0.10",
"priceExtended": 55.35,
"priceExtendedFormatted": "55.35",
"lineItems": null
},
{
"id": "SMMXMXDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-DS",
"explanation": "",
"transactionCount": 230,
"volume": 21011,
"volumeFormatted": "21,011.00",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 32.51,
"priceFormatted": "$21,011.00 @ 0.1%\n230 x $0.05",
"priceExtended": 32.51,
"priceExtendedFormatted": "32.51",
"lineItems": null
},
{
"id": "SMNKM3DU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-DD",
"explanation": "",
"transactionCount": 26,
"volume": 904.72,
"volumeFormatted": "904.72",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 3.01,
"priceFormatted": "$904.72 @ 0.1%\n26 x $0.081",
"priceExtended": 3.01,
"priceExtendedFormatted": "3.01",
"lineItems": null
},
{
"id": "SMOB3PDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Chip-DZ",
"explanation": "",
"transactionCount": 39,
"volume": 2271.61,
"volumeFormatted": "2,271.61",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 4.22,
"priceFormatted": "$2,271.61 @ 0.1%\n39 x $0.05",
"priceExtended": 4.22,
"priceExtendedFormatted": "4.22",
"lineItems": null
},
{
"id": "SMRHRTTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Fallback-VS",
"explanation": "",
"transactionCount": 2,
"volume": 59.06,
"volumeFormatted": "59.06",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.16,
"priceFormatted": "$59.06 @ 0.1%\n2 x $0.05",
"priceExtended": 0.16,
"priceExtendedFormatted": "0.16",
"lineItems": null
},
{
"id": "SMTKH2TU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Fallback-VD",
"explanation": "",
"transactionCount": 4,
"volume": 235.21,
"volumeFormatted": "235.21",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.56,
"priceFormatted": "$235.21 @ 0.1%\n4 x $0.081",
"priceExtended": 0.56,
"priceExtendedFormatted": "0.56",
"lineItems": null
},
{
"id": "SMT4OIDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Fallback-MC",
"explanation": "",
"transactionCount": 1,
"volume": 22.28,
"volumeFormatted": "22.28",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.07,
"priceFormatted": "$22.28 @ 0.1%\n1 x $0.05",
"priceExtended": 0.07,
"priceExtendedFormatted": "0.07",
"lineItems": null
},
{
"id": "SM3YFIDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Fallback-MD",
"explanation": "",
"transactionCount": 3,
"volume": 276.63,
"volumeFormatted": "276.63",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.52,
"priceFormatted": "$276.63 @ 0.1%\n3 x $0.081",
"priceExtended": 0.52,
"priceExtendedFormatted": "0.52",
"lineItems": null
},
{
"id": "SM4HREDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Fallback-MB",
"explanation": "",
"transactionCount": 1,
"volume": 13.37,
"volumeFormatted": "13.37",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.06,
"priceFormatted": "$13.37 @ 0.1%\n1 x $0.05",
"priceExtended": 0.06,
"priceExtendedFormatted": "0.06",
"lineItems": null
},
{
"id": "SM4SSKTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Swiped/EMV Enabled-VS",
"explanation": "",
"transactionCount": 2,
"volume": 21.92,
"volumeFormatted": "21.92",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.12,
"priceFormatted": "$21.92 @ 0.1%\n2 x $0.05",
"priceExtended": 0.12,
"priceExtendedFormatted": "0.12",
"lineItems": null
},
{
"id": "SM4Z2EDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Swiped/EMV Enabled-VD",
"explanation": "",
"transactionCount": 55,
"volume": 1448.3,
"volumeFormatted": "1,448.30",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 5.9,
"priceFormatted": "$1,448.30 @ 0.1%\n55 x $0.081",
"priceExtended": 5.9,
"priceExtendedFormatted": "5.90",
"lineItems": null
},
{
"id": "SM5ADYTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Swiped/EMV Enabled-MC",
"explanation": "",
"transactionCount": 5,
"volume": 207.07,
"volumeFormatted": "207.07",
"perTransactionFee": 0.05,
"perTransactionFeeFormatted": "0.05",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 0.46,
"priceFormatted": "$207.07 @ 0.1%\n5 x $0.05",
"priceExtended": 0.46,
"priceExtendedFormatted": "0.46",
"lineItems": null
},
{
"id": "SM5K6UTU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Swiped/EMV Enabled-MD",
"explanation": "",
"transactionCount": 45,
"volume": 1037.2,
"volumeFormatted": "1,037.20",
"perTransactionFee": 0.081,
"perTransactionFeeFormatted": "0.081",
"transactionPercentage": 0.001,
"transactionPercentageFormatted": "0.1%",
"price": 4.68,
"priceFormatted": "$1,037.20 @ 0.1%\n45 x $0.081",
"priceExtended": 4.68,
"priceExtendedFormatted": "4.68",
"lineItems": null
},
{
"id": "SM6FHBDU6MI65KNZTYA4RH54WI",
"lineType": "count-and-volume",
"productId": "",
"quantity": 1,
"description": "Swiped/EMV Enabled-AM",
"explanation": "",
"transactionCount": 1,
"volume": 27.85,
"volumeFormatted": "27.85",
"perTransactionFee": 0.1,
"perTransactionFeeFormatted": "0.10",
"transactionPercentage": 0.002,
"transactionPercentageFormatted": "0.2%",
"price": 0.16,
"priceFormatted": "$27.85 @ 0.2%\n1 x $0.10",
"priceExtended": 0.16,
"priceExtendedFormatted": "0.16",
"lineItems": null
},
{
"id": "SM6WSXTU6MI65KNZTYA4RH54WI",
"lineType": "tx-count",
"productId": "",
"quantity": 1,
"description": "Batch Fee",
"explanation": "",
"transactionCount": 30,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0.08,
"perTransactionFeeFormatted": "0.08",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 2.4,
"priceFormatted": "30 x $0.08",
"priceExtended": 2.4,
"priceExtendedFormatted": "2.40",
"lineItems": null
}
]
},
{
"id": "SM7VV7DU6MI65KNZTYA4RH54WI",
"lineType": "header",
"productId": "",
"quantity": 0,
"description": "Misc Fees",
"explanation": "These are uncommon and unusual fees that occassionally crop up.",
"transactionCount": 0,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 0,
"priceFormatted": "",
"priceExtended": 10,
"priceExtendedFormatted": "10.00",
"lineItems": [
{
"id": "SNAJQDTU6MI65KNZTYA4RH54WI",
"lineType": "",
"productId": "",
"quantity": 1,
"description": "Monthly Fee",
"explanation": "",
"transactionCount": 1,
"volume": 0,
"volumeFormatted": "0.00",
"perTransactionFee": 0,
"perTransactionFeeFormatted": "0.00",
"transactionPercentage": 0,
"transactionPercentageFormatted": "0%",
"price": 10,
"priceFormatted": "",
"priceExtended": 10,
"priceExtendedFormatted": "10.00",
"lineItems": null
}
]
}
],
"payments": [
{
"id": "SNAUJNTU6MI65KNZTYA4RH54WI",
"timestamp": "2023-10-27T18:06:58Z",
"transactionType": "TSYS",
"paymentType": "TSYS ACH",
"authCode": "",
"maskedPan": "****0000",
"pending": false,
"approved": true,
"responseDescription": "SUBMITTED TO FED",
"amount": 8058.21,
"amountFormatted": "8,058.21"
}
],
"deposits": [
{
"id": "SNBQZJTU6MI65KNZTYA4RH54WI",
"transactionCount": 230,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10854.53,
"netDepositFormatted": "10,854.53",
"totalSales": 10854.53,
"totalSalesFormatted": "10,854.53",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNCXKBDU6MI65KNZTYA4RH54WI",
"transactionCount": 328,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 18320.2,
"netDepositFormatted": "18,320.20",
"totalSales": 18320.2,
"totalSalesFormatted": "18,320.20",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNB3JFDU6MI65KNZTYA4RH54WI",
"transactionCount": 599,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 29308.32,
"netDepositFormatted": "29,308.32",
"totalSales": 29308.32,
"totalSalesFormatted": "29,308.32",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNDTOITU6MI65KNZTYA4RH54WI",
"transactionCount": 635,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 31839.34,
"netDepositFormatted": "31,839.34",
"totalSales": 31839.34,
"totalSalesFormatted": "31,839.34",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNECGJTU6MI65KNZTYA4RH54WI",
"transactionCount": 19,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 449.25,
"netDepositFormatted": "449.25",
"totalSales": 449.25,
"totalSalesFormatted": "449.25",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNE26DDU6MI65KNZTYA4RH54WI",
"transactionCount": 503,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 25812.21,
"netDepositFormatted": "25,812.21",
"totalSales": 25812.21,
"totalSalesFormatted": "25,812.21",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNGYFUDU6MI65KNZTYA4RH54WI",
"transactionCount": 277,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10753.31,
"netDepositFormatted": "10,753.31",
"totalSales": 10753.31,
"totalSalesFormatted": "10,753.31",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNH656DU6MI65KNZTYA4RH54WI",
"transactionCount": 132,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 4264.1,
"netDepositFormatted": "4,264.10",
"totalSales": 4264.1,
"totalSalesFormatted": "4,264.10",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNJD5OTU6MI65KNZTYA4RH54WI",
"transactionCount": 239,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 34091.34,
"netDepositFormatted": "34,091.34",
"totalSales": 34091.34,
"totalSalesFormatted": "34,091.34",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNJ24WDU6MI65KNZTYA4RH54WI",
"transactionCount": 492,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 28462.69,
"netDepositFormatted": "28,462.69",
"totalSales": 28466.02,
"totalSalesFormatted": "28,466.02",
"totalRefunds": 3.33,
"totalRefundsFormatted": "3.33"
},
{
"id": "SNQ6TFTU6MI65KNZTYA4RH54WI",
"transactionCount": 238,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10953.64,
"netDepositFormatted": "10,953.64",
"totalSales": 10953.64,
"totalSalesFormatted": "10,953.64",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNRK3JDU6MI65KNZTYA4RH54WI",
"transactionCount": 583,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 29009.22,
"netDepositFormatted": "29,009.22",
"totalSales": 29009.22,
"totalSalesFormatted": "29,009.22",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNRTVADU6MI65KNZTYA4RH54WI",
"transactionCount": 293,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10220.47,
"netDepositFormatted": "10,220.47",
"totalSales": 10220.47,
"totalSalesFormatted": "10,220.47",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SNSE2HDU6MI65KNZTYA4RH54WI",
"transactionCount": 144,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 8442.06,
"netDepositFormatted": "8,442.06",
"totalSales": 8442.06,
"totalSalesFormatted": "8,442.06",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOV4GBDU6MI65KNZTYA4RH54WI",
"transactionCount": 162,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 7534.13,
"netDepositFormatted": "7,534.13",
"totalSales": 7534.13,
"totalSalesFormatted": "7,534.13",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOWZYODU6MI65KNZTYA4RH54WI",
"transactionCount": 224,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10763.65,
"netDepositFormatted": "10,763.65",
"totalSales": 10773.69,
"totalSalesFormatted": "10,773.69",
"totalRefunds": 10.04,
"totalRefundsFormatted": "10.04"
},
{
"id": "SOXT77DU6MI65KNZTYA4RH54WI",
"transactionCount": 276,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 12528.69,
"netDepositFormatted": "12,528.69",
"totalSales": 12528.69,
"totalSalesFormatted": "12,528.69",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOXGNLTU6MI65KNZTYA4RH54WI",
"transactionCount": 620,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 34943.14,
"netDepositFormatted": "34,943.14",
"totalSales": 34993.3,
"totalSalesFormatted": "34,993.30",
"totalRefunds": 50.16,
"totalRefundsFormatted": "50.16"
},
{
"id": "SOX5LXTU6MI65KNZTYA4RH54WI",
"transactionCount": 586,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 32064.72,
"netDepositFormatted": "32,064.72",
"totalSales": 32223.03,
"totalSalesFormatted": "32,223.03",
"totalRefunds": 158.31,
"totalRefundsFormatted": "158.31"
},
{
"id": "SOYNB5TU6MI65KNZTYA4RH54WI",
"transactionCount": 232,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 9773.48,
"netDepositFormatted": "9,773.48",
"totalSales": 9773.48,
"totalSalesFormatted": "9,773.48",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOY7BKDU6MI65KNZTYA4RH54WI",
"transactionCount": 148,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 4369.79,
"netDepositFormatted": "4,369.79",
"totalSales": 4369.79,
"totalSalesFormatted": "4,369.79",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOZOURDU6MI65KNZTYA4RH54WI",
"transactionCount": 157,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 7073.39,
"netDepositFormatted": "7,073.39",
"totalSales": 7073.39,
"totalSalesFormatted": "7,073.39",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SOZZADDU6MI65KNZTYA4RH54WI",
"transactionCount": 223,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 12427.9,
"netDepositFormatted": "12,427.90",
"totalSales": 12427.9,
"totalSalesFormatted": "12,427.90",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SO2LPBDU6MI65KNZTYA4RH54WI",
"transactionCount": 558,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 27126.43,
"netDepositFormatted": "27,126.43",
"totalSales": 27126.43,
"totalSalesFormatted": "27,126.43",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SO2326DU6MI65KNZTYA4RH54WI",
"transactionCount": 275,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 13371.34,
"netDepositFormatted": "13,371.34",
"totalSales": 13371.34,
"totalSalesFormatted": "13,371.34",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SO3K6ETU6MI65KNZTYA4RH54WI",
"transactionCount": 638,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 29393.37,
"netDepositFormatted": "29,393.37",
"totalSales": 29393.37,
"totalSalesFormatted": "29,393.37",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SO375CTU6MI65KNZTYA4RH54WI",
"transactionCount": 282,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10895.79,
"netDepositFormatted": "10,895.79",
"totalSales": 10895.79,
"totalSalesFormatted": "10,895.79",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
},
{
"id": "SO4UX6TU6MI65KNZTYA4RH54WI",
"transactionCount": 160,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 5154.05,
"netDepositFormatted": "5,154.05",
"totalSales": 5194.16,
"totalSalesFormatted": "5,194.16",
"totalRefunds": 40.11,
"totalRefundsFormatted": "40.11"
},
{
"id": "SO6OPYTU6MI65KNZTYA4RH54WI",
"transactionCount": 169,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 5940.67,
"netDepositFormatted": "5,940.67",
"totalSales": 6059.93,
"totalSalesFormatted": "6,059.93",
"totalRefunds": 119.26,
"totalRefundsFormatted": "119.26"
},
{
"id": "SO7LQQTU6MI65KNZTYA4RH54WI",
"transactionCount": 206,
"batchId": "",
"feesPaid": 0,
"feesPaidFormatted": "0.00",
"netDeposit": 10470.61,
"netDepositFormatted": "10,470.61",
"totalSales": 10470.61,
"totalSalesFormatted": "10,470.61",
"totalRefunds": 0,
"totalRefundsFormatted": "0.00"
}
]
}
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns detailed information about a specific merchant statement or invoice.
All line items are returned a topographically sorted tree modeling the nested line item structure of the invoice. Details about any payments posted against the invoice are returned.
It the invoice is a merchant statement, details about every merchant deposit that occurred during the statement period are also returned.
Partner Commission Breakdown
Partner Commission Breakdown Example:
Linux/Mac OS: ./blockchyp -test -cmd="partner-commission-breakdown" -statementId="<STATEMENT_ID>"
Windows: ./blockchyp.exe -test -cmd="partner-commission-breakdown" -statementId="<STATEMENT_ID>"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go/v2"
)
func partnerCommissionBreakdownExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.PartnerCommissionBreakdownRequest{}
response, err := client.PartnerCommissionBreakdown(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Success {
fmt.Println("Success")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
PartnerCommissionBreakdownRequest request = new PartnerCommissionBreakdownRequest
{
};
// Run the transaction.
PartnerCommissionBreakdownResponse response = await blockchyp.PartnerCommissionBreakdownAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.PartnerCommissionBreakdownRequest;
import com.blockchyp.client.dto.PartnerCommissionBreakdownResponse;
public class PartnerCommissionBreakdownExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
PartnerCommissionBreakdownRequest request = new PartnerCommissionBreakdownRequest();
// Send the request
PartnerCommissionBreakdownResponse response = client.partnerCommissionBreakdown(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
];
$response = BlockChyp::partnerCommissionBreakdown($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
}
response = blockchyp.partnerCommissionBreakdown(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
}
# run the transaction.
response = client.partner_commission_breakdown(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.partnerCommissionBreakdown({
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
[client partnerCommissionBreakdownWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"success"];
if (success.boolValue) {
NSLog(@"Success");
}
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
client.partnerCommissionBreakdown(withRequest: request, handler: { (request, response, error) in
let approved = response["success"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("Success")
}
})
}
Example response encoded as JSON:
{
"success": false,
"error": "",
"responseDescription": "",
"invoiceId": "YXIYN627J7005FBWAJBKYEIAAQ",
"partnerName": "Demo Partner, Inc.",
"partnerStatementId": "SCH34K3JAEI65EJNAJBKYEIAAI",
"partnerStatementDate": "2023-09-30T04:28:21Z",
"merchantId": "W5JCF4NVXAI6ZE6K700KYEIAAI",
"merchantCompanyName": "Tacos Panjamo",
"merchantDbaName": "Tacos Panjamo",
"grandTotal": 8058.21,
"grandTotalFormatted": "8,058.21",
"totalFees": 8058.21,
"totalFeesFormatted": "8,058.21",
"totalDue": 0,
"totalDueFormatted": "0.00",
"totalVolume": 486611.83,
"totalVolumeFormatted": "486,611.83",
"totalTransactions": 9628,
"partnerResidual": 332.88,
"partnerResidualFormatted": "332.88",
"interchange": 6175.64,
"interchangeFormatted": "6,175.64",
"assessments": 653.05,
"assessmentsFormatted": "653.05",
"totalPassthrough": 6828.69,
"totalPassthroughFormatted": "6,828.69",
"totalNonPassthrough": 215.83,
"totalNonPassthroughFormatted": "215.83",
"totalCardBrandFees": 7044.52,
"totalCardBrandFeesFormatted": "7,044.52",
"totalBuyRate": 7398.54,
"totalBuyRateFormatted": "7,398.54",
"buyRateBeforePassthrough": 569.85,
"buyRateBeforePassthroughFormatted": "569.85",
"netMarkup": 443.84,
"netMarkupFormatted": "443.84",
"partnerNonPassthroughShare": 161.87,
"partnerNonPassthroughShareFormatted": "161.87",
"chargebackFees": 0,
"chargebackFeesFormatted": "0.00",
"chargebackCount": 0,
"partnerPercentage": 0.75,
"partnerPercentageFormatted": "75%",
"buyRateLineItems": [
{
"description": "Standard",
"volume": 180755.76,
"volumeFormatted": "180,755.76",
"volumeRate": 0.00015,
"volumeRateFormatted": "0.015%",
"count": 2485,
"countRate": 0.02,
"countRateFormatted": "0.02",
"rateSummary": "180,755.76 @ 0.015%, 2,485 X 0.02",
"total": 103.94,
"totalFormatted": "103.94"
},
{
"description": "Premium",
"volume": 19751.28,
"volumeFormatted": "19,751.28",
"volumeRate": 0.0012,
"volumeRateFormatted": "0.12%",
"count": 160,
"countRate": 0.07,
"countRateFormatted": "0.07",
"rateSummary": "19,751.28 @ 0.12%, 160 X 0.07",
"total": 58.62,
"totalFormatted": "58.62"
},
{
"description": "Debit",
"volume": 286486,
"volumeFormatted": "286,486.00",
"volumeRate": 0.00015,
"volumeRateFormatted": "0.015%",
"count": 6983,
"countRate": 0.045,
"countRateFormatted": "0.045",
"rateSummary": "286,486.00 @ 0.015%, 6,983 X 0.045",
"total": 400.19,
"totalFormatted": "400.19"
},
{
"description": "Batch Fees",
"volume": 0,
"volumeFormatted": "",
"volumeRate": 0,
"volumeRateFormatted": "",
"count": 30,
"countRate": 0.07,
"countRateFormatted": "0.07",
"rateSummary": "30 X 0.07",
"total": 2.1,
"totalFormatted": "2.10"
},
{
"description": "Monthly",
"volume": 0,
"volumeFormatted": "",
"volumeRate": 0,
"volumeRateFormatted": "",
"count": 1,
"countRate": 5,
"countRateFormatted": "5.00",
"rateSummary": "1 X 5.00",
"total": 5,
"totalFormatted": "5.00"
}
],
"revenueDetails": [
{
"id": "",
"description": "Total Acquiring Revenue",
"expandable": false,
"negative": false,
"total": 8058.21,
"totalFormatted": "8,058.21",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "WAB",
"expandable": false,
"negative": false,
"total": 8058.21,
"totalFormatted": "8,058.21",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "BlockChyp Fees",
"expandable": false,
"negative": false,
"total": 2430.02,
"totalFormatted": "2,430.02",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": null
},
{
"id": "",
"description": "Interchange Fees",
"expandable": false,
"negative": false,
"total": 12351.28,
"totalFormatted": "12,351.28",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": null
},
{
"id": "",
"description": "Misc Fees",
"expandable": false,
"negative": false,
"total": 20,
"totalFormatted": "20.00",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": null
},
{
"id": "",
"description": "Other Passthrough Fees",
"expandable": false,
"negative": false,
"total": 1315.12,
"totalFormatted": "1,315.12",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": null
}
]
}
]
}
],
"cardBrandCostDetails": [
{
"id": "",
"description": "Total Card Brand Costs",
"expandable": false,
"negative": false,
"total": 7044.52,
"totalFormatted": "7,044.52",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "WAB",
"expandable": false,
"negative": false,
"total": 7044.52,
"totalFormatted": "7,044.52",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "Passthrough Fees",
"expandable": false,
"negative": false,
"total": 6828.69,
"totalFormatted": "6,828.69",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "Interchange Fees",
"expandable": false,
"negative": false,
"total": 6175.64,
"totalFormatted": "6,175.64",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "DISC",
"expandable": false,
"negative": false,
"total": 462.86,
"totalFormatted": "462.86",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "DS Commercial Electronic Submission Level",
"expandable": false,
"negative": false,
"total": 61.5,
"totalFormatted": "61.50",
"perTranFeeRange": {
"min": "0.15",
"avg": "0.15",
"max": "0.15"
},
"transactionPercentageRange": {
"min": "2.45%",
"avg": "2.45%",
"max": "2.45%"
},
"detailLines": null
},
{
"id": "",
"description": "DS PSL - Retail Prepaid",
"expandable": false,
"negative": false,
"total": 1.25,
"totalFormatted": "1.25",
"perTranFeeRange": {
"min": "0.16",
"avg": "0.16",
"max": "0.16"
},
"transactionPercentageRange": {
"min": "1.12%",
"avg": "1.12%",
"max": "1.12%"
},
"detailLines": null
},
{
"id": "",
"description": "DS PSL Retail DB",
"expandable": false,
"negative": false,
"total": 12.89,
"totalFormatted": "12.89",
"perTranFeeRange": {
"min": "0.16",
"avg": "0.16",
"max": "0.16"
},
"transactionPercentageRange": {
"min": "1.10%",
"avg": "1.10%",
"max": "1.10%"
},
"detailLines": null
},
{
"id": "",
"description": "DS PSL Retail PR",
"expandable": false,
"negative": false,
"total": 180.69,
"totalFormatted": "180.69",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.74%",
"avg": "1.74%",
"max": "1.74%"
},
"detailLines": null
},
{
"id": "",
"description": "DS PSL Retail Rewards",
"expandable": false,
"negative": false,
"total": 203.06,
"totalFormatted": "203.06",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.72%",
"avg": "1.72%",
"max": "1.72%"
},
"detailLines": null
},
{
"id": "",
"description": "DS Retail (Premium Plus)",
"expandable": false,
"negative": false,
"total": 3.4699999999999998,
"totalFormatted": "3.47",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.25%",
"avg": "2.25%",
"max": "2.25%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "AMEX",
"expandable": false,
"negative": false,
"total": 418.89,
"totalFormatted": "418.89",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "AM Prepaid Tier 1",
"expandable": false,
"negative": false,
"total": 0.48,
"totalFormatted": "0.48",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.35%",
"avg": "1.35%",
"max": "1.35%"
},
"detailLines": null
},
{
"id": "",
"description": "AM Retail Tier 1",
"expandable": false,
"negative": false,
"total": 66.31,
"totalFormatted": "66.31",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.60%",
"avg": "1.60%",
"max": "1.60%"
},
"detailLines": null
},
{
"id": "",
"description": "AM Retail Tier 2",
"expandable": false,
"negative": false,
"total": 191.15,
"totalFormatted": "191.15",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.95%",
"avg": "1.95%",
"max": "1.95%"
},
"detailLines": null
},
{
"id": "",
"description": "AM Retail Tier 3",
"expandable": false,
"negative": false,
"total": 160.95,
"totalFormatted": "160.95",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.40%",
"avg": "2.40%",
"max": "2.40%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "VISA",
"expandable": false,
"negative": false,
"total": 3398.71,
"totalFormatted": "3,398.71",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "VS Business Card CP Debit",
"expandable": false,
"negative": false,
"total": 14.84,
"totalFormatted": "14.84",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.70%",
"avg": "1.70%",
"max": "1.70%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Purchase Retail Prepaid",
"expandable": false,
"negative": false,
"total": 10.41,
"totalFormatted": "10.41",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.15%",
"avg": "2.15%",
"max": "2.15%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Tr 5 Prod 2",
"expandable": false,
"negative": false,
"total": 130.08,
"totalFormatted": "130.08",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.25%",
"avg": "2.25%",
"max": "2.25%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Tr1 Prod 2",
"expandable": false,
"negative": false,
"total": 1.26,
"totalFormatted": "1.26",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.90%",
"avg": "1.90%",
"max": "1.90%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Tr2 Prod 2",
"expandable": false,
"negative": false,
"total": 56.54,
"totalFormatted": "56.54",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.05%",
"avg": "2.05%",
"max": "2.05%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Tr3 Prod 2",
"expandable": false,
"negative": false,
"total": 26.04,
"totalFormatted": "26.04",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.10%",
"avg": "2.10%",
"max": "2.10%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Business Tr4 Prod 2",
"expandable": false,
"negative": false,
"total": 50.54,
"totalFormatted": "50.54",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.20%",
"avg": "2.20%",
"max": "2.20%"
},
"detailLines": null
},
{
"id": "",
"description": "VS CPS Retail Check Debit",
"expandable": false,
"negative": false,
"total": 192.9,
"totalFormatted": "192.90",
"perTranFeeRange": {
"min": "0.15",
"avg": "0.15",
"max": "0.15"
},
"transactionPercentageRange": {
"min": "0.80%",
"avg": "0.80%",
"max": "0.80%"
},
"detailLines": null
},
{
"id": "",
"description": "VS CPS Retail Pp",
"expandable": false,
"negative": false,
"total": 81.9,
"totalFormatted": "81.90",
"perTranFeeRange": {
"min": "0.15",
"avg": "0.15",
"max": "0.15"
},
"transactionPercentageRange": {
"min": "1.15%",
"avg": "1.15%",
"max": "1.15%"
},
"detailLines": null
},
{
"id": "",
"description": "VS CPS Small Ticket Debit",
"expandable": false,
"negative": false,
"total": 20.29,
"totalFormatted": "20.29",
"perTranFeeRange": {
"min": "0.04",
"avg": "0.04",
"max": "0.04"
},
"transactionPercentageRange": {
"min": "1.55%",
"avg": "1.55%",
"max": "1.55%"
},
"detailLines": null
},
{
"id": "",
"description": "VS CPS Small Ticket Pp",
"expandable": false,
"negative": false,
"total": 11.3,
"totalFormatted": "11.30",
"perTranFeeRange": {
"min": "0.05",
"avg": "0.05",
"max": "0.05"
},
"transactionPercentageRange": {
"min": "1.60%",
"avg": "1.60%",
"max": "1.60%"
},
"detailLines": null
},
{
"id": "",
"description": "VS CPS Small Ticket Regulated",
"expandable": false,
"negative": false,
"total": 158.76,
"totalFormatted": "158.76",
"perTranFeeRange": {
"min": "0.22",
"avg": "0.22",
"max": "0.22"
},
"transactionPercentageRange": {
"min": "0.05%",
"avg": "0.05%",
"max": "0.05%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Credit Voucher Non PT Credit",
"expandable": false,
"negative": false,
"total": -2.16,
"totalFormatted": "-2.16",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.76%",
"avg": "1.76%",
"max": "1.76%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Electronic",
"expandable": false,
"negative": false,
"total": 1.6400000000000001,
"totalFormatted": "1.64",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.10%",
"avg": "1.10%",
"max": "1.10%"
},
"detailLines": null
},
{
"id": "",
"description": "VS InterReg Corporate",
"expandable": false,
"negative": false,
"total": 1.34,
"totalFormatted": "1.34",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "2%",
"avg": "2%",
"max": "2%"
},
"detailLines": null
},
{
"id": "",
"description": "VS InterReg Regulated Debit",
"expandable": false,
"negative": false,
"total": 0.23,
"totalFormatted": "0.23",
"perTranFeeRange": {
"min": "0.22",
"avg": "0.22",
"max": "0.22"
},
"transactionPercentageRange": {
"min": "0.05%",
"avg": "0.05%",
"max": "0.05%"
},
"detailLines": null
},
{
"id": "",
"description": "VS InterReg Super Premium",
"expandable": false,
"negative": false,
"total": 0.4,
"totalFormatted": "0.40",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.97%",
"avg": "1.97%",
"max": "1.97%"
},
"detailLines": null
},
{
"id": "",
"description": "VS Premium Card",
"expandable": false,
"negative": false,
"total": 2.13,
"totalFormatted": "2.13",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.80%",
"avg": "1.80%",
"max": "1.80%"
},
"detailLines": null
},
{
"id": "",
"description": "VS US Corporate Card - Card Present",
"expandable": false,
"negative": false,
"total": 2.41,
"totalFormatted": "2.41",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.50%",
"avg": "2.50%",
"max": "2.50%"
},
"detailLines": null
},
{
"id": "",
"description": "VS US Purchasing Card - Card Present",
"expandable": false,
"negative": false,
"total": 2.9,
"totalFormatted": "2.90",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.50%",
"avg": "2.50%",
"max": "2.50%"
},
"detailLines": null
},
{
"id": "",
"description": "VS US Regulated Debit",
"expandable": false,
"negative": false,
"total": 794.27,
"totalFormatted": "794.27",
"perTranFeeRange": {
"min": "0.22",
"avg": "0.22",
"max": "0.22"
},
"transactionPercentageRange": {
"min": "0.05%",
"avg": "0.05%",
"max": "0.05%"
},
"detailLines": null
},
{
"id": "",
"description": "VS VIN Product 2",
"expandable": false,
"negative": false,
"total": 460.15,
"totalFormatted": "460.15",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.65%",
"avg": "1.65%",
"max": "1.65%"
},
"detailLines": null
},
{
"id": "",
"description": "VS VSP VIQ Product 2",
"expandable": false,
"negative": false,
"total": 1108,
"totalFormatted": "1,108.00",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.10%",
"avg": "2.10%",
"max": "2.10%"
},
"detailLines": null
},
{
"id": "",
"description": "VS VT Product 2",
"expandable": false,
"negative": false,
"total": 125.74,
"totalFormatted": "125.74",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.51%",
"avg": "1.51%",
"max": "1.51%"
},
"detailLines": null
},
{
"id": "",
"description": "VS VTR Product 2",
"expandable": false,
"negative": false,
"total": 103.82,
"totalFormatted": "103.82",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.65%",
"avg": "1.65%",
"max": "1.65%"
},
"detailLines": null
},
{
"id": "",
"description": "Visa VIQ Product 2",
"expandable": false,
"negative": false,
"total": 42.98,
"totalFormatted": "42.98",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.10%",
"avg": "2.10%",
"max": "2.10%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "MC",
"expandable": false,
"negative": false,
"total": 1895.18,
"totalFormatted": "1,895.18",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "MC Business Level 1 Data Rate I",
"expandable": false,
"negative": false,
"total": 1.31,
"totalFormatted": "1.31",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.65%",
"avg": "2.65%",
"max": "2.65%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Business Level 2 Data Rate I",
"expandable": false,
"negative": false,
"total": 14.96,
"totalFormatted": "14.96",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.80%",
"avg": "2.80%",
"max": "2.80%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Business Level 3 Data Rate I",
"expandable": false,
"negative": false,
"total": 8.39,
"totalFormatted": "8.39",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.85%",
"avg": "2.85%",
"max": "2.85%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Business Level 4 Data Rate I",
"expandable": false,
"negative": false,
"total": 1.09,
"totalFormatted": "1.09",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.95%",
"avg": "2.95%",
"max": "2.95%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Business Level 5 Data Rate I",
"expandable": false,
"negative": false,
"total": 2.5300000000000002,
"totalFormatted": "2.53",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "3%",
"avg": "3%",
"max": "3%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Commercial Rate 1 Large Market",
"expandable": false,
"negative": false,
"total": 35.29,
"totalFormatted": "35.29",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.70%",
"avg": "2.70%",
"max": "2.70%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Consumer Credit Refund Group 4",
"expandable": false,
"negative": false,
"total": -0.88,
"totalFormatted": "-0.88",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.75%",
"avg": "1.75%",
"max": "1.75%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Consumer Rate 2-Card Present Core",
"expandable": false,
"negative": false,
"total": 4.52,
"totalFormatted": "4.52",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1.10%",
"avg": "1.10%",
"max": "1.10%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Corporate Data Rate 1",
"expandable": false,
"negative": false,
"total": 21.32,
"totalFormatted": "21.32",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.65%",
"avg": "2.65%",
"max": "2.65%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Enhanced Merit III Base",
"expandable": false,
"negative": false,
"total": 177.26,
"totalFormatted": "177.26",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.80%",
"avg": "1.80%",
"max": "1.80%"
},
"detailLines": null
},
{
"id": "",
"description": "MC High Value Merit III Base 1",
"expandable": false,
"negative": false,
"total": 134.42,
"totalFormatted": "134.42",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.30%",
"avg": "2.30%",
"max": "2.30%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Merit 3 Prepaid",
"expandable": false,
"negative": false,
"total": 21.75,
"totalFormatted": "21.75",
"perTranFeeRange": {
"min": "0.15",
"avg": "0.15",
"max": "0.15"
},
"transactionPercentageRange": {
"min": "1.15%",
"avg": "1.15%",
"max": "1.15%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Merit III Credit",
"expandable": false,
"negative": false,
"total": 52.81,
"totalFormatted": "52.81",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.65%",
"avg": "1.65%",
"max": "1.65%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Merit III Debit",
"expandable": false,
"negative": false,
"total": 116.64,
"totalFormatted": "116.64",
"perTranFeeRange": {
"min": "0.15",
"avg": "0.15",
"max": "0.15"
},
"transactionPercentageRange": {
"min": "1.05%",
"avg": "1.05%",
"max": "1.05%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Small Ticket Card Present",
"expandable": false,
"negative": false,
"total": 0.24,
"totalFormatted": "0.24",
"perTranFeeRange": {
"min": "0.02",
"avg": "0.02",
"max": "0.02"
},
"transactionPercentageRange": {
"min": "1.65%",
"avg": "1.65%",
"max": "1.65%"
},
"detailLines": null
},
{
"id": "",
"description": "MC US Cons Regulated POS Debit w/Fraud Adj",
"expandable": false,
"negative": false,
"total": 468.18,
"totalFormatted": "468.18",
"perTranFeeRange": {
"min": "0.22",
"avg": "0.22",
"max": "0.22"
},
"transactionPercentageRange": {
"min": "0.05%",
"avg": "0.05%",
"max": "0.05%"
},
"detailLines": null
},
{
"id": "",
"description": "MC World Elite Merit III",
"expandable": false,
"negative": false,
"total": 666,
"totalFormatted": "666.00",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "2.30%",
"avg": "2.30%",
"max": "2.30%"
},
"detailLines": null
},
{
"id": "",
"description": "MC World Elite Small Ticket Card Present",
"expandable": false,
"negative": false,
"total": 0.84,
"totalFormatted": "0.84",
"perTranFeeRange": {
"min": "0.02",
"avg": "0.02",
"max": "0.02"
},
"transactionPercentageRange": {
"min": "2.30%",
"avg": "2.30%",
"max": "2.30%"
},
"detailLines": null
},
{
"id": "",
"description": "MC World Merit III",
"expandable": false,
"negative": false,
"total": 168.41,
"totalFormatted": "168.41",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "1.90%",
"avg": "1.90%",
"max": "1.90%"
},
"detailLines": null
},
{
"id": "",
"description": "MC World Small Ticket Card Present",
"expandable": false,
"negative": false,
"total": 0.1,
"totalFormatted": "0.10",
"perTranFeeRange": {
"min": "0.02",
"avg": "0.02",
"max": "0.02"
},
"transactionPercentageRange": {
"min": "1.90%",
"avg": "1.90%",
"max": "1.90%"
},
"detailLines": null
}
]
}
]
},
{
"id": "",
"description": "Assessment Fees",
"expandable": false,
"negative": false,
"total": 653.05,
"totalFormatted": "653.05",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "MC",
"expandable": false,
"negative": false,
"total": 184.34,
"totalFormatted": "184.34",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "ACQ Brand Volume",
"expandable": false,
"negative": false,
"total": 171.88,
"totalFormatted": "171.88",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.13%",
"avg": "0.13%",
"max": "0.13%"
},
"detailLines": null
},
{
"id": "",
"description": "ACQ Brand Volume Above",
"expandable": false,
"negative": false,
"total": 12.46,
"totalFormatted": "12.46",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.14%",
"avg": "0.14%",
"max": "0.14%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "VISA",
"expandable": false,
"negative": false,
"total": 402.25,
"totalFormatted": "402.25",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "US Acquirer Service Fee - Credit",
"expandable": false,
"negative": false,
"total": 142.96,
"totalFormatted": "142.96",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.14%",
"avg": "0.14%",
"max": "0.14%"
},
"detailLines": null
},
{
"id": "",
"description": "US Acquirer Service Fee - Debit",
"expandable": false,
"negative": false,
"total": 259.29,
"totalFormatted": "259.29",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.13%",
"avg": "0.13%",
"max": "0.13%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "AMEX",
"expandable": false,
"negative": false,
"total": 32.6,
"totalFormatted": "32.60",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "US Assessment Fee",
"expandable": false,
"negative": false,
"total": 32.6,
"totalFormatted": "32.60",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.17%",
"avg": "0.17%",
"max": "0.17%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "DISC",
"expandable": false,
"negative": false,
"total": 33.86,
"totalFormatted": "33.86",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "Discover Acquirer Assessment Fee",
"expandable": false,
"negative": false,
"total": 33.86,
"totalFormatted": "33.86",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.14%",
"avg": "0.14%",
"max": "0.14%"
},
"detailLines": null
}
]
}
]
}
]
},
{
"id": "",
"description": "Non Passthrough Fees",
"expandable": false,
"negative": false,
"total": 215.83,
"totalFormatted": "215.83",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "VISA",
"expandable": false,
"negative": false,
"total": 119.67,
"totalFormatted": "119.67",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "International ACQ - IAF",
"expandable": false,
"negative": false,
"total": 2.05,
"totalFormatted": "2.05",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.45%",
"avg": "0.45%",
"max": "0.45%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF DOM Credit Auth",
"expandable": false,
"negative": false,
"total": 27.4,
"totalFormatted": "27.40",
"perTranFeeRange": {
"min": "0.0195",
"avg": "0.0195",
"max": "0.0195"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF DOM Credit Auth Reversal",
"expandable": false,
"negative": false,
"total": 0.02,
"totalFormatted": "0.02",
"perTranFeeRange": {
"min": "0.0195",
"avg": "0.0195",
"max": "0.0195"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF DOM Debit Auth",
"expandable": false,
"negative": false,
"total": 71.67,
"totalFormatted": "71.67",
"perTranFeeRange": {
"min": "0.0155",
"avg": "0.0155",
"max": "0.0155"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF DOM Debit Auth Reversal",
"expandable": false,
"negative": false,
"total": 0.11,
"totalFormatted": "0.11",
"perTranFeeRange": {
"min": "0.0155",
"avg": "0.0155",
"max": "0.0155"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF INTL Credit Auth",
"expandable": false,
"negative": false,
"total": 0.12,
"totalFormatted": "0.12",
"perTranFeeRange": {
"min": "0.0395",
"avg": "0.0395",
"max": "0.0395"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NAPF INTL Debit Auth",
"expandable": false,
"negative": false,
"total": 0.36,
"totalFormatted": "0.36",
"perTranFeeRange": {
"min": "0.0355",
"avg": "0.0355",
"max": "0.0355"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "US Acquirer ISA Base Purchase",
"expandable": false,
"negative": false,
"total": 4.53,
"totalFormatted": "4.53",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "1%",
"avg": "1%",
"max": "1%"
},
"detailLines": null
},
{
"id": "",
"description": "VS FANF CP",
"expandable": false,
"negative": false,
"total": 2,
"totalFormatted": "2.00",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "VS RAF Never Approve Domestic",
"expandable": false,
"negative": false,
"total": 0.3,
"totalFormatted": "0.30",
"perTranFeeRange": {
"min": "0.10",
"avg": "0.10",
"max": "0.10"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "Visa Acquirer Credit Voucher Fee Credit",
"expandable": false,
"negative": false,
"total": 0.02,
"totalFormatted": "0.02",
"perTranFeeRange": {
"min": "0.0195",
"avg": "0.0195",
"max": "0.0195"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "Visa Acquirer Credit Voucher Fee Debit/PPD",
"expandable": false,
"negative": false,
"total": 0.09,
"totalFormatted": "0.09",
"perTranFeeRange": {
"min": "0.0155",
"avg": "0.0155",
"max": "0.0155"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "Visa BASE II Transmission Fee",
"expandable": false,
"negative": false,
"total": 11,
"totalFormatted": "11.00",
"perTranFeeRange": {
"min": "0.0018",
"avg": "0.0018",
"max": "0.0018"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "MC",
"expandable": false,
"negative": false,
"total": 86.65,
"totalFormatted": "86.65",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "ACQ Program Support",
"expandable": false,
"negative": false,
"total": 3.48,
"totalFormatted": "3.48",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.85%",
"avg": "0.85%",
"max": "0.85%"
},
"detailLines": null
},
{
"id": "",
"description": "Cross Border - Domestic",
"expandable": false,
"negative": false,
"total": 2.46,
"totalFormatted": "2.46",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.60%",
"avg": "0.60%",
"max": "0.60%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Acquirer License Fee",
"expandable": false,
"negative": false,
"total": 17.66,
"totalFormatted": "17.66",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0.01%",
"avg": "0.01%",
"max": "0.01%"
},
"detailLines": null
},
{
"id": "",
"description": "MC Safety Net Acquirer Fee",
"expandable": false,
"negative": false,
"total": 2.15,
"totalFormatted": "2.15",
"perTranFeeRange": {
"min": "0.0007",
"avg": "0.0007",
"max": "0.0007"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "Mastercard Location Fee",
"expandable": false,
"negative": false,
"total": 1.25,
"totalFormatted": "1.25",
"perTranFeeRange": {
"min": "0.00",
"avg": "0.00",
"max": "0.00"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NABU Auth",
"expandable": false,
"negative": false,
"total": 59.61,
"totalFormatted": "59.61",
"perTranFeeRange": {
"min": "0.0195",
"avg": "0.0195",
"max": "0.0195"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "NABU Returns",
"expandable": false,
"negative": false,
"total": 0.04,
"totalFormatted": "0.04",
"perTranFeeRange": {
"min": "0.0195",
"avg": "0.0195",
"max": "0.0195"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "DISC",
"expandable": false,
"negative": false,
"total": 6.31,
"totalFormatted": "6.31",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "DS Network Authorization Fee",
"expandable": false,
"negative": false,
"total": 5.57,
"totalFormatted": "5.57",
"perTranFeeRange": {
"min": "0.019",
"avg": "0.019",
"max": "0.019"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
},
{
"id": "",
"description": "Discover Data Usage Fee",
"expandable": false,
"negative": false,
"total": 0.74,
"totalFormatted": "0.74",
"perTranFeeRange": {
"min": "0.0025",
"avg": "0.0025",
"max": "0.0025"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
}
]
},
{
"id": "",
"description": "AMEX",
"expandable": false,
"negative": false,
"total": 3.2,
"totalFormatted": "3.20",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": [
{
"id": "",
"description": "Amex Acquirer Transaction Fee",
"expandable": false,
"negative": false,
"total": 3.2,
"totalFormatted": "3.20",
"perTranFeeRange": {
"min": "0.02",
"avg": "0.02",
"max": "0.02"
},
"transactionPercentageRange": {
"min": "0%",
"avg": "0%",
"max": "0%"
},
"detailLines": null
}
]
}
]
},
{
"id": "",
"description": "Ignored Costs",
"expandable": false,
"negative": false,
"total": 0,
"totalFormatted": "0.00",
"perTranFeeRange": null,
"transactionPercentageRange": null,
"detailLines": null
}
]
}
]
}
]
}
- API Credential Types: Partner
- Required Role: Partner API Access
This API allows partners to pull down the low level data used to compute a partner commission for a specific merchant statement.
The statementId
is required and must be the id of a valid merchant invoice of type statement
.
Authorization Responses
When you execute authorization requests via terminals or directly via the gateway, BlockChyp returns just about everything except PCI scoped information.
While much of this information is self-documenting, we thought it might be helpful to provide a bit more detail on the fields returned by a transaction.
In this section, we'll show a typical sample response and provide a detailed documentation for all the fields.
Sample response for an EMV contact transaction:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "688149",
"transactionId": "DRJSIVMOHAI6VKFSAJBKYEIAAQ",
"transactionRef": "30188518136",
"transactionType": "charge",
"timestamp": "2020-05-04T18:50:22Z",
"tickBlock": "0003d28eb5d1b62e9b8d4337a9a62d3403ab0fe419839048042c380f584983a5",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "103.81",
"authorizedAmount": "103.81",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "A84402A0BC10D1F5",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"tsi": "6800",
"merchantName": "CLI Regression Test",
"applicationLabel": "VISA CREDIT",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "103.81",
"transactionType": "charge",
"entryMethod": "CHIP",
"cashBackAmount": "0.00",
"surcharge": "3.81",
"cashDiscount": "0.00"
},
"customer": {
"id": "P7UV23UOEII6VJCUAJBKYEIAAI",
"customerRef": "",
"firstName": "Peter",
"lastName": "Gregory",
"companyName": "Raviga Capital",
"emailAddress": "peter@raviga.capital",
"smsNumber": "9136488888",
"paymentMethods": null
},
"whiteListedCard": null,
"storeAndForward": false
}
Field | Description |
---|---|
success | Returns true if no unexpected error occurred processing the transaction. This doesn't mean the transaction was approved; just that no unexpected error occurred. If this value is false, it usually indicates network trouble, a bad configuration, or invalid parameters. |
error | If success is false, this field will include some text describing the error. |
responseDescription | A narrative description of the response. There are no hard coded values for this field, so don't hard code any string tests when using this field. |
approved | Returns true if the transaction was approved. |
authCode | Authorization code returned by the payment card network. |
transactionId | BlockChyp assigned ID for the transaction. You'll need this for capturing preauths, voids, or giving refunds. You should store it in your transaction records. |
transactionRef | If you passed in a transactionRef with the authorization request (which you should definitely do), it will be echoed back here. |
transactionType | Echoes back the transaction type. For a terminal transaction, will be charge , preauth , enroll , or refund . |
timestamp | The date and time BlockChyp processed the transaction in ISO-8601 format. Always returned in UTC. |
tickBlock | The most recent clockchain hash when the transaction was processed. You don't really need to worry about this unless you're dealing with low level blockchain stuff. |
test | A boolean flag indicating that this was a test transaction. |
partialAuth | Flag indicates that the transaction was a partial auth, meaning that the transaction was authorized for an amount less than the requested amount. If your system supports gift cards, you'll need to check for this. |
altCurrency | A flag indicating that the transaction was paid for in a different currency than the request. |
fasAuth | A flag indicating that the customer presented an FSA or HSA card for payment. |
currencyCode | The three character ISO code for the currency used for the transaction. Since BlockChyp is currently US only, this will almost always be USD . |
requestedAmount | Amount requested for the transaction. |
authorizedAmount | Amount authorized for the transaction. This will usually be the same as requestedAmount unless the transaction was declined or a partial authorization. |
entryMethod | Indicates the entry method. For Contact EMV, this will be CHIP . |
paymentType | Indicates the card association or card type. VISA , MC , DEBIT , etc. |
maskedPan | The card number with all digits other than the last four masked out. |
cardHolder | The card holder's name. |
receiptSuggestions | A collection of fields that we strongly recommend you put on all printed receipts. If you put all these fields on your receipts, 90% of the stuff you'll need to do to ensure you're following all the EMV rules is done. |
aid | Application Identifier. Taken from EMV tag 9F06 , this identifies the app on the chip selected by the terminal. Required on all EMV receipts. |
arqc | Application Cryptogram. Taken from EMV tag 9F26 , this is the unique transaction signature generated by the chip. This is not required on receipts, but we recommend it because this value is real proof that a chip was present. |
iad | Issuer Application Data. Taken from EMV tag 9F10 , this is pass through information generated by the card issuer's chip application. Purpose and content vary by card issuer. |
tvr | Terminal Verification Response. Taken from EMV tag 95 , this is a bitfield that documents what steps the terminal took to verify the card. |
tsi | Transaction Status Information. Taken from EMV tag 9B , this is a bitfield that documents all the risk management steps performed to authorize the transaction, whether done by the chip or the terminal. |
merchantName | Merchant's name as it should appear on the receipt. |
applicationLabel | The human readable application name that goes along with the AID. |
requestSignature | This will be true if the transaction requires a written signature and the terminal didn't capture it. It's under receipt suggestions since it means you'll need to put a signature line on the printed receipt. |
cashBackAmount | Indicates the amount of cash back the customer requested if this was a debit transaction |
surcharge | For cash discount and surcharge enabled accounts, returns the surcharge applied to the transaction. |
cashDiscount | If payment method was a debit card and the merchant is using cash discounting, this will return the offsetting cash discount. |
customer | If a customer was created as part of the transaction or if the presented card was previously associated with a customer record, the full customer record is returned. |
whiteListedCard | This field returns detailed card information if the card belongs to a white listed BIN. This has to be configured on a per merchant basis. This allows developers to use the terminal as a dumb terminal and process the payment on their own. This is typically only used for corporate gift card systems. |
storeAndForward | A flag indicating that the transaction was conditionally authorized offline as a store and forward transaction. |
Working With Signatures
Linux/Mac OS: ./blockchyp -test -type="charge" -terminal="Test Terminal" -amount="25.00"
Windows: ./blockchyp.exe -test -type="charge" -terminal="Test Terminal" -amount="25.00"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go"
)
func chargeExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "55.00",
SigFormat: blockchyp.SignatureFormatPNG,
SigWidth: 400,
}
response, err := client.Charge(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "55.00",
SigFormat = SignatureFormat.PNG,
SigWidth = 400,
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ChargeAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class ChargeExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("55.00");
request.setSigFormat(SignatureFormat.PNG);
request.setSigWidth(400);
// Send the request
AuthorizationResponse response = client.charge(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '55.00',
'sigFormat' => BlockChyp::SIGNATURE_FORMAT_PNG,
'sigWidth' => 400,
];
$response = BlockChyp::charge($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
"test": true,
"terminalName": 'Test Terminal',
"amount": '55.00'
"sigFormat": SignatureFormat::PNG,
"sigWidth": 400,
}
response = blockchyp.charge(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "55.00",
"sigFormat": blockchyp.SignatureFormat.PNG,
"sigWidth": 400,
}
# run the transaction.
response = client.charge(request)
print("Response: %r" % response)
let BlockChyp = require("BlockChyp");
let client = BlockChyp.newClient({
apiKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
bearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
signingKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947"
});
// setup request object
request = {
test: true,
terminalName: 'Test Terminal',
amount: '55.00',
sigFormat: SignatureFormat.PNG,
sigWidth: 400,
}
response = client.charge(request)
// view the result
console.log("Response: " + JSON.stringify(response))
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request[@"test"] = @YES;
request[@"terminalName"] = @"Test Terminal";
request[@"amount"] = @"55.00";
request[@"sigFormat"] = SIGNATURE_FORMAT_PNG;
request[@"sigWidth"] = @400;
[client chargeWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"authCode", [response objectForKey:@"authCode"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "55.00"
request["sigFormat"] = SIGNATURE_FORMAT_PNG
request["sigWidth"] = 400
client.charge(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("authCode" + ": " + (response["authCode"] as? String).unsafelyUnwrapped)
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "052509",
"transactionId": "KJ3DPHULBAI6VOTSNSLM7WZLHE",
"transactionRef": "04781125618",
"transactionType": "charge",
"timestamp": "2020-04-30T18:28:10Z",
"tickBlock": "009991a8ac7b6a4420760e1e14e1689c88be2a610a033d6908c1b04b5c00f9da",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "25.00",
"authorizedAmount": "25.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "CHIP",
"paymentType": "VISA",
"maskedPan": "************0010",
"cardHolder": "UAT USA/Test Card 04",
"avsResponse": "",
// sig file returned in hex if sigFile output not specified
"sigFile":"89504e470d0a1a0a0000000d49484452000...",
"receiptSuggestions": {
"aid": "A0000000031010",
"arqc": "BDFD1A64620D9382",
"iad": "06010A03A0B800",
"tvr": "8000008800",
"tsi": "6800",
"merchantName": "Test Merchant",
"applicationLabel": "VISA CREDIT",
"requestSignature": false,
"maskedPan": "************0010",
"authorizedAmount": "25.00",
"transactionType": "charge",
"entryMethod": "CHIP",
"cashBackAmount": "0.00",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
Believe it or not, we still live in a world where people sometimes have to sign their names. This might be in the context of a payment transaction or it could be in the context of signing an agreement.
No matter the context, written signatures in BlockChyp are always handled the same way.
When Are Signatures Required?
It used to be always in the days before EMV. These days it's more complicated. For Terms and Conditions requests, the answer is always unless you specifically disable signature capture. (Not common.)
For terminal transactions, it depends on the outcome of a conversation between the card and the terminal. If the card and the terminal can't use some other form of customer verification (like a PIN code), the terminal will usually prompt for a signature. Mag stripe cards (other than gift or EBT) will always prompt for a signature.
Disabling Signatures
You can disable signatures in the merchant profile or you can pass in a
disableSignature
flag with a transaction. This will bypass electronic
signature capture. Bear in mind that the signature CVM requirement doesn't
go away just because you pass in the flag. For payment transactions, you'll
still usually need to capture a signature. Check the requestSignature
flag
under receiptSuggestions
to determine if you need to get a written signature
on the receipt. This will ensure your receipts are always compliant and
you won't have to worry about the rules.
Default Behavior
Signatures are typically only needed during audits or fraud investigations and for that reason we don't burden you with storing them by default. We store the signatures in our system for all payment and Terms & Conditions transactions. If you need to view or audit a signature, just bring up the T&C Log entry or transaction in the BlockChyp dashboard and you'll be able to inspect it.
The only exception are signatures captured with the direct Capture Signature API. This is considered a low level terminal API so you'll have to do some extra work to get your hands on these signatures.
Getting Signature Images
If for some reason you actually want signature images you can pass in a few extra parameters with your request and get signatures back in a common raster format. BlockChyp can return the image as hexadecimal encoded binary as part of the response (see the example response) or you can specify a file location the image should be exported to.
- sigFormat: The file format you'd like that signature in. Currently supported options are PNG or JPEG.
- sigWidth: Max width of the image in pixels. If provided, we'll scale the underlying vector image to your preferred max width while preserving the aspect ratio.
- sigFile: An optional file location to which the image file will be written.
Gift Cards
The BlockChyp gift card system is quite a bit different from conventional gift cards. Conventional gift cards, just like credit cards, typically rely on 16 digit primary account numbers. These numbers are relatively easy to guess via brute force, which makes them vulnerable to a host of security problems. But unlike conventional credit card numbers, gift cards aren’t protected by PCI and often implemented by white listing gift card BIN ranges. They’re usually the most insecure part of any payment system.
BlockChyp gift cards do have 16 digit numbers printed on them for familiarity and convenience, but these numbers are for identification purposes only. Under the hood every BlockChyp gift card has a unique set of P256 elliptic curve keys.
The elliptic curve keys are used to open a new blockchain when new gift cards are activated and, as the card is redeemed and recharged, the keys are used to sign transactions. This means that shared secrets (i.e. primary account numbers) are never transmitted over the network with a BlockChyp gift card transaction. The transaction could be intercepted or sent in the clear and not compromise the gift card.
We’ve gone through a lot of trouble to insulate developers from dealing with blockchain details. BlockChyp gift card transactions are like any other transaction with the exception of how gift cards are identified. Authorization requests for gift card transactions return the elliptic curve public key in the publicKey field. If you need to keep track of gift cards in your SaaS or point-of-sale systems, use the public key. A remaining balance is also returned with every gift card authorization.
Although you don’t have to understand blockchain technology to work with BlockChyp gift cards, the merchant and developer dashboards expose methods of browsing and viewing the raw blockchain for the curious.
Third Party Gift Cards
For merchants with existing gift card liability, these gift cards can be easily imported into BlockChyp. Simply provide your liability report to your BlockChyp representative. BlockChyp will review the liability data and import the gift cards into your BlockChyp account.
Third party gift cards are redeemed just like BlockChyp gift cards. Simply swipe them on the terminal at the present card prompt.
BIN Range White Listing
In the event that developers need to process certain card types outside of BlockChyp, it is possible to white list BIN ranges and have the raw card data returned. Configuring a merchant account for white listing does require a security review by BlockChyp. If you need to white list a BIN range, contact BlockChyp support to complete the setup.
EBT
Linux/Mac OS: ./blockchyp -test -type="charge" -terminal="Test Terminal" -amount="25.00" -ebt
Windows: ./blockchyp.exe -test -type="charge" -terminal="Test Terminal" -amount="25.00" -ebt
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go"
)
func chargeExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "55.00",
CardType: blockchyp.CardTypeEBT,
}
response, err := client.Charge(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "55.00",
CardType = CardType.EBT,
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ChargeAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class ChargeExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("55.00");
request.setCardType(CardType.EBT);
// Send the request
AuthorizationResponse response = client.charge(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '55.00',
'cardType' => BlockChyp::CARD_TYPE_EBT,
];
$response = BlockChyp::charge($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
"test": true,
"terminalName": 'Test Terminal',
"amount": '55.00',
"cardType": CardType::EBT,
}
response = blockchyp.charge(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "55.00",
"cardType": blockchyp.CardType.EBT,
}
# run the transaction.
response = client.charge(request)
print("Response: %r" % response)
let BlockChyp = require("BlockChyp");
let client = BlockChyp.newClient({
apiKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
bearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
signingKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947"
});
// setup request object
request = {
test: true,
terminalName: 'Test Terminal',
amount: '55.00',
cardType: CardType.EBT,
}
response = client.charge(request)
// view the result
console.log("Response: " + JSON.stringify(response))
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request[@"test"] = @YES;
request[@"terminalName"] = @"Test Terminal";
request[@"amount"] = @"55.00";
request[@"cardType"] = CARD_TYPE_EBT;
[client chargeWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"authCode", [response objectForKey:@"authCode"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "55.00"
request["cardType"] = CARD_TYPE_EBT
client.charge(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("authCode" + ": " + (response["authCode"] as? String).unsafelyUnwrapped)
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "353248",
"transactionId": "CMKSS74OHAI6VG24AJBKYEIAAM",
"transactionRef": "30828430488",
"transactionType": "charge",
"timestamp": "2020-05-04T22:25:08Z",
"tickBlock": "000f694d8d7b497ae3730e92bb84af0c441ed66cd7200176aaf6c699052f8bf5",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "55.00",
"authorizedAmount": "55.00",
"remainingBalance": "45.00",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "SWIPE",
"paymentType": "EBT",
"maskedPan": "************1112",
"cardHolder": "BEGHETTI/NELSON",
"avsResponse": "",
"receiptSuggestions": {
"merchantName": "CLI Regression Test",
"requestSignature": false,
"maskedPan": "************1112",
"authorizedAmount": "55.00",
"transactionType": "charge",
"entryMethod": "SWIPE",
"pinVerified": true,
"cashBackAmount": "0.00",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
EBT (Electronic Benefits Transfer) cards are payment cards used in the United States to access government food assistance programs. They replaced food stamps some years ago and help prevent people who are struggling financially from going hungry.
Unfortunately EBT is an often overlooked part of a payments system since most of us who build payment systems for a living are fortunate enough to not need them.
At BlockChyp we believe payment methods intended to help people who are struggling deserve extra effort and scrutiny. If you've ever been at the grocery store behind a mother when the WIC or EBT redemption processes were slow or glitchy, you've seen the human cost of a poorly implemented EBT system.
EBT systems should be simple and fast so as not to attract attention and spare EBT cardholders any unnecessary embarrassment or anxiety.
Luckily supporting EBT in BlockChyp is easy. To run an EBT transaction, just set
the ebt
flag when you run a normal charge transaction.
This will put the terminal in EBT mode, prompt the user for their EBT pin and execute the transaction. As a courtesy, we'll even return the remaining balance on the card as part of the transaction response.
Manual EBT
EBT cards get beat up and their magnetic stripes wear out just like conventional mag
stripe cards. For this reason, we support a keyed entry mode for EBT cards.
Just set the manual
flag along with ebt
to run a manual EBT transaction.
Balance Checks
The Balance API referenced above can be used to check the remaining balance on
an EBT card without running a transaction. Just set the ebt
flag or CardType.
You can likewise check the balance of a manually entered EBT card by adding
the manual
flag.
Cryptocurrency
Charge Example:
Linux/Mac OS: ./blockchyp -test -cmd="charge" -terminal="Test Terminal" -amount="25.00" -crypto="ANY"
Windows: ./blockchyp.exe -test -cmd="charge" -terminal="Test Terminal" -amount="25.00" -crypto="ANY"
package main
import (
"fmt"
"log"
blockchyp "github.com/blockchyp/blockchyp-go"
)
func chargeExample() {
// sample credentials
creds := blockchyp.APICredentials{
APIKey: "ZDSMMZLGRPBPRTJUBTAFBYZ33Q",
BearerToken: "ZLBW5NR4U5PKD5PNP3ZP3OZS5U",
SigningKey: "9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947",
}
// instantiate the client
client := blockchyp.NewClient(creds)
// setup request object
request := blockchyp.AuthorizationRequest{
Test: true,
TerminalName: "Test Terminal",
Amount: "55.00",
Cryptocurrency: "ANY",
}
response, err := client.Charge(request)
if err != nil {
log.Fatal(err)
}
//process the result
if response.Approved {
fmt.Println("approved")
}
fmt.Printf("Response: %+v\n", response)
}
// Populate request parameters.
AuthorizationRequest request = new AuthorizationRequest
{
Test = true,
TerminalName = "Test Terminal",
Amount = "55.00",
Cryptocurrency = "ANY",
};
// Run the transaction.
AuthorizationResponse response = await blockchyp.ChargeAsync(request);
// View the result.
Console.WriteLine(response);
package com.blockchyp.client.examples;
import java.util.ArrayList;
import java.util.Collection;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.blockchyp.client.APICredentials;
import com.blockchyp.client.BlockChypClient;
import com.blockchyp.client.dto.AuthorizationRequest;
import com.blockchyp.client.dto.AuthorizationResponse;
public class ChargeExample {
@SuppressWarnings({ "rawtypes", "unchecked" })
public static void main(String[] args) throws Exception {
APICredentials creds = new APICredentials();
creds.setApiKey(System.getenv("BC_API_KEY"));
creds.setBearerToken(System.getenv("BC_BEARER_TOKEN"));
creds.setSigningKey(System.getenv("BC_SIGNING_KEY"));
BlockChypClient client = new BlockChypClient(creds);
// Set request parameters
AuthorizationRequest request = new AuthorizationRequest();
request.setTest(true);
request.setTerminalName("Test Terminal");
request.setAmount("55.00");
request.setCryptocurrency("ANY");
// Send the request
AuthorizationResponse response = client.charge(request);
// View the result
System.out.println("Response: " + prettyPrint(response));
}
public static String prettyPrint(Object object) throws Exception {
ObjectWriter writer = new ObjectMapper()
.writer()
.withDefaultPrettyPrinter();
return object.getClass().getSimpleName()
+ ": "
+ writer.writeValueAsString(object);
}
}
<?php
// For composer based systems
require_once('vendor/autoload.php');
// For manual installation
#require_once('/path/to/blockchyp/init.php');
use BlockChyp\BlockChyp;
BlockChyp::setApiKey(getenv('BC_API_KEY'));
BlockChyp::setBearerToken(getenv('BC_BEARER_TOKEN'));
BlockChyp::setSigningKey(getenv('BC_SIGNING_KEY'));
// Populate request values
$request = [
'test' => true,
'terminalName' => 'Test Terminal',
'amount' => '55.00',
'cryptocurrency' => 'ANY',
];
$response = BlockChyp::charge($request);
// View the result
echo 'Response: ' . print_r($response, true) . PHP_EOL;
# frozen_string_literal: true
require 'blockchyp'
blockchyp = BlockChyp::BlockChyp.new(
ENV['BC_API_KEY'],
ENV['BC_BEARER_TOKEN'],
ENV['BC_SIGNING_KEY']
)
# Set request parameters
request = {
test: true,
terminalName: 'Test Terminal',
amount: '55.00'
cryptocurrency: 'ANY'
}
response = blockchyp.charge(request)
puts "Response: #{response.inspect}"
import os
import blockchyp
# initialize a client.
client = blockchyp.Client(
api_key=os.environ["BC_API_KEY"],
bearer_token=os.environ["BC_BEARER_TOKEN"],
signing_key=os.environ["BC_SIGNING_KEY"],
)
# populate request parameters.
request = {
"test": True,
"terminalName": "Test Terminal",
"amount": "55.00",
"cryptocurrency": "ANY",
}
# run the transaction.
response = client.charge(request)
print("Response: %r" % response)
let BlockChyp = require('@blockchyp/blockchyp-js');
let client = BlockChyp.newClient({
apiKey: 'ZDSMMZLGRPBPRTJUBTAFBYZ33Q',
bearerToken: 'ZLBW5NR4U5PKD5PNP3ZP3OZS5U',
signingKey: '9c6a5e8e763df1c9256e3d72bd7f53dfbd07312938131c75b3bfd254da787947'
});
client.charge({
test: true,
terminalName: 'Test Terminal',
amount: '55.00',
cryptocurrency: 'ANY',
})
.then(function (response) {
console.log('Response: ' + JSON.stringify(response.data))
})
.catch(function (error) {
console.log(error)
});
#import <Foundation/Foundation.h>
#import <BlockChyp/BlockChyp.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BlockChyp *client = [[BlockChyp alloc]
initWithApiKey:@"SPBXTSDAQVFFX5MGQMUMIRINVI"
bearerToken:@"7BXBTBUPSL3BP7I6Z2CFU6H3WQ"
signingKey:@"bcae3708938cb8004ab1278e6c0fcd68f9d815e1c3c86228d028242b147af58e"];
NSMutableDictionary *request = [[NSMutableDictionary alloc] init];
request["test"] = true
request["terminalName"] = @"Test Terminal"
request["amount"] = @"55.00"
request["cryptocurrency"] = @"ANY"
[client chargeWithRequest:request handler:^(NSDictionary *request, NSDictionary *response, NSError *error) {
NSNumber *success = [response objectForKey:@"approved"];
if (success.boolValue) {
NSLog(@"approved");
}
NSLog(@"%@: %@", @"authCode", [response objectForKey:@"authCode"])
NSLog(@"%@: %@", @"authorizedAmount", [response objectForKey:@"authorizedAmount"])
}];
[pool drain];
return 0;
}
import BlockChyp
class ExampleClass {
func example() {
let client = BlockChyp.init(
apiKey: "ZN5WQGX5PN6BE2MF75CEAWRETM",
bearerToken: "SVVHJCYVFWJR2QKYKFWMZQVZL4",
signingKey: "7c1b9e4d1308e7bbe76a1920ddd9449ce50af2629f6bb70ed3c110365935970b"
)
var request: [String:Any] = [:]
request["test"] = true
request["terminalName"] = "Test Terminal"
request["amount"] = "55.00"
request["cryptocurrency"] = "ANY"
client.charge(withRequest: request, handler: { (request, response, error) in
let approved = response["approved"] as? Bool
if (approved.unsafelyUnwrapped) {
NSLog("approved")
}
NSLog("authorizedAmount" + ": " + (response["authorizedAmount"] as? String).unsafelyUnwrapped)
})
}
Example response encoded as JSON:
{
"success": true,
"error": "",
"responseDescription": "pending-confirmation",
"approved": false,
"transactionId": "STBGKO7HOQI6ZPBHAJBKYEIAAQ",
"batchId": "EP55BSHHNEI6ZLCSAJBKYEIAAQ",
"transactionType": "charge",
"timestamp": "2022-06-08T21:47:22Z",
"tickBlock": "000c235065f7e89c264efffca8d05c7d4f85c3c78362faf9855c010c72eb46d2",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "4.20",
"authorizedAmount": "0.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "",
"confirmed": false,
"cryptoAuthorizedAmount": "0.00013862",
"cryptoNetworkFee": "0.000001410",
"cryptocurrency": "BTC",
"cryptoNetwork": "L1",
"cryptoReceiveAddress": "tb1qvsktxrcefpy5cvvvhsn2rs8f6hnynmgnp98v9h",
"cryptoBlock": "",
"cryptoTransactionId": "e39385e8a1bbd4e855a7ab11ab09995fcbcb445df77be55af91807b989612f8e",
"cryptoPaymentRequest": "bitcoin:tb1qvsktxrcefpy5cvvvhsn2rs8f6hnynmgnp98v9h?amount=0.00013862&label=CLI+Regression+Test",
"cryptoStatus": "pending-confirmation",
"entryMethod": "CRYPTO",
"paymentType": "BTC",
"avsResponse": "",
"receiptSuggestions": {
"terminalId": "N27CXMG5KYI6ZH5DAJBKYEIAAM",
"merchantName": "CLI Regression Test",
"merchantId": "MFLQFJUJJAI6TBE3AJBKYEIAAQ",
"requestSignature": false,
"authorizedAmount": "0.00",
"transactionType": "charge",
"entryMethod": "CRYPTO"
},
"customer": null,
"customers": null,
"whiteListedCard": null,
"storeAndForward": false
}
BlockChyp has recently unveiled basic support for cryptocurrency transactions including Bitcoin. The development effort required to support crypto is minimal, but some development effort is needed in order to avoid confusing end of day procedures.
For example, if crypto were treated as just another payment method, it could lead to discrepancies between actual merchant deposits and expected deposits.
Running a crypto transaction is identical to a normal charge transaction, with one exception. Cryptocurrency
transactions are enabled via the crypto
parameter. Developers can pass in a three digit
currency code to specify a specific cryptocurrency, or ANY
in order to support any cryptocurrency
the merchant may have enabled. Use of the ANY
value will ensure that your point-of-sale system
doesn't need updating as BlockChyp rolls out support for additional cryptocurrencies or second level
networks over time.
When a crypto transaction is initiated, the terminal will convert the amount requested into the selected cryptocurrency at the current exchange rate (updated every ten minutes) and display a QR code on the terminal. The customer is then prompted to use their mobile crypto wallet to submit a transaction directly to the network. BlockChyp will scan the blockchain and provide a response to the terminal once the transaction is detected on the public crypto network.
Since crypto transactions aren't always confirmed right away, the approved
flag is normally returned as
false until a transaction is confirmed. Developers should look at the cryptocurrency fields in the response to
determine which cryptocurrency was used, the exchange rate, fee paid by the sender and other relevant fields.
Developers should consider a transaction paid when the cryptoStatus
field is pending-confirmation
or confirmed
.
Crypto Response Fields
The fields below are unique to crypto transactions and may be needed to properly support crypto transactions in point-of-sale systems.
- cryptocurrency: The common currency code identifying the cryptocurrency used for the transactions. (e.g. BTC for Bitcoin)
- cryptoNetwork: Specifies if the transactions was processed on the main blockchain or a second level network. For example,
L1
indicates the Bitcoin main chain andL2
would indicate Bitcoin Lighting. - cryptoAuthorizedAmount: Authorized amount in cryptocurrency.
- cryptoNetworkFee: Fee paid to the crypto network or miner by the sender.
- cryptoReceiveAddress: Address the transaction was sent to. Should an address controlled by the merchant.
- cryptoBlock: Hash or ID of the block a transaction is placed in. May be empty for L2 networks or until a transaction is mined.
- cryptoTransactionId: Identifier assigned to the transaction by the crypto/blockchain network.
- cryptoPaymentRequest: Full payment request URI that was encoded as QR code on the terminal when payment was requested.
- cryptoStatus: Status of the crypto transactions. Usually
pending-confirmation
orconfirmed
.
Crypto Batches
To avoid confusing FIAT (US Dollar) transactions with cryptocurrency transactions, crypto transactions are grouped into special batches called crypto batches. This means that a merchant that does a mixture of conventional payments and crypto payments will have two batches per day.
Bitcoin
As of this writing, BlockChyp only supports Level 1 Bitcoin transactions, but Lightning support and other cryptocurrency support is planned. In order to receive Bitcoin, Merchants must first enable Bitcoin in the Cryptocurrency settings section of the merchant portal and configure a default receive address. Merchants may optionally enable Custom Bitcoin Addresses if the point of sale solution has access to the hot Bitcoin wallet and the capability to generate unique receive addresses for each transaction. Otherwise, leave Custom Bitcoin Addresses disabled.
By default, Merchants are responsible for creating their own wallets or opening their own exchange accounts to receive and manage their Bitcoin.
Confirmation Time and Risk
Bitcoin transactions on the main blockchain are not instantaneous and care should be taken to prevent fraud. In order for a Bitcoin transaction to be considered irreversible, it's customary to wait for six confirmations. This means that a transaction is picked up by a miner, placed into a block, and five additional blocks are produced/mined by the network. This can take several hours. We recommend developers verify that crypto transactions are confirmed as part of closing or end of day procedures via the Transaction Status API.
We also recommend that merchants take steps to either prevent the release of merchandise or services until crypto transactions are fully confirmed or set an upper limit on the value of merchandise that can be released without confirmation. BlockChyp will provide warnings when an unconfirmed Bitcoin transaction is likely to be fraudulent due to paying below market transaction fees.
Bitcoin Refunds
Bitcoin refunds require access to the merchant's wallet and are not supported at this time. In order to process a refund, the merchant must use their wallet or crypto exchange and process the refund manually.
Testing Bitcoin Transactions
All test merchant accounts assume use of Bitcoin's testnet3 network and blockchain. In order to test Bitcoin transactions, we recommend you download a mobile wallet with testnet support (like Bitpay) and configure a testnet3 wallet. There are a number of public testnet3 faucets that can be used to obtain testnet3 Bitcoin for testing.
Cash Discounting
Cash discounting is another payments industry nonsense term. The payments industry frequently uses the word discount when they mean fees, and this is no exception. Cash discounting is the practice of adding surcharges to cover credit card processing fees and removing those fees (or discounting them) when the customer pays in cash or with a debit card.
BlockChyp begrudgingly supports cash discounting in several different ways.
Surcharging
This method treats cash and debit transactions normally and only adds a surcharge when an eligible credit card is presented.
Use the surcharge
flag by itself to enable this method.
Surcharging With Cash Discounting
This method adds a surcharge to all transactions, but adds an offsetting cash discount when a Debit, EBT, or Gift Card is presented.
Use the surcharge
and the cashDiscount
flags to enable this method.
True Cash Discounting
This method never applies a surcharge, but may apply an automatic discount if the customer pays with Debit, Gift Card or EBT. This is probably the most honest way to support cash discounting, but it requires that merchants raise their prices in order to build the credit card fees in. It's usually not what's intended.
Use the cashDiscount
flag by itself to support this method.
Merchant Setup
Only merchants on Flat Rate pricing are eligible for Cash Discounting since interchange rates are not known in real time. There are additional underwriting steps for cash discount merchants.
Testing Cash Discounting
To enable a test merchant account for cash discounting, login into the developer portal, bring up the test merchant you'd like to configure and click 'TEST SETTINGS'.
Here you'll see an option for enabling cash discounting and setting test pricing.
Fractional Pennies With Split Payments
Surcharging often involves rounding fractional pennies to arrive at a final surcharge total. By default, all fractional pennies are rounded up to the nearest penny. This is normally fine, but in a split tender situation rounding up all payments can end up overcharging the customer by an extra penny.
To prevent this issue, developers can override the default rounding mode by passing in an alternate rounding mode parameter with an authorization request.
Supported values for this parameter are up
, down
, and nearest
.
Note that rounding mode impacts surcharge calculations only and won't impact any other aspect of the transaction.
Cloud Relay Mode
By default, BlockChyp communicates with terminals over the local network. Terminals announce their local IP address as part of the activation process and continually update it as DHCP leases expire. The SDKs also have some fault tolerance and failure handling logic built in to keep terminals up and running even if internet access is down.
This is great if your system is running on the same network as the terminal, but an increasing number of point-of-sale systems are cloud based. If your system is one of these cloud based systems, local communication with the payment terminal isn't possible.
This is why we have cloud relay mode. In cloud relay mode, the SDKs route all terminal requests through our secure cloud and back down to the destination terminals (without requiring any custom router or firewall configuration).
You don't code for cloud relay any differently than you code for locally networked terminals. It's all handled under the SDK abstraction. This means that if your system has cloud based and on prem deployment models, you can use the same code.
Enabling Cloud Relay
Cloud relay is turned on during terminal activation. Just check the extra box during activation to enable it.
The Down Side of Cloud Relay
More Overhead: There's a bit more overhead required to run cloud relay transactions since every SDK request goes out to the cloud and back. It's still much faster than most payment systems, but it is a little slower than local mode.
No Store and Forward Support: Because the Internet is required for cloud relay mode, offline authorization via store and forward is not supported.
Store and Forward
Store and forward example response:
{
"success": true,
"error": "",
"responseDescription": "Approved Offline (SF)",
"approved": true,
"authCode": "000000",
"transactionId": "",
"transactionRef": "54300670144",
"transactionType": "charge",
"timestamp": "2020-05-04T23:39:05Z",
"tickBlock": "",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "7.77",
"authorizedAmount": "7.77",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "0.00",
"authorizedCashBackAmount": "0.00",
"entryMethod": "CHIP",
"paymentType": "DISC",
"maskedPan": "************0133",
"cardHolder": "UAT USA/Test Card 15",
"avsResponse": "",
"receiptSuggestions": {
"aid": "A0000001523010",
"arqc": "BA5ABFB8BC87C15A",
"iad": "0106A00003400000",
"tvr": "8000048800",
"tsi": "6800",
"applicationLabel": "DISCOVER",
"requestSignature": false,
"maskedPan": "************0133",
"authorizedAmount": "7.77",
"transactionType": "charge",
"entryMethod": "CHIP",
"pinVerified": true,
"cashBackAmount": "0.00",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": true
}
Sometimes the Internet goes down.
BlockChyp's store and forward system allows merchants to keep processing transactions on a restricted basis even if the internet is down and we're unable to obtain online authorizations. Offline transactions are encrypted and stored in the terminal's flash memory until Internet service is restored. Terminals can store up to 100 offline transactions.
There's no special coding required to unlock this functionality although you may want
to keep track of store and forward transactions in your system so you can check
to make sure they went through later. S&F transactions are
always identified with the storeAndForward
flag.
If you plan to support store and forward, you might consider keeping track of transactions that return this flag and use the Transaction Status API to get the online authorization status of transactions once they finally make it to the gateway.
Enabling Store and Forward
Store and Forward must be specifically enabled in the merchant profile and merchants must choose a floor limit. The terminal will authorize transactions below the floor limit offline and reject transactions above the floor limit.
The Risk
When using store and forward, the merchant is accepting the risk that some transactions may be declined online. There's usually no recourse in these situations, so store and forward should be used carefully or not at all in industries with high decline rates. In some cases our underwriters may disable it outright.
Testing Store and Forward
Testing this sort of thing has been historically tricky. The processors just tell us it works and we hope they turn out to be right. Usually they're not.
Of course, you could always just unplug your Internet every time you want to test Store and Forward. And you should try that at least once, just so you know it really works, but it's not a good idea to knock the whole office offline every time you want to test it.
For this reason, we have special trigger values that allow you to simulate Store and Forward transactions. Because you'll want to test transactions above or below the floor limit, instead of a single trigger value, we support any amount with all sevens.
For example, all of the following are valid store and forward simulation trigger amounts:
- 0.07
- 0.77
- 7.77
- 77.77
You get the idea. When you run a transaction against a test merchant account with one of these trigger amounts, the terminal will simulate a network failure during authorization. You'll get the same response you'd get for a live Store and Forward transaction.
The terminal will wait two minutes and then enter an exponential retry loop to obtain online authorization just like it would with a real network outage.
If your network is healthy, you should see your transaction in the gateway batch history within 2-3 minutes.
Receipt Requirements
{
"approved":true,
"responseDescription":"Approved",
"transactionId":"NZ6FGYAYLYI6TLVWNSLM7WZLHE",
"transactionRef":"cfd068099a4280f1f09a965d9cc522f25ef4e06a95c9a9461d59fa5deed62180",
"transactionType":"charge","timestamp":"2019-01-15T00:42:36Z",
"tickBlock":"000e61f8204a2a372cac288f833a8e0949dd50d0074d5133432dce4e78d97913",
"authCode":"612797",
"entryMethod":"CHIP",
"paymentType":"VISA",
"maskedPan":"************0010",
"cardHolder":"Test/Card 01 ",
"partialAuth":false,
"altCurrency":false,
"currencyCode":"USD",
"requestedAmount":"20.55",
"authorizedAmount":"20.55",
"receiptSuggestions":{
"aid":"A0000000031010",
"arqc":"E0A09074268A87F4",
"iad":"06010A03A0B800",
"tvr":"0240008000",
"tsi":"E800",
"merchantName":"Test Merchant",
"applicationLabel":"VISA CREDIT",
"requestSignature":true,
"maskedPan":"************0010",
"authorizedAmount":"20.55",
"transactionType":"charge",
"entryMethod":"CHIP"
}
}
BlockChyp API responses include information that most developers will use to create printed receipts. Consider the sample transaction response.
The response includes a number of fields consumers are used to seeing on receipts such as masked PAN and auth code.
It also includes a receiptSuggestions
section that collects all EMV fields we recommend putting on your receipts.
Not all card brands have the same requirements, but if you always include the following data elements on all receipts, your receipts will be compliant with all card brand receipt requirements and recommendations.
- authCode
- maskedPan
- aid
- applicationLabel
- arqc
Web Tokenizer
BlockChyp was created to make terminal based payments simpler and easier, but we still do e-commerce, even for ourselves when merchants buy terminals.
We support e-commerce in a variety of architectures, from direct use of the API (which would put e-commerce developers in PCI scope) to the more modern approach of in-browser tokenization.
The BlockChyp Tokenizer is a JavaScript library you can embed in web applications to capture and tokenize payment methods. It captures sensitive card data in a cross origin hosted iframe, keeping your system out of PCI Scope. You get back a token you can then use to interact with the BlockChyp core APIs just like any other token.
The code, documentation, and more information about the Web Tokenizer can be found on Github.
Customers and Tokens
In addition to basic tokenization, BlockChyp provides APIs for linking tokens to customer records, managing tokens, and managing or searching customer records.
Creating Tokens
Tokens can be created three different ways: via the web tokenizer, via the enroll transaction, or via sideband enrollment by adding the enroll flag to a charge, preauth, or refund transaction.
Note that the examples that follow create a token only. Subsequent sections will get into how customer records can be created and linked to payment tokens.
Web Tokenizer
For ecommerce transactions, nearly all transactions are tokenized via the BlockChyp Web Tokenizer. This technique leverages the web tokenizing library to tokenize a payment method directly in the browser
Consult the section above for more detail about the web tokenizer.
Direct Enrollment
The enroll API can be used to tokenize a card with a payment terminal.
Here's a CLI based example:
./blockchyp -test -terminal="Test Terminal" -type="enroll"
The token returned in the response can then be used for future transactions.
Sideband Enrollment
A slight variation on using the enroll API is to run a terminal charge,
preauth, or refund transaction with the enroll
flag set to true.
Here's a simple CLI based example...
./blockchyp -test -terminal="Test Terminal" -type="charge" -enroll -amount="5.00
This will run the requested transaction and return a reusable token if the transaction is approved.
Creating Customer Records
Customer records can be created directly through the customer API or as part of a payment or enroll transaction.
Direct Customer Creation
The most straightforward way to create a customer record is to use the customer API directly. This method creates a plain customer record with no associated payment records.
The following example shows how this can be done via the CLI. Examples for all programming languages can be found above in the Transaction Reference section.
./blockchyp -test -type="update-customer" -customerRef="MYID" -firstName="Peter" -lastName="Gregory" -companyName="Raviga Capital" -email="peter@raviga.capital" -sms="9136488888"
Once this record has been created, the customer id returned in the response can be used to link subsequent payment transactions to the customer record or to associate payment tokens with the customer.
Once created, a customer record can be modified by calling this came API with a customer id or customer ref.
Sideband Customer Creation
Customer records can also be created inline as part of a transaction by passing optional customer information.
Web Tokenizer
A payment method enrolled in the token vault via the web tokenizer can also be linked to a customer record.
All that's needed is to add a customer value to the request before calling the tokenize method as shown below:
Terminal Transactions
Customers can also be created inline as part of a terminal transaction. The AuthorizationRequest data model has an optional customer field that can be used to pass in customer information. If customer data is provided, the customer will be created as a side effect of the transaction.
There are also optional command line arguments that provide a shortcut for passing in customer data via the CLI:
./blockchyp -test -terminal="Test Terminal" -type="enroll" -firstName="Erlich" -lastName="Bachman" -companyName="Aviato"
Locating Customers By Payment Method
If a payment method has been tokenized and linked to a customer record, customer information is returned automatically with any subsequent payment transactions if the payment method is used again. This information is returned automatically as part of the AuthorizationResponse. There are no special parameters required to enable it.
This is a great way of determining when you have a returning customer, as seen in the following example:
./blockchyp -test -terminal="Test Terminal" -type="charge" -amount="5.00"
Retrieving Customers
Customer records, once created, can be retrieved via search and by ID.
Searching Customer Records
The customer search API executes a simple fuzzy search against the customer database. All that's needed is to pass in query text and the search will match against the customer's first name, last name, company name, or sms number.
Customer search is supported by all languages SDK's including the CLI:
./blockchyp -test -type="search-customer" -query="erlich"
Retrieving a Single Customer Record
Detailed customer records can be retrieved individually by customer id or customer ref although we recommend you use customer id. (It's a tiny bit faster and there's a guarantee that customer ids are never duplicated.)
Here's a CLI based example:
./blockchyp -test -type="get-customer" -customerId="BHR26TBF7EI6ZB2KVTPEQAAREI"
Customer records will include information about every saved payment token associated with the customer record, which you can use for payment transactions.
Retrieving Token Metadata
Developers can also look up save payment metadata, including associated customer records, by token.
Here's a CLI based example:
./blockchyp -test -type="token-metadata" -token="XTABANWPEFEX56MFLI2GICLM4E"
This API is fairly self-explanatory, but note that customer information is returned as an array because it is possible for a token to be linked to multiple customer records at once.
The customer records returned are based on the underlying payment method, not the specific token, so if a card has been tokenized more than once, every customer linked to the same underlying card will be returned.
Modifying Token Customer Associations
Special APIs are provided for manually changing the associations or links between tokens and customers. Tokens can be linked or unlinked at will.
Unlink Tokens
This API allows developers to break a relationship between a token and a customer record. Here's a basic CLI example...
./blockchyp -test -type="unlink-token" -token="N2DTGDSSZNBAX7GT5HBZPHIOWA" -customerId="XK4LRXBF6II6ZB7WVTPEQAAREI"
Link Tokens
This API allows developers to add an association between a token and a customer. If the link already exists, the request is ignored.
Here's a basic CLI example...
./blockchyp -test -type="link-token" -token="N2DTGDSSZNBAX7GT5HBZPHIOWA" -customerId="XK4LRXBF6II6ZB7WVTPEQAAREI"
Removing Customers and Tokens
Nobody likes to lose customers, but when it does happen, the token and customer delete APIs are here to help you facilitate the inevitable.
Delete Customers
The delete customer API will remove a customer record from the system.
It will not remove customer ref information from any historical transactions and it will not automatically delete tokens associated with the customer.
Here's a basic CLI example:
./blockchyp -test -type="delete-customer" -customerId="BHR26TBF7EI6ZB2KVTPEQAAREI"
Delete Tokens
The delete token API removes payment tokens from the system permanently.
Here's a CLI example:
./blockchyp -test -type="delete-token" -token=XTABANWPEFEX56MFLI2GICLM4E
Address Verification
Sample address verification response:
{
"success": true,
"error": "",
"responseDescription": "approved",
"approved": true,
"authCode": "399232",
"transactionId": "CMKSTBUOHAI6VG24AJBKYEIAAM",
"batchId": "746LP4EOFMI6VH4UAJBKYEIAAU",
"transactionType": "charge",
"timestamp": "2020-05-05T04:49:10Z",
"tickBlock": "000e11877145009475a84197f4bd0fd1414a71b5f9690fd41b39a7ad21d9108d",
"test": true,
"partialAuth": false,
"altCurrency": false,
"fsaAuth": false,
"currencyCode": "USD",
"requestedAmount": "50.00",
"authorizedAmount": "50.00",
"remainingBalance": "",
"tipAmount": "0.00",
"taxAmount": "0.00",
"requestedCashBackAmount": "",
"authorizedCashBackAmount": "",
"entryMethod": "KEYED",
"paymentType": "VISA",
"maskedPan": "************1111",
"avsResponse": "match",
"receiptSuggestions": {
"merchantName": "CLI Regression Test",
"requestSignature": false,
"maskedPan": "************1111",
"authorizedAmount": "50.00",
"transactionType": "charge",
"entryMethod": "KEYED",
"surcharge": "0.00",
"cashDiscount": "0.00"
},
"customer": null,
"whiteListedCard": null,
"storeAndForward": false
}
Address Verification usually doesn't factor much into terminal based transactions, but it's still an important backstop against fraud when working with manually entered cards and e-commerce transactions.
Developers have the option at any time to add address verification to a transaction and void or reverse the transaction if they're unhappy with the result.
To use the address verification system, pass a postalCode
or address
into any
authorization transaction. The response will have an avsResponse
field with a code
indicating the AVS status.
The possible status codes returned would be the following.
- not_supported: Indicates that AVS is not supported for some reason, either technical or related to the payment type.
- retry: Inconclusive response. Try again.
- no_match: No provided postal code or address information matched.
- zip_matched: The postal code matched.
- address_match: The address matched.
- match: Both address and postal code matched.
Testing Address Verification
For testing purposes, nearly all valid zip codes and addresses return as a match.
There are a few special zip codes and addresses that can be used to trigger other responses as listed on the table below:
Response Code | Trigger Criteria |
---|---|
not_supported | Postal Code: 85360 |
no_match | Postal Code: 73038 |
no_match | Address: 1701 Page Mill Road |
Standard Codes
BlockChyp has a set of standard strings for things like Card Types and Entry Methods.
If there were industry wide standards for this sort of thing, BlockChyp would gladly embrace them, but unfortunately that’s not the way things work. The lists below enumerate the keys you’ll need to bake into your system as constants for BlockChyp.
Card Types
This list enumerates the codes for card types and payment methods.
Code | Card Type |
---|---|
VISA | Visa |
MC | MasterCard |
AMEX | American Express |
DISC | Discover |
DINERS | Diners Club International |
CUP | China Union Pay |
JCB | Japan Card Bureau |
DEBIT | Debit |
EBT | EBT (Electronic Benefits Transfer) |
BC_GIFT | BlockChain Gift Card |
Entry Methods
This list enumerates the codes for entry methods.
Code | Entry Method |
---|---|
CHIP | EMV Chip Contact |
CONTACTLESS_EMV | EMV Contactless |
ECOM | E-Commerce |
KEYED | Manually Entered |
SWIPE | Swiped |
TOKEN | Token |
REST API Reference
We recommend developers use SDKs instead of the REST APIs directly as it will make implementation go faster. Our SDKs deal with HMAC authentication and locating terminals for you. But, if you prefer to do a direct REST API integration, we won't stop you. The REST APIs aren't complicated.
BlockChyp consists of two REST APIs: the small API that runs on every BlockChyp payment terminal and the Gateway API.
Gateway API
Like everything in BlockChyp, the Gateway was designed to be simple. With a few exceptions, the concepts should be familiar to anyone who's done a previous payment gateway implementation.
Endpoints
Per PCI requirements, BlockChyp uses completely separate systems for live and test transactions. Make sure you route test and live transactions to the correct endpoints as given below:
Environment | Endpoint |
---|---|
Live Transactions | https://api.blockchyp.com |
Test Transaction | https://test.blockchyp.com |
A Sample Transaction
Let's dive into a sample API request. The sample shows a conventional charge transaction using a previously enrolled recurring payment token.
This example shows the mechanics of a simple token based transaction using the common VISA test card number of 4111 1111 1111 1111.
transactionRef is where you would provide your own ID for a transaction. It's not required, but highly recommended because it allows you to track responses against your own ID scheme, and more importantly, time out reversals are not supported unless you provide a transactionRef value.
Most notable in this sample request are the three headers used by BlockChyp's Dual authentication scheme (Timestamp, Nonce, and Authorization).
Authentication Headers
BlockChyp credentials take the form of an API Key, a Bearer Token, and a Signing Key - and are generated by the BlockChyp dashboard. These three credentials are used to assemble the Authorization header.
Gateway API requests are protected using a combination of Bearer Tokens and HMAC headers. The reason for this is that HMAC headers and Bearer Tokens provide offsetting security benefits.
For example, Bearer Tokens can be stored in the BlockChyp datastore as salted one way hashes which protects them in the event of a database breach. But Bearer Tokens must be sent over the network with every request where they might be vulnerable to interception in the event of a TLS or SSL vulnerability.
To offset this risk, we also require every API request include a digital signature in the form of an HMAC value computed via the Signing Key. Since HMAC signatures change for every request, they are of no value to a hacker, even if intercepted.
All API requests require the following three headers:
Nonce
Example Header:
Nonce: HHU8JX48KKX8AYHENKRYMJ5MB6YHM43GHWW7VDRJQDVY0YTBWRGG
This header should be a unique string with a minimum length of 16 characters. Developers are encouraged to use a cryptographically secure random number generator to produce nonces. Nonces are checked for uniqueness in real time.
The Nonce has to be sent in its own header as shown above and also must be fed into the HMAC computation as part of the Authorization header.
Timestamp
Example Header:
Timestamp: 2018-12-10T18:07:15Z
This header should be the ISO 8601 formatted timestamp at the time the transaction is executed in UTC. The timestamp must be within 10 minutes of the current time or the gateway will reject the transaction.
Authorization
Example Header:
Authorization: Dual PCZFLPXD2PWI7B7VVFHD4VJ4KE:b695b1af23f9d1ce2983f1f69237866b7fa69878dcdc873ed3507374d8c0508b
Authorization: Dual <Bearer Token>:<API Key>:<HMAC Signature>
The authorization header is assembled by starting with the keyword "Dual" which references BlockChyp's Dual authentication scheme.
Add a space and then the Bearer Token followed by the API Key, separated by a colon.
To compute the HMAC Signature, first concatenate the API Key, Bearer Token, Timestamp and Nonce with no separator. (We've kept the canonical message to be signed a bit simpler than other HMAC implementations in order to make implementation accessible to developers of all skill levels.)
Next, compute an SHA 256 HMAC with the Signing Key and encode it as a hexadecimal string.
The sample code below shows how to compute an HMAC value in the Go Language.
Go Language HMAC Example:
Heartbeat (/api/heartbeat)
HTTP Method | Path |
---|---|
GET | /api/heartbeat |
This endpoint is used to test connectivity with the Gateway and get updated time reference information. This API will return a response even if the big three authentication headers are not provided so it's usually a good API to start an implementation with.
If a valid Authorization header is provided, this API will also return the Blockchain public key of the merchant. This is a simple GET request and accepts no path or query string parameters.
The heartbeat response includes the latest Gateway Timestamp, the latest tick block for the Blockchain and if your Authorization headers are valid, the Blockchain Public Key of the merchant.
We recommend you write an integration test that ensures that merchantPk is non-null as a way to test your Authorization and HMAC implementation.
Sample Request and Response:
Terminal Route (/api/terminal-route)
HTTP Method | Path |
---|---|
GET | /api/terminal-route |
Query String Parameter | Description | Required |
---|---|---|
terminal | Name assigned to the terminal at activation | Yes |
This API is used to get current metadata about BlockChyp terminals including the terminal's IP Address on the private network along with transient credentials and blockchain public key information.
We strongly recommend that payment terminals be configured with static IP addresses, but we also understand that real life point-of-sale or merchant networks can be chaotic environments where recommendations aren't always followed.
This API is part of a set of techniques BlockChyp uses to try and cope with real world merchant networks. Terminals check in with the BlockChyp network when they're activated and periodically throughout the day. They report their IP address on the private network along with some internal metrics used to monitor the overall health of the network and for fraud detection.
The Terminal Route API can be used to lookup a terminal's IP Address by the name assigned to the terminal at activation. It serves as a simple DNS system for terminals and makes merchant networks more robust, even if all terminals are left on the default DHCP settings.
The JSON response includes the following data elements that might require a bit of explanation:
Field | Description |
---|---|
ipAddress | The current local IP address of the terminal on the private network. If the point-of-sale or client application is on the same network as the terminal, the terminal's REST API can be found at ports 8080 and 8443 at the given IP Address. |
cloudRelayEnabled | Indicates that this terminal is accessible via the Gateway. Not recommended, but unavoidable if the point-of-sale system and terminal are on different network segments. |
transientCredentials | Special credentials restricted for use only with the given terminal. All direct API calls to terminals should use these credentials, especially if the merchants are unable to run TLS/SSL on their local network. |
publicKey | The blockchain public key for the terminal in BlockChyp's compressed key format. Can be used to validate the signatures of terminal responses. |
rawKey | The raw version of the terminal's blockchain public key. Includes the name of the standard elliptic curve (usually P256) and the raw x and y coordinates of the public key in hexadecimal format. |
Terminal Ping ( /api/terminal-test )
HTTP Method | Path |
---|---|
POST | /api/terminal-test |
- API Credential Types: Merchant
- Required Role: Payment API Access
This simple test transaction helps ensure good communication with a payment terminal and is usually the first test you'll run in development.
It tests communication with the terminal and returns a positive response if everything is okay. It works the same way in local or cloud relay mode.
If you get a positive response, you've successfully verified all of the following:
- The terminal is online.
- There is a valid route to the terminal.
- The API Credentials are valid.
Sample Request and Response
Terminal Locate ( /api/terminal-locate )
HTTP Method | Path |
---|---|
POST | /api/terminal-locate |
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint returns a terminal's routing and location information.
The result will indicate whether or not the terminal is in cloud relay mode and will return the local IP address if the terminal is in local mode.
The terminal will also return the public key for the terminal.
Sample Request and Response
Charge ( /api/charge )
HTTP Method | Path |
---|---|
POST | /api/charge |
- API Credential Types: Merchant
- Required Role: Payment API Access
Our most popular transaction executes a standard authorization and capture. This is the most basic of basic payment transactions, typically used in conventional retail.
Charge transactions can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is keylogging. If you use terminals for manual card entry, you'll bypass any keyloggers that might be maliciously running on the point-of-sale system.
Common Variations
- Gift Card Redemption: There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
- EBT: Set the
CardType
field toblockchyp.CardTypeEBT
to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined. - Cash Back: To enable cash back for debit transactions, set the
CashBack
field. If the card presented isn't a debit card, theCashBack
field will be ignored. - Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field with theCardType
field set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault inline with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details. - Cryptocurrency The
Cryptocurrency
field can be used to switch the standard present card screen to a cryptocurrency screen. The field value can beANY
to enable any supported cryptocurrency or a single currency code such asBTC
for Bitcoin.
There are two situations in which charge transactions would go directly to the gateway instead of to a terminal.
Tokenized Charge Sample Request and Response
This example shows how to use a token previously obtained from an enroll transaction or the web tokenizer. Never pass PINs or mag stripe data directly into this API. Always use terminals or the web tokenizer to capture sensitive card data.
Cloud Relay Sample Request and Response
This example shows how to start a charge transaction on a terminal via cloud relay.
Preauthorization ( /api/preauth )
HTTP Method | Path |
---|---|
POST | /api/preauth |
- API Credential Types: Merchant
- Required Role: Payment API Access
A preauthorization puts a hold on funds and must be captured later. This is used in scenarios where the final transaction amount might change. A common example is fine dining, where a tip adjustment is required before final settlement.
Another use case for preauthorization is e-commerce. Typically, an online order is preauthorized at the time of the order and then captured when the order ships.
Preauthorizations can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is key logging. If you use terminals for manual card entry, you'll bypass any key loggers that might be maliciously running on the point-of-sale system.
Cryptocurrency
Note that preauths are not supported for cryptocurrency.
Common Variations
- Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field withCardType
set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault in line with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
Tokenized Charge Sample Request and Response
This example shows how to use a token previously obtained from an enroll transaction or the web tokenizer. Never pass PINs or mag stripe data directly into this API. Always use terminals or the web tokenizer to capture sensitive card data.
Cloud Relay Sample Request and Response
This example shows how to start a preauth transaction on a terminal via cloud relay.
Capture Preauthorization ( /api/capture )
HTTP Method | Path |
---|---|
POST | /api/capture |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to capture a previously approved preauthorization.
You'll need to make sure you pass in the Transaction ID returned by the original preauth transaction so we know which transaction we're capturing. If you want to capture the transaction for the exact amount of the preauth, the Transaction ID is all you need to pass in.
You can adjust the total if you need to by passing in a new amount
. We
also recommend you pass in updated amounts for tax
and tip
as it can
sometimes reduce your interchange fees. (Level II Processing, for example.)
Sample Request and Response
Refund ( /api/refund )
HTTP Method | Path |
---|---|
POST | /api/refund |
- API Credential Types: Merchant
- Required Role: Payment API Access
It's not ideal, but sometimes customers want their money back.
Our refund API allows you to confront this unpleasant reality by executing refunds in a few different scenarios.
The most fraud resistent method is to execute refunds in the context of a previous transaction. You should always keep track of the Transaction ID returned in a BlockChyp response. To refund the full amount of the previous transaction, just pass in the original Transaction ID with the refund requests.
Partial Refunds
For a partial refund, just pass in an amount along with the Transaction ID. The only rule is that the amount must be equal to or less than the original transaction. You can execute multiple partial refunds against the same original transaction as long as the total refunded amount doesn't exceed the original amount.
Tokenized Refunds
You can also use a token to execute a refund. Pass in a token instead of the Transaction ID and the desired refund amount.
Free Range Refunds
When you execute a refund without referencing a previous transaction, we call this a free range refund.
We don't recommend this type of refund, but it is permitted. If you absolutely insist on doing it, pass in a Terminal Name and an amount.
You can execute a manual or keyed refund by passing the ManualEntry
field
to a free range refund request.
Gift Card Refunds
Gift card refunds are allowed in the context of a previous transaction, but free range gift card refunds are not allowed. Use the gift card activation API if you need to add more funds to a gift card.
Store and Forward Support
Refunds are not permitted when a terminal falls back to store and forward mode.
Auto Voids
If a refund referencing a previous transaction is executed for the full amount before the original transaction's batch is closed, the refund is automatically converted to a void. This saves the merchant a little bit of money.
Cryptocurrency
Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Sample Request and Response
Cloud Relay Free Range Refund Example
Enroll ( /api/enroll )
HTTP Method | Path |
---|---|
POST | /api/enroll |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to tokenize and enroll a payment method in the token vault. You can also pass in customer information and associate the payment method with a customer record.
A token is returned in the response that can be used in subsequent charge, preauth, and refund transactions.
Gift Cards and EBT
Gift Cards and EBT cards cannot be tokenized.
E-Commerce Tokens
The tokens returned by the enroll API and the e-commerce web tokenizer are the same tokens and can be used interchangeably.
Sample Request and Response
Void ( /api/void )
HTTP Method | Path |
---|---|
POST | /api/void |
- API Credential Types: Merchant
- Required Role: Payment API Access
Mistakes happen. If a transaction is made by mistake, you can void it with this API. All that's needed is to pass in a Transaction ID and execute the void before the original transaction's batch closes.
Voids work with EBT and gift card transactions with no additional parameters.
Cryptocurrency
Note that voids are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Sample Request and Response
Time Out Reversal ( /api/reverse )
HTTP Method | Path |
---|---|
POST | /api/reverse |
- API Credential Types: Merchant
- Required Role: Payment API Access
Payment transactions require a stable network to function correctly and no network is stable all the time. Time out reversals are a great line of defense against accidentally double charging consumers when payments are retried during shaky network conditions.
We highly recommend developers use this API whenever a charge, preauth, or refund transaction times out. If you don't receive a definitive response from BlockChyp, you can't be certain about whether or not the transaction went through.
The best practice in this situation is to send a time out reversal request. Time out reversals check for a transaction and void it if it exists.
The only caveat is that developers must use the transactionRef
property (txRef
for the CLI) when executing charge, preauth, and refund transactions.
The reason for this requirement is that if a system never receives a definitive response for a transaction, the system would never have received the BlockChyp generated Transaction ID. We have to fall back to Transaction Ref to identify a transaction.
Cryptocurrency
Note that refunds are not supported for cryptocurrency. You must refund crypto transactions manually from your cryptocurrency wallet.
Sample Request and Response
Gift Card Activation ( /api/gift-activate )
HTTP Method | Path |
---|---|
POST | /api/gift-activate |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API activates or adds value to BlockChyp gift cards. Just pass in the terminal name and the amount to add to the card. Once the customer swipes their card, the terminal will use keys on the mag stripe to add value to the card.
You don't need to handle a new gift card activation or a gift card recharge any differently. The terminal firmware will figure out what to do on its own while also returning the new balance for the gift card.
This is the part of the system where BlockChyp's blockchain DNA comes closest to the surface. The BlockChyp gift card system doesn't really use gift card numbers. This means they can't be stolen.
BlockChyp identifies cards with an elliptic curve public key instead. Gift card transactions are actually blocks signed with those keys. This means there are no shared secrets sent over the network. To keep track of a BlockChyp gift card, hang on to the public key returned during gift card activation. That's the gift card's elliptic curve public key.
We sometimes print numbers on our gift cards, but these are actually decimal encoded hashes of a portion of the public key to make our gift cards seem normal to normies. They can be used for balance checks and play a lookup role in online gift card authorization, but are of little use beyond that.
Voids and Reversals
Gift card activations can be voided and reversed just like any other BlockChyp transaction. Use the Transaction ID or Transaction Ref to identify the gift activation transaction as you normally would for voiding or reversing a conventional payment transaction.
Importing Gift Cards
BlockChyp does have the ability to import gift card liability from conventional gift card platforms. Unfortunately, BlockChyp does not support activating cards on third party systems. However, you can import your outstanding gift cards and customers can swipe them on the terminals like BlockChyp's standard gift cards.
No special coding is required to access this feature. The gateway and terminal firmware handle everything for you.
Third Party Gift Card Networks
BlockChyp does not currently provide any native support for other gift card platforms beyond importing gift card liability. We do have a white listing system that can be used to support your own custom gift card implementations. We have a security review process before we can allow a BIN range to be white listed, so contact support@blockchyp.com if you need to white list a BIN range.
Sample Request and Response
Balance ( /api/balance )
HTTP Method | Path |
---|---|
POST | /api/balance |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API checks a gift or EBT card balance.
Gift Card Balance Checks
For gift cards, pass in a terminal name and the customer will be prompted to swipe a card on that terminal. The remaining balance will be displayed briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.
EBT Balance Checks
All EBT transactions require a PIN, so to check an EBT card balance,
you need to pass in the ebt
flag just like you would for a normal EBT
charge transaction. The customer will be prompted to swipe their card and
enter a PIN code. If everything checks out, the remaining balance on the
card will be displayed on the terminal for the customer and returned with the API response.
Testing Gift Card Balance Checks
Test gift card balance checks work no differently than live gift cards. You must activate a test gift card first to test balance checks. Test gift cards are real blockchain cards that live on our parallel test blockchain.
Testing EBT Gift Card Balance Checks
All test EBT transactions assume a starting balance of $100.00. As a result, test EBT balance checks always return a balance of $100.00.
Sample Request and Response
Close Batch ( /api/close-batch )
HTTP Method | Path |
---|---|
POST | /api/close-batch |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API will close the merchant's batch if it's currently open.
By default, merchant batches will close automatically at 3 AM in their local time zone. The automatic batch closure time can be changed in the Merchant Profile or disabled completely.
If automatic batch closure is disabled, you'll need to use this API to close the batch manually.
Sample Request and Response
Send Payment Link ( /api/send-payment-link )
HTTP Method | Path |
---|---|
POST | /api/send-payment-link |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to send an invoice to a customer and capture payment via a BlockChyp hosted payment page.
If you set the autoSend
flag, BlockChyp will send a basic invoice email
to the customer for you that includes the payment link. If you'd rather have
more control over the look of the email message, you can omit the autoSend
flag and send the customer email yourself.
There are a lot of optional parameters for this API, but at a minimum
you'll need to pass in a total, customer name, and email address. (Unless
you use the cashier
flag.)
Customer Info
Unless you're using the cashier
flag, you must specify a customer; either by
creating a new customer record inline or passing in an existing Customer ID or Customer Ref.
Line Item Level Data
It's not strictly required, but we strongly recommend sending line item level detail with every request. It will make the invoice look more complete and the data format for line item level data is the exact same format used for terminal line item display, so the same code can be used to support both areas.
Descriptions
You can also provide a free form description or message to display near the bottom of the invoice. Usually this is some kind of thank you note or instruction.
Terms and Conditions
You can include long form contract language with a request and capture terms and conditions accepted at the same time payment is captured.
The interface is identical to that used for the terminal based Terms and
Conditions API in that you can pass in content directly via tcContent
or via
a preconfigured template via tcAlias
. The Terms and Conditions log will also be updated when
agreement acceptance is incorporated into a send link request.
Auto Send
BlockChyp does not send the email notification automatically. This safeguard prevents real
emails from going out when you may not expect them If you want BlockChyp to send the email
for you, just add the autoSend
flag with all requests.
Cryptocurrency
If the merchant is configured to support cryptocurrency transactions, the payment page will display additional UI widgets that allowing customers to switch to a crypto payment method.
Tokenization
Add the enroll
flag to a send link request to enroll the payment method
in the token vault.
Add the enrollOnly
flag to enroll the payment method in the token vault without any immediate payment taking place. The payment link will ask the user for their payment information and inform them that they will not be charged immediately, but that their payment may be used for future transactions.
Cashier Facing Card Entry
BlockChyp can be used to generate internal/cashier facing card entry pages as well. This is designed for situations where you might need to take a phone order and don't have an available terminal.
If you pass in the cashier
flag, no email will be sent and you'll be able to
load the link in a browser or iframe for payment entry. When the cashier
flag
is used, the autoSend
flag will be ignored.
Note that cryptocurrency is not supported for cashier facing payment entry.
Payment Notifications
When a customer successfully submits payment, the merchant will receive an email notifying them that the payment was received.
Real Time Callback Notifications
Email notifications are fine, but you may want your system to be informed
immediately whenever a payment event occurs. By using the optional callbackUrl
request
property, you can specify a URL to which the Authorization Response will be posted
every time the user submits a payment, whether approved or otherwise.
The response will be sent as a JSON encoded POST request and will be the exact same format as all BlockChyp charge and preauth transaction responses.
Status Polling
If real time callbacks aren't practical or necessary in your environment, you can always use the Payment Link Status API described futher on.
A common use case for the send link API with status polling is curbside pickup. You could have your system check the Payment Link Status when a customer arrives to ensure it's been paid without necessarily needing to create background threads to constantly poll for status updates.
Sample Request and Response
Resend Payment Link ( /api/resend-payment-link )
HTTP Method | Path |
---|---|
POST | /api/resend-payment-link |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API will resend a previously created payment link. An error is returned if the payment link is expired, has been cancelled, or has already been paid.
Sample Request and Response
Cancel Payment Link ( /api/cancel-payment-link )
HTTP Method | Path |
---|---|
POST | /api/cancel-payment-link |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API cancels a payment link.
Sample Request and Response
Payment Link Status ( /api/payment-link-status )
HTTP Method | Path |
---|---|
POST | /api/payment-link-status |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to check on the status of a payment link, including transaction data and the full history of attempted transactions.
This API is the preferred source of truth and best practice when you want to check on the status of a payment link (as opposed to Transaction Status). The Transaction Status API is not ideal because of ambiguity when there are multiple transactions associated with a single payment link.
You must pass the linkCode
value associated with the payment link. It is included in the response from BlockChyp when the payment link is originally created.
Sample Request and Response
Transaction Status ( /api/tx-status )
HTTP Method | Path |
---|---|
POST | /api/tx-status |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API returns the current status for any transaction. You can lookup a transaction by its BlockChyp assigned Transaction ID or your own Transaction Ref.
You should always use globally unique Transaction Ref values, but in the event that you duplicate Transaction Refs, the most recent transaction matching your Transaction Ref is returned.
Sample Request and Response
Terminal Clear ( /api/terminal-clear )
HTTP Method | Path |
---|---|
POST | /api/terminal-clear |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API interrupts whatever a terminal may be doing and returns it to the idle state.
Sample Request and Response
Terminal Status ( /api/terminal-status )
HTTP Method | Path |
---|---|
POST | /api/terminal-status |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API returns the current status of a payment terminal. This is typically used as a way to determine if the terminal is busy before sending a new transaction.
If the terminal is busy, idle
will be false and the status
field will return
a short string that indicates the transaction type currently in progress. The system
will also return the timestamp of the last status change in the since
field.
The cardInSlot
field in the response will indicates whether or not a card is currently in the card reader slot.
If the system is running a payment transaction and you wisely passed in a Transaction Ref, this API will also return the Transaction Ref of the in progress transaction.
The table below lists all possible status responses.
Status Code | Description |
---|---|
idle | The terminal is idle and ready for transactions. The default branding is being displayed. |
activate | The terminal is in the process of activating and pairing with the merchant account. |
balance | A balance check (EBT or Gift Card) is pending on the terminal. |
boolean-prompt | A boolean prompt (yes/no) operation is pending on the terminal. |
signature | A signature capture is pending. |
crypto | A cryptocurrency transaction is pending. |
enroll | A token vault enrollment operation is pending. |
gift-activate | A gift card activation operation is in progress. |
message | The terminal is displaying a custom message. |
charge | The terminal is executing a charge transaction. |
preauth | The terminal is executing a preauth transaction. |
refund | The terminal is executing a refund transaction. |
survey | The terminal is displaying post transaction survey questions. |
terms-and-conditions | The terminal is pending terms and conditions acceptance and signature. |
text-prompt | The terminal is awaiting response to a text input prompt. |
txdisplay | The terminal is displaying transaction and/or line item level details. |
Sample Request and Response
Terms & Conditions Capture ( /api/terminal-tc )
HTTP Method | Path |
---|---|
POST | /api/terminal-tc |
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API allows you to prompt a customer to accept a legal agreement on the terminal and (usually) capture their signature.
Content for the agreement can be specified in two ways. You can reference a previously configured T&C template or pass in the full agreement text with every request.
Using Templates
If your application doesn't keep track of agreements you can leverage BlockChyp's
template system. You can create any number of T&C Templates in the merchant dashboard
and pass in the tcAlias
flag to specify which one should display.
Raw Content
If your system keeps track of the agreement language or executes complicated merging
and rendering logic, you can bypass our template system and pass in the full text with
every transaction. Use tcName
to pass in the agreement name and tcContent
to
pass in the contract text. Note that only plain text is supported.
Bypassing Signatures
Signature images are captured by default. If for some reason this doesn't fit your
use case and you'd like to capture acceptance without actually capturing a signature image, set
the disableSignature
flag in the request.
Terms & Conditions Log
Every time a user accepts an agreement on the terminal, the signature image (if captured), will be uploaded to the gateway. The image will also be added to the log along with the full text of the agreement. This preserves the historical record in the event that standard agreements or templates change over time.
Associating Agreements with Transactions
To associate a Terms & Conditions log entry with a transaction, just pass in the Transaction ID or Transaction Ref for the associated transaction.
Sample Request and Response
Capture Signature ( /api/capture-signature )
HTTP Method | Path |
---|---|
POST | /api/capture-signature |
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint captures a written signature from the terminal and returns the image.
Unlike the Terms & Conditions API, this endpoint performs basic signature capture with no agreement display or signature archival.
Under the hood, signatures are captured in a proprietary vector format and
must be converted to a common raster format in order to be useful to most
applications. At a minimum, you must specify an image format using the
sigFormat
parameter. Currently, JPG and PNG are supported.
By default, images are returned in the JSON response as hex encoded binary.
You can redirect the binary image output to a file using the sigFile
parameter.
You can also scale the output image to your preferred width by
passing in a sigWidth
parameter. The image will be scaled to that
width, preserving the aspect ratio of the original image.
Sample Request and Response
New Transaction Display ( /api/terminal-txdisplay )
HTTP Method | Path |
---|---|
POST | /api/terminal-txdisplay |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API sends totals and line item level data to the terminal.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication
and rounding may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Sample Request and Response
Update Transaction Display ( /api/terminal-txdisplay )
HTTP Method | Path |
---|---|
PUT | /api/terminal-txdisplay |
- API Credential Types: Merchant
- Required Role: Payment API Access
Similar to New Transaction Display, this variant allows developers to update line item level data currently being displayed on the terminal.
This feature is designed for situations where you want to update the terminal display as items are scanned. You'll only have to send information to the terminal that's changed, which usually means the new line item and updated totals.
If the terminal is not in line item display mode and you invoke this endpoint, the first invocation will behave like a New Transaction Display call.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication and rounding
may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Sample Request and Response
Display Message ( /api/message )
HTTP Method | Path |
---|---|
POST | /api/message |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API displays a message on the payment terminal.
Just specify the target terminal and the message using the message
parameter.
Sample Request and Response
Boolean Prompt ( /api/boolean-prompt )
HTTP Method | Path |
---|---|
POST | /api/boolean-prompt |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to answer a yes or no question.
You can specify the question or prompt with the prompt
parameter and
the response is returned in the response
field.
This can be used for a number of use cases including starting a loyalty enrollment workflow or customer facing suggestive selling prompts.
Custom Captions
You can optionally override the "YES" and "NO" button captions by
using the yesCaption
and noCaption
request parameters.
Sample Request and Response
Text Prompt ( /api/text-prompt )
HTTP Method | Path |
---|---|
POST | /api/text-prompt |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to enter numeric or alphanumeric data.
Due to PCI rules, free-form prompts are not permitted when the response could be any valid string. The reason for this is that a malicious developer (not you, of course) could use text prompts to ask the customer to input a card number or PIN code.
This means that instead of providing a prompt, you provide a promptType
instead.
The prompt types currently supported are listed below:
- phone: Captures a phone number.
- email: Captures an email address.
- first-name: Captures a first name.
- last-name: Captures a last name.
- customer-number: Captures a customer number.
- rewards-number: Captures a rewards number.
You can specify the prompt with the promptType
parameter and
the response is returned in the response
field.
Sample Request and Response
Update Customer ( /api/update-customer )
HTTP Method | Path |
---|---|
POST | /api/update-customer |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API adds or updates a customer record.
If you pass in customer information including firstName
, lastName
, email
,
or sms
without any Customer ID or Customer Ref, a new record will
be created.
If you pass in customerRef
and customerId
, the customer record will be updated
if it exists.
Customer Ref
The customerRef
field is optional, but highly recommended as this allows you
to use your own customer identifiers instead of storing BlockChyp's Customer IDs
in your systems.
Creating Customer Records With Payment Transactions
If you have customer information available at the time a payment transaction is executed, you can pass all the same customer information directly into a payment transaction. BlockChyp will create a customer record at the same time payment is captured. The advantage of this approach is that the customer's payment card is automatically associated with the customer record in a single step. If the customer uses the payment card in the future, the customer data will automatically be returned. You won't need to ask the customer to provide any additional information.
Sample Request and Response
Retrieve Customer ( /api/customer )
HTTP Method | Path |
---|---|
POST | /api/customer |
- API Credential Types: Merchant
- Required Role: Payment API Access
With this API, you can retrieve detailed information about a customer record, including saved payment methods if available.
Customers can be looked up by customerId
or customerRef
.
Sample Request and Response
Search Customer ( /api/customer-search )
HTTP Method | Path |
---|---|
POST | /api/customer-search |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API searches the customer database and returns matching results.
Use query
to pass in a search string and the system will return all results whose
first or last names contain the query string.
Sample Request and Response
Cash Discount ( /api/cash-discount )
HTTP Method | Path |
---|---|
POST | /api/cash-discount |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API calculates the surcharge, cash discount, and total amounts for cash transactions.
If you're using BlockChyp's cash discounting features, you can use this endpoint to ensure the numbers and receipts for true cash transactions are consistent with transactions processed by BlockChyp.
Sample Request and Response
Batch History ( /api/batch-history )
HTTP Method | Path |
---|---|
POST | /api/batch-history |
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint allows developers to query the gateway for the merchant's batch history. The data will be returned in descending order of open date with the most recent batch returned first. The results will include basic information about the batch. Consider using the Batch Details API for more detail about a specific batch.
Limiting Results
This API will return a maximum of 250 results. Use the maxResults
property to
limit maximum results even further and use the startIndex
property to
page through results that span multiple queries.
For example, if you want the ten most recent batches, pass in a value of
10
for maxResults
. Also note that startIndex
is zero based. Use a value of 0
to
get the first batch in the dataset.
Filtering by Date Range
You can also filter results by date. Use the startDate
and endDate
properties to return only those batches opened between those dates.
You can use either startDate
and endDate
and you can use date filters
in conjunction with maxResults
and startIndex
Sample Request and Response
Batch Details ( /api/batch-details )
HTTP Method | Path |
---|---|
POST | /api/batch-details |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows developers to pull down details for a specific batch, including captured volume, gift card activity, expected deposit, and captured volume broken down by terminal.
The only required request parameter is batchId
. Batch IDs are returned
with every transaction response and can be discovered using the Batch
History API.
Sample Request and Response
Transaction History ( /api/tx-history )
HTTP Method | Path |
---|---|
POST | /api/tx-history |
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint provides several different methods to sift through transaction history.
By default with no filtering properties, this endpoint will return the 250 most recent transactions.
Limiting Results
This API will return a maximum of 50 results in a single query. Use the maxResults
property
to limit maximum results even further and use the startIndex
property to
page through results that span multiple queries.
For example, if you want the ten most recent batches, pass in a value of
10
for maxResults
. Also note that startIndex
is zero based. Use a value of 0
to
get the first transaction in the dataset.
Filtering By Date Range
You can also filter results by date. Use the startDate
and endDate
properties to return only transactions run between those dates.
You can use either startDate
or endDate
and you can use date filters
in conjunction with maxResults
and startIndex
Filtering By Batch
To restrict results to a single batch, pass in the batchId
parameter.
Filtering By Terminal
To restrict results to those executed on a single terminal, pass in the terminal name.
Combining Filters
None of the above filters are mutually exclusive. You can combine any of the above properties in a single request to restrict transaction results to a narrower set of results.
Searching Transaction History
You can search transaction history by passing in search criteria with the
query
option. The search system will match the amount (requested and authorized),
last four of the card number, cardholder name, and the auth code.
Note that when search queries are used, terminalName or batch id filters are not supported.
Sample Request and Response
Retrieve Pricing Policy ( /api/read-pricing-policy )
HTTP Method | Path |
---|---|
POST | /api/read-pricing-policy |
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns the current pricing policy for a merchant. This API is valid for partner scoped API credentials
and merchantId
is a required parameter. By default this API returns the currently in-force pricing policy for a merchant,
but other inactive policies can be returned by providing the id
parameter.
Buy rates for interchange plus and fixed rate pricing are always returned, but only the pricing related to the pricing model type (flat rate or interchange plus) are actually used in fee calculation.
Each pricing level returns three values: buyRate
, current
, and limit
. The actual price the merchant will pay is
given in the current
field. The other values reflect the contract minimum (buyRate
) and maximum (limit
) range
the partner can use when changing prices.
Sample Request and Response
Partner Statements ( /api/partner-statement-list )
HTTP Method | Path |
---|---|
POST | /api/partner-statement-list |
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns a list of partner residual statements. By default, all statements are returned with the most recent
statements listed first. Optional date parameters (startDate
and endDate
) can filter statements to a specific date range.
The list of statements returns basic information about statements like volume, transaction count, and commissions earned.
Use the id
returned with each statement summary with the Partner Statement Detail API to pull down full details.
Sample Request and Response
Partner Statement Detail ( /api/partner-statement-detail )
HTTP Method | Path |
---|---|
POST | /api/partner-statement-detail |
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns detailed information about a specific partner statement. Aggregate data is returned along with line item level data for each underlying merchant statement.
Use the merchant invoice id with the Merchant Statement Detail API and the Partner Commission Breakdown API to get the merchant statement and the card brand fee cost breakdown respectively.
Sample Request and Response
Merchant Invoices ( /api/merchant-invoice-list )
HTTP Method | Path |
---|---|
POST | /api/merchant-invoice-list |
- API Credential Types: Partner or Merchant
- Required Role: Partner API Access or Merchant API
The API returns a list of merchant statements and invoices. By default, all invoices are returned with the most recent
statements listed first. Optional date parameters (startDate
and endDate
) can be used to filter statements by date
range.
The invoiceType
parameter can also be used to filter invoices by type. Invoices could be conventional invoices, such
as those generated when ordering terminals or gift cards, or invoices could be merchant statements.
Sample Request and Response
Merchant Invoice Detail ( /api/merchant-invoice-detail )
HTTP Method | Path |
---|---|
POST | /api/merchant-invoice-detail |
- API Credential Types: Partner
- Required Role: Partner API Access
The API returns detailed information about a specific merchant statement or invoice.
All line items are returned a topographically sorted tree modeling the nested line item structure of the invoice. Details about any payments posted against the invoice are returned.
It the invoice is a merchant statement, details about every merchant deposit that occurred during the statement period are also returned.
Sample Request and Response
Partner Commission Breakdown ( /api/partner-commission-breakdown )
HTTP Method | Path |
---|---|
POST | /api/partner-commission-breakdown |
- API Credential Types: Partner
- Required Role: Partner API Access
This API allows partners to pull down the low level data used to compute a partner commission for a specific merchant statement.
The statementId
is required and must be the id of a valid merchant invoice of type statement
.
Sample Request and Response
Merchant Profile ( /api/public-merchant-profile )
HTTP Method | Path |
---|---|
POST | /api/public-merchant-profile |
- API Credential Types: Merchant
- Required Role: Payment API Access
The API returns detailed metadata about the merchant's configuration, including basic identity information, terminal settings, store and forward settings, and bank account information for merchants that support split settlement.
Some of these fields can be updated via the Update Merchant API, but many of these fields are controlled by underwriting and cannot be altered outside of the underwriting and risk processes.
Merchant Descriptive Fields
The following fields are basic descriptive fields that can be used to describe and identify merchants.
- companyName: The merchant's official corporate entity name.
- dbaName: The business's DBA (doing business as) name.
- contactName: Name of the merchant's primary control contact.
- contactNumber: Primary control contact's phone number.
- locationName: Optional location name for multi-location operators.
- storeNumber: Optional store number for multi-location operators.
- partnerRef: Optional reference number partners can add to a merchant record. Usually the partner's own identifier for the merchant.
- timeZone: Unix style local time zone for the merchant. Example: America/New_York.
- publicKey: Read only field. The merchant's blockchain public key. Generated and assigned when a merchant account is first created.
- billingAddress: Address for billing and written correspondence.
- shippingAddress: Physical shipping address. Usually the actual street address of the business.
- status: Current status of the merchant account.
- tcDisabled: Disables all terms and conditions features in the merchant dashboard. Used to hide the feature if a partner has not chosen to support it.
- gatewayOnly: Indicates that a merchant has been boarded in gateway only mode. Not common.
Batch and Terminal Settings
The following fields are used to control batch closure and high level terminal configuration.
- batchCloseTime: Time in 24 hour HH:MM format when batches will automatically close in the merchant's local time. Defaults to 3 AM.
- autoBatchClose: Flag the determines whether or not batches will automatically close. Defaults to true.
- disableBatchEmails: Flag that optionally turns off automatic batch closure notification emails.
- cooldownTimeout: The amount of time in seconds after a transactions for which the transaction response is displayed on the terminal. After the cooldown period elapses, the terminal will revert to the idle state and display the currently active terminal branding.
- surveyTimeout: The amount of time in seconds a survey question should be displayed on a terminal before reverting to the idle screen.
- pinEnabled: Enables pin code entry for debit cards, EBT cards, and EMV cards with pin CVMs. Will be ignored if terminals are not injected with the proper encryption keys.
- pinBypassEnabled: Enable pin bypass for debit transactions.
- cashBackEnabled: Enables cash back for debit transactions.
- cashbackPresets: An array of four default values for cashback amounts when cashback is enabled.
- storeAndForwardEnabled: Enables automatic store and forward during network outages. Store and Forward does not support cash back, refunds, EBT, or gift card transactions.
- storeAndForwardFloorLimit: Maximum dollar value of a store and forward transaction.
- ebtEnabled: Enables EBT (SNAP) on BlockChyp terminals.
- tipEnabled: Enables tips entry on the terminal.
- promptForTip: If true, the terminal will always prompt for a tip, even if the API call does not request a tip prompt.
- tipDefaults: An array of exactly three percentages that will be used to calculate default tip amounts.
- giftCardsDisabled: Disables BlockChyp gift cards. Normally only used if the merchant is using an alternate gift card system.
- digitalSignaturesEnabled: Enables electronic signature capture for mag stripe cards and EMV cards with Signature CVMs.
- digitalSignatureReversal: Will cause a transaction to auto-reverse if the consumer refuses to provide a signature.
- manualEntryEnabled: Enables manual card entry.
- manualEntryPromptZip: Requires zip code based address verification for manual card entry.
- manualEntryPromptStreetNumber: Requires street/address based verification for manual card entry.
Card Brand and Transaction Settings
- freeRangeRefundsEnabled: Enables direct refunds that do not reference a previous transaction.
- partialAuthEnabled: Indicates that partial authorizations (usually for gift card support) are enabled.
- splitBankAccountsEnabled: Used for law firm merchants only.
- contactlessEmv: Enables contactless/tap transactions on a terminal. Defaults to true.
- visa: Enables Visa transactions.
- masterCard: Enables MasterCard transactions.
- amex: Enables American Express transactions.
- discover: Enables Discover transactions.
- jcb: Enables JCB (Japan Card Bureau) transactions.
- unionPay: Enables China UnionPay transactions.
Sample Request and Response
List Queued Transactions ( /api/queue/list )
HTTP Method | Path |
---|---|
POST | /api/queue/list |
- API Credential Types: Merchant
- Required Role: Payment API Access
Returns a list of transaction refs of transactions queued on a terminal. Details about the transactions can be retrieved using the Transaction Status API.
Sample Request and Response
Delete Queued Transaction ( /api/queue/delete )
HTTP Method | Path |
---|---|
POST | /api/queue/delete |
- API Credential Types: Merchant
- Required Role: Payment API Access
Deletes one or all queued transactions from a terminal. If *
is passed as
a transaction ref, then the entire terminal queue will be cleared. An error is
returned if the passed transaction ref is not queued on the terminal.
Sample Request and Response
Delete Customer ( /api/customer/ )
HTTP Method | Path |
---|---|
DELETE | /api/customer/ |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API deletes a customer record.
Sample Request and Response
Token Metadata ( /api/token/ )
HTTP Method | Path |
---|---|
GET | /api/token/ |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API retrieves status and metadata information about a token, including any links to customer records.
This will also return any customer records related to the card behind the token. If the underlying card has been tokenized multiple times, all customers related to the card will be returned, even if those customer associations are related to other tokens.
Sample Request and Response
Link Token ( /api/link-token )
HTTP Method | Path |
---|---|
POST | /api/link-token |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API links a payment token with a customer record. Usually this would only be needed to reverse a previous unlink operation.
Sample Request and Response
Unlink Token ( /api/unlink-token )
HTTP Method | Path |
---|---|
POST | /api/unlink-token |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API removes a payment token link from a customer record.
This will remove links between the customer record and all tokens for the same underlying card.
Sample Request and Response
Delete Token ( /api/token/ )
HTTP Method | Path |
---|---|
DELETE | /api/token/ |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API deletes a payment token from the gateway. Tokens are automatically deleted if they have not been used for a year.
Sample Request and Response
Reboot Terminal ( /api/terminal-reboot )
HTTP Method | Path |
---|---|
POST | /api/terminal-reboot |
- API Credential Types: Merchant
- Required Role: Payment API Access
This API reboots the terminal.
Sample Request and Response
Terminal API
Every BlockChyp terminal has a small web server running a simple REST API. Developers can use this API to capture card present payments and activate gift cards. All other transactions are done directly through the Gateway API.
Terminal Activation
A terminal must be activated and paired with a merchant account before it will accept transactions. To activate a terminal, login to the BlockChyp dashboard, create a test merchant account, and click ACTIVATE TERMINAL.
Next, connect your terminal to the network and power it up. Once the terminal starts up, it will display a message reading TOUCH TO ACTIVATE. Touch the screen and in a few moments the terminal will display a six character activation code. Enter the code in the Dashboard's activation form along with a unique name you'd like to use for the terminal.
The terminal will now be ready for transactions.
Web Server Ports
BlockChyp terminals listen for transactions on ports 8080 and 8443.
- HTTP Port: 8080
- HTTPS Port: 8443
Because terminals usually run on private networks and SSL can be difficult to implement on these networks, plain HTTP is supported. Sensitive card authentication data is not sent or received by terminals, but we still strongly encourage developers and merchants to favor HTTPS on port 8443.
SSL/TLS
Because terminals run on private networks, conventional SSL or TLS based on the major certificate authorities is not supported. When BlockChyp terminals are activated, a unique certificate is generated and signed by BlockChyp's own root certificate authority. The root certificate is provided here in PEM format.
BlockChyp Root Certificate For Private Terminal Networks:
A Sample Request
Before we get too much further, let's take a look at a basic request. The example below shows a simple form of a charge request.
POST: https://<IP_ADDRESS>:8443/api/charge
You can refer to terminals by their IP address or host names if you've configured them for your network. We recommend avoiding the use of manual IP address configuration in your systems as IP addresses can be obtained on demand from the Payment Gateway's Terminal Route API. This API returns the current private IP address and provides for a more robust implementation in the event that installers or merchants fail to statically configure IP addresses for terminals.
Terminal Ping ( /api/test )
HTTP Method | Path |
---|---|
POST | /api/test |
URL Pattern: https://<IP_ADDRESS>:8443/api/test
- API Credential Types: Merchant
- Required Role: Payment API Access
This simple test transaction helps ensure good communication with a payment terminal and is usually the first test you'll run in development.
It tests communication with the terminal and returns a positive response if everything is okay. It works the same way in local or cloud relay mode.
If you get a positive response, you've successfully verified all of the following:
- The terminal is online.
- There is a valid route to the terminal.
- The API Credentials are valid.
Sample Request and Response
Charge ( /api/charge )
HTTP Method | Path |
---|---|
POST | /api/charge |
URL Pattern: https://<IP_ADDRESS>:8443/api/charge
- API Credential Types: Merchant
- Required Role: Payment API Access
Our most popular transaction executes a standard authorization and capture. This is the most basic of basic payment transactions, typically used in conventional retail.
Charge transactions can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is keylogging. If you use terminals for manual card entry, you'll bypass any keyloggers that might be maliciously running on the point-of-sale system.
Common Variations
- Gift Card Redemption: There's no special API for gift card redemption in BlockChyp. Simply execute a plain charge transaction and if the customer swipes a gift card, our terminals will identify the gift card and run a gift card redemption. Also note that if for some reason the gift card's original purchase transaction is associated with fraud or a chargeback, the transaction will be rejected.
- EBT: Set the
CardType
field toblockchyp.CardTypeEBT
to process an EBT SNAP transaction. Note that test EBT transactions always assume a balance of $100.00, so test EBT transactions over that amount may be declined. - Cash Back: To enable cash back for debit transactions, set the
CashBack
field. If the card presented isn't a debit card, theCashBack
field will be ignored. - Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field with theCardType
field set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault inline with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. Good for pay-at-the-table and other service related scenarios. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details. - Cryptocurrency The
Cryptocurrency
field can be used to switch the standard present card screen to a cryptocurrency screen. The field value can beANY
to enable any supported cryptocurrency or a single currency code such asBTC
for Bitcoin.
Sample Request and Response
Preauthorization ( /api/preauth )
HTTP Method | Path |
---|---|
POST | /api/preauth |
URL Pattern: https://<IP_ADDRESS>:8443/api/preauth
- API Credential Types: Merchant
- Required Role: Payment API Access
A preauthorization puts a hold on funds and must be captured later. This is used in scenarios where the final transaction amount might change. A common example is fine dining, where a tip adjustment is required before final settlement.
Another use case for preauthorization is e-commerce. Typically, an online order is preauthorized at the time of the order and then captured when the order ships.
Preauthorizations can use a payment terminal to capture a payment or use a previously enrolled payment token.
Terminal Transactions
For terminal transactions, make sure you pass in the terminal name using the terminalName
property.
Token Transactions
If you have a payment token, omit the terminalName
property and pass in the token with the token
property instead.
Card Numbers and Mag Stripes
You can also pass in PANs and Mag Stripes, but you probably shouldn't, as this will put you in PCI scope and the most common vector for POS breaches is key logging. If you use terminals for manual card entry, you'll bypass any key loggers that might be maliciously running on the point-of-sale system.
Cryptocurrency
Note that preauths are not supported for cryptocurrency.
Common Variations
- Manual Card Entry: Set the
ManualEntry
field to enable manual card entry. Good as a backup when chips and MSR's don't work or for more secure phone orders. You can even combine theManualEntry
field withCardType
set toblockchyp.CardTypeEBT
for manual EBT card entry. - Inline Tokenization: You can enroll the payment method in the token vault in line with a charge transaction by setting the
Enroll
field. You'll get a token back in the response. You can even bind the token to a customer record if you also pass in customer data. - Prompting for Tips: Set the
PromptForTip
field if you'd like to prompt the customer for a tip before authorization. You can prompt for tips as part of a preauthorization, although it's not a very common approach. - Cash Discounting and Surcharging: The
Surcharge
andCashDiscount
fields can be used together to support cash discounting or surcharge problems. Consult the Cash Discount documentation for more details.
Sample Request and Response
Enroll ( /api/enroll )
HTTP Method | Path |
---|---|
POST | /api/enroll |
URL Pattern: https://<IP_ADDRESS>:8443/api/enroll
- API Credential Types: Merchant
- Required Role: Payment API Access
This API allows you to tokenize and enroll a payment method in the token vault. You can also pass in customer information and associate the payment method with a customer record.
A token is returned in the response that can be used in subsequent charge, preauth, and refund transactions.
Gift Cards and EBT
Gift Cards and EBT cards cannot be tokenized.
E-Commerce Tokens
The tokens returned by the enroll API and the e-commerce web tokenizer are the same tokens and can be used interchangeably.
Sample Request and Response
Gift Card Activation ( /api/gift-activate )
HTTP Method | Path |
---|---|
POST | /api/gift-activate |
URL Pattern: https://<IP_ADDRESS>:8443/api/gift-activate
- API Credential Types: Merchant
- Required Role: Payment API Access
This API activates or adds value to BlockChyp gift cards. Just pass in the terminal name and the amount to add to the card. Once the customer swipes their card, the terminal will use keys on the mag stripe to add value to the card.
You don't need to handle a new gift card activation or a gift card recharge any differently. The terminal firmware will figure out what to do on its own while also returning the new balance for the gift card.
This is the part of the system where BlockChyp's blockchain DNA comes closest to the surface. The BlockChyp gift card system doesn't really use gift card numbers. This means they can't be stolen.
BlockChyp identifies cards with an elliptic curve public key instead. Gift card transactions are actually blocks signed with those keys. This means there are no shared secrets sent over the network. To keep track of a BlockChyp gift card, hang on to the public key returned during gift card activation. That's the gift card's elliptic curve public key.
We sometimes print numbers on our gift cards, but these are actually decimal encoded hashes of a portion of the public key to make our gift cards seem normal to normies. They can be used for balance checks and play a lookup role in online gift card authorization, but are of little use beyond that.
Voids and Reversals
Gift card activations can be voided and reversed just like any other BlockChyp transaction. Use the Transaction ID or Transaction Ref to identify the gift activation transaction as you normally would for voiding or reversing a conventional payment transaction.
Importing Gift Cards
BlockChyp does have the ability to import gift card liability from conventional gift card platforms. Unfortunately, BlockChyp does not support activating cards on third party systems. However, you can import your outstanding gift cards and customers can swipe them on the terminals like BlockChyp's standard gift cards.
No special coding is required to access this feature. The gateway and terminal firmware handle everything for you.
Third Party Gift Card Networks
BlockChyp does not currently provide any native support for other gift card platforms beyond importing gift card liability. We do have a white listing system that can be used to support your own custom gift card implementations. We have a security review process before we can allow a BIN range to be white listed, so contact support@blockchyp.com if you need to white list a BIN range.
Sample Request and Response
Balance ( /api/balance )
HTTP Method | Path |
---|---|
POST | /api/balance |
URL Pattern: https://<IP_ADDRESS>:8443/api/balance
- API Credential Types: Merchant
- Required Role: Payment API Access
This API checks a gift or EBT card balance.
Gift Card Balance Checks
For gift cards, pass in a terminal name and the customer will be prompted to swipe a card on that terminal. The remaining balance will be displayed briefly on the terminal screen and the API response will include the gift card's public key and the remaining balance.
EBT Balance Checks
All EBT transactions require a PIN, so to check an EBT card balance,
you need to pass in the ebt
flag just like you would for a normal EBT
charge transaction. The customer will be prompted to swipe their card and
enter a PIN code. If everything checks out, the remaining balance on the
card will be displayed on the terminal for the customer and returned with the API response.
Testing Gift Card Balance Checks
Test gift card balance checks work no differently than live gift cards. You must activate a test gift card first to test balance checks. Test gift cards are real blockchain cards that live on our parallel test blockchain.
Testing EBT Gift Card Balance Checks
All test EBT transactions assume a starting balance of $100.00. As a result, test EBT balance checks always return a balance of $100.00.
Sample Request and Response
Terminal Clear ( /api/clear )
HTTP Method | Path |
---|---|
POST | /api/clear |
URL Pattern: https://<IP_ADDRESS>:8443/api/clear
- API Credential Types: Merchant
- Required Role: Payment API Access
This API interrupts whatever a terminal may be doing and returns it to the idle state.
Sample Request and Response
Terminal Status ( /api/terminal-status )
HTTP Method | Path |
---|---|
POST | /api/terminal-status |
URL Pattern: https://<IP_ADDRESS>:8443/api/terminal-status
- API Credential Types: Merchant
- Required Role: Payment API Access
This API returns the current status of a payment terminal. This is typically used as a way to determine if the terminal is busy before sending a new transaction.
If the terminal is busy, idle
will be false and the status
field will return
a short string that indicates the transaction type currently in progress. The system
will also return the timestamp of the last status change in the since
field.
The cardInSlot
field in the response will indicates whether or not a card is currently in the card reader slot.
If the system is running a payment transaction and you wisely passed in a Transaction Ref, this API will also return the Transaction Ref of the in progress transaction.
The table below lists all possible status responses.
Status Code | Description |
---|---|
idle | The terminal is idle and ready for transactions. The default branding is being displayed. |
activate | The terminal is in the process of activating and pairing with the merchant account. |
balance | A balance check (EBT or Gift Card) is pending on the terminal. |
boolean-prompt | A boolean prompt (yes/no) operation is pending on the terminal. |
signature | A signature capture is pending. |
crypto | A cryptocurrency transaction is pending. |
enroll | A token vault enrollment operation is pending. |
gift-activate | A gift card activation operation is in progress. |
message | The terminal is displaying a custom message. |
charge | The terminal is executing a charge transaction. |
preauth | The terminal is executing a preauth transaction. |
refund | The terminal is executing a refund transaction. |
survey | The terminal is displaying post transaction survey questions. |
terms-and-conditions | The terminal is pending terms and conditions acceptance and signature. |
text-prompt | The terminal is awaiting response to a text input prompt. |
txdisplay | The terminal is displaying transaction and/or line item level details. |
Sample Request and Response
Terms & Conditions Capture ( /api/tc )
HTTP Method | Path |
---|---|
POST | /api/tc |
URL Pattern: https://<IP_ADDRESS>:8443/api/tc
- API Credential Types: Merchant
- Required Role: Terms & Conditions Management
This API allows you to prompt a customer to accept a legal agreement on the terminal and (usually) capture their signature.
Content for the agreement can be specified in two ways. You can reference a previously configured T&C template or pass in the full agreement text with every request.
Using Templates
If your application doesn't keep track of agreements you can leverage BlockChyp's
template system. You can create any number of T&C Templates in the merchant dashboard
and pass in the tcAlias
flag to specify which one should display.
Raw Content
If your system keeps track of the agreement language or executes complicated merging
and rendering logic, you can bypass our template system and pass in the full text with
every transaction. Use tcName
to pass in the agreement name and tcContent
to
pass in the contract text. Note that only plain text is supported.
Bypassing Signatures
Signature images are captured by default. If for some reason this doesn't fit your
use case and you'd like to capture acceptance without actually capturing a signature image, set
the disableSignature
flag in the request.
Terms & Conditions Log
Every time a user accepts an agreement on the terminal, the signature image (if captured), will be uploaded to the gateway. The image will also be added to the log along with the full text of the agreement. This preserves the historical record in the event that standard agreements or templates change over time.
Associating Agreements with Transactions
To associate a Terms & Conditions log entry with a transaction, just pass in the Transaction ID or Transaction Ref for the associated transaction.
Sample Request and Response
Capture Signature ( /api/capture-signature )
HTTP Method | Path |
---|---|
POST | /api/capture-signature |
URL Pattern: https://<IP_ADDRESS>:8443/api/capture-signature
- API Credential Types: Merchant
- Required Role: Payment API Access
This endpoint captures a written signature from the terminal and returns the image.
Unlike the Terms & Conditions API, this endpoint performs basic signature capture with no agreement display or signature archival.
Under the hood, signatures are captured in a proprietary vector format and
must be converted to a common raster format in order to be useful to most
applications. At a minimum, you must specify an image format using the
sigFormat
parameter. Currently, JPG and PNG are supported.
By default, images are returned in the JSON response as hex encoded binary.
You can redirect the binary image output to a file using the sigFile
parameter.
You can also scale the output image to your preferred width by
passing in a sigWidth
parameter. The image will be scaled to that
width, preserving the aspect ratio of the original image.
Sample Request and Response
New Transaction Display ( /api/txdisplay )
HTTP Method | Path |
---|---|
POST | /api/txdisplay |
URL Pattern: https://<IP_ADDRESS>:8443/api/txdisplay
- API Credential Types: Merchant
- Required Role: Payment API Access
This API sends totals and line item level data to the terminal.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication
and rounding may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Sample Request and Response
Update Transaction Display ( /api/txdisplay )
HTTP Method | Path |
---|---|
PUT | /api/txdisplay |
URL Pattern: https://<IP_ADDRESS>:8443/api/txdisplay
- API Credential Types: Merchant
- Required Role: Payment API Access
Similar to New Transaction Display, this variant allows developers to update line item level data currently being displayed on the terminal.
This feature is designed for situations where you want to update the terminal display as items are scanned. You'll only have to send information to the terminal that's changed, which usually means the new line item and updated totals.
If the terminal is not in line item display mode and you invoke this endpoint, the first invocation will behave like a New Transaction Display call.
At a minimum, you should send total information as part of a display request,
including total
, tax
, and subtotal
.
You can also send line item level data and each line item can have a description
,
qty
, price
, and extended
price.
If you fail to send an extended price, BlockChyp will multiply the qty
by the
price
. However, we strongly recommend you precalculate all the fields yourself
to ensure consistency. For example, your treatment of floating-point multiplication and rounding
may differ slightly from BlockChyp's.
Discounts
You have the option to show discounts on the display as individual line items with negative values or you can associate discounts with a specific line item. You can apply any number of discounts to an individual line item with a description and amount.
Sample Request and Response
Display Message ( /api/message )
HTTP Method | Path |
---|---|
POST | /api/message |
URL Pattern: https://<IP_ADDRESS>:8443/api/message
- API Credential Types: Merchant
- Required Role: Payment API Access
This API displays a message on the payment terminal.
Just specify the target terminal and the message using the message
parameter.
Sample Request and Response
Boolean Prompt ( /api/boolean-prompt )
HTTP Method | Path |
---|---|
POST | /api/boolean-prompt |
URL Pattern: https://<IP_ADDRESS>:8443/api/boolean-prompt
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to answer a yes or no question.
You can specify the question or prompt with the prompt
parameter and
the response is returned in the response
field.
This can be used for a number of use cases including starting a loyalty enrollment workflow or customer facing suggestive selling prompts.
Custom Captions
You can optionally override the "YES" and "NO" button captions by
using the yesCaption
and noCaption
request parameters.
Sample Request and Response
Text Prompt ( /api/text-prompt )
HTTP Method | Path |
---|---|
POST | /api/text-prompt |
URL Pattern: https://<IP_ADDRESS>:8443/api/text-prompt
- API Credential Types: Merchant
- Required Role: Payment API Access
This API prompts the customer to enter numeric or alphanumeric data.
Due to PCI rules, free-form prompts are not permitted when the response could be any valid string. The reason for this is that a malicious developer (not you, of course) could use text prompts to ask the customer to input a card number or PIN code.
This means that instead of providing a prompt, you provide a promptType
instead.
The prompt types currently supported are listed below:
- phone: Captures a phone number.
- email: Captures an email address.
- first-name: Captures a first name.
- last-name: Captures a last name.
- customer-number: Captures a customer number.
- rewards-number: Captures a rewards number.
You can specify the prompt with the promptType
parameter and
the response is returned in the response
field.
Sample Request and Response
List Queued Transactions ( /api/queue/list )
HTTP Method | Path |
---|---|
POST | /api/queue/list |
URL Pattern: https://<IP_ADDRESS>:8443/api/queue/list
- API Credential Types: Merchant
- Required Role: Payment API Access
Returns a list of transaction refs of transactions queued on a terminal. Details about the transactions can be retrieved using the Transaction Status API.
Sample Request and Response
Delete Queued Transaction ( /api/queue/delete )
HTTP Method | Path |
---|---|
POST | /api/queue/delete |
URL Pattern: https://<IP_ADDRESS>:8443/api/queue/delete
- API Credential Types: Merchant
- Required Role: Payment API Access
Deletes one or all queued transactions from a terminal. If *
is passed as
a transaction ref, then the entire terminal queue will be cleared. An error is
returned if the passed transaction ref is not queued on the terminal.
Sample Request and Response
Reboot Terminal ( /api/reboot )
HTTP Method | Path |
---|---|
POST | /api/reboot |
URL Pattern: https://<IP_ADDRESS>:8443/api/reboot
- API Credential Types: Merchant
- Required Role: Payment API Access
This API reboots the terminal.
Sample Request and Response
Getting Help
We've done our best to make this documentation as complete as possible, but no documentation is perfect, especially in the payments industry.
If you have questions or run into any problems, feel free to contact us at support@blockchyp.com.