Conversation
holtbp
commented
Aug 10, 2022
| # Create a flight estimate | ||
| distance_m = 1_000_000 # Pass in the distance traveled in meters | ||
| patch.estimates.create_mass_estimate(distance_m=distance_m) | ||
| patch.estimates.create_flight_estimate(distance_m=distance_m) |
pcothenet
approved these changes
Aug 10, 2022
Contributor
Author
>>> import os
>>> import patch_api
>>> patch = patch_api.ApiClient(api_key=os.environ.get('SANDBOX_API_KEY'))
>>> distance_m = 1_000_000 # Pass in the distance traveled in meters
>>> transportation_method = "rail"
>>> package_mass_g = 5000
>>> estimate = patch.estimates.create_ecommerce_estimate(
... distance_m=distance_m,
... transportation_method=transportation_method,
... package_mass_g=package_mass_g
... )
>>> print(estimate)
{'data': {'id': 'est_test_d43572a2c2e992dcbce24cb666c82a42',
'mass_g': 69,
'order': None,
'production': False,
'type': 'ecommerce'},
'error': None,
'success': True} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
patch.estimates.create_ecommerce_estimatemethodWhy
New endpoint for our ecommerce customers!
SDK Release Checklist