Introduction
We provide a REST API to help you create postage labels with your application. To get started, you will need to register and create 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
- 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
- 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.
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.
- 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
Retrieve Purchase
Retrieves a previously created shipping label.
Required fields
- key: API key
- secret: API secret
- 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
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