Skip to content

Commit 91f8a83

Browse files
authored
Document service_request_number placement on mailpieces (#538)
Adds a shared service_request_number attribute and references it from the postcard, letter, self mailer, and check create models (the four resources that accept it per lob-api validators). The field was previously undocumented, which led a customer to nest it inside merge_variables where the API silently ignores it — the mailpiece is created with no promotion applied and no error. The description states the field must be top-level and must not be nested in merge_variables, and the postcard create examples now include it as a sibling of size. Mirrors the USPS promotions help-center language. Follow-up to ER-515.
1 parent 55f03bd commit 91f8a83

7 files changed

Lines changed: 69 additions & 6 deletions

File tree

dist/lob-api-bundled.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8946,6 +8946,7 @@ paths:
89468946
front: tmpl_a1234dddg
89478947
back: tmpl_a1234dddg
89488948
size: 6x9
8949+
service_request_number: '12345678'
89498950
mail_type: usps_first_class
89508951
merge_variables:
89518952
name: Harry
@@ -8994,6 +8995,7 @@ paths:
89948995
front: tmpl_c94e83ca2cd5121
89958996
back: tmpl_c94e83ca2cd5121
89968997
size: 6x9
8998+
service_request_number: '12345678'
89978999
mail_type: usps_first_class
89989000
merge_variables:
89999001
name: Harry
@@ -9055,6 +9057,7 @@ paths:
90559057
front: tmpl_a1234dddg
90569058
back: tmpl_a1234dddg
90579059
size: 6x9
9060+
service_request_number: '12345678'
90589061
mail_type: usps_first_class
90599062
merge_variables:
90609063
name: Harry
@@ -16026,9 +16029,10 @@ components:
1602616029
source_material:
1602716030
$ref: '#/components/schemas/booklet_source_material'
1602816031
failure_reason:
16032+
type: object
16033+
nullable: true
1602916034
allOf:
1603016035
- $ref: '#/components/schemas/failure_reason'
16031-
- nullable: true
1603216036
object:
1603316037
type: string
1603416038
description: Value is resource type.
@@ -18391,9 +18395,10 @@ components:
1839118395
status:
1839218396
$ref: '#/components/schemas/status'
1839318397
failure_reason:
18398+
type: object
18399+
nullable: true
1839418400
allOf:
1839518401
- $ref: '#/components/schemas/failure_reason'
18396-
- nullable: true
1839718402
object:
1839818403
type: string
1839918404
description: Value is resource type.
@@ -18494,6 +18499,15 @@ components:
1849418499
- $ref: '#/components/schemas/tmpl_id'
1849518500
- $ref: '#/components/schemas/remote_file_url'
1849618501
- $ref: '#/components/schemas/local_file_path'
18502+
service_request_number:
18503+
type: string
18504+
description: |-
18505+
The service request number (SR#) of an approved USPS promotion (for example, the Integrated Technology promotion) to apply to this mailpiece. Supported on letters, postcards, self mailers, and checks.
18506+
18507+
This must be a **top-level** field in the create request, alongside `size`, `front`, and `back` — **not** nested inside `merge_variables` or any other object. A misplaced `service_request_number` is silently ignored: the mailpiece is created successfully with no promotion applied and no error returned.
18508+
18509+
The SR# must be approved for your account and cover the resource type, size, and mail type of this mailpiece for the promotion to apply. If omitted, no promotion is applied. See our <a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/usps-promotions-through-lob" target="_blank">guide to USPS promotions through Lob</a> for more information.
18510+
nullable: true
1849718511
check_editable_props:
1849818512
allOf:
1849918513
- $ref: '#/components/schemas/check_base'
@@ -18562,6 +18576,8 @@ components:
1856218576
$ref: '#/components/schemas/billing_group_id'
1856318577
use_type:
1856418578
$ref: '#/components/schemas/chk_use_type'
18579+
service_request_number:
18580+
$ref: '#/components/schemas/service_request_number'
1856518581
print_speed:
1856618582
$ref: '#/components/schemas/print_speed'
1856718583
check_editable:
@@ -19289,9 +19305,10 @@ components:
1928919305
status:
1929019306
$ref: '#/components/schemas/status'
1929119307
failure_reason:
19308+
type: object
19309+
nullable: true
1929219310
allOf:
1929319311
- $ref: '#/components/schemas/failure_reason'
19294-
- nullable: true
1929519312
object:
1929619313
type: string
1929719314
description: Value is resource type.
@@ -19687,6 +19704,8 @@ components:
1968719704
$ref: '#/components/schemas/qr_code'
1968819705
use_type:
1968919706
$ref: '#/components/schemas/ltr_use_type'
19707+
service_request_number:
19708+
$ref: '#/components/schemas/service_request_number'
1969019709
fsc:
1969119710
type: boolean
1969219711
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `A4` and `us_legal` letter size.
@@ -19767,9 +19786,10 @@ components:
1976719786
status:
1976819787
$ref: '#/components/schemas/status'
1976919788
failure_reason:
19789+
type: object
19790+
nullable: true
1977019791
allOf:
1977119792
- $ref: '#/components/schemas/failure_reason'
19772-
- nullable: true
1977319793
object:
1977419794
type: string
1977519795
description: Value is resource type.
@@ -19846,6 +19866,8 @@ components:
1984619866
$ref: '#/components/schemas/qr_code'
1984719867
use_type:
1984819868
$ref: '#/components/schemas/psc_use_type'
19869+
service_request_number:
19870+
$ref: '#/components/schemas/service_request_number'
1984919871
fsc:
1985019872
type: boolean
1985119873
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `4x6` or `A5` postcard sizes.
@@ -20326,9 +20348,10 @@ components:
2032620348
campaign_id:
2032720349
$ref: '#/components/schemas/campaign_id'
2032820350
failure_reason:
20351+
type: object
20352+
nullable: true
2032920353
allOf:
2033020354
- $ref: '#/components/schemas/failure_reason'
20331-
- nullable: true
2033220355
self_mailer_deletion:
2033320356
description: Lob uses RESTful HTTP response codes to indicate success or failure of an API request. In general, 2xx indicates success, 4xx indicate an input error, and 5xx indicates an error on Lob's end.
2033420357
properties:
@@ -20387,6 +20410,8 @@ components:
2038720410
$ref: '#/components/schemas/qr_code'
2038820411
use_type:
2038920412
$ref: '#/components/schemas/sfm_use_type'
20413+
service_request_number:
20414+
$ref: '#/components/schemas/service_request_number'
2039020415
fsc:
2039120416
type: boolean
2039220417
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `11x9_bifold` self-mailer size.
@@ -20479,9 +20504,10 @@ components:
2047920504
campaign_id:
2048020505
$ref: '#/components/schemas/campaign_id'
2048120506
failure_reason:
20507+
type: object
20508+
nullable: true
2048220509
allOf:
2048320510
- $ref: '#/components/schemas/failure_reason'
20484-
- nullable: true
2048520511
color:
2048620512
$ref: '#/components/schemas/color'
2048720513
snap_pack_deletion:

resources/checks/models/check_editable_props.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,8 @@ allOf:
9898
use_type:
9999
$ref: "../attributes/chk_use_type.yml"
100100

101+
service_request_number:
102+
$ref: "../../../shared/attributes/service_request_number.yml"
103+
101104
print_speed:
102105
$ref: "../../../shared/attributes/print_speed.yml"

resources/letters/models/letter_editable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ allOf:
6767
use_type:
6868
$ref: "../attributes/ltr_use_type.yml"
6969

70+
service_request_number:
71+
$ref: "../../../shared/attributes/service_request_number.yml"
72+
7073
fsc:
7174
type: boolean
7275
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `A4` and `us_legal` letter size.

resources/postcards/models/postcard_editable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ allOf:
2727
use_type:
2828
$ref: "../attributes/psc_use_type.yml"
2929

30+
service_request_number:
31+
$ref: "../../../shared/attributes/service_request_number.yml"
32+
3033
fsc: # Forest Stewardship Council
3134
type: boolean
3235
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `4x6` or `A5` postcard sizes.

resources/postcards/postcards.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ post:
212212
front: tmpl_a1234dddg
213213
back: tmpl_a1234dddg
214214
size: "6x9"
215+
service_request_number: "12345678"
215216
mail_type: usps_first_class
216217
merge_variables:
217218
name: Harry
@@ -261,6 +262,7 @@ post:
261262
front: tmpl_c94e83ca2cd5121
262263
back: tmpl_c94e83ca2cd5121
263264
size: "6x9"
265+
service_request_number: "12345678"
264266
mail_type: usps_first_class
265267
merge_variables:
266268
name: Harry
@@ -323,6 +325,7 @@ post:
323325
front: tmpl_a1234dddg
324326
back: tmpl_a1234dddg
325327
size: "6x9"
328+
service_request_number: "12345678"
326329
mail_type: usps_first_class
327330
merge_variables:
328331
name: Harry

resources/self_mailers/models/self_mailer_editable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ allOf:
6767
use_type:
6868
$ref: "../attributes/sfm_use_type.yml"
6969

70+
service_request_number:
71+
$ref: "../../../shared/attributes/service_request_number.yml"
72+
7073
fsc:
7174
type: boolean
7275
description: This is in beta. Contact support@lob.com or your account contact to learn more. Not available for `11x9_bifold` self-mailer size.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
type: string
2+
3+
description: >-
4+
The service request number (SR#) of an approved USPS promotion (for example,
5+
the Integrated Technology promotion) to apply to this mailpiece. Supported on
6+
letters, postcards, self mailers, and checks.
7+
8+
9+
This must be a **top-level** field in the create request, alongside `size`,
10+
`front`, and `back` — **not** nested inside `merge_variables` or any other
11+
object. A misplaced `service_request_number` is silently ignored: the
12+
mailpiece is created successfully with no promotion applied and no error
13+
returned.
14+
15+
16+
The SR# must be approved for your account and cover the resource type, size,
17+
and mail type of this mailpiece for the promotion to apply. If omitted, no
18+
promotion is applied. See our
19+
<a href="https://help.lob.com/print-and-mail/building-a-mail-strategy/usps-promotions-through-lob" target="_blank">guide to USPS promotions through Lob</a>
20+
for more information.
21+
22+
nullable: true

0 commit comments

Comments
 (0)