Skip to content

Instantly share code, notes, and snippets.

@alies-dev
Created April 7, 2023 11:29
Show Gist options
  • Save alies-dev/7ea46fc93467212f9a2abbe2f7cbb2c1 to your computer and use it in GitHub Desktop.
Save alies-dev/7ea46fc93467212f9a2abbe2f7cbb2c1 to your computer and use it in GitHub Desktop.
Lob example
<?php
/** @var \OpenAPI\Client\Configuration $config */
/** @var string $from_lob_address_id */
/** @var string $front */
/** @var string $back */
$editableAddress = new AddressEditable([
'address_line1' => 'al. Jana Pawła II 21/37',
'address_city' => 'Warszawa',
'address_zip' => '00-854', // valid zip
'address_state' => 'Mazowieckie', // state is optional in PL
'address_country' => 'PL',
]);
$postcardsApi = new PostcardsApi($this->config);
$postcardEditable = new PostcardEditable([
'from' => $from_lob_address_id, // required
'to' => $addressEditable, // required
'front' => $front, // required
'back' => $back, // required
'use_type' => \OpenAPI\Client\Model\CmpUseType::MARKETING->value, // required
]);
$postcard = $postcardsApi->create($postcardEditable);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment