Write shipping information

POST /OrderPackage/SetOrderPackageCargoInfoList — OMS API · Packages

Writes the shipping company, shipping key, barcode, and tracking information to packages. The body is an array; you can send multiple records in a single request.

When to call: When the package is shipped or the shipping information is finalized.

  • The tracking number field is named trackingCode.
  • If isChangeStatus: true, the package and its lines are set to Shipped status; if the workflow does not allow the transition, HTTP 200 with isSuccess: false is returned.
  • Fields sent empty do not delete existing values.
  • If no package is found, returns errorMesssage: "Package not found!".

İstek gövdesi

  • cargoKey (string): Shipping key.
  • trackingUrl (string): Shipping tracking link.
  • cargoBarcode (string): Shipping barcode.
  • cargoCompany (string): Shipping company code.
  • trackingCode (string): Shipping tracking number.
  • isChangeStatus (boolean): If true, the package and its lines are set to Shipped status (returns error if workflow is not suitable).
  • sourcePackageId (string, zorunlu): The package's sourcePackageId value.

Yanıtlar

  • 200: Successful. Always check the isSuccess field in the body.
  • 400: Body validation failed (missing required field, type mismatch, or malformed JSON). The response is in ASP.NET Core ValidationProblemDetails format; the errors field indicates which field is invalid.
  • 401: Authorization header missing, token invalid or expired. The body is empty; obtain a new token via /Auth/login.
  • 500: Unexpected server error. This response returns fields in PascalCase (unlike other responses) and includes null fields.

200 yanıt alanları

  • errors (object[]): Detailed error list. Returned only if present.
    • errors.code (string): Error code.
    • errors.message (string): Error message.
  • isSuccess (boolean, zorunlu): true if the operation is successful. It can be false even if HTTP 200 is returned; check in every response.
  • statusCode (integer<int32>, zorunlu): Status code. Usually 0 in successful responses; should not be used instead of HTTP status code.
  • errorSource (string): Error source. Returned only if present.
  • correlationId (string): Request tracking ID. Returned only if present.
  • errorMesssage (string): Error message (field name is written with three s in the source). Returned only if there is an error.