API Docs

Endpoint: https://api.autopacksafe.com/v1

Note: All authenticated endpoints require the following header:

x-api-key: YOUR_API_KEY_HERE

Request your API key from your insurance advisor.

Example payload:

{
            "email": "correo@mail.com",
            "password": "123456789"
          }

Expected response:

{
        "success": true,
        "status": 200,
        "message": "Successful login.",
        "data": {
          "client": {
            "first_name": "Laura",
            "last_name": "Hernández",
            "email": "correo@mail.com",
            "phone": "33333333",
            "company_name": "Empresa"
          },
          "token": "**********"
        }
      }

Possible errors:

  • 400 Bad Request: Invalid input data or missing fields.
  • 401 Unauthorized: Incorrect credentials.
  • 500 Internal Server Error: Unexpected server error.

Get Quote

URL: {{endpoint}}/quotes

Method: POST

Headers:

x-api-key: YOUR_API_KEY_HERE

Example payload:

{
          "insured_sum": 3500
      }

Field descriptions:

Field Description
insured_sum Required. The total value to be insured (numeric).
Maximum: 200000 MXN

Expected response:

{
          "success": true,
          "status": 200,
          "message": "Quotes retrieved successfully.",
          "data": {
              "cost": 28.41,
              "description": "Standard coverage with regular process: estimated compensation within 3 to 7 weeks."
          }
      }
Response fields:
Field Description
data.cost The insurance premium cost (in the same currency as insured_sum)
data.description Description of the coverage terms

Possible errors:

  • 400 Bad Request: Invalid input data or missing fields.
  • 401 Unauthorized: Missing or invalid API key.
  • 500 Internal Server Error: Unexpected server error.

Create Policy

URL: {{endpoint}}/insurance

Method: POST

Headers:

x-api-key: YOUR_API_KEY_HERE

Example payload:

{
          "service": "standard",
          "commodity_id": 1548,
          "beneficiary_name": "YURI ELIZABETH QUINONES ACEVES",
          "beneficiary_tax_id": "QUAY920127K14",
          "currency_id": 1,
          "goods_type_id": 1,
          "insured_sum": 10293,
          "origin_city": "Guadalajara",
          "origin_state": "Jalisco",
          "origin_zip": "44160",
          "destination_city": "Camargo",
          "destination_state": "Chihuahua",
          "destination_zip": "33601",
          "coverage_start_date": "2025-04-23",
          "coverage_end_date": "2025-05-03",
          "cargo_description": "Bisuteria",
          "invoice_number": "",
          "tracking_number": "5986326010"
      }

Field descriptions:

Field Description
service Service type. Currently only "standard" is available
commodity_id Commodity ID. Get valid IDs from /commodities endpoint
beneficiary_name Full legal name of the beneficiary
beneficiary_tax_id Tax ID (RFC for Mexican beneficiaries)
currency_id 1 = MXN (Mexican Peso)
2 = USD (US Dollar)
goods_type_id 1 = New products
2 = Used products
insured_sum Total insured amount (numeric value)
origin_city Shipment origin city
origin_state Shipment origin state (2-letter code)
origin_zip Shipment origin ZIP code
destination_city Shipment destination city
destination_state Shipment destination state (2-letter code)
destination_zip Shipment destination ZIP code
coverage_start_date Coverage start date (YYYY-MM-DD)
coverage_end_date Coverage end date (YYYY-MM-DD)
cargo_description Description of the goods being shipped
invoice_number Optional invoice number
tracking_number Carrier tracking number

Expected response:

{
          "success": true,
          "status": 201,
          "message": "Insurance policy created successfully.",
          "data": {
              "policy_id": "AP186",
              "insurer_name": "autopacksafe",
              "insured_sum": 10293,
              "cost": 83.58
          }
      }

Possible errors:

  • 400 Bad Request: Invalid input data or missing fields.
  • 401 Unauthorized: Missing or invalid API key.
  • 500 Internal Server Error: Unexpected server error.

View Policies

URL: {{endpoint}}/policies

Method: GET

Headers:

x-api-key: YOUR_API_KEY_HERE

Expected response:

{
          "success": true,
          "status": 200,
          "message": "Insurance policies retrieved successfully.",
          "data": {
              "current_page": 1,
              "data": [
                  {
                      "id": "AP151",
                      "service": "standard",
                      "beneficiary_id": 138,
                      "currency_id": 1,
                      "goods_type_id": 1,
                      "insured_sum": 1000,
                      "origin_city": "León",
                      "destination_city": "Monterrey",
                      "coverage_start_date": "2025-04-07",
                      "coverage_end_date": "2025-04-10",
                      "cargo_description": "Tiffany Chairs",
                      "tracking_number": "794676870079",
                      "invoice_number": null,
                      "insurer_name": "autopacksafe",
                      "sell_price": 8.12,
                      "created_at": "2025-04-07T23:57:06.000000Z"
                  }
              ]
          }
      }

Possible errors:

  • 401 Unauthorized: Missing or invalid API key.
  • 500 Internal Server Error: Unexpected server error.

View Policy

URL: {{endpoint}}/policy/AP172

Method: GET

Headers:

x-api-key: YOUR_API_KEY_HERE

Expected response:

{
          "success": true,
          "status": 200,
          "message": "Insurance policy retrieved successfully.",
          "data": {
              "id": "AP151",
              "service": "standard",
              "beneficiary_id": 138,
              "currency_id": 1,
              "goods_type_id": 1,
              "insured_sum": 1000,
              "origin_city": "León",
              "origin_state": "",
              "destination_city": "Monterrey",
              "destination_state": "",
              "coverage_start_date": "2025-04-07",
              "coverage_end_date": "2025-04-10",
              "cargo_description": "Tiffany Chairs",
              "tracking_number": "794676870079",
              "invoice_number": null,
              "insurer_name": "autopacksafe",
              "sell_price": 8.12,
              "created_at": "2025-04-07T23:57:06.000000Z"
          }
      }

Possible errors:

  • 401 Unauthorized: Missing or invalid API key.
  • 404 Not Found: Policy not found.
  • 500 Internal Server Error: Unexpected server error.

View Policy PDF

URL: {{endpoint}}/policy/pdf/AP172

Method: GET

Headers:

x-api-key: YOUR_API_KEY_HERE

Expected response:

Returns the policy document in PDF format.

Possible errors:

  • 401 Unauthorized: Missing or invalid API key.
  • 404 Not Found: Policy not found.
  • 500 Internal Server Error: Unexpected server error.

View Transactions

URL: {{endpoint}}/transactions

Method: GET

Headers:

x-api-key: YOUR_API_KEY_HERE

Expected response:

{
          "success": true,
          "status": 200,
          "message": "Transactions retrieved successfully.",
          "data": [
              {
                  "description": "Se adquirió la póliza de seguro AS0021",
                  "type": "withdrawal",
                  "amount": "32.48",
                  "balance": "967.52",
                  "created_at": "2025-03-17T17:30:50.000000Z"
              }
          ]
      }

Possible errors:

  • 401 Unauthorized: Missing or invalid API key.
  • 500 Internal Server Error: Unexpected server error.

View Commodities

URL: {{endpoint}}/commodities

Method: GET

Headers:

x-api-key: YOUR_API_KEY_HERE

Expected response:

{
          "success": true,
          "status": 200,
          "message": "Commodities retrieved successfully.",
          "data": [
              {
                  "id": 303,
                  "clave": "JUG",
                  "nombre": "Toys",
                  "id_categoria": 39,
                  "estado": 1
              },
              {
                  "id": 1525,
                  "clave": "ABA",
                  "nombre": "Groceries",
                  "id_categoria": 18,
                  "estado": 1
              },
              {
                  "id": 1526,
                  "clave": "ACB",
                  "nombre": "Beauty accessories",
                  "id_categoria": 7,
                  "estado": 1
              }
          ]
      }

Possible errors:

  • 401 Unauthorized: Missing or invalid API key.
  • 500 Internal Server Error: Unexpected server error.
1