GET/actual_costs
Important! This method is only available for Greater-China based sellers with an active eDIS account.
This method is used to retrieve the actual weight and cost for one or more packages based on the provided input criteria.
Responses can be filtered by the tracking_numbers query parameter. If this parameter is used, actual costs for each package associated with the provided tracking numbers are returned.
Alternatively, responses can be filtered by the trans_begin_time and trans_end_time query parameters. If these parameters are used, the actual costs of all packages created within this date range are returned.
Only one filtering method can be used per call.
Input
Resource URI
This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com
root URI with api.sandbox.ebay.com
URI parameters
Parameter | Type | Description |
---|---|---|
tracking_numbers | array of string | This query parameter specifies the tracking number(s) of the package(s) for which to retrieve the actual weight and cost. Tracking numbers are returned when creating packages through the createPackage method. Up to 200 tracking numbers can be provided. Note: This query parameter is required if trans_begin_time and trans_end_time is not provided. Occurrence: Conditional |
trans_begin_time | string | This query parameter specifies the start time of a transaction in UTC format. If the the trans_begin_time and trans_end_time query parameters are used, the actual costs of all packages created within this date range are returned. Note: This query parameter and trans_end_time are required if tracking_numbers is not provided. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Occurrence: Conditional |
trans_end_time | string | This query parameter specifies ending time of a transaction in UTC format. If the the trans_begin_time and trans_end_time query parameters are used, the actual costs of all packages created within this date range are returned. Note: This query parameter and trans_start_time are required if tracking_numbers is not provided. Format: YYYY-MM-DDTHH:MM:SS.SSSZ Occurrence: Conditional |
HTTP request headers
All requests made to eBay REST operations require you to provide the Authorization
HTTP header for authentication authorization.
All other standard RESTful request headers are optional. For more information on standard RESTful request headers, see the HTTP request headers- opens rest request components page table.
OAuth scope
This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):
https://api.ebay.com/oauth/scope/sell.edelivery
See OAuth access tokens for more information.
Request payload
This call has no payload.
Request fields
This call has no field definitions.
Output
HTTP response headers
This call has no response headers.
Response payload
Response fields
Output container/field | Type | Description |
---|---|---|
actualCosts | array of GetActualCostResponsesData | This array returns a list of actual costs associated with the packages matching the input criteria. Occurrence: Always |
actualCosts.actualWeight | number | The actual weight of the package in grams. Occurrence: Always |
actualCosts.amount | Amount | This container specifies the total monetary amount of the actual cost of the package. Occurrence: Always |
actualCosts.amount.currency | CurrencyCodeEnum | This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost. Occurrence: Conditional |
actualCosts.amount.value | string | The monetary amount, in the currency specified by the currency field. Occurrence: Conditional |
actualCosts.billingTime | string | The time the seller was charged for the actual cost of the package in UTC format. Occurrence: Always |
actualCosts.chargeMode | string | The two-digit charge mode for the package.
Occurrence: Always |
actualCosts.chargeWeight | number | The weight, in grams, charged for when shipping the package. Occurrence: Always |
actualCosts.costType | string | The two-digit cost type of the package. This field indicates any fees associated with the package.
Occurrence: Always |
actualCosts.message | string | A seller-defined message to the buyer regarding the transaction. Occurrence: Always |
actualCosts.remark | string | A remark to the seller themselves. Occurrence: Always |
actualCosts.resultCode | string | The result code associated with the call. Occurrence: Always |
actualCosts.size | string | The size of the package in centimeters. This value is returned in Length*Width*Height format. Occurrence: Always |
actualCosts.trackingNumber | string | The tracking number associated with the package. Occurrence: Always |
HTTP status codes
This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.
Status | Meaning |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
355000 | API_EDIS | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay developer support for assistance. |
355069 | API_EDIS | REQUEST | The date format of the trans_begin_time field is incorrect. |
355070 | API_EDIS | REQUEST | The date format of the trans_end_time field is incorrect. |
355071 | API_EDIS | REQUEST | The specified tracking number {tracking_number} does not belong to the seller, so cannot be retrieved. |
355400 | API_EDIS | REQUEST | The access token provided in the Authorization header is not for an eBay user account that is currently allowed to call this API. Please go to account settings to add to your account list. |
Warnings
This call has no warnings.
Samples
New to making API calls? Please see Making a Call.
Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.
Sample 1: Retrieve actual costs for a package based on a provided tracking number
This method can be used to retrieve the actual cost and weight for one or more packages.
Input
When making this call, either the tracking number(s) or the transit start and end times of the packages for which to retrieve actual costs are required as query parameters.
In this sample, a single tracking_numbers value is used as a query parameter.
GEThttps://api.ebay.com/sell/edelivery_international_shipping/v1/actual_costs?tracking_numbers=E*****************N
Output
If the call is successful, actual weight and cost information for the package associated with the specified tracking number will be returned.