Crear Envío

Crea un nuevo Envío para una orden.

Argumentos

Tipo

Descripción

amount

integer

El precio del envío en centavos.

tracking_number

string

Número de rastreo que el proveedor de envios proporciona. (opcional)

carrier

string

Nombre del proveedor de envío.

method

string

Método de envío. (opcional)

metadata

hash

Hash en donde el usuario puede enviar información adicional por cada 'shipping_line'. (opcional)

order  = Conekta::Order.find("ord_2fw8EWJusiRrxdPzT")
order.create_shipping_line({
  amount: 0,
  tracking_number: "TRACK123",
  carrier: "Fedex",
  method: "Airplane"
})
curl -H "Accept: application/vnd.conekta-v2.0.0+json" \
-H "Content-type: application/json" \
-u key_eYvWV7gSDkNYXsmr: \
-X POST -d '{
    "description": "Free Shipping",
    "amount": 0,
    "tracking_number": "TRACK123",
    "carrier": "Fedex",
    "method": "Airplane"
}' https://api.conekta.io/orders/ord_2fw8EWJusiRrxdPzT/shipping_lines
$order = \Conekta\Order::find("ord_2fw8EWJusiRrxdPzT");
$order->createShippingLine([
  'amount' => 0,
  'tracking_number' => 'TRACK123',
  'carrier' => 'Fedex',
  'method'  => 'Airplane'
]);
conekta.Order.find("ord_2fw8EWJusiRrxdPzT", function(err, order) {
    order.createShippingLine({
        "amount": 0,
        "tracking_number": "TRACK123",
        "carrier": "Fedex",
        "method": "Airplane"
    }, function (err, shippingLine) {
        console.log(shippingLine);
    });
});
order = conekta.order.find("ord_2fw8EWJusiRrxdPzT")
order.createShippingLine({
  "amount": 0,
  "tracking_number": "TRACK123",
  "carrier": "Fedex",
  "method": "Airplane"
})
Order order = Order.find("ord_2fw8EWJusiRrxdPzT");
JSONObject shippingLineParams = new JSONObject("{"
  + "'description': 'Free Shipping',"
  + "'amount': 0,"
  + "'tracking_number': 'TRACK123',"
  + "'carrier': 'USPS',"
  + "'method': 'Train'"
+ "}");

order.createShippingLine(shippingLineParams);
order = new Order().find("ord_2fw8EWJusiRrxdPzT");
order.createShippingLine(@"{
  ""amount"": 0,
  ""tracking_number"": ""TRACK123"",
  ""carrier"": ""Fedex"",
  ""method"": ""Airplane""
}");
import  (
    conekta "github.com/conekta/conekta-go"
    "github.com/conekta/conekta-go/shippinglines"
)

shippingLinesParams := &conekta.ShippingLinesParams{
    Amount:    0,
    TrackingNumber: "TRACK123",
    Carrier: "Fedex",
    Method: "Airplane", 
}
shippinglines.Create("ord_2fw8EWJusiRrxdPzT", shippingLinesParams)