Checkout
Choose which carriers and services your buyers see at checkout, and what each one is called.
When a buyer reaches checkout on a connected store, they choose a shipping option. These operations decide which options exist and what they are named.
The three levels
Shop checkout
├── Carrier which carriers appear POST /checkout/{shop_id}/carriers
│ └── Services which of its services appear POST .../carriers/{carrier_id}/services
│ └── alias what the buyer reads "Entrega en 2 días"
└── off stop offering shipping DELETE /checkout/{shop_id}
1. See what you can offer
API reference → List carriers you can offer at checkout
curl -G https://queries.test.envia.com/checkout/carriers-available \
-H "Authorization: Bearer $ENVIA_TOKEN" \
-d shop_id=1204 -d country_code=MXThis is what is possible for your account. What is currently active on the shop is a different call: Get checkout carriers.
2. Decide which carriers appear
API reference → Set which carriers appear at checkout
curl -X POST https://queries.test.envia.com/checkout/1204/carriers \
-H "Authorization: Bearer $ENVIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "carrier_ids": [12, 45, 7] }'
This replaces the list, it does not add to it. Send every carrier you want active, not just the new one.An empty array turns them all off and leaves the buyer with no shipping options at checkout — which looks like a broken store, not a disabled one. If that is what you mean, use Turn off checkout instead.
To remove a single carrier without touching the rest, use Remove one carrier. It is safer than rebuilding the list.
3. Choose services, and name them for a human
API reference → Choose which services of a carrier appear
This is the part that changes conversion:
curl -X POST https://queries.test.envia.com/checkout/1204/carriers/12/services \
-H "Authorization: Bearer $ENVIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"services": [
{ "service_id": 6, "alias": "Entrega en 2 días" },
{ "service_id": 18, "alias": "Entrega al día siguiente" },
{ "service_id": 22, "alias": null }
]
}'alias is what the buyer reads. Without it they see the carrier's internal name — "DHL Economy Select" — which tells them nothing about when the parcel arrives, the only thing they care about at that moment.
Set alias: null to keep the carrier's own name.
This also replaces the list of services for that carrier.
Turning it off
API reference → Turn off checkout for a shop
curl -X DELETE https://queries.test.envia.com/checkout/1204 \
-H "Authorization: Bearer $ENVIA_TOKEN"The configuration is kept. Turning checkout back on later does not mean building it again.
Adjusting the price the buyer sees
Checkout price rules change what the buyer is charged for shipping, based on the order's value or weight.
Free shipping over a threshold is one of these:
curl -X POST https://queries.test.envia.com/checkout-rules \
-H "Authorization: Bearer $ENVIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"shop_id": 1204,
"name": "Envío gratis desde $999",
"type": "Money",
"measurement": "MXN",
"min": 999,
"amount_type": "FIXED",
"amount": 0,
"international": 0,
"active": 1,
"operation_id": 1
}'amount_type decides what happens to the price:
DISCOUNT | Take amount off the quote |
INCREASE | Add amount |
FIXED | Charge exactly amount, ignoring the quote |
OMIT | Do not offer the option at all |
Scope a rule geographically with selected_country_code, selected_state_code and selected_city_code — null applies everywhere — and narrow it to specific carriers or products.
operation_idreferences an internal price-operations catalog that is not exposed by the API today. Ask support for the value you need. It is a known gap.
When the quote fails
If a carrier's API is down, the route has no coverage, or the request times out, there is no live price to show. Without a fallback, checkout shows no shipping options at all — and the buyer leaves. It is the difference between a degraded checkout and a broken one.
A backup rate is a static weight-bracket table used in exactly that moment:
curl -X POST https://queries.test.envia.com/checkout-backup-rules/1204 \
-H "Authorization: Bearer $ENVIA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"national": {
"name": "Envío estándar",
"unitWeight": "KG",
"currency": "MXN",
"deliveryTime": 5,
"items": [
{ "min": 0, "max": 1, "price": 99 },
{ "min": 1, "max": 5, "price": 149 },
{ "min": 5, "max": 20, "price": 249 }
]
}
}'Two things to get right:
- Cover the whole range you ship. A weight that falls in no bracket has no fallback — you are back to showing nothing.
nationalandinternationalare separate tables. Configuring one leaves the other without a fallback. Reading them back returnsnullfor the side you have not set — thatnullis worth alerting on.
Where this sits
Checkout decides what the buyer can pick. Shipping rules decide what you actually ship it with once the order arrives. They are different layers, and it is normal for them to disagree: the buyer picks "2-day delivery", your rules pick the carrier that serves that promise at the best price.
Endpoints
| Operation | Reference |
|---|---|
| Carriers you can offer | GET /checkout/carriers-available |
| Carriers active at a shop | GET /checkout/{shop_id}/carriers |
| Set active carriers | POST /checkout/{shop_id}/carriers |
| Remove one carrier | DELETE .../carriers/{carrier_id} |
| Set services and aliases | POST .../carriers/{carrier_id}/services |
| Turn off checkout | DELETE /checkout/{shop_id} |
| List price rules | GET /checkout-rules |
| Create price rule | POST /checkout-rules |
| Update price rule | PUT /checkout-rules/{id} |
| Delete price rule | DELETE /checkout-rules/{id} |
| Products in a rule | GET · POST · DELETE |
| Carriers in a rule | GET · POST · DELETE |
| Carriers a rule can use | GET /checkout-rule-available-carriers/... |
| Get backup rates | GET /checkout-backup-rules/{shop_id} |
| Set backup rates | POST /checkout-backup-rules/{shop_id} |
| Update a backup table | PUT .../{rule_id} |
| Delete a backup table | DELETE .../{rule_id} |
Next steps
Assign a service to each store order automatically, with no one choosing by hand.
Define where you ship and which carriers serve each place, then check coverage at runtime.
Show live shipping rates at checkout, and create the label when the order is placed.
Updated 18 days ago