我正在使用Shippo API尝试将我的费率/包裹设置为USPS优先级。根据文档,我觉得我需要添加/编辑$rate数组,但我似乎无法解决这个问题。
// Select the rate you want to purchase.
// We simply select the first rate in this example.
// $rate = $shipment["rates_list"][0];
$rate = array(
'object_state' => 'VALID',
'provider' => 'USPS',
'servicelevel_name' => 'Priority Mail',
'servicelevel_token' => 'usps_priority'
);
// Purchase the desired rate
$transaction = Shippo_Transaction::create(array(
'rate'=> $rate["object_id"],
//'rate' => $rate["usps_priority"],
'async'=> false
));发布于 2016-05-06 05:49:04
看起来我们的InstaLabel功能非常适合你,https://goshippo.com/shipping-api/instalabel
该链接上有一个完整的PHP示例,但下面是您指定的代码:
$transaction = Shippo_Transaction::create( array(
'shipment' => $shipment,
'carrier_account' => 'b741b99f95e841639b54272834bc478c',
'servicelevel_token' => 'usps_priority',
);
);https://stackoverflow.com/questions/37058507
复制相似问题