Download the PHP package postbode/postbode-api without Composer

On this page you can find all versions of the php package postbode/postbode-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package postbode-api

Postbode API client for PHP

Official PHP client for version 2 of the Postbode.nu API: send letters, postcards and fulfillment orders, and follow them until they land on the doormat.

Full API reference: https://postbode.app/docs/api

Requirements

Installation

If your project does not have an HTTP client yet, add one — Guzzle is the usual choice and needs no further configuration:

Already using Symfony's HttpClient, or a client of your own? Pass it in and skip the extra dependency.

Getting started

  1. Set up an account at https://postbode.nu
  2. Create an API token at https://postbode.app/gebruiker/api-tokens

To use a specific HTTP client rather than whichever one is discovered:

Sending a letter

Build the request, hand it to the API, and you get a fully typed item back.

The client base64-encodes your PDFs, so never do that yourself. addDocumentFromFile() reads them off disk, addDocumentFromContents() takes bytes you already have in memory.

Every builder method returns a new instance, so a partly configured request is safe to keep as a template:

Creating a concept first

Leave out ->send(), or pass ->send(false), to create the item without shipping it. Check it, then release it:

Checking the price up front

Nothing is created and nothing is charged by asking.

Following an item

Your recipients can look an item up themselves with just its reference and their own postal code:

Endpoints

Every endpoint hangs off the client as a property.

Property Methods
$postbode->mailboxes list(), get(), create()
$postbode->postals list(), get(), create(), delete(), calculate(), send(), cancel(), performAction(), proof(), document(), logs(), findByV1Id()
$postbode->envelopes listForMailbox(), get(), create(), delete(), pdf(), windowPreview()
$postbode->products listForMailbox(), get()
$postbode->tags listForMailbox(), get(), create()
$postbode->paperTypes list()
$postbode->address validate()
$postbode->fulfillment create()
$postbode->tracking track()

Every endpoint that takes a request builder also accepts a plain array, if you would rather build the payload yourself:

Enums

Statuses, shipping methods and printing options are backed enums, each with a label() describing it in the same words the API documentation uses.

Available: PostalStatus, PostalType, PostalAction, ShippingType, PostalPrinting, PostalPlex, EnvelopeStatus, FulfillmentOrderStatus, TransactionType, TagColor.

Statuses on a resource keep both the typed enum and the raw value, so a status code introduced after this release still decodes:

Error handling

Failed calls throw; they never return a status code. Everything derives from PostbodeException, so one catch covers the lot.

Upgrading from 1.x and 2.x

Version 3 is a rewrite against the v2 API and shares no method names with earlier releases. See UPGRADING.md for the full mapping, including how to translate the letter IDs you already stored into v2 UUIDs.

Examples

Runnable scripts live in examples/. Set POSTBODE_API_KEY and run one:

Contributing

License

MIT


All versions of postbode-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
php-http/discovery Version ^1.19
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1|^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package postbode/postbode-api contains the following files

Loading the files please wait ...