Get Archived Reports¶
HTTP Request¶
GET /v4/ledger/developers/{developerId}/transactions/archived
Summary¶
This operation retrieves transaction history that is older than 6 months.
Note: For transaction history within the last 6 months, use the Get Transaction Reports API.
Considerations¶
This API returns transactions for shipments where
rates.carrier
is equal toUSPS
.You must provide a date through the query parameters. You must provide either a
fromDate
ortoDate
, or both.If you provide one date parameter and not the other, the API will return 31 days of data. The missing parameter will default to 31 days from the given parameter.
The date range cannot cannot exceed 92 days, unless you specify a
transactionId
orparcelTrackingNumber
, in which case there is no limit on the date range.Transactions are returned in UTC/GMT time.
All transactions for a given shipment use the same
transactionId
. Therefore, a given transaction ID can appear multiple times in a report. Each occurrence represents a different transaction for the same shipment.The
transactionId
comprises the developer ID and the shipment’s X-PB-TransactionId, separated by an underscore:<developer_id>_<X-PB-TransactionId>
Request URLs¶
Sandbox: https://shipping-api-sandbox.pitneybowes.com/shippingservices/v4/ledger/developers/{developerId}/transactions/archived
Production: https://shipping-api.pitneybowes.com/shippingservices/v4/ledger/developers/{developerId}/transactions/archived
Path Parameter¶
Name |
Description |
---|---|
developerId |
Required. Your Pitney Bowes developer ID. |
Query Parameters¶
A date parameter is required. You must provide a fromDate
, a toDate
, or
both.
Name |
Description |
---|---|
fromDate |
The beginning of the date range for the returned transactions. Specify this value in UTC using the ISO 8601 standard. The value must include both date and time and must end with fromDate=2019-10-05T00:00:00Z
You must specify either a The date range cannot cannot exceed 92 days, unless you specify a |
merchantId |
Returns all transactions for a specific merchant. Enter the merchant’s Shipper ID. The Shipper ID is found in the |
page |
The index number of the page to return. Page index numbering starts at |
parcelTrackingNumber |
Returns all transactions associated with a specific label. The parameter identifies the label by the shipment’s tracking number. |
shipDetails |
If set to
If set to Default Value: |
size |
The number of transactions to return per page in the result set. Default Value: |
toDate |
The end of the date range for the returned transactions. Specify this value in UTC using the ISO 8601 standard. The value must include both date and time and must end with toDate=2019-11-02T23:59:00Z
You must specify either a The date range cannot cannot exceed 92 days, unless you specify a |
transactionId |
Returns all transactions associated with a specific label. The parameter identifies the label by a string that comprises the developer ID and the shipment’s <developer_ID>_<X-PB-TransactionId>
For example: 12345678_ad507ef7414a78ac22b3
|
transactionType |
Returns all transactions of a given transaction type. Valid values:
|
Request Headers¶
Name |
Description |
---|---|
Authorization |
Required. OAuth token generated using the Generate an OAuth Token API. |
Accept-Language |
Language and country code. Default: |
Response Elements¶
Name |
Data Type |
Description |
---|---|---|
content |
Array[Transaction Object] |
The transactions. Each object in the array is a separate transaction. The Transaction Object is described in the next table below. Note: Multiple transactions can share the same |
searchCriteria |
Object |
The query parameters and the developer ID. The following is returned for a query on {
"developerId": "12345678",
"merchantId": "9024324564",
"transactionType": "POSTAGE PRINT",
"fromDate": "2019-08-01T02:00:00.000+0000",
"toDate": "2019-11-01T02:00:00.000+0000"
}
Note that the object always returns the |
last |
Boolean |
If true, this is the last page of the result set. |
totalPages |
Number |
Total number of pages in the result set. |
totalElements |
Number |
Total number of transactions in the result set for the specified query filters. |
sort |
Array[Object] |
An object with information about the sort order. |
numberOfElements |
Number |
Number of transactions in the current page. |
first |
Boolean |
If true, this is the first page of the result set. |
size |
Number |
Number of transactions per page in the result set. Default: |
number |
Number |
The index number of the page being returned. Page index numbering starts at 0. If number is set to |
Transaction Object (Archived Reports API)¶
Name |
Data Type |
Description |
---|---|---|
transactionId |
String |
The ID used to uniquely identify the shipment associated with the transaction. The ID is a combination of the developer ID and the shipment’s <Developer-ID>_<X-PB-TransactionId>
|
transactionDateTime |
String |
The date and time of the transaction, returned in UTC/GMT using the ISO 8601 standard. |
transactionType |
String |
Type of transaction. Valid values:
|
developerName |
String |
Name of the developer account used to print the shipment label. |
developerId |
String |
The developer ID used to print the shipment label. |
developerPostagePaymentMethod |
String |
The developer’s PB Postage Account payment method. This applies only to transactions that use the Bulk Postage Account payment model, as described in Merchant Enrollment Models. |
developerRatePlan |
String |
Rate plan of the developer. |
developerRateAmount |
String |
Amount charged to the developer. The amount is based on the developer’s rate plan. If the merchant (shipper) has an NSA, the amount is instead based on the NSA. APV Adjustments: If the transaction is an APV adjustment, this field is the difference between the charge that was calculated at the time of print and the charge calculated by USPS®. |
developerPostagePaymentAccountBalance |
String |
This field is not currently used. |
merchantName |
String |
Name of the merchant. |
merchantId |
String |
The value of the |
merchantPostageAccountPaymentMethod |
String |
The merchant’s PB Postage Account payment method. This applies only to transactions that use the Individual Postage Account payment model, as described in Merchant Enrollment Models. |
merchantRatePlan |
String |
Rate plan of the merchant (shipper). |
merchantRate |
String |
Amount charged to the merchant. This is based on the merchant’s shipper rate plan. APV Adjustments: If the transaction is an APV adjustment, this field is the difference between the charge to the merchant calculated at the time of print and the charge calculated based on information from USPS. |
shipperPostagePaymentAccountBalance |
String |
Postage balance in the merchant’s PB Postage Account. This is the ending balance after this transaction was processed. If the merchant’s postage balance is currently negative, the merchant must refill the postage account. See How do I fill my PB Postage Account with funds? |
labelFee |
String |
Currently not used. |
parcelTrackingNumber |
String |
Tracking number. |
weightInOunces |
String |
Weight in ounces. In the case of an APV adjustment, this is based on the new information received from USPS. |
zone |
String |
Zone. In the case of an APV adjustment this is based on the new information received from USPS. |
packageLengthInInches |
String |
Package length in inches. In the case of an APV adjustment, this is based on the new information received from USPS. |
packageWidthInInches |
String |
Package width in inches. In the case of an APV adjustment, this is based on the new information received from USPS. |
packageHeightInInches |
String |
Package height in inches. In the case of an APV adjustment, this is based on the new information received from USPS. |
packageTypeIndicator |
String |
Indicates whether cubic pricing was used. Valid values:
In the case of an APV adjustment, this is based on the new information received from USPS. |
packageType |
String |
The parcel type. For supported parcel types, see the carrier page for the carrier you are using. In the case of an APV adjustment, this is based on the new information received from USPS. |
mailClass |
String |
Service. |
internationalCountryGroup |
String |
International country group code. |
originationAddress |
String |
Origination address. |
originZip |
String |
Origin postal code. |
destinationAddress |
String |
Destination address. |
destinationZip |
String |
Destination postal code. |
destinationCountry |
String |
Destination country. |
postageDepositAmount |
String |
Postage deposit amount. |
creditCardFee |
String |
Credit card fee. |
refundStatus |
String |
Refund status. Possible values include:
For more information on refunds, see Refunds FAQs. |
refundDenialReason |
String |
The reason for a refund denial. |
printStatus |
String |
For a PB Expedited Returns label, the label’s status. Possible values:
Note: This information also appears in the status field. |
shipmentId |
String |
The unique identifier for the shipment generated when the shipment was created. |
refundRequestor |
String |
Indicates who requested the refund.
|
externalId |
String |
This applies only to the following:
|
adjustmentReason |
String |
This applies only to APV adjustments and gives the reason for the adjustment based on information received from USPS. Possible values are:
|
meterNumber |
String |
Internal identification number for the postage meter that was used. |
dimensionalWeightOz |
BigDecimal |
The dimensional weight, if applicable. To return this field, set the |
valueOfGoods |
BigDecimal |
The value provided in the To return this field, set the |
specialServices |
Array[Special Services Object] |
This array contains the shipment’s special services, including the fee paid for each service. To return this field, set the |
status |
String |
The transaction status for the following types of transactions:
|
description |
String |
Details on the status of an ACH transaction. Possible values:
|
clientFacilityId |
String |
For a PB Standard transaction, this is the ID that was assigned to the merchant’s facility during onboarding with PB Standard. |
carrierFacilityId |
String |
For a PB Standard transaction, this is the ID of the PB Standard facility that was assigned to the merchant during onboarding with PB Standard. |
inductionPostalCode |
BigDecimal |
The postal code where the shipment was tendered to the carrier. To return this field, set the |
tracking |
Object |
For a Note: This object is not returned by the Get Archived Reports API. |
tracking.parcelStatus |
String |
The most recent tracking event within 30 days of the parcel’s ship date. This is the same information returned in the Note: Transaction Reports record tracking status only for the first 30 days after the parcel’s ship date. |
tracking.statusDate |
String |
The local date and time where the tracking event occurred. This is the same information returned in |
customMessage1 |
String |
The message specified in the PRINT_CUSTOM_MESSAGE_1 shipment option in the Create Shipment request. To return this field, set the |
customMessage2 |
String |
The message specified in the PRINT_CUSTOM_MESSAGE_2 shipment option in the Create Shipment request. To return this field, set the |
Sample Request¶
curl -X GET ".../v4/ledger/developers/12345678/transactions/archived?fromDate=2019-04-01T00:00:01Z&shipDetails=1" \
-H "Authorization: Bearer <oauth_token>" \
-H "Accept-Language:en-US"
{
"content": [ {
"transactionId": "12345678_s1846423",
"transactionDateTime": "2019-04-16T13:33:58.972+0000",
"transactionType": "POSTAGE PRINT",
"developerName": "PB",
"developerId": "12345678",
"developerPostagePaymentMethod": null,
"developerRatePlan": null,
"developerRateAmount": 48.600,
"developerPostagePaymentAccountBalance": null,
"merchantName": "Jones",
"merchantId": "9024324564",
"merchantPostageAccountPaymentMethod": "OTHER",
"merchantRatePlan": null,
"merchantRate": null,
"shipperPostagePaymentAccountBalance": 475.160,
"labelFee": null,
"parcelTrackingNumber": "9405509898644503696569",
"weightInOunces": 1,
"zone": "6",
"packageLengthInInches": 36.000,
"packageWidthInInches": 12.000,
"packageHeightInInches": 12.300,
"packageTypeIndicator": "NonCubic",
"packageType": "PKG",
"mailClass": "Priority Mail",
"internationalCountryPriceGroup": null,
"originationAddress": "545 Market St,San Francisco,CA,94105",
"originZip": "94105",
"destinationAddress": "284 W Fulton St,Garden City,KS,67846",
"destinationZip": "67846535284",
"destinationCountry": "US",
"postageDepositAmount": null,
"creditCardFee": null,
"refundStatus": null,
"refundDenialReason": null,
"printStatus": null,
"shipmentId": "USPS2200250326735036",
"refundRequestor": null,
"externalId": null,
"adjustmentReason": null,
"meterNumber": "0001259113",
"dimensionalWeightOz": 432,
"valueOfGoods": 0.000,
"specialServices": [ {
"specialServiceId": "Ins",
"fee": 0.0,
"inputParameters": [ {
"name": "INPUT_VALUE",
"value": "50"
} ]
},{
"specialServiceId": "DelCon",
"fee": 0.0,
"inputParameters": [ {
"name": "INPUT_VALUE",
"value": "0"
} ]
} ],
"status": null,
"description": null,
"customMessage1": null,
"customMessage2": null
},
...
],
"searchCriteria": {
"developerId": "12345678",
"fromDate": "2019-04-01T00:00:01.000+0000",
"toDate": "2019-05-02T00:00:01.000+0000",
"shipDetails": 1
},
"last": false,
"totalElements": 88,
"totalPages": 5,
"first": true,
"numberOfElements": 20,
"sort": [ {
"direction": "ASC",
"property": "transactionDateTime",
"ignoreCase": false,
"nullHandling": "NATIVE",
"descending": false,
"ascending": true
} ],
"size": 20,
"number": 0
}
Error Codes¶
The following error code is specific to reports:
Error Code |
Error Message |
Solution |
---|---|---|
invalid.date.time |
Date range can not exceed 3 months. From date: ___ To date: ___ |
See Query Parameters for allowed range. |
invalid.date.time |
Provided Date/time ___ is invalid, valid format is YYYY-MM-DDThh:mm:ss.sZ |
See Query Parameters for correct format. |
For a list of all error codes returned by the Ecommerce APIs, please see Error Codes.