Bitcoin Postage API Documentation
Prerequisites for using our API
We provide a REST API to help you create postage labels with your application.
Before you can start using the API, you need to do the following:
- Create an account
- Create an API access
Authentication
Once you've registered and created your API access, you will have access to your API key and secret. These are required when making calls to the API. You can have multiple API access codes, which will allow you to manage multiple applications under the same account.
Making Requests
All requests to our API are made with POST verbs. When making requests, arguments are passed via params. If you're using one of our plugins, the requests are handled for you automatically when you call the appropriate function.
Endpoints
Get Rates
Displays the available postage services and rates for a given package
Required fields
- key : API key
- secret : API secret
- to_name : Name of recipient
- to_street : Street address of recipient
- to_street2 : Address Line 2 of recipient
- to_city : City of recipient
- to_state : State of recipient
- to_zip : ZIP code of recipient
- to_country : Country of recipient
- to_phone : Phone number of recipient
- from_name : Name of sender
- from_street : Street address of sender
- from_street2 : Address Line 2 of sender
- from_city : City of sender
- from_state : State of sender
- from_zip : ZIP code of sender
- from_country : Country of sender
- from_phone : Phone number of sender
- package_type : List of available package types can be found here
- carrier : List of available carriers can be found here. If you want to get rates for all carriers, use the value - all.
- serviceoption : Only if using FedEx or UPS - List of available service options can be found here
- weight_oz : Ounces remainder of package weight (not full weight in ounces)
- weight_lbs : Pounds of package weight (integer - submit remainder as ounces in above parameter)
- height : Inches of package height
- width : Inches of package width
- depth : Inches of package depth/length
HTTP request
POST https://bitcoinpostage.info/api/get-rates
Create Purchase
Purchases a shipping label. Please note that this function uses your account's credit balance.
Required fields
- key : API key
- secret : API secret
- to_name : Name of recipient
- to_street : Street address of recipient
- to_street2 : Address Line 2 of recipient
- to_city : City of recipient
- to_state : State of recipient
- to_zip : ZIP code of recipient
- to_country : Country of recipient
- to_phone : Phone number of recipient
- from_name : Name of sender
- from_street : Street address of sender
- from_street2 : Address Line 2 of sender
- from_city : City of sender
- from_state : State of sender
- from_zip : ZIP code of sender
- from_country : Country of sender
- from_phone : Phone number of sender
- package_type : List of available package types can be found here
- carrier : List of available carriers can be found here
- service : Service chosen from the Get Rates endpoint output
- serviceoption : Only if using FedEx or UPS - List of available service options can be found here
- weight_oz : Ounces remainder of package weight (not full weight in ounces)
- weight_lbs : Pounds of package weight (integer - submit remainder as ounces in above parameter)
- height : Inches of package height
- width : Inches of package width
- depth : Inches of package depth/length
- label_format : Label format PNG or PDF
- test_mode : The value true enables the test mode. Allows you to test the work of the api, without withdrawing credits. Works only for USPS.
- delivery_confirmation : If you want to request a signature, you can pass ADULT_SIGNATURE or SIGNATURE. You may also request NO_SIGNATURE to leave the package at the door.
HTTP request
POST https://bitcoinpostage.info/api/create-purchase
Create International Purchase
Purchases a shipping label. Please note that this function uses your account's credit balance.
Required fields
- key : API key
- secret : API secret
- to_name : Name of recipient
- to_street : Street address of recipient
- to_street2 : Address Line 2 of recipient
- to_city : City of recipient
- to_state : State of recipient
- to_zip : ZIP code of recipient
- to_country : Country of recipient
- to_phone : Phone number of recipient
- from_name : Name of sender
- from_street : Street address of sender
- from_street2 : Address Line 2 of sender
- from_city : City of sender
- from_state : State of sender
- from_zip : ZIP code of sender
- from_country : Country of sender
- from_phone : Phone number of sender
- package_type : List of available package types can be found here
- carrier : List of available carriers can be found here
- service : Service chosen from the Get Rates endpoint output
- serviceoption : Only if using FedEx or UPS - List of available service options can be found here
- weight_oz : Ounces remainder of package weight (not full weight in ounces)
- weight_lbs : Pounds of package weight (integer - submit remainder as ounces in above parameter)
- height : Inches of package height
- width : Inches of package width
- depth : Inches of package depth/length
- test_mode : The value true enables the test mode. Allows you to test the work of the api, without withdrawing credits. Works only for USPS.
- delivery_confirmation : If you want to request a signature, you can pass ADULT_SIGNATURE or SIGNATURE. You may also request NO_SIGNATURE to leave the package at the door.
- type_contents : Type of Contents: Documents, Gift, Merchandise, Returned Goods, Sample
- signer : Signer / Name
- customs : Contains information relating to each product within
the
package.
There can be several in one request.
Fields separated by :: Quantity, Description, Total Value($), Total Weight(oz), Country code of origin, Tariff Number
Example - 2::Books::100::20::US::49019900
HTTP request
POST https://bitcoinpostage.info/api/create-purchase
Create Batch Purchase
Purchases up to 5 shipping labels at once. Please note that this function uses your account's credit balance.
Required fields
- key : API key
- secret : API secret
- shipments : An array of shipment objects
Shipment object fields
- to_name : Name of recipient
- to_street : Street address of recipient
- to_street2 : Address Line 2 of recipient
- to_city : City of recipient
- to_state : State of recipient
- to_zip : ZIP code of recipient
- to_country : Country of recipient
- to_phone : Phone number of recipient
- from_name : Name of sender
- from_street : Street address of sender
- from_street2 : Address Line 2 of sender
- from_city : City of sender
- from_state : State of sender
- from_zip : ZIP code of sender
- from_country : Country of sender
- from_phone : Phone number of sender
- package_type : List of available package types can be found here
- carrier : List of available carriers can be found here
- service : Service chosen from the Get Rates endpoint output
- serviceoption : Only if using FedEx or UPS - List of available service options can be found here
- weight_oz : Ounces remainder of package weight (not full weight in ounces)
- weight_lbs : Pounds of package weight (integer - submit remainder as ounces in above parameter)
- height : Inches of package height
- width : Inches of package width
- depth : Inches of package depth/length
- label_format : Label format PNG or PDF
- delivery_confirmation : If you want to request a signature, you can pass ADULT_SIGNATURE or SIGNATURE. You may also request NO_SIGNATURE to leave the package at the door.
- test_mode : The value true enables the test mode. Allows you to test the work of the api, without withdrawing credits. Works only for USPS.
Attention
This request needs to be sent in JSON format, unlike other API requests.
HTTP request
POST https://bitcoinpostage.info/api/create-batch-purchase
Retrieve Purchase
Retrieves a previously created shipping label.
Required fields
- key : API key
- secret : API secret
- order_id : Order ID returned by the Create Purchase endpoint
HTTP request
POST https://bitcoinpostage.info/api/retrieve-purchase
Charge Credits
Creates a pending transaction to charge your account. Once you complete the bitcoin transaction to the address specified, your account will automatically be charged. Please note that sending the wrong amount will result in failing to charge your account, and any given address is only usable for a single transaction.
Required fields
- key : API key
- secret : API secret
- amount : Amount in USD you wish to charge
- currency : BTC, XMR or LTC
HTTP request
POST https://bitcoinpostage.info/api/charge-credits
Get Credits
Retrieves your current credit balance.
Required fields
- key : API key
- secret : API secret
HTTP request
POST https://bitcoinpostage.info/api/get-credits
Orders List
Retrieves your orders list.
Required fields
- key : API key
- secret : API secret
HTTP request
POST https://bitcoinpostage.info/api/orders
Retrieve Purchase
Retrieves all shipments from your order.
Required fields
- key : API key
- secret : API secret
- order_id : Order ID
HTTP request
POST https://bitcoinpostage.info/api/retrieve-order