---
title: "Create Scan Code"
method: POST
path: "/scan_codes"
tags: ["Scan Code"]
---

# Create Scan Code

`POST /scan_codes`

## Request

- Base URL: `https://tb.paymentfusion.com`
- URL: `https://tb.paymentfusion.com/scan_codes`
- Auth: none declared. Required headers: `Authorization`, `Accept`, `Content-Type`

Called by the Independent Software Vendor. Returns a base64 encoded QR code.

## Headers

- `Authorization` string, api_id:api_token, required
- `Accept` string, required
- `Content-Type` string, required

## Request body `application/x-www-form-urlencoded`

- object
  - `id` string, required: The HPP identifer for the transaction
  - `transaction_type` string, required: The type of transaction that will be performed. (e.g. transaction_type=Sale) Allowed Values - `"Auth"`, `"Sale"`, `"SaveOnly"`
  - `amount` number, float, required: The amount in USD up to 6 decimals that will be charged, must be a number greater than 0 and its last 4 digits must be 0. (e.g. \"1\", \"1.00\", \"1.01\", \"1.2\", \"1.230000\").
  - `type` string, required: The type of scan code that will be returned. Allowed Values - `"qr_code"`
  - `ttl` integer: The time to live in hours for the scan code. Default - 744, Range - 1 to 4464
  - `invoice_number` string: The invoice number of the transaction that will be performed. (e.g. invoice_number=INV333)
  - `pn_ref` string: The gateway's transaction reference number (e.g. pn_ref=523222)
  - `echo_fields` boolean: Enable echo_fields
  - `approved_redirect` string: Redirect URL for approval
  - `declined_redirect` string: Redirect URL for declined
  - `send_customer_receipt` boolean: Determines if the receipt should be sent or not
  - `receipt_template` string: Allowed Values - `"pending"`, `"approved"`, `"declined"`, `"void"`, `"error"`, `"installment"`, `"refund"`, `"refunded"`, `"credit"`, `"default"`
  - `customer_email` string: Specifies the customer email address
  - `test_mode` boolean: Enable test_mode
  - `force_duplicate` boolean: Allows multiple transactions with the same amount to be created on the same merchant
  - `amount_is_editable` boolean: Specifies if the amount is editable or not
  - `non_taxable` boolean: Specifies if the transaction is non taxable
  - `tax_amount` number, float: Specifies the tax amount value in USD up to 6 decimals, its last 4 digits must be 0. (e.g. "1", "1.00", "1.01", "1.2", "1.230000").
  - `shipping_amount` number, float: Specifies the shipping amount value in USD up to 6 decimals, its last 4 digits must be 0. (e.g. "1", "1.00", "1.01", "1.2", "1.230000").
  - `discount_amount` number, float: Specifies the discount value in USD up to 6 decimals, its last 4 digits must be 0. (e.g. "1", "1.00", "1.01", "1.2", "1.230000").
  - `tip_amount` number, float: Specifies the tip value in USD up to 6 decimals, its last 4 digits must be 0. (e.g. "1", "1.00", "1.01", "1.2", "1.230000").
  - `customer_name` string: Specifies the customer name
  - `phone_number` string: Specifies the customer phone number
  - `billing_first_name` string: Specifies the billing first name
  - `billing_last_name` string: Specifies the billing last name
  - `billing_address_1` string: Specifies the billing address line 1
  - `billing_address_2` string: Specifies the billing address line 2
  - `billing_city` string: Specifies the billing city
  - `billing_state` string: Specifies the billing state
  - `billing_zip` string: Specifies the billing zip code
  - `shipping_is_billing` boolean: Specifies if the shipping address is the same as the billing address
  - `shipping_first_name` string: Specifies the shipping person first name
  - `shipping_last_name` string: Specifies the shipping person last name
  - `shipping_address_1` string: Specifies the shipping address line 1
  - `shipping_address_2` string: Specifies the shipping address line 2
  - `shipping_city` string: Specifies the shipping city
  - `shipping_state` string: Specifies the shipping state
  - `shipping_zip` string: Specifies the shipping address zip code
  - `comment` string: Specifies a comment for the transaction
  - `description` string: Specifies the description of the transaction
  - `clerk` string: Sales clerk. Optional value indicating the clerk/person processing transaction, for reporting purposes.
  - `remote_id` string: Specifies the remote id
  - `short_url` boolean: Generates a short HPP URL
  - `custom_fields` string: Optional field of comma separated key=value pairs (e.g. custom_fields=key_1=value_1,key_2=value_2,key_3=value_3) reserved keys tb_id, tb_transaction_type
  - `callback_url_1` string: One of the three URLs where Transaction Broker will POST to when a HPP request is completed. This eliminates the need for polling for the request's status. Only HTTPS URLs are allowed. The callback will the callback will retry if the host is unresponsive. The response received from the callback url must have the response code 2xx. Basic auth credentials may be added in to url ie. 'https://username:password@address.com' or as an url param 'https://address.com?token=secret'. Size range - `0..2000`.
  - `callback_url_2` string: One of the three URLs where Transaction Broker will POST to when a HPP request is completed. This eliminates the need for polling for the request's status. Only HTTPS URLs are allowed. The callback will the callback will retry if the host is unresponsive. The response received from the callback url must have the response code 2xx. Basic auth credentials may be added in to url ie. 'https://username:password@address.com' or as an url param 'https://address.com?token=secret'. Size range - `0..2000`.
  - `callback_url_3` string: One of the three URLs where Transaction Broker will POST to when a HPP request is completed. This eliminates the need for polling for the request's status. Only HTTPS URLs are allowed. The callback will the callback will retry if the host is unresponsive. The response received from the callback url must have the response code 2xx. Basic auth credentials may be added in to url ie. 'https://username:password@address.com' or as an url param 'https://address.com?token=secret'. Size range - `0..2000`.

## Response `201`

Success

- object
  - `id` string: identifier for the scan code in our system
  - `scan_code` string: base64 encode png image of scan code
  - `v` string: The API version that was used to handle the request.

## Other responses

- `4XX`: Possible errors - 1, 28, 29, 85, 106, 189, 223, 225, 226, 257, 259, 275, 276, 277, 278, 281, 282, 283, 284, 285
- `5XX`: Possible errors - 221

---

[API](https://skmtc.dev/bankofamerica/apis/transaction-broker-api.md) - [All operations](https://skmtc.dev/bankofamerica/apis/transaction-broker-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bankofamerica/apis/transaction-broker-api/revisions/6097bc689e41?raw)
