Cryptographically Secure RESTful Interface
BitPay provides a standards-based REST interface which enables application developers to interact in a powerful, yet secure way with their BitPay account. Using the BitPay API, clients can create and manage invoices, issue refunds, manage bills, retrieve real-time rates information, view merchant ledger entries, and much more. Developers may call the API directly over HTTPS using the language of their choice, or take advantage of one of BitPay's Node.js, PHP, and Ruby API clients.
BitPay considers the following types of API changes to be non-breaking and backwards-compatible:
Authentication in BitPay's API utilizes a specialized identification scheme, BitAuth Identity Protocol. Every Identity is represented in public form as a Client ID, which much like the Bitcoin protocol, is simply a hash of the identity's public key. For your convenience, all of BitPay's Client Libraries support this functionality.
Authorization in BitPay's API utilizes Capability-based Security principles. Each API call must be accompanied by an API Token which grants access to the requested capability. API Tokens are analagous to a real-world event ticket, which grants access to a specific event when presented at the door. Also like tickets, they may grant broad or narrow privileges (e.g. 'General Admission' vs. 'Seat 44B') as well as add bearer requirements (e.g. 'Must be over 21' or 'Non-transferrable, must show ID').
New tokens are provided with each response from the API. For example, creating a new Invoice with one token will provide a new, second token that grants access to view and interact with that Invoice exclusively. If not using BitPay's Client Libraries, you will need to keep track of these tokens on your own.
Facades named collections of capabilities that can be granted, such as the ability to create invoices or grant refunds. In the ticket analogy, this corresponds to the ticket 'level', where a 'VIP' ticket would confer broader access than a 'Standard' level ticket. When registering an Identity, it is against a specific facade. Best practices suggest that the requested facade should be limited to the minimum level that grants the required capabilities.
| Facade | Capabilities Description |
|---|---|
public |
The implicit facade applied when no token is provided. Provides access to public methods for generating merchant applications, generating and claiming tokens, or checking exchange rates. |
pos |
Limited to creating new invoices for the merchant's organization |
merchant |
The broadest set of capabilities against a merchant organization. Allows for create, search, and view actions for Invoices and Bills; ledger download, as well as the creation of new merchant or pos tokens associated with the account. |
To use any non-public facade a token will need to be sent with the API request. Tokens can require authentication, which would requiring cryptographically signing each request. You can either generate a token directly from an API client or via the My Account -> API Tokens page. To receive a token directly from an API client, send a POST request to bitpay.com/tokens with the following query parameters:
My BitPay Client)Tf3wXWuwfT1TmenHF21P1nYZ7BeyrYNdiwo)merchant)This will respond with a new token that will include a pairingCode. This pairing code can then be shared with a merchant organization administrator to approve access. This can be done by visiting My Account -> API Tokens and entering the pairing code, or by visiting the url format: bitpay.com/api-access-request?pairingCode=<pairingcode_goes_here>.
Alternatively, pairing codes can be generated directly at My Account -> API Tokens, and can then be claimed by API clients which associates a Client ID with the token, and will activate it for further usage. To claim a token from an API client, send a POST request to bitpay.com/tokens with the following parameters:
My BitPay Client)Tf3wXWuwfT1TmenHF21P1nYZ7BeyrYNdiwo)As retrieved from My Account -> API Tokens)A token without a Client ID authentication restriction can be made, and a token can then be copied directly to make API calls, such as creating invoices. It is also important to note that pairing codes will expire after 24 hours, however once a token is approved or claimed the expiration is cleared.
Requests to the BitPay REST API follow a RESTful convention using standard HTTP verbs against various BitPay resources to return JSON formatted responses. Once again the mechanics of this exchange may be simplified through the use of one of the BitPay libraries.
Each request should include in the HTTP headers:
x-identity(the hexadecimal public key generated from the client private key)x-signature(header which is cryptographically computed as described below)content-type: application/jsonx-accept-version: 2.0.0To make an API request send an HTTP request with a HTTP method to a resource URI and include in the body JSON parameters of the following (plus any additional parameters needed):
token(obtained during client registration process above)guid(an optional parameter to enforce idempotence for POST requests)For more information about specific resource URIs, please visit the resource documentation.
The x-signature header is the ECDSA signature of the full request URL concatenated with the request body, signed with your private key. So if you are sending a request to:
https://bitpay.com/invoices
And your request body is:
{"amount":500,"currency":"USD","token":"1234567"}
The string you will sign is:
https://bitpay.com/invoices{"amount":500,"currency":"USD","token":"1234567"}
The result should be included as the value of the x-signature request header.
The BitPay REST API supports CORS, so that you may send requests directly from the client, however remember to never expose your private key. If your key becomes compromised, you will want to disable your old Client ID and register a new one.
API sessions are an optional feature of our API which can be utilized to provide even greater security and reliability. In particular it protects against replay attacks and ensures api requests are processed in the same order they are received.
An API session can be created by issuing a POST to /sessions. The server responds with a sessionId. The sessionId is used in each subsequent request along with a requestNumber. These fields, sessionId and requestNumber are included as parameters either in the URL for a GET or in the data body for POST and PUT.
On the first request, the requestNumber should be 1. Each additional request should increment the requestNumber by 1. If the server receives a request out of order it will return an error. If the client does not hear back from the server because of an interruption in network connectivity or some other problem, the client may retry by sending the same request with the same requestNumber. The server will then respond with a cached copy of the data if it had already serviced that request but was interrupted when delivering it to the client.
API sessions timeout after 15 minutes of inactivity. After 15 minutes, clients will get an error, and must create a new session. Clients can be programmed to handle creation of new sessions and timeouts automatically. Please see the Node.js client library for a working implementation.
Industry codes used in `orgs` resource
| BitPay Code | Name |
|---|---|
| BP1621 | Accounting |
| BP8293 | Airlines/Aviation |
| BP4443 | Alternative Dispute Resolution |
| BP4163 | Alternative Medicine |
| BP9372 | Animation |
| BP6770 | Apparel/Fashion |
| BP6823 | Architecture/Planning |
| BP3006 | Arts/Crafts |
| BP2459 | Automotive |
| BP0169 | Aviation/Aerospace |
| BP0683 | Banking/Mortgage |
| BP9810 | Biotechnology/Greentech |
| BP8822 | Bitcoin Mining Hardware |
| BP8452 | Bitcoin Mining Co-op |
| BP1627 | Broadcast Media |
| BP9648 | Building Materials |
| BP7908 | Business Supplies/Equipment |
| BP4175 | Capital Markets/Hedge Fund/Private Equity |
| BP1903 | Chemicals |
| BP2863 | Civic/Social Organization |
| BP6822 | Civil Engineering |
| BP1176 | Commercial Real Estate |
| BP0070 | Computer/Network Security |
| BP1060 | Computer Games |
| BP1683 | Computer Hardware |
| BP0135 | Computer Networking |
| BP4528 | Computer Software/Engineering |
| BP9823 | Construction |
| BP2835 | Consumer Electronics |
| BP0492 | Consumer Goods |
| BP5016 | Consumer Services |
| BP5268 | Cosmetics |
| BP5778 | Currency Exchange |
| BP3715 | Dairy |
| BP0793 | Defense/Space |
| BP8062 | Design |
| BP2962 | Dietary Supplements |
| BP8635 | Education Management |
| BP6150 | E-Learning |
| BP3759 | Electrical/Electronic Manufacturing |
| BP8424 | Entertainment |
| BP9312 | Environmental Services |
| BP9883 | Events Services |
| BP5020 | Executive Office |
| BP5203 | Facilities Services |
| BP8908 | Farming |
| BP8425 | File Sharing |
| BP1259 | Financial Services |
| BP0483 | Fine Art |
| BP2980 | Fishery |
| BP3789 | Food/Beverages |
| BP1083 | Food Production |
| BP2703 | Fund-Raising |
| BP8130 | Furniture |
| BP0428 | Gambling/Casinos |
| BP3492 | Glass/Ceramics/Concrete |
| BP3331 | Government Administration |
| BP5240 | Government Relations |
| BP2691 | Graphic Design/Web Design |
| BP2699 | Health/Fitness |
| BP6285 | Higher Education/Academia |
| BP6368 | Hospital/Health Care |
| BP5716 | Hospitality |
| BP7639 | Human Resources/HR |
| BP9442 | Import/Export |
| BP5884 | Individual/Family Services |
| BP0462 | Industrial Automation |
| BP9982 | Information Services |
| BP6246 | Information Technology/IT |
| BP7786 | Insurance |
| BP5144 | International Affairs |
| BP7474 | International Trade/Development |
| BP4945 | Internet |
| BP9235 | Investment Banking/Venture |
| BP6174 | Investment Management/Hedge Fund/Private Equity |
| BP5854 | Judiciary |
| BP5614 | Law Enforcement |
| BP0959 | Law Practice/Law Firms |
| BP0875 | Legal Services |
| BP0389 | Legislative Office |
| BP1152 | Leisure/Travel/Tourism |
| BP1671 | Libraries |
| BP0068 | Logistics/Supply Chain |
| BP2686 | Luxury Goods/Jewelry |
| BP8110 | Machinery |
| BP8883 | Management Consulting |
| BP6520 | Maritime |
| BP2641 | Market Research |
| BP2136 | Marketing/Advertising/Sales |
| BP5592 | Mechanical or Industrial Engineering |
| BP8891 | Media Production |
| BP4115 | Medical Devices/Equipment |
| BP2970 | Medical Practice |
| BP4178 | Mental Health Care |
| BP1043 | Military |
| BP1044 | Money Service Business |
| BP4244 | Motion Pictures/Film |
| BP2215 | Museums/Institutions |
| BP0533 | Music |
| BP1664 | Nanotechnology |
| BP4929 | Newspapers/Journalism |
| BP5293 | Non-Profit/Volunteering |
| BP1759 | Oil/Energy/Solar/Greentech |
| BP1376 | Online Publishing |
| BP5916 | Outsourcing/Offshoring |
| BP5206 | Package/Freight Delivery |
| BP6850 | Packaging/Containers |
| BP4340 | Paper/Forest Products |
| BP7841 | Performing Arts |
| BP7408 | Prepaid Cards/Gift Cards |
| BP7376 | Pharmaceuticals |
| BP8014 | Philanthropy |
| BP4387 | Photography |
| BP5475 | Plastics |
| BP2310 | Political Organization |
| BP0088 | Precious Metals |
| BP7297 | Primary/Secondary Education |
| BP1099 | Printing |
| BP5901 | Professional Training |
| BP9953 | Program Development |
| BP0937 | Public Policy |
| BP1761 | Public Relations/PR |
| BP7033 | Public Safety |
| BP3275 | Publishing Industry |
| BP1539 | Railroad Manufacture |
| BP8414 | Ranching |
| BP9091 | Real Estate/Mortgage |
| BP0007 | Recreational Facilities/Services |
| BP2864 | Religious Institutions |
| BP9264 | Renewables/Environment |
| BP6653 | Research Industry |
| BP2938 | Restaurants |
| BP6277 | Retail Industry |
| BP3520 | Security/Investigations |
| BP1590 | Semiconductors |
| BP1104 | Shipbuilding |
| BP7148 | Sporting Goods |
| BP3345 | Sports |
| BP3135 | Staffing/Recruiting |
| BP2620 | Supermarkets |
| BP6279 | Telecommunications |
| BP7010 | Textiles |
| BP5077 | Think Tanks |
| BP6741 | Tobacco |
| BP3367 | Translation/Localization |
| BP5132 | Transportation |
| BP4134 | Utilities |
| BP2191 | Venture Capital/VC |
| BP4737 | Veterinary |
| BP3527 | Video on Demand |
| BP3487 | VPN/Hosting |
| BP7456 | Warehousing |
| BP0126 | Wholesale |
| BP3612 | Wine/Spirits |
| BP0514 | Wireless |
| BP8901 | Writing/Editing |
Codes marked as deprecated may have been used in the past, but are no longer used for newly written ledger entries.
| BitPay Code | Name |
|---|---|
| 1000 | Invoice |
| 1001 (deprecated) | Fee |
| 1002 (deprecated) | Payment |
| 1003 (deprecated) | Other |
| 1004 | Fee Refund |
| 1005 (deprecated) | Deposit |
| 1006 | Exchange |
| 1007 | Exchange Fee |
| 1008 | Plan Charge |
| 1009 | Plan Prorated Credit |
| 1010 | Plan Underutilization Credit |
| 1011 | Payoff Negative Balance |
| 1012 | Donation |
| 1013 (deprecated) | Corrective |
| 1014 (deprecated) | Settlement Fee |
| 1016 | Custom |
| 1017 | Account Settlement |
| 1018 | Overpayment Credit Fee |
| 1019 | Overpayment Credit |
| 1020 | Invoice Refund |
| 1021 | Overpayment Credit Refund |
| 1022 | Corrective for Failed Account Settlement |
| 1023 | Invoice Fee |
| 1024 | Bitcoin Deposit |
| 1025 | Fiat Deposit |
| 1026 | Donation Fee |
| 1027 | Custom Fee |
| 1030 | Affiliate Commission |
| 1031 | Manual Affiliate Commission |
| 1032 | Merchant Card Deposit |
| 1033 | Custom Plan Charge |
| 1034 | Funding Payout Request |
| 1035 | Manually Funding Payout Request |
| 1036 | Custom Fee Reimbursement |
| 1037 | Custom Plan Charge Reimbursement |
| 1038 | Testnet Bitcoin Settlement |
| 1039 | Refund Fee |
| 1040 | Payout Fee |
| 1041 | Wire Fee |
US wallet provider names used for payouts
| BitPay Code | Name |
|---|---|
| bitgo | |
| uphold | |
| circle | |
| coinbase | |
| gdax | |
| gemini | |
| itbit | |
| kraken |
Codes for invoice and payout events with webhook notifications
| BitPay Code | Name |
|---|---|
| 1001 | invoice_created |
| 1002 | invoice_receivedPayment |
| 1003 | invoice_paidInFull |
| 1004 | invoice_expired |
| 1005 | invoice_confirmed |
| 1006 | invoice_completed |
| 1007 | invoice_refunded |
| 1008 | invoice_markedInvalid |
| 1009 | invoice_paidAfterExpiration |
| 1010 | invoice_expiredPartial |
| 1011 | invoice_blockedByTierLimit |
| 1012 | invoice_manuallyNotified |
| 1013 | invoice_failedToConfirm |
| 1014 | invoice_latePayment |
| 1015 | invoice_adjustmentComplete |
| 1016 | invoice_refundComplete |
| 2001 | payoutRequest_funded |
| 2002 | payoutRequest_completed |
| 2003 | payoutRequest_cancelled |
| 3001 | org_completedSetup |
Bills are payment requests addressed to specific buyers. Bill line items have fixed prices, typically denominated in fiat currency.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
token
API token for bill resource
|
string |
✓ |
createdDate
Time of bill creation
|
date |
✓ |
delivered
Indicates whether bill has been delivered to buyer
|
boolean |
✓ |
number
Bill identifier, specified by merchant
|
string |
|
status
Can be `draft`, `sent`, `paid`, or `complete`
|
string |
|
currency
ISO 4217 3-character currency code
|
string |
|
showRate
Indicates whether corresponding invoice web page should display equivalent fiat amount
|
boolean |
|
archived
Indicates whether bill is visible in BitPay website
|
boolean |
|
name
Buyer Name
|
string |
|
address1
Buyer Street Address
|
string |
|
address2
Buyer Apartment or Suite Number
|
string |
|
city
Buyer Locality or City
|
string |
|
state
Buyer State or province
|
string |
|
zip
Buyer Zip or Postal Code
|
string |
|
country
Buyer Country Code (ISO 3166-1 alpha-2)
|
string |
|
email
Buyer Email
|
string |
|
phone
Buyer Phone
|
string |
|
dueDate
UTC date, ISO-8601 format yyyy-mm-dd or yyyy-mm-ddThh:mm:ssZ. Default is current time.
|
date |
|
items
List of line items
|
array |
|
description
Line item description
|
string |
|
price
Line item unit price, in `currency`
|
number |
|
quantity
Line item number of units
|
number |
Creates a bill for the calling merchant.
| Required Parameters | description price quantity |
| Facades | merchant |
Retrieves all of the caller's bills.
| Parameters | status |
| Facades | merchant |
Retrieves the specified bill.
| Parameters | none |
| Facades | merchant |
Updates the specified bill.
| Required Parameters | description price quantity |
| Facades | merchant |
Delivers the bill to the recipient's email.
| Parameters | none |
| Facades | merchant |
Clients are devices or developer applications used to access the BitPay API. A client is identified by its access key id. A client is associated with a token via a pairing process.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
|
label
Description of client
|
string |
|
approved
Indicates whether client is approved
|
boolean |
|
disabled
Indicates whether client is enabled
|
boolean |
|
token
API token for clients resource
|
string |
✓ |
Associates a client identity with a user.
| Required Parameters | none |
| Facades | public |
Retrieves the registered client access keys for the caller.
| Parameters | none |
| Facades | client |
Modifies the given client access key (approving or disabling).
| Required Parameters | none |
| Facades | client public |
Currencies are fiat currencies supported by BitPay
| Name | Type | Read-Only |
|---|---|---|
code
ISO 4217 3-character currency code
|
string |
|
symbol
Display symbol
|
string |
|
precision
Number of decimal places
|
number |
|
exchangePctFee
Basis points
|
number |
|
payoutEnabled
Indicates whether BitPay can exchange currency for BTC
|
boolean |
|
name
English currency name
|
string |
|
plural
English plural form
|
string |
|
alts
Alternative currency name(s)
|
string |
|
minimum
Minimum supported value
|
string |
|
payoutFields
Can be `merchantEIN`
|
array |
Retrieves the list of supported currencies.
| Parameters | none |
| Facades | public |
Invoices are time-sensitive payment requests addressed to specific buyers. An invoice has a fixed price, typically denominated in fiat currency. It also has a BTC equivalent price, calculated by BitPay, with an expiration time of about 15 minutes.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
token
API token for invoice resource
|
string |
✓ |
price
Fixed price amount, denominated in `currency`
|
number |
|
currency
Fixed price currency, not the expiring BTC price
|
string |
|
orderId
Order id
|
string |
|
orderID
Order id (deprecated)
|
string |
|
itemDesc
Invoice description, from first line item of bill
|
string |
|
itemCode
`bitcoindonation` for donations, otherwise null
|
string |
|
notificationEmail
Contact for notification of invoice status change. If missing, then account notification email address is notified.
|
string |
|
notificationURL
Webhook URL for instant payment notification (IPN)
|
string |
|
redirectURL
URL to redirect your shopper back to your website after a successful purchase. Be sure to include "http://" or "https://" in the url.
|
string |
|
paymentUrls
All URLs where your shopper can pay the invoice. URLs are temporary and will change and not be available after 15 minutes when the invoice expires, unless the invoice has been paid. Notice this field is deprecated; use paymentCodes
|
array |
✓ |
`BIP protocol`
URL for given BIP protocol
|
string |
|
paymentCodes
The URIs for sending a transaction to the invoice. The first key is the transaction currency. The transaction currency maps to an object containing the payment URIs. The key of this object is the BIP number and the value is the payment URI. ex: '{"BTC":{"BIP21": "bitcoin:18LzEcVK6y6DDBdqeWRAQk7BfKA9NMdVSK?amount=1.2345"}}' BIP72, BIP72b, and BIP73 are also supported.
|
object |
✓ |
posData
Order reference number from the point-of-sale (POS). It should be a unique identifer for each order that you submit. Field is a passthru-variable returned in the payment notification post, without any modifications, for you to match up the BitPay payment notification with the request that was sent to BitPay.
|
string |
|
transactionSpeed
Can be `high`, `medium`, or `low`. HIGH speed confirmations typically take 5-10 seconds, and can be used for digital goods or low-risk items. LOW speed confirmations take about 1 hour, and should be used for high-value items. If missing, then account transaction speed is used.
|
string |
|
fullNotifications
Indicates whether email and IPN notifications should be sent for this invoice. If missing, then account notification settings are used.
|
boolean |
|
extendedNotifications
Indicates whether IPN notifications should be sent for this invoice when the invoice expires or is refunded. If true, then fullNotifications is automatically set to true.
|
boolean |
|
physical
Indicates whether items are physical goods. Alternatives include digital goods and services.
|
boolean |
|
buyer
Customer who pays the invoice
|
object |
|
name
Buyer Name
|
string |
|
address1
Buyer Street Address
|
string |
|
address2
Buyer Apartment or Suite Number
|
string |
|
locality
Buyer Locality or City
|
string |
|
region
Buyer State or province
|
string |
|
postalCode
Buyer Zip or Postal Code
|
string |
|
country
Buyer Country code
|
string |
|
email
Buyer Email
|
string |
|
phone
Buyer Phone
|
string |
|
notify
Indicates whether receipt email should be sent to buyer for this invoice
|
boolean |
|
url
Web address of invoice, expires at `expirationTime`
|
string |
✓ |
status
Can be `new` (invoice has not yet been fully paid), `paid` (received payment but has not yet been fully confirmed), `confirmed` (confirmed based on the transaction speed settings), `complete` (confirmed by BitPay and credited to the ledger), `expired` (can no longer receive payments), and `invalid` (invoice has received payments but was invalid)
|
string |
✓ |
btcDue
BTC amount due. This is what the purchaser should pay. This value changes as payments are made to the invoice. Merchants should check that this field is 0 before considering this invoice fully paid.
|
number |
✓ |
btcPaid
BTC amount paid. The total amount paid to the invoice so far.
|
number |
✓ |
btcPrice
BTC equivalent of `price`, expires at `expirationTime`. This value does not change as payments are made to the invoice. BitPay adds its fees to this total, so the actual amount BitPay needs to collect will be higher than this value.
|
number |
✓ |
paymentSubtotals
Equivalent of price in terms of the transaction currency. This value does not include fees. The key is the currency and the value is an amount in satoshis.
|
object |
✓ |
paymentTotals
The total amount that the purchaser should pay. This is like paymentSubtotals, but with fees included. The key is the currency and the value is an amount in satoshis.
|
object |
✓ |
invoiceTime
UNIX time of invoice creation, in milliseconds
|
number |
✓ |
expirationTime
UNIX time when invoice is last available to be paid, in milliseconds
|
number |
✓ |
currentTime
Time of API call
|
date |
✓ |
exceptionStatus
Can be `paidPartial`, `paidOver`, or false
|
boolean |
✓ |
rate
BTC exchange rate used for invoice, denominated in `currency`
|
number |
✓ |
exRates
All exchange rates used for invoice
|
array |
✓ |
`currency code`
Exchange rate for given currency code. Notice: this field is deprecated; use exchangeRates
|
number |
✓ |
exchangeRates
An object of exchange rates keyed by source and target currencies. ex: {"BTC": {"USD": 7342.99, "EUR": 6325.53}}
|
object |
✓ |
transactions
All transactions used to pay invoice
|
array |
✓ |
amount
Amount paid, in satoshis
|
number |
✓ |
confirmations
Number of confirmations in blockchain
|
number |
✓ |
time
Time of transaction from bitcoin network
|
date |
✓ |
receivedTime
Time when BitPay received transaction from network
|
date |
✓ |
flags
Miscellaneous invoice attributes
|
object |
✓ |
refundable
Indicates whether buyer bitcoin address is available for this invoice
|
boolean |
✓ |
creditedOverpaymentAmounts
For invoices where an overpayment has been credited to the merchant's ledger, this shows the overpayment amount credited. The amounts are listed in terms of all of the currencies that the invoice has exchange rates for. The key is the currency code, and the value is the amount.
|
object |
✓ |
refundAmounts
If this invoice was fully paid and was then refunded from the ledger, this object will include the amounts refunded. This does not include refunds from the invoice for overpaid and underpaid amounts. The key is the currency code, and the value is the amount. BTC will always be listed. Notice: this field is deprecated; use refundInfo
|
object |
✓ |
refundInfo
If this invoice has one or more refund from the ledger, refundInfo gives an array with an object per refund that includes information about the refund. refundInfo may not be available for invoices before August 2017.
|
array |
✓ |
supportRequest
the id of the refund support request
|
string |
✓ |
currency
the currency code of the refund currency
|
string |
✓ |
amounts
a map of currency codes to the refunded amount in that currency, includes refunded amount in the refund currency, settlement currency, and BTC
|
object |
✓ |
transactionCurrency
the currency used to pay the invoice. This field will only be avaliable after a transaction is applied to the invoice. ex: 'BTC'
|
string |
✓ |
supportedTransactionCurrencies
The currencies that may be used to pay an invoice. The object is keyed by currency code. The values are objects with an "enabled" boolean.
|
object |
✓ |
Creates an invoice for the calling merchant.
| Required Parameters | price currency |
| Facades | merchant pos |
Retrieves the specified invoice for the calling merchant.
| Parameters | none |
| Facades | public merchant |
Retrieves a bus token which can be used to subscribe to invoice events.
| Parameters | none |
| Facades | public merchant |
| Name | Type |
|---|---|
url
URL where you can subscribe to events
|
string |
token
API token for subscriber resource, passed as `&token=` query parameter value
|
string |
events
All supported `&events[]=` query parameter values. Can be `payment`.
|
array |
actions
All supported `&action=` query parameter values. Can be `subscribe` or `unsubscribe`.
|
array |
Retrieves invoices for the calling merchant filtered by query. The `limit` and `offset` parameters specify pages for large query sets.
| Parameters | status orderId itemCode dateStart dateEnd limit offset |
| Facades | merchant |
Creates a refund request for the given invoice.
| Name | Type | Required | Facades |
|---|---|---|---|
bitcoinAddress
|
string |
merchant | |
amount
|
number |
merchant | |
currency
|
string |
merchant |
| Name | Type |
|---|---|
id
Refund request resource id
|
string |
requestDate
Time of API call
|
date |
status
Can be `pending`, `success`, or `failure`
|
string |
token
API token for invoice refund request resource
|
string |
Returns the status of a refund.
| Parameters | none |
| Facades | merchant |
Cancels a pending refund request.
| Parameters | none |
| Facades | merchant |
Returns the status of all refunds on an invoice.
| Parameters | none |
| Facades | merchant |
[WARNING: This feature is deprecated] Accepts underpayment for the invoice. Uses type `acceptUnderpayment` to accept an underpayment. Uses `commit` true to commit the adjustment to the invoice or false to preview it.
| Name | Type | Required | Facades |
|---|---|---|---|
type
|
string |
✓ | merchant |
commit
|
boolean |
merchant |
Resends the IPN for the specified invoice.
| Parameters | none |
| Facades | merchant |
Ledgers are records of money movement.
| Name | Type | Read-Only |
|---|---|---|
code
Numeric ledger entry code. See the References section at the top of the page for a list of codes and their respective types. New codes may be added in the future for new purposes. Some codes that were once used have since been deprecated and replaced by newer codes. Any integration looking at ledger entry codes needs to anticipate that new codes may be added. Entries with unrecognized codes should be treated as general purpose entries until the integration can be updated to understand the purpose of the new code.
|
number |
|
type
English description of the ledger entry type based on the code. This is for descriptive purposes only and is subject to change.
|
string |
|
txType
[DEPRECATED] Similar to `type`, but some of the strings may be different. This may not be available on some entries.
|
string |
|
amount
Ledger entry amount
|
number |
|
timestamp
Ledger entry timestamp
|
date |
|
description
Ledger entry description
|
string |
|
scale
Power of 10 used for conversion
|
number |
|
invoiceId
Invoice identifier
|
string |
|
invoiceAmount
Invoice amount
|
number |
|
invoiceCurrency
Invoice currency code
|
string |
|
exRates
All exchange rates used for invoice
|
array |
|
`currency code`
Exchange rate for given currency code
|
number |
|
rateEstimated
Some entries do not have exchange rates of their own. For these entries, the listed exchange rate is estimated based on historical data and the timestamp.
|
boolean |
Retrieves the caller's ledger entries for the given currency.
| Parameters | startDate endDate |
| Facades | merchant |
Retrieves the caller's ledgers for each currency with summary.
| Parameters | none |
| Facades | merchant |
| Name | Type |
|---|---|
currency
ISO 4217 3-character currency code
|
string |
balance
Account balance, in given currency code
|
number |
Organizations are entities such as businesses, schools, NGOs, and clubs. They may be affiliated with another organization.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
numericId
Organization id
|
string |
✓ |
affiliateOid
Affiliate organization id
|
string |
✓ |
completedSetup
Indicates whether organization has completed account setup
|
boolean |
✓ |
name
Business name
|
string |
|
address1
Street Address
|
string |
|
address2
Apartment or suite number
|
string |
|
locality
City or locality
|
string |
|
region
State or province
|
string |
|
postalCode
ZIP or postal code
|
string |
|
country
ISO 3166-1 alpha-2 country code
|
string |
|
website
Website for customers
|
string |
|
phone
Support phone contact
|
string |
|
email
Support email contact
|
string |
|
legalBusinessName
Legal business name
|
string |
|
industryCode
Industry code
|
string |
|
isNonProfit
US non-profit status
|
boolean |
|
taxId
US tax id
|
string |
|
owners
Business owners
|
array |
|
givenName
First name of owner
|
string |
|
familyName
Last name of owner
|
string |
|
payoutInfo
Identifiers of all bitcoin addresses and bank accounts where BitPay settles your net payment. Identifiers vary by currency.
|
array |
|
label
Label of address or account
|
string |
|
currency
`BTC` or ISO 4217 3-character currency code
|
string |
|
percent
Percentage of net payment
|
number |
|
bitcoinAddress
Bitcoin address
|
string |
|
name
Name on account
|
string |
|
taxId
Tax id of bank account
|
string |
|
routing
Bank routing number
|
string |
|
account
Bank account number
|
string |
|
iban
IBAN account number
|
string |
|
swift
SWIFT bank number
|
string |
|
sort
Bank sort code
|
string |
|
notificationURLs
URLs where BitPay sends webhook notifications
|
array |
|
url
URL
|
string |
|
format
Format of notification. Can be `json`. Default is `json`.
|
string |
✓ |
eventTypes
Types of events sent to this URL. Can be `org_completedSetup`. An empty array means that URL is used for all event types.
|
array |
|
failCount
Number of failed attempts since last success
|
number |
✓ |
lastSuccess
UTC date, ISO-8601 format yyyy-mm-dd. Indicates date of most recent successful notification
|
date |
✓ |
refundReserveAmounts
Amounts automatically withheld from each settlement for the purpose of processing refunds. ex: {"BTC": 0.1234, "USD": 200.00}
|
object |
✓ |
settlementMinimums
Balance that is required in order to recieve a settlement in a given currency. ex: {"BTC": 0.1234, "USD": 200.00}
|
object |
✓ |
Creates an org affiliated with the calling partner.
| Required Parameters | name |
| Facades | onboarding |
Retrieves all of the caller's orgs.
| Parameters | name |
| Facades | onboarding |
Retrieves the specified org.
| Parameters | none |
| Facades | onboarding |
Payouts are batches of bitcoin payments to employees, customers, partners, etc.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
token
API token for payout request resource
|
string |
✓ |
account
Merchant account id
|
string |
✓ |
status
Can be `new`, `funded`, `processing`, `complete`, `failed`, and `cancelled`
|
string |
✓ |
btc
BTC equivalent amount
|
number |
✓ |
requestDate
Date when request was submitted
|
date |
✓ |
instructions
Payout instructions
|
array |
|
id
Resource id of instructions
|
string |
✓ |
status
Can be `unpaid`
|
string |
✓ |
btc
BTC payment summary
|
object |
✓ |
paid
Amount paid
|
number |
✓ |
unpaid
Amount unpaid
|
number |
✓ |
transactions
Transactions
|
array |
✓ |
amount
BTC amount
|
number |
|
address
Bitcoin address
|
string |
|
label
Label
|
string |
|
walletProvider
If the payout request is for more than 3000 USD and sends to an address controlled by one of the specified wallet providers, the name of the wallet provider and the receiverInfo for the recipient must be provided. The list of wallet providers can be found in the references section at the top of the page.
|
string |
|
receiverInfo
|
object |
|
name
Full name of the individual who is receiving the payout
|
string |
|
emailAddress
email address of the individual who is receiving the payout
|
string |
|
address
street address of the recipient
|
object |
|
streetAddress1
|
string |
|
streetAddress2
|
string |
|
locality
equivalent to city
|
string |
|
region
equivalent to state or province
|
string |
|
postalCode
|
string |
|
country
|
string |
|
amount
Fiat or BTC amount
|
number |
|
currency
Payout currency
|
string |
|
percentFee
Percent fee charged on the payout
|
number |
✓ |
fee
Absolute amount of the fee charged, in the currency of the payout
|
number |
✓ |
depositTotal
Total amount, including the fee, that must be deposited to fund the payout
|
number |
✓ |
effectiveDate
Date when request is effective. Note that the time of day will automatically be set to 09:00:00.000 UTC time for the given day. Only requests submitted before 09:00:00.000 UTC are guaranteed to be processed on the same day.
|
date |
|
reference
Merchant-provided data
|
string |
|
bankTransferId
Merchant-provided data, to help match funding payments to payout batches
|
string |
|
supportPhone
BitPay support phone number
|
string |
✓ |
pricingMethod
Can be `manual_2` or `vwap_24hr`
|
string |
|
notificationEmail
IPN email address
|
string |
|
notificationURL
Webhook URL for instant payment notification (IPN). Notifications include an event object with name and BitPay code properties and a data object containing information about the event.
|
string |
Creates a payout batch request.
| Required Parameters | instructions amount address amount currency effectiveDate |
| Facades | payroll |
Retrieves all of the caller's payout requests by status.
| Parameters | status |
| Facades | payroll |
Cancels the given payout request if status is still new.
| Parameters | none |
| Facades | payroll |
Retrieves the specified payout request.
| Parameters | none |
| Facades | payroll |
Rates are exchange rates, representing the number of fiat currency units equivalent to one BTC.
| Name | Type | Read-Only |
|---|---|---|
code
ISO 4217 3-character currency code
|
string |
|
name
English currency name
|
string |
|
rate
Currency units per BTC
|
number |
Retrieves the list of exchange rates.
| Parameters | none |
| Facades | public |
Retrieves the exchange rate for the given currency.
| Parameters | none |
| Facades | public |
Creates an API session to protect against replay attacks and ensure requests are received in the same order they are sent.
| Required Parameters | none |
| Facades | public |
Settlements are transfers of payment profits from BitPay to bank accounts and bitcoin wallets owned by merchants, partners, etc. This endpoint exposes reports detailing these settlements.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
accountId
Account Id
|
string |
|
currency
`BTC` or ISO 4217 3-character currency code
|
string |
✓ |
payoutInfo
|
object |
|
name
Name on bank account
|
string |
✓ |
account
Bank account number
|
string |
✓ |
routing
Bank routing number
|
string |
✓ |
merchantEIN
Merchant EIN number
|
string |
✓ |
label
Account label
|
string |
✓ |
bankCountry
Country of bank account
|
string |
✓ |
status
Can be `processing`, `completed`, or `failed`
|
string |
✓ |
dateCreated
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was created.
|
date |
✓ |
dateExecuted
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was executed. This is the time when ledger entries were written.
|
date |
✓ |
dateCompleted
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was completed. Present for `completed` and `failed` settlements only.
|
date |
✓ |
openingDate
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Ledger entries newer than or equal to this date and older than closingDate are included in this settlement.
|
date |
✓ |
closingDate
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Ledger entries older than this date and newer than openingDate are included in this settlement.
|
date |
✓ |
openingBalance
Opening balance as of openingDate
|
number |
✓ |
ledgerEntriesSum
Sum of all ledger entries included in the settlement
|
number |
✓ |
withholdings
|
array |
|
amount
Amount withheld from settlement
|
number |
|
code
Code identifying what type of withholding
|
string |
|
description
Description of withholding
|
string |
|
notes
Any additional notes about this withholding
|
string |
|
withholdingsSum
Sum of withholdings
|
number |
✓ |
totalAmount
Total amount settled, in `currency`
|
number |
✓ |
Retrieves settlement reports for the calling merchant filtered by query. The `limit` and `offset` parameters specify pages for large query sets.
| Parameters | startDate endDate currency status limit offset |
| Facades | merchant |
Retrieves a summary of the specified settlement.
| Parameters | none |
| Facades | merchant |
Gets a detailed reconciliation report of the activity within the settlement period
| Parameters | none |
| Facades | merchant |
| Name | Type |
|---|---|
id
Resource id
|
string |
accountId
Account Id
|
string |
currency
`BTC` or ISO 4217 3-character currency code
|
string |
payoutInfo
|
object |
name
Name on bank account
|
string |
account
Bank account number
|
string |
routing
Bank routing number
|
string |
merchantEIN
Merchant EIN number
|
string |
label
Account label
|
string |
bankCountry
Country of bank account
|
string |
status
Can be `processing`, `completed`, or `failed`
|
string |
dateCreated
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was created.
|
date |
dateExecuted
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was executed. This is the time when ledger entries were written.
|
date |
dateCompleted
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Indicates date when settlement was completed. Present for `completed` and `failed` settlements only.
|
date |
openingDate
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Ledger entries newer than or equal to this date and older than closingDate are included in this settlement.
|
date |
closingDate
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Ledger entries older than this date and newer than openingDate are included in this settlement.
|
date |
openingBalance
Opening balance as of openingDate
|
number |
ledgerEntriesSum
Sum of all ledger entries included in the settlement
|
number |
withholdings
|
array |
amount
Amount withheld from settlement
|
number |
code
Code identifying what type of withholding
|
string |
description
Description of withholding
|
string |
notes
Any additional notes about this withholding
|
string |
withholdingsSum
Sum of withholdings
|
number |
totalAmount
Total amount settled, in `currency`
|
number |
ledgerEntries
|
array |
code
Ledger entry code
|
number |
invoiceId
Invoice id (if applicable)
|
string |
amount
Total settlement amount for this entry, in currency being settled
|
number |
timestamp
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Time that this entry was written to the ledger
|
date |
description
Ledger entry description
|
string |
reference
Bitcoin txid of settlement transaction
|
string |
invoiceData
|
object |
orderId
Invoice order id
|
string |
date
UTC date, ISO-8601 format yyyy-mm-ddThh:mm:ssZ. Date of invoice creation
|
date |
price
Invoice price
|
number |
currency
Invoice currency
|
string |
overpaidAmount
The amount the invoice was overpaid (denominated in the invoice currency)
|
number |
payoutPercentage
The percentage of invoice settled to each currency. The keys are currency codes, the values are numbers from 0 to 100
|
object |
btcPrice
BTC amount required to fully pay invoice (for fiat currency invoices only)
|
number |
refundAmounts
Total refunded transaction amounts by currency (will always include BTC). Notice: this field is deprecated; use refundInfo
|
object |
refundInfo
Information about the refund. refundInfo may not be available for invoices before August 2017.
|
object |
supportRequest
the refund support request id
|
string |
currency
the refund currency
|
string |
amounts
the refund amount denominated in BTC and settlement and refund currencies
|
object |
Subscriptions are repeat billing agreements with specific buyers. BitPay sends bill emails to buyers identified in active subscriptions according to the specified schedule.
| Name | Type | Read-Only |
|---|---|---|
id
Resource id
|
string |
✓ |
token
API token for subscription resource
|
string |
✓ |
billData
See `bills` resource
|
object |
|
schedule
Schedule of repeat bill due dates. Can be `weekly`, `monthly`, `quarterly`, `yearly`, or a simple cron expression specifying seconds, minutes, hours, day of month, month, and day of week. BitPay maintains the difference between the due date and the delivery date in all subsequent, automatically-generated bills.
|
string |
|
status
Can be `draft` or `active` or `cancelled`. Subscriptions in active state will create new Bills on the nextDelivery date.
|
string |
|
nextDelivery
UTC date, ISO-8601 format yyyy-mm-dd or yyyy-mm-ddThh:mm:ssZ. Default is current time. Current or past date indicates that the bill can be delivered immediately. BitPay may modify the hh:mm:ss values in order to distribute deliveries evenly throughout the day.
|
date |
Creates a repeat billing subscription.
| Required Parameters | billData schedule |
| Facades | merchant |
Retrieves all of the caller's subscriptions.
| Parameters | status |
| Facades | merchant |
Retrieves the specified subscription.
| Parameters | none |
| Facades | merchant |
Updates the specified subscription.
| Required Parameters | none |
| Facades | merchant |
Tokens are API access identifiers which are associated with a set of capabilities. A capability may be very broad, for example, retrieve the list of all exchange rates. Or a capability may be very specific, for example, update bill #12345.
| Name | Type | Read-Only |
|---|---|---|
id
Client identity based on bitcoin identity protocol
|
string |
|
pairingCode
Access approval code
|
string |
|
facade
Can be `merchant`, or `pos`
|
string |
|
label
Token label, may include spaces, underscores, and dashes
|
string |
Creates or claims an access token.
| Required Parameters | id |
| Facades | public merchant onboarding |
| Name | Type |
|---|---|
policies
undefined
|
array |
policy
Can be `sin`, `access`, `events`, `id`, or `session`
|
string |
method
Can be `requireSin`, `requireFacadeAccess`, `allowEventStream`, `invalidated`, `inactive`, `unclaimed`, `requireSession`
|
string |
params
Can be `support`, SIN value, or null
|
array |
resource
Token identifier
|
string |
token
API token for token resource
|
string |
facade
Can be `merchant`, or `pos`
|
string |
dateCreated
UNIX time of creation, in milliseconds
|
number |
pairingExpiration
UNIX time of expiration, in milliseconds
|
number |
pairingCode
Access approval code
|
string |
Get access to the most powerful bitcoin infrastructure on the planet.
Accept Bitcoin ›