Skip to main content

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

GET https://api.ebay.com/sell/edelivery_international_shipping/v1/actual_costs?

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

ParameterTypeDescription
tracking_numbersarray of stringThis 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_timestringThis 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_timestringThis 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/fieldTypeDescription
actualCostsarray of GetActualCostResponsesData

This array returns a list of actual costs associated with the packages matching the input criteria.

Occurrence: Always

actualCosts.actualWeightnumber

The actual weight of the package in grams.

Occurrence: Always

actualCosts.amountAmount

This container specifies the total monetary amount of the actual cost of the package.

Occurrence: Always

actualCosts.amount.currencyCurrencyCodeEnum

This enum value represents the type of currency being used. Both the value and currency fields are required/always returned when expressing cost.

See the CurrencyCodeEnum type for the full list of supported values.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

actualCosts.amount.valuestring

The monetary amount, in the currency specified by the currency field.

Both the value and currency fields are required/always returned when expressing cost.

Occurrence: Conditional

actualCosts.billingTimestring

The time the seller was charged for the actual cost of the package in UTC format.

Occurrence: Always

actualCosts.chargeModestring

The two-digit charge mode for the package.

Valid values:

  • 01: Actual weight
  • 02: Additional dimension weight
  • 03: Charged by lite mode

Occurrence: Always

actualCosts.chargeWeightnumber

The weight, in grams, charged for when shipping the package.

Occurrence: Always

actualCosts.costTypestring

The two-digit cost type of the package. This field indicates any fees associated with the package.

The following values are the typical cost types returned through this field. If an undocumented cost type is returned, check the logistic provider's website for the latest values:

  • 01: Shipping fee
  • 02: Domestic
  • 03: Return fee
  • 04: Domestic burning fee
  • 05: Custom collected fee
  • 06: Weight gap fee
  • 07: Duplication compensation

Occurrence: Always

actualCosts.messagestring

A seller-defined message to the buyer regarding the transaction.

Note: This field is always returned, but will show as null or have an empty value if not defined/applicable.

Occurrence: Always

actualCosts.remarkstring

A remark to the seller themselves.

Note: This field is always returned, but will show as null or have an empty value if not defined/applicable.

Occurrence: Always

actualCosts.resultCodestring

The result code associated with the call.

For example, a result code of 200 indicates that the call was a success.

Occurrence: Always

actualCosts.sizestring

The size of the package in centimeters. This value is returned in Length*Width*Height format.

Occurrence: Always

actualCosts.trackingNumberstring

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.

StatusMeaning
200OK
400Bad Request
401Unauthorized
404Not found
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
355000API_EDISAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
355069API_EDISREQUESTThe date format of the trans_begin_time field is incorrect.
355070API_EDISREQUESTThe date format of the trans_end_time field is incorrect.
355071API_EDISREQUESTThe specified tracking number {tracking_number} does not belong to the seller, so cannot be retrieved.
355400API_EDISREQUESTThe 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.