UPS Rates

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

UPS Rates

Mike Ealy-2
Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
costs? I'm using Lasso 8.6 on a Mac.

I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
supported anymore.

Thanks,
Mike Ealy



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

maxwellk2
I haven't looked at UPS's API, but the USPS and Stamps.com APIs did not look friendly. Just started testing ShipEngine.com and it's been super easy so far, they support multiple carriers including UPS. Here are the REST API docs:

        https://docs.shipengine.com/docs

The Pay-As-You-Go of 5¢ per shipment sees very reasonable given all the functionality, plus you don't have to learn another API if you need more than UPS later on.

-Max


> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>
> Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
> costs? I'm using Lasso 8.6 on a Mac.
>
> I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
> supported anymore.
>
> Thanks,
> Mike Ealy
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Mike Ealy-2
Thanks Max,

I'll take a look. Just needed UPS but this may be where I end up.

Mike



> I haven't looked at UPS's API, but the USPS and Stamps.com APIs
> did not look friendly. Just started testing ShipEngine.com and
> it's been super easy so far, they support multiple carriers
> including UPS. Here are the REST API docs:
>
>     https://docs.shipengine.com/docs
>
> The Pay-As-You-Go of 5¢ per shipment sees very reasonable given
> all the functionality, plus you don't have to learn another API
> if you need more than UPS later on.
>
> -Max


> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>
> Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
> costs? I'm using Lasso 8.6 on a Mac.
>
> I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
> supported anymore.
>
> Thanks,
> Mike Ealy
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>



#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Carl Ketterling
In reply to this post by maxwellk2
Max,

I’ve been trying to use ShipEngine.com, and I’m having problems.  Can you share what you’ve done?

Specifically, I’ve been having problems getting the correct data from the curl command.  I’ve been using ‘shell’ tag from http://www.lassosoft.com/tagswap/detail/shell and wonder if that is the cause.

Could you provide an example of one of your calls?

Carl


> On Jan 24, 2018, at 8:31 PM, Maxwell Klein <[hidden email]> wrote:
>
> I haven't looked at UPS's API, but the USPS and Stamps.com APIs did not look friendly. Just started testing ShipEngine.com and it's been super easy so far, they support multiple carriers including UPS. Here are the REST API docs:
>
> https://docs.shipengine.com/docs
>
> The Pay-As-You-Go of 5¢ per shipment sees very reasonable given all the functionality, plus you don't have to learn another API if you need more than UPS later on.
>
> -Max
>
>
>> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>>
>> Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
>> costs? I'm using Lasso 8.6 on a Mac.
>>
>> I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
>> supported anymore.
>>
>> Thanks,
>> Mike Ealy
>>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

stevepiercy
You don't provide sufficient information to help.

What do you try?

What do you expect to see?

What do you observe?

What is your operating system and version?

--steve


On 3/30/18 at 12:09 AM, [hidden email] (Carl Ketterling) pronounced:

>Max,
>
>I’ve been trying to use ShipEngine.com, and I’m having
>problems.  Can you share what you’ve done?
>
>Specifically, I’ve been having problems getting the correct
>data from the curl command.  I’ve been using ‘shell’ tag
>from http://www.lassosoft.com/tagswap/detail/shell and wonder
>if that is the cause.
>
>Could you provide an example of one of your calls?
>
>Carl
>
>
>>On Jan 24, 2018, at 8:31 PM, Maxwell Klein <[hidden email]> wrote:
>>
>>I haven't looked at UPS's API, but the USPS and Stamps.com APIs did not look friendly.
>Just started testing ShipEngine.com and it's been super easy so
>far, they support multiple carriers including UPS. Here are the
>REST API docs:
>>
>>https://docs.shipengine.com/docs
>>
>>The Pay-As-You-Go of 5¢ per shipment sees very reasonable given all the functionality,
>plus you don't have to learn another API if you need more than UPS later on.
>>
>>-Max
>>
>>
>>> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>>>   Can anyone suggest a solution to pass parameters to UPS to
>>>retrieve shipping
>>> costs? I'm using Lasso 8.6 on a Mac.
>>>   I remember using TC_UPS_RateQuote years ago but it doesn't
>>>seem to be
>>> supported anymore.
>>>   Thanks,
>>> Mike Ealy
>>>     #############################################################
>>>   This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Carl Ketterling
Well, I was hoping to see how someone else made the call (assuming it’s working for them) so that I could find my own problem.  But here goes.


I have Lasso 9 running on macOS.

I’m using the sample code for “Get Shipping Rates” from shipengine.com (https://docs.shipengine.com/docs/get-shipping-rates).

If I copy and past their curl command, I get what I think is a complete response (over 700 lines).  When I use Lasso, I get a much shorter response (30 lines).

Details below.

Carl


# -------------------------------------------------------
# The Lasso Page

<?LassoScript

        local( theURL = 'https://api.shipengine.com/v1/rates' ) // RATES URL
        local( postData = '\'
{
  "shipment": {
    "validate_address": "no_validation",
    "ship_to": {
      "name": "Mickey and Minnie Mouse",
      "phone": "714-781-4565",
      "company_name": "The Walt Disney Company",
      "address_line1": "500 South Buena Vista Street",
      "city_locality": "Burbank",
      "state_province": "CA",
      "postal_code": "91521",
      "country_code": "US"
    },
    "ship_from": {
      "name": "Dade Murphy",
      "phone": "512-485-4282",
      "company_name": "Zero Cool",
      "address_line1": "345 Chambers Street",
      "address_line2": "Suite 100",
      "city_locality": "New York City",
      "state_province": "NY",
      "postal_code": "10282",
      "country_code": "US",
    },
    "packages": [
      {
        "weight": {
          "value": 1.0,
          "unit": "ounce"
        }
      }
    ]
  },
  "rate_options": {
    "carrier_ids": [
      "se-123890"
    ]
  }
}
\'' )

        local( curlResult = shell( 'curl '
                + #theURL
                + ' -X ' + 'POST'
                + ' -H ' + '"Content-Type: application/json"'
                + ' -H ' + '"api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw"'
                + ' -d ' + #postData )
        )

#curlResult

?>

# -------------------------------------------------------
# The Lasso Output

: [],
  "packages": [
    {
      "package_code": "package",
      "weight": {
        "value": 1.00,
        "unit": "ounce"
      },
      "dimensions": {
        "unit": "inch",
        "length": 0.0,
        "width": 0.0,
        "height": 0.0
      },
      "insured_value": {
        "currency": "usd",
        "amount": 0.00
      },
      "label_messages": {
        "reference1": null,
        "reference2": null,
        "reference3": null
      }
    }
  ],
  "total_weight": {
    "value": 1.00,
    "unit": "ounce"
  }
}


# -------------------------------------------------------
# The cURL Command and Output

$ curl 'https://api.shipengine.com/v1/rates' -X POST \

>   -H "Content-type: application/json" \
>   -H "api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw" \
>   -d '
> {
>   "shipment": {
>     "validate_address": "no_validation",
>     "ship_to": {
>       "name": "Mickey and Minnie Mouse",
>       "phone": "714-781-4565",
>       "company_name": "The Walt Disney Company",
>       "address_line1": "500 South Buena Vista Street",
>       "city_locality": "Burbank",
>       "state_province": "CA",
>       "postal_code": "91521",
>       "country_code": "US"
>     },
>     "ship_from": {
>       "name": "Dade Murphy",
>       "phone": "512-485-4282",
>       "company_name": "Zero Cool",
>       "address_line1": "345 Chambers Street",
>       "address_line2": "Suite 100",
>       "city_locality": "New York City",
>       "state_province": "NY",
>       "postal_code": "10282",
>       "country_code": "US",
>     },
>     "packages": [
>       {
>         "weight": {
>           "value": 1.0,
>           "unit": "ounce"
>         }
>       }
>     ]
>   },
>   "rate_options": {
>     "carrier_ids": [
>       "se-123890"
>     ]
>   }
> }'

{
  "rate_response": {
    "rates": [
      {
        "rate_id": "se-12385913",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 0.47
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "letter",
        "delivery_days": 4,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-03T00:00:00Z",
        "carrier_delivery_days": "3",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS First Class Mail",
        "service_code": "usps_first_class_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385914",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 1.00
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "large_envelope_or_flat",
        "delivery_days": 4,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-03T00:00:00Z",
        "carrier_delivery_days": "3",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS First Class Mail",
        "service_code": "usps_first_class_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385915",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 2.66
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "package",
        "delivery_days": 4,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-03T00:00:00Z",
        "carrier_delivery_days": "3",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS First Class Mail",
        "service_code": "usps_first_class_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385916",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 7.53
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "package",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385917",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 12.45
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "medium_flat_rate_box",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385918",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 6.85
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "small_flat_rate_box",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385919",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 17.10
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "large_flat_rate_box",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385920",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 6.35
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_envelope",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385921",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 6.90
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_padded_envelope",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385922",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 10.75
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "regional_rate_box_a",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385923",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 20.98
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "regional_rate_box_b",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385924",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 6.65
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_legal_envelope",
        "delivery_days": 3,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail",
        "service_code": "usps_priority_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385925",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 29.87
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "package",
        "delivery_days": 2,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "1-2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail Express",
        "service_code": "usps_priority_mail_express",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385926",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 21.98
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_envelope",
        "delivery_days": 2,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "1-2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail Express",
        "service_code": "usps_priority_mail_express",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385927",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 22.46
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_padded_envelope",
        "delivery_days": 2,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "1-2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail Express",
        "service_code": "usps_priority_mail_express",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385928",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 22.09
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "flat_rate_legal_envelope",
        "delivery_days": 2,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-02T00:00:00Z",
        "carrier_delivery_days": "1-2",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Priority Mail Express",
        "service_code": "usps_priority_mail_express",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385929",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 2.66
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "package",
        "delivery_days": 8,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-07T00:00:00Z",
        "carrier_delivery_days": "7",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Media Mail",
        "service_code": "usps_media_mail",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      },
      {
        "rate_id": "se-12385930",
        "rate_type": "shipment",
        "carrier_id": "se-123890",
        "shipping_amount": {
          "currency": "usd",
          "amount": 7.75
        },
        "insurance_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "confirmation_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "other_amount": {
          "currency": "usd",
          "amount": 0.00
        },
        "zone": 8,
        "package_type": "package",
        "delivery_days": 8,
        "guaranteed_service": false,
        "estimated_delivery_date": "2018-04-07T00:00:00Z",
        "carrier_delivery_days": "7",
        "ship_date": "2018-03-30T00:00:00Z",
        "negotiated_rate": false,
        "service_type": "USPS Parcel Select Ground",
        "service_code": "usps_parcel_select",
        "trackable": true,
        "carrier_code": "stamps_com",
        "carrier_nickname": "Free",
        "carrier_friendly_name": "Stamps.com",
        "validation_status": "valid",
        "warning_messages": [],
        "error_messages": []
      }
    ],
    "invalid_rates": [],
    "rate_request_id": "se-912762",
    "shipment_id": "se-219724633",
    "created_at": "2018-03-30T19:18:12.327Z",
    "status": "completed",
    "errors": []
  },
  "shipment_id": "se-219724633",
  "carrier_id": null,
  "service_code": null,
  "external_shipment_id": null,
  "ship_date": "2018-03-30T00:00:00Z",
  "created_at": "2018-03-30T19:18:11.18Z",
  "modified_at": "2018-03-30T19:18:11.18Z",
  "shipment_status": "pending",
  "ship_to": {
    "name": "Mickey and Minnie Mouse",
    "phone": "714-781-4565",
    "company_name": "The Walt Disney Company",
    "address_line1": "500 South Buena Vista Street",
    "address_line2": null,
    "address_line3": null,
    "city_locality": "Burbank",
    "state_province": "CA",
    "postal_code": "91521",
    "country_code": "US",
    "address_residential_indicator": "unknown"
  },
  "ship_from": {
    "name": "Dade Murphy",
    "phone": "512-485-4282",
    "company_name": "Zero Cool",
    "address_line1": "345 Chambers Street",
    "address_line2": "Suite 100",
    "address_line3": null,
    "city_locality": "New York City",
    "state_province": "NY",
    "postal_code": "10282",
    "country_code": "US",
    "address_residential_indicator": "unknown"
  },
  "warehouse_id": null,
  "return_to": {
    "name": "Dade Murphy",
    "phone": "512-485-4282",
    "company_name": "Zero Cool",
    "address_line1": "345 Chambers Street",
    "address_line2": "Suite 100",
    "address_line3": null,
    "city_locality": "New York City",
    "state_province": "NY",
    "postal_code": "10282",
    "country_code": "US",
    "address_residential_indicator": "unknown"
  },
  "confirmation": "none",
  "customs": null,
  "advanced_options": {
    "bill_to_account": null,
    "bill_to_country_code": null,
    "bill_to_party": null,
    "bill_to_postal_code": null,
    "contains_alcohol": false,
    "delivered_duty_paid": false,
    "non_machinable": false,
    "saturday_delivery": false,
    "freight_class": null,
    "custom_field1": null,
    "custom_field2": null,
    "custom_field3": null
  },
  "insurance_provider": "none",
  "tags": [],
  "packages": [
    {
      "package_code": "package",
      "weight": {
        "value": 1.00,
        "unit": "ounce"
      },
      "dimensions": {
        "unit": "inch",
        "length": 0.0,
        "width": 0.0,
        "height": 0.0
      },
      "insured_value": {
        "currency": "usd",
        "amount": 0.00
      },
      "label_messages": {
        "reference1": null,
        "reference2": null,
        "reference3": null
      }
    }
  ],
  "total_weight": {
    "value": 1.00,
    "unit": "ounce"
  }
}





> On Mar 30, 2018, at 2:30 AM, Steve Piercy - Website Builder <[hidden email]> wrote:
>
> You don't provide sufficient information to help.
>
> What do you try?
>
> What do you expect to see?
>
> What do you observe?
>
> What is your operating system and version?
>
> --steve
>
>
> On 3/30/18 at 12:09 AM, [hidden email] (Carl Ketterling) pronounced:
>
>> Max,
>>
>> I’ve been trying to use ShipEngine.com, and I’m having problems.  Can you share what you’ve done?
>>
>> Specifically, I’ve been having problems getting the correct data from the curl command.  I’ve been using ‘shell’ tag from http://www.lassosoft.com/tagswap/detail/shell and wonder if that is the cause.
>>
>> Could you provide an example of one of your calls?
>>
>> Carl
>>
>>
>>> On Jan 24, 2018, at 8:31 PM, Maxwell Klein <[hidden email]> wrote:
>>>
>>> I haven't looked at UPS's API, but the USPS and Stamps.com APIs did not look friendly.
>> Just started testing ShipEngine.com and it's been super easy so far, they support multiple carriers including UPS. Here are the REST API docs:
>>>
>>> https://docs.shipengine.com/docs
>>>
>>> The Pay-As-You-Go of 5¢ per shipment sees very reasonable given all the functionality,
>> plus you don't have to learn another API if you need more than UPS later on.
>>>
>>> -Max
>>>
>>>
>>>> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>>>>  Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
>>>> costs? I'm using Lasso 8.6 on a Mac.
>>>>  I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
>>>> supported anymore.
>>>>  Thanks,
>>>> Mike Ealy
>>>>    #############################################################
>>>>  This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy              Website Builder              Eugene, OR
> <[hidden email]>               <http://www.stevepiercy.com/>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

stevepiercy
1.  This might not be relevant because you're using Lasso 9, but
what version of macOS?  There is a known issue with libcurl on
certain versions, which might affect Lasso 9 (I know it affects
Lasso 8).  There is a workaround by installing curl via
homebrew, and calling that version instead.  See:

https://github.com/stevepiercy/AuthorizeNet_AIM/issues/5

2.  You should not use shell with Lasso 9 because it is designed
for Lasso 8.

Additionally when using third party APIs over HTTP, you can use
include_url for most situations, then either curl, or
sys_process to invoke curl, if necessary.  Use one of the
following Lasso 9 native types or methods in order of preference:

- include_url
- curl
- sys_process

Lasso's curl requires some patience and tweaking to get just
right.  Setting headers is troublesome, as shown in the example
below.  The documentation of Lasso's curl methods is
suboptimal.  sys_process is usually straightforward, but I was
not able to figure out how to get it to work in the example
below, which I included for completeness and comparison.

All that said, here are two methods, one each for include_url
and curl mixed together.

[
local(url) = 'https://api.shipengine.com/v1/rates'
local(c) = curl(#url)
local(headers) = staticarray(
     'Content-Type'='application/json',
     'api-key'='ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw')
local(data) = '{
   "shipment": {
     "validate_address": "no_validation",
     "ship_to": {
       "name": "Mickey and Minnie Mouse",
       "phone": "714-781-4565",
       "company_name": "The Walt Disney Company",
       "address_line1": "500 South Buena Vista Street",
       "city_locality": "Burbank",
       "state_province": "CA",
       "postal_code": "91521",
       "country_code": "US"
     },
     "ship_from": {
       "name": "Dade Murphy",
       "phone": "512-485-4282",
       "company_name": "Zero Cool",
       "address_line1": "345 Chambers Street",
       "address_line2": "Suite 100",
       "city_locality": "New York City",
       "state_province": "NY",
       "postal_code": "10282",
       "country_code": "US",
     },
     "packages": [
       {
         "weight": {
           "value": 1.0,
           "unit": "ounce"
         }
       }
     ]
   },
   "rate_options": {
     "carrier_ids": [
       "se-123890"
     ]
   }
}'



// curl method

local(curl_headers) = ''
local(delimit) = ''
with item in #headers
do {
     #curl_headers -> append(#delimit + #item->first + ': ' + #item->second)
     #delimit = '\r\n'
}

handle => { #c->close }
#c -> set(CURLOPT_VERBOSE, 0)
#c -> set(CURLOPT_POST, 1)
#c -> set(CURLOPT_POSTFIELDS, #data)
#c -> set(CURLOPT_HTTPHEADER, #curl_headers)

local(result) = #c -> result
#c -> close

'<textarea rows="20" cols="80">'
#result
'</textarea>'



// include_url method

#result = include_url(
     #url,
     -postparams=#data,
     -sendmimeheaders=#headers)

'<textarea rows="20" cols="80">'
#result
'</textarea>'



// sys_process failed attempt

local(cmd) = (#url
         + ' -X POST'
         + ' -H "Content-type: application/json"'
         + ' -H "api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw"'
         + ' -d \'' + #data + '\''
         )

local(proc) = sys_process('/usr/bin/curl', staticarray(#cmd))
local(outfoo)
'<textarea rows="20" cols="80">'
while(#proc->isOpen or #outfoo := #proc->readString) => {^
    #outfoo->asString->encodeHtml
^}
'</textarea>'
#proc->close

]

--steve


On 3/30/18 at 2:27 PM, [hidden email] (Carl Ketterling) pronounced:

>Well, I was hoping to see how someone else made the call
>(assuming it’s working for them) so that I could find my own
>problem.  But here goes.
>
>
>I have Lasso 9 running on macOS.
>
>I’m using the sample code for “Get Shipping Rates” from
>shipengine.com (https://docs.shipengine.com/docs/get-shipping-rates).
>
>If I copy and past their curl command, I get what I think is a
>complete response (over 700 lines).  When I use Lasso, I get a
>much shorter response (30 lines).
>
>Details below.
>
>Carl
>
>
># -------------------------------------------------------
># The Lasso Page
>
><?LassoScript
>
>local( theURL = 'https://api.shipengine.com/v1/rates' ) // RATES URL
>local( postData = '\'
>{
>"shipment": {
>"validate_address": "no_validation",
>"ship_to": {
>"name": "Mickey and Minnie Mouse",
>"phone": "714-781-4565",
>"company_name": "The Walt Disney Company",
>"address_line1": "500 South Buena Vista Street",
>"city_locality": "Burbank",
>"state_province": "CA",
>"postal_code": "91521",
>"country_code": "US"
>},
>"ship_from": {
>"name": "Dade Murphy",
>"phone": "512-485-4282",
>"company_name": "Zero Cool",
>"address_line1": "345 Chambers Street",
>"address_line2": "Suite 100",
>"city_locality": "New York City",
>"state_province": "NY",
>"postal_code": "10282",
>"country_code": "US",
>},
>"packages": [
>{
>"weight": {
>"value": 1.0,
>"unit": "ounce"
>}
>}
>]
>},
>"rate_options": {
>"carrier_ids": [
>"se-123890"
>]
>}
>}
>\'' )
>
>local( curlResult = shell( 'curl '
>+ #theURL
>+ ' -X ' + 'POST'
>+ ' -H ' + '"Content-Type: application/json"'
>+ ' -H ' + '"api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw"'
>+ ' -d ' + #postData )
>)
>
>#curlResult
>
>?>
>
># -------------------------------------------------------
># The Lasso Output
>
>: [],
>"packages": [
>{
>"package_code": "package",
>"weight": {
>"value": 1.00,
>"unit": "ounce"
>},
>"dimensions": {
>"unit": "inch",
>"length": 0.0,
>"width": 0.0,
>"height": 0.0
>},
>"insured_value": {
>"currency": "usd",
>"amount": 0.00
>},
>"label_messages": {
>"reference1": null,
>"reference2": null,
>"reference3": null
>}
>}
>],
>"total_weight": {
>"value": 1.00,
>"unit": "ounce"
>}
>}
>
>
># -------------------------------------------------------
># The cURL Command and Output
>
>$ curl 'https://api.shipengine.com/v1/rates' -X POST \
>>-H "Content-type: application/json" \
>>-H "api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw" \
>>-d '
>>{
>>"shipment": {
>>"validate_address": "no_validation",
>>"ship_to": {
>>"name": "Mickey and Minnie Mouse",
>>"phone": "714-781-4565",
>>"company_name": "The Walt Disney Company",
>>"address_line1": "500 South Buena Vista Street",
>>"city_locality": "Burbank",
>>"state_province": "CA",
>>"postal_code": "91521",
>>"country_code": "US"
>>},
>>"ship_from": {
>>"name": "Dade Murphy",
>>"phone": "512-485-4282",
>>"company_name": "Zero Cool",
>>"address_line1": "345 Chambers Street",
>>"address_line2": "Suite 100",
>>"city_locality": "New York City",
>>"state_province": "NY",
>>"postal_code": "10282",
>>"country_code": "US",
>>},
>>"packages": [
>>{
>>"weight": {
>>"value": 1.0,
>>"unit": "ounce"
>>}
>>}
>>]
>>},
>>"rate_options": {
>>"carrier_ids": [
>>"se-123890"
>>]
>>}
>>}'
>
>{
>"rate_response": {
>"rates": [
>{
>"rate_id": "se-12385913",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 0.47
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "letter",
>"delivery_days": 4,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-03T00:00:00Z",
>"carrier_delivery_days": "3",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS First Class Mail",
>"service_code": "usps_first_class_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385914",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 1.00
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "large_envelope_or_flat",
>"delivery_days": 4,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-03T00:00:00Z",
>"carrier_delivery_days": "3",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS First Class Mail",
>"service_code": "usps_first_class_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385915",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 2.66
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "package",
>"delivery_days": 4,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-03T00:00:00Z",
>"carrier_delivery_days": "3",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS First Class Mail",
>"service_code": "usps_first_class_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385916",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 7.53
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "package",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385917",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 12.45
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "medium_flat_rate_box",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385918",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 6.85
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "small_flat_rate_box",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385919",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 17.10
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "large_flat_rate_box",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385920",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 6.35
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_envelope",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385921",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 6.90
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_padded_envelope",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385922",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 10.75
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "regional_rate_box_a",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385923",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 20.98
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "regional_rate_box_b",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385924",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 6.65
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_legal_envelope",
>"delivery_days": 3,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail",
>"service_code": "usps_priority_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385925",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 29.87
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "package",
>"delivery_days": 2,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "1-2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail Express",
>"service_code": "usps_priority_mail_express",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385926",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 21.98
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_envelope",
>"delivery_days": 2,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "1-2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail Express",
>"service_code": "usps_priority_mail_express",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385927",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 22.46
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_padded_envelope",
>"delivery_days": 2,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "1-2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail Express",
>"service_code": "usps_priority_mail_express",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385928",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 22.09
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "flat_rate_legal_envelope",
>"delivery_days": 2,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-02T00:00:00Z",
>"carrier_delivery_days": "1-2",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Priority Mail Express",
>"service_code": "usps_priority_mail_express",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385929",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 2.66
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "package",
>"delivery_days": 8,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-07T00:00:00Z",
>"carrier_delivery_days": "7",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Media Mail",
>"service_code": "usps_media_mail",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>},
>{
>"rate_id": "se-12385930",
>"rate_type": "shipment",
>"carrier_id": "se-123890",
>"shipping_amount": {
>"currency": "usd",
>"amount": 7.75
>},
>"insurance_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"confirmation_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"other_amount": {
>"currency": "usd",
>"amount": 0.00
>},
>"zone": 8,
>"package_type": "package",
>"delivery_days": 8,
>"guaranteed_service": false,
>"estimated_delivery_date": "2018-04-07T00:00:00Z",
>"carrier_delivery_days": "7",
>"ship_date": "2018-03-30T00:00:00Z",
>"negotiated_rate": false,
>"service_type": "USPS Parcel Select Ground",
>"service_code": "usps_parcel_select",
>"trackable": true,
>"carrier_code": "stamps_com",
>"carrier_nickname": "Free",
>"carrier_friendly_name": "Stamps.com",
>"validation_status": "valid",
>"warning_messages": [],
>"error_messages": []
>}
>],
>"invalid_rates": [],
>"rate_request_id": "se-912762",
>"shipment_id": "se-219724633",
>"created_at": "2018-03-30T19:18:12.327Z",
>"status": "completed",
>"errors": []
>},
>"shipment_id": "se-219724633",
>"carrier_id": null,
>"service_code": null,
>"external_shipment_id": null,
>"ship_date": "2018-03-30T00:00:00Z",
>"created_at": "2018-03-30T19:18:11.18Z",
>"modified_at": "2018-03-30T19:18:11.18Z",
>"shipment_status": "pending",
>"ship_to": {
>"name": "Mickey and Minnie Mouse",
>"phone": "714-781-4565",
>"company_name": "The Walt Disney Company",
>"address_line1": "500 South Buena Vista Street",
>"address_line2": null,
>"address_line3": null,
>"city_locality": "Burbank",
>"state_province": "CA",
>"postal_code": "91521",
>"country_code": "US",
>"address_residential_indicator": "unknown"
>},
>"ship_from": {
>"name": "Dade Murphy",
>"phone": "512-485-4282",
>"company_name": "Zero Cool",
>"address_line1": "345 Chambers Street",
>"address_line2": "Suite 100",
>"address_line3": null,
>"city_locality": "New York City",
>"state_province": "NY",
>"postal_code": "10282",
>"country_code": "US",
>"address_residential_indicator": "unknown"
>},
>"warehouse_id": null,
>"return_to": {
>"name": "Dade Murphy",
>"phone": "512-485-4282",
>"company_name": "Zero Cool",
>"address_line1": "345 Chambers Street",
>"address_line2": "Suite 100",
>"address_line3": null,
>"city_locality": "New York City",
>"state_province": "NY",
>"postal_code": "10282",
>"country_code": "US",
>"address_residential_indicator": "unknown"
>},
>"confirmation": "none",
>"customs": null,
>"advanced_options": {
>"bill_to_account": null,
>"bill_to_country_code": null,
>"bill_to_party": null,
>"bill_to_postal_code": null,
>"contains_alcohol": false,
>"delivered_duty_paid": false,
>"non_machinable": false,
>"saturday_delivery": false,
>"freight_class": null,
>"custom_field1": null,
>"custom_field2": null,
>"custom_field3": null
>},
>"insurance_provider": "none",
>"tags": [],
>"packages": [
>{
>"package_code": "package",
>"weight": {
>"value": 1.00,
>"unit": "ounce"
>},
>"dimensions": {
>"unit": "inch",
>"length": 0.0,
>"width": 0.0,
>"height": 0.0
>},
>"insured_value": {
>"currency": "usd",
>"amount": 0.00
>},
>"label_messages": {
>"reference1": null,
>"reference2": null,
>"reference3": null
>}
>}
>],
>"total_weight": {
>"value": 1.00,
>"unit": "ounce"
>}
>}
>
>
>
>
>
>>On Mar 30, 2018, at 2:30 AM, Steve Piercy - Website Builder <[hidden email]> wrote:
>>
>>You don't provide sufficient information to help.
>>
>>What do you try?
>>
>>What do you expect to see?
>>
>>What do you observe?
>>
>>What is your operating system and version?
>>
>>--steve
>>
>>
>>On 3/30/18 at 12:09 AM, [hidden email] (Carl Ketterling) pronounced:
>>
>>> Max,
>>>   I’ve been trying to use ShipEngine.com, and I’m having
>>>problems.  Can you share what
>you’ve done?
>>>   Specifically, I’ve been having problems getting the
>>>correct data from the curl command.
>I’ve been using ‘shell’ tag from
>http://www.lassosoft.com/tagswap/detail/shell and wonder if
>that is the cause.
>>>   Could you provide an example of one of your calls?
>>>   Carl
>>>  
>>>> On Jan 24, 2018, at 8:31 PM, Maxwell Klein <[hidden email]> wrote:
>>>>   I haven't looked at UPS's API, but the USPS and
>>>>Stamps.com APIs did not look friendly.
>>> Just started testing ShipEngine.com and it's been super easy so far, they support
>multiple carriers including UPS. Here are the REST API docs:
>>>>   https://docs.shipengine.com/docs
>>>>   The Pay-As-You-Go of 5¢ per shipment sees very
>>>>reasonable given all the functionality,
>>> plus you don't have to learn another API if you need more than UPS later on.
>>>>   -Max
>>>>  
>>>>> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>>>>>  Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
>>>>> costs? I'm using Lasso 8.6 on a Mac.
>>>>>  I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
>>>>> supported anymore.
>>>>>  Thanks,
>>>>> Mike Ealy
>>>>>    #############################################################
>>>>>  This message is sent to you because you are subscribed to
>>>>> the mailing list Lasso [hidden email]
>>>>> Official list archives available at http://www.lassotalk.com
>>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>>> Send administrative queries to  <[hidden email]>
>>>>    #############################################################
>>>>   This message is sent to you because you are subscribed to
>>>> the mailing list Lasso [hidden email]
>>>> Official list archives available at http://www.lassotalk.com
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>    #############################################################
>>>   This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
>>Steve Piercy              Website Builder              Eugene, OR
>><[hidden email]>               <http://www.stevepiercy.com/>
>>
>>
>>#############################################################
>>
>>This message is sent to you because you are subscribed to
>>the mailing list Lasso [hidden email]
>>Official list archives available at http://www.lassotalk.com
>>To unsubscribe, E-mail to: <[hidden email]>
>>Send administrative queries to  <[hidden email]>
>
>
>#############################################################
>
>This message is sent to you because you are subscribed to
>the mailing list Lasso [hidden email]
>Official list archives available at http://www.lassotalk.com
>To unsubscribe, E-mail to: <[hidden email]>
>Send administrative queries to  <[hidden email]>

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Jolle Carlestam-2

> 31 mars 2018 kl. 09:59 skrev Steve Piercy - Website Builder <[hidden email]>:
>
> 2.  You should not use shell with Lasso 9 because it is designed for Lasso 8.

That’s not actually true. There’s an excellent translation of shell to Lasso 9 done by Jono, and then improved by me. I am using it a lot in my projects. It uses sys_process.
You can get it here:

https://gist.github.com/jolle-c/7e3a6a0d30a032573bb67eae423ff865

That said, I agree with Steve that in this case you could probably use Lasso 9 curl calls directly.


HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Brad Lindsay
In reply to this post by stevepiercy
One thing to add is that instead of using include_url or curl, you
could take a look at some classes I wrote to work with curl:

https://github.com/bfad/Lasso-HTTP

This was written in Lasso 9 for Lasso 9, and it should cover most of
what you need for web API requests in a nicer interface.

Brad



On March 31, 2018 at 2:59:15 AM, Steve Piercy - Website Builder
([hidden email]) wrote:

> 1. This might not be relevant because you're using Lasso 9, but
> what version of macOS? There is a known issue with libcurl on
> certain versions, which might affect Lasso 9 (I know it affects
> Lasso 8). There is a workaround by installing curl via
> homebrew, and calling that version instead. See:
>
> https://github.com/stevepiercy/AuthorizeNet_AIM/issues/5
>
> 2. You should not use shell with Lasso 9 because it is designed
> for Lasso 8.
>
> Additionally when using third party APIs over HTTP, you can use
> include_url for most situations, then either curl, or
> sys_process to invoke curl, if necessary. Use one of the
> following Lasso 9 native types or methods in order of preference:
>
> - include_url
> - curl
> - sys_process
>
> Lasso's curl requires some patience and tweaking to get just
> right. Setting headers is troublesome, as shown in the example
> below. The documentation of Lasso's curl methods is
> suboptimal. sys_process is usually straightforward, but I was
> not able to figure out how to get it to work in the example
> below, which I included for completeness and comparison.
>
> All that said, here are two methods, one each for include_url
> and curl mixed together.
>
> [
> local(url) = 'https://api.shipengine.com/v1/rates'
> local(c) = curl(#url)
> local(headers) = staticarray(
> 'Content-Type'='application/json',
> 'api-key'='ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw')
> local(data) = '{
> "shipment": {
> "validate_address": "no_validation",
> "ship_to": {
> "name": "Mickey and Minnie Mouse",
> "phone": "714-781-4565",
> "company_name": "The Walt Disney Company",
> "address_line1": "500 South Buena Vista Street",
> "city_locality": "Burbank",
> "state_province": "CA",
> "postal_code": "91521",
> "country_code": "US"
> },
> "ship_from": {
> "name": "Dade Murphy",
> "phone": "512-485-4282",
> "company_name": "Zero Cool",
> "address_line1": "345 Chambers Street",
> "address_line2": "Suite 100",
> "city_locality": "New York City",
> "state_province": "NY",
> "postal_code": "10282",
> "country_code": "US",
> },
> "packages": [
> {
> "weight": {
> "value": 1.0,
> "unit": "ounce"
> }
> }
> ]
> },
> "rate_options": {
> "carrier_ids": [
> "se-123890"
> ]
> }
> }'
>
>
>
> // curl method
>
> local(curl_headers) = ''
> local(delimit) = ''
> with item in #headers
> do {
> #curl_headers -> append(#delimit + #item->first + ': ' + #item->second)
> #delimit = '\r\n'
> }
>
> handle => { #c->close }
> #c -> set(CURLOPT_VERBOSE, 0)
> #c -> set(CURLOPT_POST, 1)
> #c -> set(CURLOPT_POSTFIELDS, #data)
> #c -> set(CURLOPT_HTTPHEADER, #curl_headers)
>
> local(result) = #c -> result
> #c -> close
>
> ''
>
>
>
> // include_url method
>
> #result = include_url(
> #url,
> -postparams=#data,
> -sendmimeheaders=#headers)
>
> ''
>
>
>
> // sys_process failed attempt
>
> local(cmd) = (#url
> + ' -X POST'
> + ' -H "Content-type: application/json"'
> + ' -H "api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw"'
> + ' -d \'' + #data + '\''
> )
>
> local(proc) = sys_process('/usr/bin/curl', staticarray(#cmd))
> local(outfoo)
> ''
> #proc->close
>
> ]
>
> --steve
>
>
> On 3/30/18 at 2:27 PM, [hidden email] (Carl Ketterling) pronounced:
>
> >Well, I was hoping to see how someone else made the call
> >(assuming it’s working for them) so that I could find my own
> >problem. But here goes.
> >
> >
> >I have Lasso 9 running on macOS.
> >
> >I’m using the sample code for “Get Shipping Rates” from
> >shipengine.com (https://docs.shipengine.com/docs/get-shipping-rates).
> >
> >If I copy and past their curl command, I get what I think is a
> >complete response (over 700 lines). When I use Lasso, I get a
> >much shorter response (30 lines).
> >
> >Details below.
> >
> >Carl
> >
> >
> ># -------------------------------------------------------
> ># The Lasso Page
> >
> >> >
> >local( theURL = 'https://api.shipengine.com/v1/rates' ) // RATES URL
> >local( postData = '\'
> >{
> >"shipment": {
> >"validate_address": "no_validation",
> >"ship_to": {
> >"name": "Mickey and Minnie Mouse",
> >"phone": "714-781-4565",
> >"company_name": "The Walt Disney Company",
> >"address_line1": "500 South Buena Vista Street",
> >"city_locality": "Burbank",
> >"state_province": "CA",
> >"postal_code": "91521",
> >"country_code": "US"
> >},
> >"ship_from": {
> >"name": "Dade Murphy",
> >"phone": "512-485-4282",
> >"company_name": "Zero Cool",
> >"address_line1": "345 Chambers Street",
> >"address_line2": "Suite 100",
> >"city_locality": "New York City",
> >"state_province": "NY",
> >"postal_code": "10282",
> >"country_code": "US",
> >},
> >"packages": [
> >{
> >"weight": {
> >"value": 1.0,
> >"unit": "ounce"
> >}
> >}
> >]
> >},
> >"rate_options": {
> >"carrier_ids": [
> >"se-123890"
> >]
> >}
> >}
> >\'' )
> >
> >local( curlResult = shell( 'curl '
> >+ #theURL
> >+ ' -X ' + 'POST'
> >+ ' -H ' + '"Content-Type: application/json"'
> >+ ' -H ' + '"api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw"'
> >+ ' -d ' + #postData )
> >)
> >
> >#curlResult
> >
> >?>
> >
> ># -------------------------------------------------------
> ># The Lasso Output
> >
> >: [],
> >"packages": [
> >{
> >"package_code": "package",
> >"weight": {
> >"value": 1.00,
> >"unit": "ounce"
> >},
> >"dimensions": {
> >"unit": "inch",
> >"length": 0.0,
> >"width": 0.0,
> >"height": 0.0
> >},
> >"insured_value": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"label_messages": {
> >"reference1": null,
> >"reference2": null,
> >"reference3": null
> >}
> >}
> >],
> >"total_weight": {
> >"value": 1.00,
> >"unit": "ounce"
> >}
> >}
> >
> >
> ># -------------------------------------------------------
> ># The cURL Command and Output
> >
> >$ curl 'https://api.shipengine.com/v1/rates' -X POST \
> >>-H "Content-type: application/json" \
> >>-H "api-key: ElJkhJuQIRoFq/kDEblco4LpZqRCdYNIoAVG7SywSXw" \
> >>-d '
> >>{
> >>"shipment": {
> >>"validate_address": "no_validation",
> >>"ship_to": {
> >>"name": "Mickey and Minnie Mouse",
> >>"phone": "714-781-4565",
> >>"company_name": "The Walt Disney Company",
> >>"address_line1": "500 South Buena Vista Street",
> >>"city_locality": "Burbank",
> >>"state_province": "CA",
> >>"postal_code": "91521",
> >>"country_code": "US"
> >>},
> >>"ship_from": {
> >>"name": "Dade Murphy",
> >>"phone": "512-485-4282",
> >>"company_name": "Zero Cool",
> >>"address_line1": "345 Chambers Street",
> >>"address_line2": "Suite 100",
> >>"city_locality": "New York City",
> >>"state_province": "NY",
> >>"postal_code": "10282",
> >>"country_code": "US",
> >>},
> >>"packages": [
> >>{
> >>"weight": {
> >>"value": 1.0,
> >>"unit": "ounce"
> >>}
> >>}
> >>]
> >>},
> >>"rate_options": {
> >>"carrier_ids": [
> >>"se-123890"
> >>]
> >>}
> >>}'
> >
> >{
> >"rate_response": {
> >"rates": [
> >{
> >"rate_id": "se-12385913",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 0.47
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "letter",
> >"delivery_days": 4,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-03T00:00:00Z",
> >"carrier_delivery_days": "3",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS First Class Mail",
> >"service_code": "usps_first_class_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385914",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 1.00
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "large_envelope_or_flat",
> >"delivery_days": 4,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-03T00:00:00Z",
> >"carrier_delivery_days": "3",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS First Class Mail",
> >"service_code": "usps_first_class_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385915",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 2.66
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "package",
> >"delivery_days": 4,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-03T00:00:00Z",
> >"carrier_delivery_days": "3",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS First Class Mail",
> >"service_code": "usps_first_class_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385916",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 7.53
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "package",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385917",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 12.45
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "medium_flat_rate_box",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385918",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 6.85
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "small_flat_rate_box",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385919",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 17.10
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "large_flat_rate_box",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385920",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 6.35
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_envelope",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385921",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 6.90
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_padded_envelope",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385922",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 10.75
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "regional_rate_box_a",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385923",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 20.98
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "regional_rate_box_b",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385924",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 6.65
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_legal_envelope",
> >"delivery_days": 3,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail",
> >"service_code": "usps_priority_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385925",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 29.87
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "package",
> >"delivery_days": 2,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "1-2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail Express",
> >"service_code": "usps_priority_mail_express",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385926",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 21.98
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_envelope",
> >"delivery_days": 2,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "1-2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail Express",
> >"service_code": "usps_priority_mail_express",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385927",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 22.46
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_padded_envelope",
> >"delivery_days": 2,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "1-2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail Express",
> >"service_code": "usps_priority_mail_express",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385928",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 22.09
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "flat_rate_legal_envelope",
> >"delivery_days": 2,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-02T00:00:00Z",
> >"carrier_delivery_days": "1-2",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Priority Mail Express",
> >"service_code": "usps_priority_mail_express",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385929",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 2.66
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "package",
> >"delivery_days": 8,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-07T00:00:00Z",
> >"carrier_delivery_days": "7",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Media Mail",
> >"service_code": "usps_media_mail",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >},
> >{
> >"rate_id": "se-12385930",
> >"rate_type": "shipment",
> >"carrier_id": "se-123890",
> >"shipping_amount": {
> >"currency": "usd",
> >"amount": 7.75
> >},
> >"insurance_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"confirmation_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"other_amount": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"zone": 8,
> >"package_type": "package",
> >"delivery_days": 8,
> >"guaranteed_service": false,
> >"estimated_delivery_date": "2018-04-07T00:00:00Z",
> >"carrier_delivery_days": "7",
> >"ship_date": "2018-03-30T00:00:00Z",
> >"negotiated_rate": false,
> >"service_type": "USPS Parcel Select Ground",
> >"service_code": "usps_parcel_select",
> >"trackable": true,
> >"carrier_code": "stamps_com",
> >"carrier_nickname": "Free",
> >"carrier_friendly_name": "Stamps.com",
> >"validation_status": "valid",
> >"warning_messages": [],
> >"error_messages": []
> >}
> >],
> >"invalid_rates": [],
> >"rate_request_id": "se-912762",
> >"shipment_id": "se-219724633",
> >"created_at": "2018-03-30T19:18:12.327Z",
> >"status": "completed",
> >"errors": []
> >},
> >"shipment_id": "se-219724633",
> >"carrier_id": null,
> >"service_code": null,
> >"external_shipment_id": null,
> >"ship_date": "2018-03-30T00:00:00Z",
> >"created_at": "2018-03-30T19:18:11.18Z",
> >"modified_at": "2018-03-30T19:18:11.18Z",
> >"shipment_status": "pending",
> >"ship_to": {
> >"name": "Mickey and Minnie Mouse",
> >"phone": "714-781-4565",
> >"company_name": "The Walt Disney Company",
> >"address_line1": "500 South Buena Vista Street",
> >"address_line2": null,
> >"address_line3": null,
> >"city_locality": "Burbank",
> >"state_province": "CA",
> >"postal_code": "91521",
> >"country_code": "US",
> >"address_residential_indicator": "unknown"
> >},
> >"ship_from": {
> >"name": "Dade Murphy",
> >"phone": "512-485-4282",
> >"company_name": "Zero Cool",
> >"address_line1": "345 Chambers Street",
> >"address_line2": "Suite 100",
> >"address_line3": null,
> >"city_locality": "New York City",
> >"state_province": "NY",
> >"postal_code": "10282",
> >"country_code": "US",
> >"address_residential_indicator": "unknown"
> >},
> >"warehouse_id": null,
> >"return_to": {
> >"name": "Dade Murphy",
> >"phone": "512-485-4282",
> >"company_name": "Zero Cool",
> >"address_line1": "345 Chambers Street",
> >"address_line2": "Suite 100",
> >"address_line3": null,
> >"city_locality": "New York City",
> >"state_province": "NY",
> >"postal_code": "10282",
> >"country_code": "US",
> >"address_residential_indicator": "unknown"
> >},
> >"confirmation": "none",
> >"customs": null,
> >"advanced_options": {
> >"bill_to_account": null,
> >"bill_to_country_code": null,
> >"bill_to_party": null,
> >"bill_to_postal_code": null,
> >"contains_alcohol": false,
> >"delivered_duty_paid": false,
> >"non_machinable": false,
> >"saturday_delivery": false,
> >"freight_class": null,
> >"custom_field1": null,
> >"custom_field2": null,
> >"custom_field3": null
> >},
> >"insurance_provider": "none",
> >"tags": [],
> >"packages": [
> >{
> >"package_code": "package",
> >"weight": {
> >"value": 1.00,
> >"unit": "ounce"
> >},
> >"dimensions": {
> >"unit": "inch",
> >"length": 0.0,
> >"width": 0.0,
> >"height": 0.0
> >},
> >"insured_value": {
> >"currency": "usd",
> >"amount": 0.00
> >},
> >"label_messages": {
> >"reference1": null,
> >"reference2": null,
> >"reference3": null
> >}
> >}
> >],
> >"total_weight": {
> >"value": 1.00,
> >"unit": "ounce"
> >}
> >}
> >
> >
> >
> >
> >
> >>On Mar 30, 2018, at 2:30 AM, Steve Piercy - Website Builder
> wrote:
> >>
> >>You don't provide sufficient information to help.
> >>
> >>What do you try?
> >>
> >>What do you expect to see?
> >>
> >>What do you observe?
> >>
> >>What is your operating system and version?
> >>
> >>--steve
> >>
> >>
> >>On 3/30/18 at 12:09 AM, [hidden email] (Carl Ketterling) pronounced:
> >>
> >>> Max,
> >>> I’ve been trying to use ShipEngine.com, and I’m having
> >>>problems. Can you share what
> >you’ve done?
> >>> Specifically, I’ve been having problems getting the
> >>>correct data from the curl command.
> >I’ve been using ‘shell’ tag from
> >http://www.lassosoft.com/tagswap/detail/shell and wonder if
> >that is the cause.
> >>> Could you provide an example of one of your calls?
> >>> Carl
> >>>
> >>>> On Jan 24, 2018, at 8:31 PM, Maxwell Klein wrote:
> >>>> I haven't looked at UPS's API, but the USPS and
> >>>>Stamps.com APIs did not look friendly.
> >>> Just started testing ShipEngine.com and it's been super easy so far, they support
> >multiple carriers including UPS. Here are the REST API docs:
> >>>> https://docs.shipengine.com/docs
> >>>> The Pay-As-You-Go of 5¢ per shipment sees very
> >>>>reasonable given all the functionality,
> >>> plus you don't have to learn another API if you need more than UPS later on.
> >>>> -Max
> >>>>
> >>>>> On Jan 24, 2018, at 1:37 PM, Mike Ealy wrote:
> >>>>> Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
> >>>>> costs? I'm using Lasso 8.6 on a Mac.
> >>>>> I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
> >>>>> supported anymore.
> >>>>> Thanks,
> >>>>> Mike Ealy
> >>>>> #############################################################
> >>>>> This message is sent to you because you are subscribed to
> >>>>> the mailing list Lasso [hidden email]
> >>>>> Official list archives available at http://www.lassotalk.com
> >>>>> To unsubscribe, E-mail to:
> >>>>> Send administrative queries to
> >>>> #############################################################
> >>>> This message is sent to you because you are subscribed to
> >>>> the mailing list Lasso [hidden email]
> >>>> Official list archives available at http://www.lassotalk.com
> >>>> To unsubscribe, E-mail to:
> >>>> Send administrative queries to
> >>> #############################################################
> >>> This message is sent to you because you are subscribed to
> >>> the mailing list Lasso [hidden email]
> >>> Official list archives available at http://www.lassotalk.com
> >>> To unsubscribe, E-mail to:
> >>> Send administrative queries to
> >>
> >>-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> >>Steve Piercy Website Builder Eugene, OR
> >>
> >>
> >>
> >>#############################################################
> >>
> >>This message is sent to you because you are subscribed to
> >>the mailing list Lasso [hidden email]
> >>Official list archives available at http://www.lassotalk.com
> >>To unsubscribe, E-mail to:
> >>Send administrative queries to
> >
> >
> >#############################################################
> >
> >This message is sent to you because you are subscribed to
> >the mailing list Lasso [hidden email]
> >Official list archives available at http://www.lassotalk.com
> >To unsubscribe, E-mail to:
> >Send administrative queries to
>
> -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
> Steve Piercy Website Builder Eugene, OR
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
> the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to:
> Send administrative queries to

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Jolle Carlestam-2
In reply to this post by Jolle Carlestam-2
WTD?

Why is this popping up now? I wrote and sent it April 3D.
I could have had a paper mail delivered by boat and it would have arrived faster.

Wake up, Lassosoft!

HDB
Jolle

Sent from a mobile device. Any anomalies is due to Autocorrect.

> 3 apr. 2018 kl. 05:03 skrev Jolle Carlestam <[hidden email]>:
>
>
>> 31 mars 2018 kl. 09:59 skrev Steve Piercy - Website Builder <[hidden email]>:
>>
>> 2.  You should not use shell with Lasso 9 because it is designed for Lasso 8.
>
> That’s not actually true. There’s an excellent translation of shell to Lasso 9 done by Jono, and then improved by me. I am using it a lot in my projects. It uses sys_process.
> You can get it here:
>
> https://gist.github.com/jolle-c/7e3a6a0d30a032573bb67eae423ff865
>
> That said, I agree with Steve that in this case you could probably use Lasso 9 curl calls directly.
>
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

Jolle Carlestam-2
In reply to this post by Brad Lindsay
Hey, Brad!
Nice to see you’re still alive.

I can second Brads recommendation. His request and response types are really nice and useful.

HDB
Jolle

Sent from a mobile device. Any anomalies is due to Autocorrect.

> 6 apr. 2018 kl. 14:35 skrev Brad Lindsay <[hidden email]>:
>
> One thing to add is that instead of using include_url or curl, you
> could take a look at some classes I wrote to work with curl:
>
> https://github.com/bfad/Lasso-HTTP
>
> This was written in Lasso 9 for Lasso 9, and it should cover most of
> what you need for web API requests in a nicer interface.
>
> Brad


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

stevepiercy
In reply to this post by Jolle Carlestam-2
On 4/3/18 at 5:03 AM, [hidden email] (Jolle Carlestam) pronounced:

>
>>31 mars 2018 kl. 09:59 skrev Steve Piercy - Website Builder <[hidden email]>:
>>
>>2.  You should not use shell with Lasso 9 because it is designed for Lasso 8.
>
>That’s not actually true. There’s an excellent translation
>of shell to Lasso 9 done by Jono, and then improved by me. I am
>using it a lot in my projects. It uses sys_process.
>You can get it here:
>
>https://gist.github.com/jolle-c/7e3a6a0d30a032573bb67eae423ff865

He was using shell which is for Lasso 8, not shell_9 for Lasso 9:
http://www.lassosoft.com/tagswap/detail/shell_9

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy              Website Builder              Eugene, OR
<[hidden email]>               <http://www.stevepiercy.com/>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: UPS Rates

maxwellk2
In reply to this post by Carl Ketterling
Hi Carl,

Showing up a bit late to the discussion, but it looks like you got some good feedback. Unfortunately my ShipEngine project is stuck in Lasso 8.6, so I hacked together some code borrowed from Steve's Authorize_Net tags, which addresses Lasso 8.6's lack of support for TLS, and uses Jason Huck's shell tag as well:

        https://github.com/stevepiercy/AuthorizeNet_AIM
        http://www.lassosoft.com/tagswap/detail/shell

The Lasso site is currently only using ShipEngine for address validation, the workflow required the core shipping work to be done in the client's office system using FileMaker. BTW, FileMaker finally has real built-in cURL and JSON functions, made the integration with ShipEngine a total breeze.

Since this is for Lasso 8 it likely won't help too much, as recommended I would much rather be using Lasso 9's include_url, but here's the basic code snippets as requested...


        local( 'posturl' = 'https://api.shipengine.com/v1/addresses/validate'
          , 'curl' = string
          , 'address' = map
          , 'response' = map
          );
         
        #address -> insert( 'address_line1' = $f -> getvalue( -name = 'shipping_address_line1' ) );
        #address -> insert( 'address_line2' = $f -> getvalue( -name = 'shipping_address_line2' ) );
        #address -> insert( 'city_locality' = $f -> getvalue( -name = 'shipping_city_locality' ) );
        #address -> insert( 'state_province' = $f -> getvalue( -name = 'shipping_state_province' ) );
        #address -> insert( 'postal_code' = $f -> getvalue( -name = 'shipping_postal_code' ) );
        #address -> insert( 'country_code' = $f -> getvalue( -name = 'shipping_ country_code' ) );
       
         #curl += 'curl -X POST ' + #posturl;
         #curl += ' -d \'' + encode_json( array( #original_address ) ) + '\'';
         #curl += ' -H \'Content-Type: application/json\'';
         #curl += ' -H \'api-key: <<enter_api-key_here>>\'';
         #curl += ' --tlsv1.2';
       
        #response = decode_json( string( shell( #curl ) ) ) ;
       

After that you have to pick apart the #response map and fish out what you need from ShipEngine, but their docs are pretty good.

-Max



> On Mar 29, 2018, at 10:09 PM, Carl Ketterling <[hidden email]> wrote:
>
> Max,
>
> I’ve been trying to use ShipEngine.com, and I’m having problems.  Can you share what you’ve done?
>
> Specifically, I’ve been having problems getting the correct data from the curl command.  I’ve been using ‘shell’ tag from http://www.lassosoft.com/tagswap/detail/shell and wonder if that is the cause.
>
> Could you provide an example of one of your calls?
>
> Carl
>
>
>> On Jan 24, 2018, at 8:31 PM, Maxwell Klein <[hidden email]> wrote:
>>
>> I haven't looked at UPS's API, but the USPS and Stamps.com APIs did not look friendly. Just started testing ShipEngine.com and it's been super easy so far, they support multiple carriers including UPS. Here are the REST API docs:
>>
>> https://docs.shipengine.com/docs
>>
>> The Pay-As-You-Go of 5¢ per shipment sees very reasonable given all the functionality, plus you don't have to learn another API if you need more than UPS later on.
>>
>> -Max
>>
>>
>>> On Jan 24, 2018, at 1:37 PM, Mike Ealy <[hidden email]> wrote:
>>>
>>> Can anyone suggest a solution to pass parameters to UPS to retrieve shipping
>>> costs? I'm using Lasso 8.6 on a Mac.
>>>
>>> I remember using TC_UPS_RateQuote years ago but it doesn't seem to be
>>> supported anymore.
>>>
>>> Thanks,
>>> Mike Ealy
>>>
>>>
>>>
>>> #############################################################
>>>
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso [hidden email]
>>> Official list archives available at http://www.lassotalk.com
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso [hidden email]
>> Official list archives available at http://www.lassotalk.com
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>