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=MX

This 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:

DISCOUNTTake amount off the quote
INCREASEAdd amount
FIXEDCharge exactly amount, ignoring the quote
OMITDo 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_id references 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:

  1. Cover the whole range you ship. A weight that falls in no bracket has no fallback — you are back to showing nothing.
  2. national and international are separate tables. Configuring one leaves the other without a fallback. Reading them back returns null for the side you have not set — that null is 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

OperationReference
Carriers you can offerGET /checkout/carriers-available
Carriers active at a shopGET /checkout/{shop_id}/carriers
Set active carriersPOST /checkout/{shop_id}/carriers
Remove one carrierDELETE .../carriers/{carrier_id}
Set services and aliasesPOST .../carriers/{carrier_id}/services
Turn off checkoutDELETE /checkout/{shop_id}
List price rulesGET /checkout-rules
Create price rulePOST /checkout-rules
Update price rulePUT /checkout-rules/{id}
Delete price ruleDELETE /checkout-rules/{id}
Products in a ruleGET · POST · DELETE
Carriers in a ruleGET · POST · DELETE
Carriers a rule can useGET /checkout-rule-available-carriers/...
Get backup ratesGET /checkout-backup-rules/{shop_id}
Set backup ratesPOST /checkout-backup-rules/{shop_id}
Update a backup tablePUT .../{rule_id}
Delete a backup tableDELETE .../{rule_id}

Next steps


Did this page help you?