Quickstart
This guide will get you all set up and ready to use the Price2b API. We'll cover how to generate your API token, authenticate requests, and make your first API call to list your products.
Before you can make requests to the Price2b API, you need to generate an API token from your account dashboard at Account Settings → API Tokens.
Generate your API token
- Log in to your Price2b account at app.price2b.com
- Navigate to Account Settings → API Tokens
- Click Create New Token
- Select the scopes you need (e.g.,
inventory:read,shipping:write) - Copy your token immediately—it won't be shown again
Make your first request
With your API token ready, you can make your first API request. Let's retrieve your product inventory to verify everything is working.
Request
GET
/v1/inventory/productscurl -G https://app.price2b.com/api/v1/inventory/products \
-H "Authorization: Bearer {your_token}" \
-H "Accept: application/json" \
-d per_page=5
Response
{
"success": true,
"data": {
"products": [
{
"id": 12345,
"sku": "PROD-001",
"name": "Wireless Headphones",
"price": 49.99,
"currency": "USD",
"stock_quantity": 150,
"status": "active"
}
],
"pagination": {
"current_page": 1,
"per_page": 5,
"total": 150,
"last_page": 30
}
}
}
Common workflows
Here are the most common workflows you'll use with the Price2b API:
Calculate DDP for international shipping
cURL
curl -X POST https://app.price2b.com/api/v1/customs/calculate \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"destination_country": "AR",
"origin_country": "CN",
"declared_value": 100.00,
"currency": "USD",
"weight": 0.5,
"hs_code": "8518300000"
}'
Get shipping quotes
cURL
curl -X POST https://app.price2b.com/api/v1/shipping/quotes \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"origin": {"country": "US", "postal_code": "33166"},
"destination": {"country": "AR", "postal_code": "C1043"},
"packages": [{"weight": 2.5, "length": 30, "width": 20, "height": 15}],
"declared_value": 150.00,
"include_ddp": true
}'
Create a shipment with label
cURL
curl -X POST https://app.price2b.com/api/v1/shipping/shipments \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"quote_id": "QT-2026-001234",
"selected_rate_index": 0,
"shipper": {...},
"recipient": {...}
}'
What's next?
Now that you've made your first API request, explore these resources:
- Authentication — Learn about token scopes and permissions
- Inventory API — Manage products and stock levels
- Shipping API — Get quotes and create shipments
- Customs API — Calculate DDP and duties
- Errors — Understand error codes and responses