Lob Cards API
The cards endpoint allows you to easily create cards that can later be affixed to Letters. The API provides endpoints for creating cards, retrieving individual cards, creating card orders, and retrieving a list of cards. back to top
The cards endpoint allows you to easily create cards that can later be affixed to Letters. The API provides endpoints for creating cards, retrieving individual cards, creating card orders, and retrieving a list of cards. back to top
openapi: 3.0.3
info:
title: Lob Cards API
version: 1.20.2
description: "Experience direct mail like never before, with unmatched personalization and scalability \x14 all in one intuitive platform."
license:
name: MIT
url: https://mit-license.org/
contact:
name: Lob Developer Experience
url: https://support.lob.com/
email: lob-openapi@lob.com
termsOfService: https://www.lob.com/legal
servers:
- url: https://api.lob.com/v1
description: production
security:
- basicAuth: []
tags:
- name: Cards
description: 'The cards endpoint allows you to easily create cards that can later be affixed to Letters.
The API provides endpoints for creating cards, retrieving individual cards, creating card orders, and retrieving a list of cards.
<div class="back-to-top" ><a href="#" onclick="toTopLink()">back to top</a></div>
'
paths:
/cards:
get:
operationId: cards_list
summary: List
description: Returns a list of your cards. The cards are returned sorted by creation date, with the most recently created addresses appearing first.
tags:
- Cards
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/before_after'
- $ref: '#/components/parameters/include'
responses:
'200':
description: Returns a list of card objects
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/list'
- type: object
properties:
data:
type: array
description: list of cards
items:
$ref: '#/components/schemas/card'
example:
data:
- id: card_7a6d73c5c8457fc
account_id: fa9ea650fc7b31a89f92
description: null
url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA
size: 2.125x3.375
auto_reorder: false
reorder_quantity: null
raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
thumbnails:
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw
available_quantity: 10000
pending_quantity: 0
countries: null
status: rendered
mode: test
orientation: horizontal
threshold_amount: 0
date_created: '2021-03-24T22:51:42.838Z'
date_modified: '2021-03-24T22:51:42.838Z'
send_date: '2021-03-24T22:51:42.838Z'
object: card
object: list
previous_url: null
next_url: null
count: 1
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X GET \"https://api.lob.com/v1/cards?limit=2\" \\\n -u <YOUR API KEY>:\n"
label: CURL
- lang: Typescript
source: "try {\n const cards = await new CardsApi(config).list(2);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cards.list({limit: 2}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = CardsApi(api_client)\n\ntry:\n cards = api.list(limit=2)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$lob->cards()->all(array(\n 'limit' => 2\n));\n"
- lang: CSharp
source: "CardsApi api = new CardsApi(config);\nList<string> includeList = new List<string>();\nincludeList.Add(\"total_count\");\n\ntry {\n CardList response = api.list(\n 2, // limit\n null, // before\n null, // after\n includeList // include\n );\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Ruby
source: "cardsApi = CardsApi.new(config)\n\nbegin\n cards = cardsApi.list({ limit: 2 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\nCardList = apiClient.CardsApi.List(context).Execute()\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: card_create
summary: Create
description: Creates a new card given information
tags:
- Cards
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/card_editable'
example:
description: Test card
front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
size: 2.125x3.375
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/card_editable'
example:
description: Test card
front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
size: 2.125x3.375
multipart/form-data:
schema:
$ref: '#/components/schemas/card_editable'
example:
description: Test card
front: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
back: https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf
size: 2.125x3.375
responses:
'200':
description: Card created successfully
content:
application/json:
schema:
$ref: '#/components/schemas/card'
examples:
basic:
value:
id: card_7a6d73c5c8457fc
account_id: fa9ea650fc7b31a89f92
description: Test card
url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA
size: 2.125x3.375
auto_reorder: false
reorder_quantity: null
raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
thumbnails:
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw
available_quantity: 10000
pending_quantity: 0
countries: null
status: rendered
mode: test
orientation: horizontal
threshold_amount: 0
date_created: '2021-03-24T22:51:42.838Z'
date_modified: '2021-03-24T22:51:42.838Z'
send_date: '2021-03-24T22:51:42.838Z'
object: card
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/cards \\\n -u <YOUR API KEY>: \\\n -d \"description=Test card\" \\\n -d \"front=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\" \\\n -d \"back=https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\" \\\n -d \"size=2.125x3.375\"\n"
label: CURL
- lang: Typescript
source: "const cardsCreate = new CardEditable({\n front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n size: CardEditableSizeEnum._2125x3375,\n description: 'Test card'\n});\n\ntry {\n const myCard = await new CardsApi(config).create(cardsCreate);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cards.create({\n description: 'Test card',\n front: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n back: 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n size: '2.125x3.375'\n}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Python
source: "card_editable = CardEditable(\n front = \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\",\n back = \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\",\n size = \"2.125x3.375\",\n description = \"Test Card\",\n)\n\nwith ApiClient(configuration) as api_client:\n api = CardsApi(api_client)\n\ntry:\n created_card = api.create(card_editable)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: "$lob->cards()->create(array(\n 'description' => 'Test card',\n 'front' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n 'back' => 'https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf',\n 'size' => => '2.125x3.375'\n));\n"
label: PHP
- lang: CSharp
source: "CardsApi api = new CardsApi(config);\n\nCardEditable cardEditable = new CardEditable(\n \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\", // front\n \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\", // back\n CardEditable.SizeEnum._2125x3375, // size\n \"Test Card\" // description\n);\n\ntry {\n Card result = api.create(cardEditable);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Ruby
source: "cardCreate = CardEditable.new({\n front: \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\",\n back: \"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\",\n size: \"2.125x3.375\",\n description: \"Test Card\",\n});\n\ncardApi = CardsApi.new(config)\n\nbegin\n createdCard = cardApi.create(cardCreate)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\n\nvar cardCreate = *lob.NewCardEditable()\ncardCreate.SetFront(\"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\")\ncardCreate.SetBack(\"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf\")\ncardCreate.SetSize(\"2.125x3.375\")\ncardCreate.SetDescription(\"Test Card\")\n\n\n\ncreatedcard, _, err := apiClient.CardsApi.Create(context).CardEditable(cardCreate).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/cards/{card_id}:
parameters:
- in: path
name: card_id
description: id of the card
required: true
schema:
$ref: '#/components/schemas/card_id'
get:
operationId: card_retrieve
summary: Retrieve
description: Retrieves the details of an existing card. You need only supply the unique customer identifier that was returned upon card creation.
tags:
- Cards
responses:
'200':
description: Returns a card object
content:
application/json:
schema:
$ref: '#/components/schemas/card'
examples:
basic:
value:
id: card_7a6d73c5c8457fc
account_id: fa9ea650fc7b31a89f92
description: Test card
url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA
size: 2.125x3.375
auto_reorder: false
reorder_quantity: null
raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
thumbnails:
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw
available_quantity: 10000
pending_quantity: 0
countries: null
status: rendered
mode: test
orientation: horizontal
threshold_amount: 0
date_created: '2021-03-24T22:51:42.838Z'
date_modified: '2021-03-24T22:51:42.838Z'
send_date: '2021-03-24T22:51:42.838Z'
object: card
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \\\n -u <YOUR API KEY>:\n"
label: CURL
- lang: Typescript
source: "try {\n const card = await new CardsApi(config).get('card_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cards.retrieve('card_7a6d73c5c8457fc', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = CardsApi(api_client)\n\ntry:\n card = api.get(\"card_7a6d73c5c8457fc\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: '$lob->cards()->get(''card_7a6d73c5c8457fc'');
'
label: PHP
- lang: CSharp
source: "CardsApi api = new CardsApi(config);\n\ntry {\n Card response = api.get(\"card_7a6d73c5c8457fc\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Ruby
source: "cardApi = CardsApi.new(config)\n\nbegin\n retrievedCard = cardApi.get(\"card_7a6d73c5c8457fc\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nfetchedCard, _, err := apiClient.CardsApi.Get(context,\"card_7a6d73c5c8457fc\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: card_update
summary: Update
description: Update the details of an existing card. You need only supply the unique identifier that was returned upon card creation.
tags:
- Cards
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/card_updatable'
example:
description: Test card
auto_reorder: true
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/card_updatable'
example:
description: Test card
auto_reorder: true
multipart/form-data:
schema:
$ref: '#/components/schemas/card_updatable'
example:
description: Test card
auto_reorder: true
responses:
'200':
description: Returns a card object
content:
application/json:
schema:
$ref: '#/components/schemas/card'
examples:
basic:
value:
id: card_7a6d73c5c8457fc
account_id: fa9ea650fc7b31a89f92
description: Test card
url: https://lob-assets.com/cards/card_c51ae96f5cebf3e.pdf?version=v1&expires=1636910992&signature=mnsDH2DAxdkN9VibdlLMxJC86sME5WYDqkNtmvGwdNsAaUWfbnv0rJhJ1mR8Ol4uxQq61j5wYZ0r3s-lBkQfDA
size: 2.125x3.375
auto_reorder: false
reorder_quantity: null
raw_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
front_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
back_original_url: https://lob-assets.com/cards/card_c51ae96f5cebf3e_raw.pdf?version=v1&expires=1636910992&signature=-bZo31FMAp2vmNaZKyXn_Qa4APqwtNinw76FrQ7uyQejFZw6VBQQYfoiQ642iXh0H2K5i2aOo8_BAkt3UJdVDw
thumbnails:
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_1.png?version=v1&expires=1636910992&signature=mrv8JDvpZK4I8WUGH0tPdtK-My5oes0Ltj_gL7BDw96SpCTTeZFHkz81SzclyFP9dQRtlsvAsjcuGcTBvCvOCg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_1.png?version=v1&expires=1636910992&signature=VgL_2Ckm_kxKiWGgWtdNoy9HHOn8dGYSVOn7UqyCbwdbVlUtx28TRN4Bo8Iru3n0keKp9He0YhKT1ILotznMDA
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_1.png?version=v1&expires=1636910992&signature=FKSzymA13j-CQ0uk20cGHZTzT3vimzNBYrgp-xifLFg4mMdo1BZALR5O0aF_jVhsX614hKP35ONdYl47TQxXAw
- small: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_small_2.png?version=v1&expires=1636910992&signature=IWsmPa_ULlv2yyqjX564d_YfHHY_M7i9YxDnw-WXDr2jtOFcArmRZQbnHeE9g_rYxnddJbgosuv8-c2utiu7Cg
medium: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_medium_2.png?version=v1&expires=1636910992&signature=zxK7VKGiTvz5Ywrkaydd0v3GcYf58R7A08J4tNfI7-aiNODDcTF3l0MqY13n9Pyc8RXSdD0XVBY-OpbA1VM-Ag
large: https://lob-assets.com/cards/card_c51ae96f5cebf3e_thumb_large_2.png?version=v1&expires=1636910992&signature=r0OFUhh315ZwN0raMZdIwJd2oCIEYsz0BABaMxIuO1PKTD0ckGWrhcGdzk2dlWQ6vSvp0CUQ5k1RXGqkIIqkDw
available_quantity: 10000
pending_quantity: 0
countries: null
status: rendered
mode: test
orientation: horizontal
threshold_amount: 0
date_created: '2021-03-24T22:51:42.838Z'
date_modified: '2021-03-24T22:51:42.838Z'
send_date: '2021-03-24T22:51:42.838Z'
object: card
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X POST https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \\\n -u <YOUR API KEY>: \\\n -d \"description=Awesome card\" \\\n -d \"auto_reorder=true\"\n"
label: CURL
- lang: Typescript
source: "const cardUpdatable = new CardEditable ({\n description: 'Awesome card',\n auto_reorder: true\n});\n\ntry {\n await new CardsApi(config).update(cardUpdatable);\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cards.update('card_7a6d73c5c8457fc', {\n description: 'Awesome card',\n auto_reorder: true\n}, function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: CSharp
source: "CardsApi api = new CardsApi(config);\nCardUpdatable update = new CardUpdatable(\"Awesome card\", true, 15000);\n\ntry {\n api.update(\"card_6afffd19045076c\", update);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Python
source: "card_updatable = CardUpdatable(\n description = \"Awesome card\",\n auto_reorder = True,\n reorder_quantity = 10000,\n)\n\nwith ApiClient(configuration) as api_client:\n api = CardsApi(api_client)\n\ntry:\n updated_card = api.update(\"card_6afffd19045076c\", card_updatable)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: Ruby
source: "cardUpdatable = CardUpdatable.new({\n description: \"Awesome card\",\n auto_reorder: \"true\",\n reorder_quantity: 10000,\n})\n\ncardApi = CardsApi.new(config)\n\nbegin\n updatedCard = cardApi.update(\"card_6afffd19045076c\", cardUpdatable)\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\ncardEditable = *lob.NewCardEditable(\"https://s3-us-west-2.amazonaws.com/public.lob.com/assets/card_horizontal.pdf()\")\ncreatedCard, _, _ := apiClient.CardsApi.Create(context).CardEditable(suite.cardEditable).Execute()\nvar updatedCard = *lob.NewCardUpdatable()\nupdatedCard.SetDescription(\"Card was updated\")\n\nresp, _, err := suite.apiClient.CardsApi.Update(context, createdCard.Id).CardUpdatable(updatedCard).Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
delete:
operationId: card_delete
summary: Delete
description: Delete an existing card. You need only supply the unique identifier that was returned upon card creation.
tags:
- Cards
responses:
'200':
$ref: '#/components/responses/card_deleted'
default:
$ref: '#/components/responses/mailpiece_error'
x-codeSamples:
- lang: Shell
source: "curl -X DELETE https://api.lob.com/v1/cards/card_7a6d73c5c8457fc \\\n -u <YOUR API KEY>:\n"
label: CURL
- lang: Typescript
source: "try {\n const deleteCard = await new CardsApi(config).delete('card_xxxx');\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cards.delete('card_7a6d73c5c8457fc', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = CardsApi(api_client)\n\ntry:\n deleted_resource = api.delete(\"card_6afffd19045076c\")\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: '$lob->cards()->delete(''card_7a6d73c5c8457fc'');
'
label: PHP
- lang: CSharp
source: "CardsApi api = new CardsApi(config);\n\ntry {\n CardDeletion response = api.delete(\"card_6afffd19045076c\");\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Ruby
source: "cardApi = CardsApi.new(config)\n\nbegin\n deletedCard = cardApi.delete(\"card_6afffd19045076c\")\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\ndeletedCard, _, err := apiClient.CardsApi.Delete(context, \"card_6afffd19045076c\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
/cards/{card_id}/orders:
parameters:
- in: path
name: card_id
description: The ID of the card to which the card orders belong.
required: true
schema:
$ref: '#/components/schemas/card_id'
get:
operationId: card_orders_retrieve
summary: Retrieve
description: Retrieves the card orders associated with the given card id.
tags:
- Cards
parameters:
- $ref: '#/components/parameters/limit'
- $ref: '#/components/parameters/offset'
responses:
'200':
description: Returns the card orders associated with the given card id
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/list'
- type: object
properties:
data:
type: array
description: List of card orders
items:
$ref: '#/components/schemas/card_order'
example:
data:
- id: co_e0f8a0562a06bea7f
card_id: card_6afffd19045076c
status: available
inventory: 9500
quantity_ordered: 10000
unit_price: 0.75
cancelled_reason: No longer needed
availability_date: '2021-10-12T21:41:48.326Z'
expected_availability_date: '2021-11-04T21:03:18.871Z'
date_created: '2021-10-07T21:03:18.871Z'
date_modified: '2021-10-16T01:00:30.144Z'
object: card_order
object: list
next_url: null
previous_url: null
count: 1
default:
$ref: '#/components/responses/card_order_error'
x-codeSamples:
- lang: Shell
source: "curl https://api.lob.com/v1/cards/card_6afffd19045076c/orders/ \\\n -u <YOUR API KEY>:\n"
label: CURL
- lang: Typescript
source: "try {\n const cardOrders = await new CardOrdersApi(cofig).get( 'co_xxxx' );\n} catch (err: any) {\n console.error(err);\n}\n"
label: TYPESCRIPT
- lang: Javascript
source: "Lob.cardOrders.list('card_6afffd19045076c', function (err, res) {\n console.log(err, res);\n});\n"
label: NODE
- lang: Python
source: "with ApiClient(configuration) as api_client:\n api = CardOrdersApi(api_client)\n\ntry:\n card_order = api.get(\"card_6afffd19045076c\", limit = 2, offset = 1)\nexcept ApiException as e:\n print(e)\n"
label: PYTHON
- lang: PHP
source: '$lob->cardOrders(''card_6afffd19045076c'')->all();
'
- lang: CSharp
source: "CardOrdersApi api = new CardOrdersApi(config);\n\ntry {\n CardOrderList response = api.get(\"card_6afffd19045076c\", 2, 1);\n} catch (ApiException e) {\n Console.WriteLine(e.ToString());\n}\n"
label: CSHARP
- lang: Ruby
source: "cardOrderApi = CardOrdersApi.new(config)\n\nbegin\n retrievedCardOrderList = cardOrderApi.get(\"card_6afffd19045076c\", { limit: 2, offset: 1 })\nrescue => err\n p err.message\nend\n"
label: RUBY
- lang: Go
source: "var context = context.Background()\ncontext = context.WithValue(suite.ctx, lob.ContextBasicAuth, lob.BasicAuth{UserName: os.Getenv(\"<YOUR_API_KEY>\")})\n\nvar apiClient = *lob.NewAPIClient(configuration)\n\nfetchedCardOrderList, _, err := apiClient.CardOrdersApi.Get(context, \"card_6afffd19045076c\").Execute()\n\nif err != nil {\n return err\n}\n"
label: GO
post:
operationId: card_order_create
summary: Create
description: Creates a new card order given information
tags:
- Cards
requestBody:
required: true
content:
application/jso
# --- truncated at 32 KB (57 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lob/refs/heads/main/openapi/lob-cards-api-openapi.yml