Skip to content

Commit

Permalink
Merge pull request #140 from EasyPost/curl_batch_buy
Browse files Browse the repository at this point in the history
curl batch buy
  • Loading branch information
Justintime50 authored Jun 25, 2024
2 parents 87c74e9 + 989aabb commit b79c16e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions official/docs/curl/current/batches/buy.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
curl -X POST https://api.easypost.com/v2/batches \
-u "EASYPOST_API_KEY": \
-H 'Content-Type: application/json' \
-d '{
"batch": {
"shipments": [
"from_address": {"id": "adr_..."},
"to_address": {"id": "adr_..."},
"parcel": {"id": "prcl_..."},
"service": "First",
"carrier": "USPS",
"carrier_accounts": ["ca_..."]
]
}
}'

curl -X POST https://api.easypost.com/v2/batches/batch_.../buy \
-u "EASYPOST_API_KEY":
2 changes: 1 addition & 1 deletion official/docs/python/current/batches/buy.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
],
)

batch = client.batch.buy(createdBatch["id"])
batch = client.batch.buy(createdBatch.id)

print(batch)

0 comments on commit b79c16e

Please sign in to comment.