Shippex.cancel_transaction

You're seeing just the function cancel_transaction, go back to Shippex module for more information.
Link to this function

cancel_transaction(transaction)

View Source

Specs

cancel_transaction(Shippex.Transaction.t()) :: {atom(), response()}

Cancels the transaction associated with label, if possible. The result is returned in a tuple.

You may pass in either the transaction, or if the full transaction struct isn't available, you may pass in the carrier, shipment, and tracking number instead.

case Shippex.cancel_shipment(transaction) do
  {:ok, result} ->
    IO.inspect(result) #=> %{code: "1", message: "Voided successfully."}
  {:error, %{code: code, message: message}} ->
    IO.inspect(code)
    IO.inspect(message)
end
Link to this function

cancel_transaction(carrier, shipment, tracking_number)

View Source

Specs

cancel_transaction(Shippex.Carrier.t(), Shippex.Shipment.t(), String.t()) ::
  {atom(), response()}