-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMAPI-1829: add buckslips docs #400
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b392707
Add buckslips resources, shared attrs, & error types
07d6809
Add Buckslips & Buckslip Orders sections to Special Features section
23187d0
Ran redoc
59f60fb
Ran bunlde & postman scripts
a5d7e3e
Update buckslip model with buckslip_orders; clean up comments
f16e1fe
Sort order
31ba023
Re-run redoc
9035b73
Re-run bundle & postman scripts
fedafd6
Add buckslips to Letters response
212bbe0
Add buckslips to campaigns
20ce119
Run bundle and postman scripts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type: string | ||
description: Description of the buckslip. | ||
maxLength: 255 | ||
nullable: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
parameters: | ||
- in: path | ||
name: buckslip_id | ||
description: id of the buckslip | ||
required: true | ||
schema: | ||
$ref: "../../shared/attributes/model_ids/buckslip_id.yml" | ||
|
||
get: | ||
operationId: buckslip_retrieve | ||
|
||
summary: Retrieve | ||
|
||
description: >- | ||
Retrieves the details of an existing buckslip. You need only supply | ||
the unique customer identifier that was returned upon buckslip creation. | ||
|
||
tags: | ||
- Buckslips | ||
|
||
responses: | ||
"200": | ||
description: Returns a buckslip object | ||
content: | ||
$ref: "responses/buckslip.yml" | ||
|
||
default: | ||
$ref: "../../shared/responses/buckslip_error.yml" | ||
|
||
x-codeSamples: | ||
- lang: Shell | ||
source: | | ||
curl https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ | ||
-u <YOUR API KEY>: | ||
label: CURL | ||
|
||
patch: | ||
operationId: buckslip_update | ||
|
||
summary: Update | ||
|
||
description: >- | ||
Update the details of an existing buckslip. You need only supply | ||
the unique identifier that was returned upon buckslip creation. | ||
|
||
tags: | ||
- Buckslips | ||
|
||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "models/buckslip_updatable.yml" | ||
example: | ||
description: Test buckslip | ||
auto_reorder: true | ||
|
||
application/x-www-form-urlencoded: | ||
schema: | ||
$ref: "models/buckslip_updatable.yml" | ||
example: | ||
description: Test buckslip | ||
auto_reorder: true | ||
|
||
multipart/form-data: | ||
schema: | ||
$ref: "models/buckslip_updatable.yml" | ||
example: | ||
description: Test buckslip | ||
auto_reorder: true | ||
|
||
responses: | ||
"200": | ||
description: Returns a buckslip object | ||
content: | ||
$ref: "responses/buckslip.yml" | ||
|
||
default: | ||
$ref: "../../shared/responses/buckslip_error.yml" | ||
|
||
x-codeSamples: | ||
- lang: Shell | ||
source: | | ||
curl -X PATCH https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ | ||
-u <YOUR API KEY>: \ | ||
-d "description=Awesome buckslip" \ | ||
-d "auto_reorder=true" | ||
label: CURL | ||
|
||
delete: | ||
operationId: buckslip_delete | ||
|
||
summary: Delete | ||
|
||
description: >- | ||
Delete an existing buckslip. You need only supply | ||
the unique identifier that was returned upon buckslip creation. | ||
|
||
tags: | ||
- Buckslips | ||
|
||
responses: | ||
"200": | ||
$ref: "../../shared/responses/buckslip_deleted.yml" | ||
|
||
default: | ||
$ref: "../../shared/responses/buckslip_error.yml" | ||
|
||
x-codeSamples: | ||
- lang: Shell | ||
source: | | ||
curl -X DELETE https://api.lob.com/v1/buckslips/bck_7a6d73c5c8457fc \ | ||
-u <YOUR API KEY>: | ||
label: CURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
parameters: | ||
- in: path | ||
name: buckslip_id | ||
description: The ID of the buckslip to which the buckslip orders belong. | ||
required: true | ||
schema: | ||
$ref: "../../../shared/attributes/model_ids/buckslip_id.yml" | ||
|
||
get: | ||
operationId: buckslip_orders_retrieve | ||
|
||
summary: Retrieve | ||
|
||
description: >- | ||
Retrieves the buckslip orders associated with the given buckslip id. | ||
|
||
tags: | ||
- Buckslip Orders | ||
|
||
parameters: | ||
- $ref: "../../../shared/parameters/limit.yml" | ||
- $ref: "../../../shared/parameters/offset.yml" | ||
|
||
responses: | ||
"200": | ||
description: Returns the buckslip orders associated with the given buckslip id | ||
content: | ||
$ref: "responses/all_buckslip_orders.yml" | ||
|
||
default: | ||
$ref: "../../../shared/responses/buckslip_order_error.yml" | ||
|
||
x-codeSamples: | ||
- lang: Shell | ||
source: | | ||
curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders/ \ | ||
-u <YOUR API KEY>: | ||
label: CURL | ||
|
||
post: | ||
operationId: buckslip_order_create | ||
|
||
summary: Create | ||
|
||
description: >- | ||
Creates a new buckslip order given information | ||
|
||
tags: | ||
- Buckslip Orders | ||
|
||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "models/buckslip_order_editable.yml" | ||
example: | ||
quantity: 10000 | ||
|
||
application/x-www-form-urlencoded: | ||
schema: | ||
$ref: "models/buckslip_order_editable.yml" | ||
example: | ||
quantity: 10000 | ||
|
||
multipart/form-data: | ||
schema: | ||
$ref: "models/buckslip_order_editable.yml" | ||
example: | ||
quantity: 10000 | ||
|
||
responses: | ||
"200": | ||
description: Buckslip order created successfully | ||
content: | ||
$ref: "responses/buckslip_order.yml" | ||
|
||
default: | ||
$ref: "../../../shared/responses/buckslip_error.yml" | ||
|
||
x-codeSamples: | ||
- lang: Shell | ||
source: | | ||
curl https://api.lob.com/v1/buckslips/bck_6afffd19045076c/orders \ | ||
-u <YOUR API KEY>: \ | ||
-d "quantity=10000" | ||
label: CURL |
36 changes: 36 additions & 0 deletions
36
resources/buckslips/buckslip_orders/models/buckslip_order.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
allOf: | ||
- $ref: "../../../../shared/models/lob_base.yml" | ||
- type: object | ||
properties: | ||
id: | ||
$ref: "../../../../shared/attributes/model_ids/bo_id.yml" | ||
buckslip_id: | ||
$ref: "../../../../shared/attributes/model_ids/buckslip_id.yml" | ||
status: | ||
description: The status of the buckslip order. | ||
enum: | ||
- pending | ||
- printing | ||
- available | ||
- cancelled | ||
- depleted | ||
type: string | ||
quantity_ordered: | ||
description: The quantity of buckslips ordered | ||
type: number | ||
default: 0 | ||
unit_price: | ||
description: The unit price for the buckslip order. | ||
type: number | ||
default: 0 | ||
cancelled_reason: | ||
description: The reason for cancellation. | ||
type: string | ||
availability_date: | ||
type: string | ||
format: date-time | ||
description: A timestamp in ISO 8601 format of the date the resource was created. | ||
expected_availability_date: | ||
type: string | ||
format: date-time | ||
description: The fixed deadline for the buckslips to be printed. |
11 changes: 11 additions & 0 deletions
11
resources/buckslips/buckslip_orders/models/buckslip_order_editable.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
type: object | ||
|
||
required: | ||
- quantity | ||
|
||
properties: | ||
quantity: | ||
type: integer | ||
description: The quantity of buckslips in the order (minimum 5,000). | ||
minimum: 5000 | ||
maximum: 10000000 |
28 changes: 28 additions & 0 deletions
28
resources/buckslips/buckslip_orders/responses/all_buckslip_orders.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: "../../../../shared/models/list.yml" | ||
- type: object | ||
properties: | ||
data: | ||
type: array | ||
description: List of buckslip orders | ||
items: | ||
$ref: "../models/buckslip_order.yml" | ||
example: | ||
data: | ||
- id: "bo_e0f8a0562a06bea7f" | ||
buckslip_id: "bck_6afffd19045076c" | ||
status: "available" | ||
quantity_ordered: 5000 | ||
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: "buckslip_order" | ||
object: list | ||
next_url: null | ||
previous_url: null | ||
count: 1 |
18 changes: 18 additions & 0 deletions
18
resources/buckslips/buckslip_orders/responses/buckslip_order.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
application/json: | ||
schema: | ||
$ref: "../models/buckslip_order.yml" | ||
|
||
examples: | ||
basic: | ||
value: | ||
id: "bo_e0f8a0562a06bea7f" | ||
buckslip_id: "bck_6afffd19045076c" | ||
status: "available" | ||
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: "buckslip_order" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could just move these above the
/bulk/us_verifications
endpoint to maintain the alphabetical ordering, that'd be great ^^There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LTGM otherwise!