### Create Order API Request Examples Source: https://pro.skydropx.com/es-MX/api-docs Examples of how to make a POST request to create an order using the Skydropx API. These examples cover cURL, Ruby, Node.js, PHP, and Python. ```bash curl -X POST 'https://pro.skydropx.com/api/v1/orders/' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer {{BEARER_TOKEN}}' ``` ```ruby require 'net/http' require 'uri' require 'json' uri = URI('https://pro.skydropx.com/api/v1/orders/') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = uri.scheme == 'https' request = Net::HTTP::Post.new(uri) request['Content-Type'] = 'application/json' request['Authorization'] = 'Bearer {{BEARER_TOKEN}}' response = http.request(request) puts response.body ``` ```javascript const axios = require('axios'); const options = { method: 'POST', url: 'https://pro.skydropx.com/api/v1/orders/', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer {{BEARER_TOKEN}}' } }; axios(options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` ```php 'https://pro.skydropx.com/api/v1/orders/', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_HTTPHEADER => array('Content-Type: application/json'), CURLOPT_HTTPHEADER => array('Authorization: Bearer {{BEARER_TOKEN}}'), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ```python import requests url = 'https://pro.skydropx.com/api/v1/orders/' headers = {"Content-Type":"application/json","Authorization":"Bearer {{BEARER_TOKEN}}"} response = requests.post(url, headers=headers) print(response.text) ``` -------------------------------- ### Fetch Extra Charges with Python (Requests) Source: https://pro.skydropx.com/es-MX/api-docs This Python example uses the requests library to fetch extra charges. It defines the URL and headers, then sends a GET request and prints the response text. ```python import requests url = 'https://pro.skydropx.com/api/v1/finance/extra-charges' headers = {"Content-Type":"application/json","Authorization":"Bearer {{BEARER_TOKEN}}"} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Get Pickup by ID using Node.js Source: https://pro.skydropx.com/es-MX/api-docs This Node.js example uses the 'axios' library to make a GET request to the SkydropX API for pickup details. Install axios using 'npm install axios'. Remember to substitute 'example_id' and '{{BEARER_TOKEN}}'. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://pro.skydropx.com/api/v1/pickups/example_id', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer {{BEARER_TOKEN}}' } }; axios(options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` -------------------------------- ### Webhook Example Source: https://pro.skydropx.com/es-MX/api-docs This is an example of a webhook payload structure, detailing package information. ```APIDOC ## Webhooks This section details the structure of webhook payloads, specifically for package events. ### Package Information - **id** (string) - Unique identifier for the package. - **type** (string) - Type of the webhook event, e.g., "package". ### Example Payload Structure ```json { "data": { "id": "5beefc46-352d-47d9-9856-2d3e2ec0f52a", "type": "package", "attributes": { "package_number": 1, "weight": "5.0", "length": "7.0", "width": "7.0", "height": "7.0" } } } ``` ``` -------------------------------- ### Pickup Request Example Source: https://pro.skydropx.com/es-MX/api-docs This example demonstrates the structure of a request body for scheduling a pickup. ```APIDOC ## POST /pickups ### Description Schedules a new pickup request. ### Method POST ### Endpoint /pickups ### Request Body - **data** (object) - Required - The main payload for the pickup request. - **id** (string) - Required - The unique identifier for the pickup. - **type** (string) - Required - The type of resource, expected to be 'pickup'. - **attributes** (object) - Required - Contains the details of the pickup. - **id** (string, uuid) - Required - UUID of the pickup. - **status** (string) - Required - Current status of the pickup (e.g., 'scheduled', 'completed', 'cancelled'). - **request_number** (string) - Required - The number assigned to the pickup request. - **packages** (integer) - Required - The number of packages included in the pickup. - **total_weight** (string) - Required - The total weight of the packages. - **scheduled_from** (string) - Required - The start time for the scheduled pickup window in ISO 8601 format. - **scheduled_to** (string) - Required - The end time for the scheduled pickup window in ISO 8601 format. - **created_at** (string) - Required - Timestamp when the pickup was created. - **updated_at** (string) - Required - Timestamp when the pickup was last updated. - **error_reason** (string, nullable) - Optional - Reason for any errors encountered during pickup scheduling. - **reschedule_remaining_days** (integer, nullable) - Optional - Number of days remaining to reschedule the pickup. - **relationships** (object) - Required - Defines relationships to other resources. - **reference_shipment** (object) - Required - Relationship to the shipment. - **data** (object) - Required - Data for the shipment relationship. - **id** (string, uuid) - Required - ID of the related shipment. - **type** (string) - Required - Type of the related resource, expected to be 'shipment'. - **address** (object) - Required - Relationship to the address. - **data** (object) - Required - Data for the address relationship. - **id** (string, uuid) - Required - ID of the related address. - **type** (string) - Required - Type of the related resource, expected to be 'address'. ### Request Example ```json { "data": { "id": "ed06f78a-8757-488c-bb82-31964449aea0", "type": "pickup", "attributes": { "id": "ed06f78a-8757-488c-bb82-31964449aea0", "status": "scheduled", "request_number": "123456789", "packages": 1, "total_weight": "30.0", "scheduled_from": "2024-09-20T09:00:00.000-06:00", "scheduled_to": "2024-09-20T14:00:00.000-06:00", "created_at": "2024-09-19T07:43:46.614-06:00", "updated_at": "2024-09-19T07:43:46.614-06:00", "error_reason": "Error al programar la recolección", "reschedule_remaining_days": 9 }, "relationships": { "reference_shipment": { "data": { "id": "d4ad5784-4f71-4474-9f34-e2a6f8366d5e", "type": "shipment" } }, "address": { "data": { "id": "901e4d68-a147-4fdf-9078-c252a672611c", "type": "address" } } } } } ``` ### Response #### Success Response (200) - **data** (object) - The created pickup resource. - **id** (string, uuid) - UUID of the pickup. - **type** (string) - Type of the resource, expected to be 'pickup'. - **attributes** (object) - Attributes of the pickup. - **id** (string, uuid) - UUID of the pickup. - **status** (string) - Current status of the pickup. - **request_number** (string) - The number assigned to the pickup request. - **packages** (integer) - The number of packages. - **total_weight** (string) - Total weight of the packages. - **scheduled_from** (string) - Scheduled start time for the pickup. - **scheduled_to** (string) - Scheduled end time for the pickup. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. - **error_reason** (string, nullable) - Reason for any errors. - **reschedule_remaining_days** (integer, nullable) - Days remaining to reschedule. - **relationships** (object) - Relationships to other resources. - **reference_shipment** (object) - Relationship to the shipment. - **data** (object) - Data for the shipment relationship. - **id** (string, uuid) - ID of the related shipment. - **type** (string) - Type of the related resource. - **address** (object) - Relationship to the address. - **data** (object) - Data for the address relationship. - **id** (string, uuid) - ID of the related address. - **type** (string) - Type of the related resource. - **included** (array) - Optional - Additional resources included in the response. - **items** (object) - An item within the included array, can be one of several types. - **oneOf** - Specifies that the item can match one of the following schemas: - **object** - Represents an address resource. - **id** (string) - ID of the address. - **type** (string) - Type of the resource, expected to be 'address'. - **attributes** (object) - Attributes of the address. - **id** (string, uuid) - UUID of the address. - **area_level1** (string) - State, province, or department. - **area_level2** (string) - City or municipality. - **area_level3** (string, nullable) - Neighborhood or colony. - **name** (string) - Name of the recipient or sender. - **postal_code** (string) - Postal code. - **country_code** (string) - Country code. - **address_type** (string, nullable) - Type of address. - **street1** (string) - Street and number. - **company** (string, nullable) - Company name. - **phone** (string) - Phone number. - **email** (string) - Email address. - **reference** (string) - Address reference. - **apartment_number** (string, nullable) - Apartment number. #### Response Example ```json { "data": { "id": "ed06f78a-8757-488c-bb82-31964449aea0", "type": "pickup", "attributes": { "id": "ed06f78a-8757-488c-bb82-31964449aea0", "status": "scheduled", "request_number": "123456789", "packages": 1, "total_weight": "30.0", "scheduled_from": "2024-09-20T09:00:00.000-06:00", "scheduled_to": "2024-09-20T14:00:00.000-06:00", "created_at": "2024-09-19T07:43:46.614-06:00", "updated_at": "2024-09-19T07:43:46.614-06:00", "error_reason": "Error al programar la recolección", "reschedule_remaining_days": 9 }, "relationships": { "reference_shipment": { "data": { "id": "d4ad5784-4f71-4474-9f34-e2a6f8366d5e", "type": "shipment" } }, "address": { "data": { "id": "901e4d68-a147-4fdf-9078-c252a672611c", "type": "address" } } } }, "included": [ { "id": "901e4d68-a147-4fdf-9078-c252a672611c", "type": "address", "attributes": { "id": "901e4d68-a147-4fdf-9078-c252a672611c", "area_level1": "Jalisco", "area_level2": "Guadalajara", "area_level3": "Providencia", "name": "Juan Perez", "postal_code": "44630", "country_code": "MX", "address_type": "residential", "street1": "Av. Providencia 1234", "company": null, "phone": "3312345678", "email": "juan.perez@example.com", "reference": "Cerca de la glorieta", "apartment_number": null } } ] } ``` ``` -------------------------------- ### Product Response Example Source: https://pro.skydropx.com/es-MX/api-docs An example of a product response, illustrating the data format for a single product and pagination metadata. ```json { "data": [ { "id": 73, "type": "product", "attributes": { "id": 73, "name": "Pantalón", "sku": 1234567890, "hscode": 6402.2, "description": "Descripción del producto", "weight": 4, "width": 4, "height": 4, "length": 4, "price": 4.5, "created_at": "2025-02-06 21:26:41 -0500", "updated_at": "2025-02-06 21:26:41 -0500", "country_id": "f12f8764-1ee7-48c7-94b3-3f5a4e610e5b", "product_type_code": 31261500, "product_type_name": "Producto 1", "description_en": "Product 1", "created_from": "interface", "international_shipment_enabled": true, "price_mxn": 4.5, "destination_country_id": "f12f8764-1ee7-48c7-94b3-3f5a4e610e5b" } } ], "meta": { "current_page": 2, "next_page": 3, "prev_page": 1, "total_pages": 3, "total_count": 8 } } ``` -------------------------------- ### Order Example Source: https://pro.skydropx.com/es-MX/api-docs A practical example of a JSON payload representing an order, demonstrating the structure and data types. ```APIDOC ## Order Example ### Description This example shows a complete order object, including all its attributes, relationships, and included item details. ### Request Example ```json { "data": { "id": "9e270243-762f-40c8-833e-ef1c4ee8282d", "type": "order", "attributes": { "id": "9e270243-762f-40c8-833e-ef1c4ee8282d", "reference": "example_reference", "tags": [ "tag1", "tag2" ], "platform": "Shopify", "ecommerce_id": "SDFG", "price": 10.0, "shipping_preferences": [ { "service": "me2", "price": "100.00" } ], "payment_type": "COD", "created_at": "2025-01-07T14:46:38.203-06:00", "address_from": { "area_level1": "Nuevo León", "area_level2": "Monterrey", "area_level3": "La Finca", "name": "Name", "postal_code": "64000", "country_code": "MX", "street1": "Olivo 4618", "company": "", "phone": "1242452456", "email": "email@example.com", "reference": "Green house", "address_type": "from", "apartment_number": "", "tax_id_number": "XAXX010101000", "tax_id_type": "rfc" }, "address_to": { "area_level1": "Monterrey Centro", "area_level2": "Monterrey", "area_level3": "La finca", "name": "Mayra Doe", "postal_code": "64000", "country_code": "MX", "street1": "22 Main St", "company": "ACS Inc.", "phone": "1234567890", "email": "jhon@doe.com", "reference": "Near the park", "address_type": "to", "apartment_number": "123", "further_information": "", "tax_id_number": "XAXX010101000", "tax_id_type": "rfc" }, "parcel": { "weight": 2.0, "length": 10, "width": 10, "height": 10 } }, "relationships": { "items": { "data": [ { "id": "c2092234-1b85-41a2-a200-858d052c0ad1", "type": "item" } ] }, "shipments": { "data": [ { "id": "9eae25ba-11b4-4b9f-9b01-3d09da8bc12d", "type": "shipment" } ] } } }, "included": [ { "id": "c2092234-1b85-41a2-a200-858d052c0ad1", "type": "item", "attributes": { "name": "prueba", "sku": "prueba", "quantity": 2, "price": 15.0, "weight": 20.0, "height": 30.0, "width": 30.0, "length": 30.0 } } ] } ``` ``` -------------------------------- ### Rate Example (Sendex) Source: https://pro.skydropx.com/es-MX/api-docs Example response for a rate query using the Sendex provider. ```APIDOC ## Rate Example (Sendex) This example demonstrates a successful rate response from the Sendex provider. ### Method GET ### Endpoint /api/v1/rates ### Response #### Success Response (200) - **data** (object) - Contains the rate details. - **id** (string) - Unique identifier for the rate. - **type** (string) - Type of the resource, e.g., "rate". - **attributes** (object) - Attributes of the rate. - **success** (boolean) - Indicates if the rate calculation was successful. - **rate_type** (string) - The type of rate, e.g., "default". - **provider_name** (string) - Internal name of the provider. - **provider_display_name** (string) - Display name of the provider. - **provider_service_name** (string) - Name of the service offered by the provider. - **provider_service_code** (string) - Code for the service. - **status** (string) - Status of the rate calculation. - **currency_code** (string) - ISO 4217 currency code. - **cost** (string) - The base cost of the service. - **amount** (string) - The final amount after taxes and fees. - **total** (string) - The total amount to be paid. - **days** (integer) - Estimated delivery days. - **insurable** (boolean) - Indicates if the shipment is insurable. - **has_own_agreement** (boolean) - Indicates if the user has a direct agreement with the provider. - **own_agreement_amount** (string) - The amount for direct agreements. - **extra_fees** (array) - List of additional fees. - **zone** (string) - Shipping zone. - **country_code** (string) - Two-letter country code. - **plan_type** (string) - Type of plan, if applicable. - **packaging_type** (string) - Type of packaging used. - **error_messages** (object) - Object containing error messages, if any. - **weight** (number) - Weight of the package. - **relationships** (object) - Relationships to other resources. - **quotation** (object) - Relationship to the quotation. - **data** (object) - Data of the quotation. - **id** (string) - ID of the quotation. - **type** (string) - Type of the resource, e.g., "quotation". - **links** (object) - Links related to the quotation. - **related** (string) - URL for the related quotation. ### Request Example ```json { "example": "request body" } ``` ### Response Example ```json { "data": { "id": "ab85cf5a-0129-42ea-9e6a-cc50cb19d99b", "type": "rate", "attributes": { "success": true, "rate_type": "default", "provider_name": "sendex", "provider_display_name": "Sendex", "provider_service_name": "Reg", "provider_service_code": "reg", "status": "price_found_external", "currency_code": "MXN", "cost": "74.3", "amount": "106.19", "total": "106.19", "days": 1, "insurable": null, "has_own_agreement": false, "own_agreement_amount": null, "extra_fees": [], "zone": "3", "country_code": "MX", "plan_type": null, "packaging_type": "package", "error_messages": {}, "weight": 5 }, "relationships": { "quotation": { "data": { "id": "76b094f9-0e15-4505-8a45-948931baf847", "type": "quotation" }, "links": { "related": "https://api.example.com/api/v1/quotations/76b094f9-0e15-4505-8a45-948931baf847" } } } } } ``` ``` -------------------------------- ### Example Response for Packagings Source: https://pro.skydropx.com/es-MX/api-docs This is an example of the JSON response structure when retrieving a list of packaging types. It includes the data for each packaging and metadata about the pagination. ```json { "data": [ { "code": "4G", "name": "Box" } ], "meta": { "current_page": 1, "next_page": 2, "total_pages": 1, "total_count": 5 } } ``` -------------------------------- ### Shipment Creation Example Source: https://pro.skydropx.com/es-MX/api-docs Example of a request body for creating an international shipment. ```APIDOC ## POST /shipments ### Description Creates a new shipment with the provided details. ### Method POST ### Endpoint /shipments ### Request Body - **data** (object) - Required - The shipment data. - **type** (string) - Required - The type of the resource, should be "shipments". - **attributes** (object) - Required - The attributes of the shipment. - **carrier_name** (string) - Required - Name of the carrier. - **service_id** (string) - Required - ID of the shipping service. - **package_type** (string) - Required - Type of the package. - **weight** (number) - Required - Weight of the package. - **length** (number) - Required - Length of the package. - **width** (number) - Required - Width of the package. - **height** (number) - Required - Height of the package. - **address_from** (object) - Required - Origin address details. - **name** (string) - Required - Name of the sender. - **street1** (string) - Required - Street address line 1. - **street2** (string) - Optional - Street address line 2. - **city** (string) - Required - City of the origin address. - **state_province** (string) - Required - State or province of the origin address. - **postal_code** (string) - Required - Postal code of the origin address. - **country_code** (string) - Required - Country code (e.g., MX, US). - **phone** (string) - Optional - Phone number for the origin address. - **email** (string) - Optional - Email for the origin address. - **company_name** (string) - Optional - Company name for the origin address. - **reference** (string) - Optional - Reference for the origin address. - **address_to** (object) - Required - Destination address details. - **name** (string) - Required - Name of the recipient. - **street1** (string) - Required - Street address line 1. - **street2** (string) - Optional - Street address line 2. - **city** (string) - Required - City of the destination address. - **state_province** (string) - Required - State or province of the destination address. - **postal_code** (string) - Required - Postal code of the destination address. - **country_code** (string) - Required - Country code (e.g., MX, US). - **phone** (string) - Required - Phone number for the destination address. - **email** (string) - Required - Email for the destination address. - **company_name** (string) - Optional - Company name for the destination address. - **reference** (string) - Optional - Reference for the destination address. - **area_level3** (string) - Optional - Neighborhood or area of the destination address. - **apartment_number** (string) - Optional - Apartment number. - **further_information** (string) - Optional - Additional delivery information (max 70 characters). - **tax_id_number** (string) - Optional - Tax ID number. - **tax_id_type** (string) - Optional - Type of Tax ID. ### Request Example ```json { "data": { "type": "shipments", "attributes": { "carrier_name": "fedex", "service_id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "package_type": "4G", "weight": 1, "length": 1, "width": 1, "height": 1, "address_from": { "name": "Sender Name", "street1": "Street 1", "city": "City", "state_province": "State", "postal_code": "12345", "country_code": "MX", "phone": "555-555-5555", "email": "sender@example.com", "company_name": "Sender Company" }, "address_to": { "name": "Recipient Name", "street1": "Street 1", "city": "City", "state_province": "State", "postal_code": "12345", "country_code": "MX", "phone": "555-555-5555", "email": "recipient@example.com", "company_name": "Recipient Company", "reference": "Ref", "area_level3": "Barrio", "apartment_number": "Apt 101", "further_information": "Additional info", "tax_id_number": "123456789", "tax_id_type": "RFC" } } } } ``` ### Response #### Success Response (201 Created) - **data** (object) - The created shipment object. - **id** (string) - The unique identifier for the shipment. - **type** (string) - The type of the resource, "shipments". - **attributes** (object) - The attributes of the shipment. - **carrier_name** (string) - Name of the carrier. - **workflow_status** (string) - Current status of the shipment workflow. - **payment_status** (string) - Status of the payment. - **total** (string) - Total cost of the shipment. - **source** (string) - Source of the shipment creation (e.g., "api"). - **carrier_id** (string) - Carrier's internal ID for the shipment. - **service_id** (string) - ID of the shipping service used. - **master_tracking_number** (string) - The main tracking number for the shipment. - **original_shipment_id** (string) - The ID of the original shipment if this is a revision. - **created_at** (string) - Timestamp of when the shipment was created. - **updated_at** (string) - Timestamp of when the shipment was last updated. - **error_detail** (object) - Details about any errors encountered during creation. - **error_code** (string) - Code for the error. - **error_message** (string) - Description of the error. - **error_message_detail** (string) - Detailed explanation of the error. - **relationships** (object) - Relationships to other resources. - **packages** (object) - Information about the packages in the shipment. - **data** (array) - Array of package objects. - **id** (string) - ID of the package. - **type** (string) - Type of the resource, "packages". - **address_from** (object) - Information about the origin address. - **data** (object) - Address object. - **id** (string) - ID of the address. - **type** (string) - Type of the resource, "addresses". - **address_to** (object) - Information about the destination address. - **data** (object) - Address object. - **id** (string) - ID of the address. - **type** (string) - Type of the resource, "addresses". #### Response Example ```json { "data": [ { "id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "type": "shipments", "attributes": { "carrier_name": "fedex", "workflow_status": "pending", "payment_status": "paid", "total": "38.20", "source": "api", "carrier_id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "service_id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "master_tracking_number": "1234567890", "original_shipment_id": "0199977a-e032-78bf-a335-00a9ae3cfdff", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z", "error_detail": null }, "relationships": { "packages": { "data": [ { "id": "pkg_123", "type": "packages" } ] }, "address_from": { "data": { "id": "addr_from_123", "type": "addresses" } }, "address_to": { "data": { "id": "addr_to_123", "type": "addresses" } } } } ], "included": [ { "id": "pkg_123", "type": "packages", "attributes": { "id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "package_type": "4G", "weight": 1, "length": 1, "width": 1, "height": 1, "consignment_note": 53102400, "package_content": "Documents", "tracking_url_provider": "https://www.fedex.com/fedextrack/?trknbr=1234567890", "tracking_status": "created", "tracking_number": "1234567890", "label_url": "https://label.com/123", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" }, "relationships": { "shipment": { "data": { "id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "type": "shipments" } } } }, { "id": "addr_from_123", "type": "addresses", "attributes": { "id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "name": "Sender Name", "street1": "Street 1", "city": "City", "state_province": "State", "postal_code": "12345", "country_code": "MX", "phone": "555-555-5555", "email": "sender@example.com", "company_name": "Sender Company" } }, { "id": "addr_to_123", "type": "addresses", "attributes": { "id": "0ac5adcc-a13d-427d-81dd-9ddd70b2f660", "name": "Recipient Name", "street1": "Street 1", "city": "City", "state_province": "State", "postal_code": "12345", "country_code": "MX", "phone": "555-555-5555", "email": "recipient@example.com", "company_name": "Recipient Company", "reference": "Ref", "area_level3": "Barrio", "apartment_number": "Apt 101", "further_information": "Additional info", "tax_id_number": "123456789", "tax_id_type": "RFC" } } ] } ``` ``` -------------------------------- ### Address Request Body Example Source: https://pro.skydropx.com/es-MX/api-docs This example demonstrates the structure of a request body for creating or updating an address. ```APIDOC ## POST /addresses ### Description Creates or updates an address with the provided details. ### Method POST ### Endpoint /addresses ### Parameters #### Request Body - **area_level1** (string) - Required - The first level administrative area (e.g., city). - **area_level2** (string) - Required - The second level administrative area (e.g., municipality). - **area_level3** (string) - Optional - The third level administrative area (e.g., neighborhood). - **name** (string) - Required - The name of the recipient. - **postal_code** (string) - Required - The postal code of the address. - **country_code** (string) - Required - The ISO 3166-1 alpha-2 country code. - **address_type** (string) - Required - The type of address (e.g., 'from', 'to'). - **street1** (string) - Required - The primary street address. - **company** (string) - Optional - The company name, if applicable. - **phone** (string) - Required - The phone number of the recipient. - **email** (string) - Required - The email address of the recipient. - **reference** (string) - Optional - Additional reference information for the address. - **apartment_number** (string) - Optional - The apartment or unit number. ### Request Example ```json { "area_level1": "Ciudad de México", "area_level2": "Venustiano Carranza", "area_level3": "Romero rubio", "name": "Juan", "postal_code": "15400", "country_code": "MX", "address_type": "from", "street1": "Persia 143", "company": "Company name", "phone": "3453453453453", "email": "juan@mail.com", "reference": "porton", "apartment_number": "Apartamento 404" } ``` ### Response #### Success Response (200) - **message** (string) - A success message indicating the address was processed. #### Response Example ```json { "message": "Address created successfully" } ``` ### Error Handling #### Bad Request (400) Returns a bad request error response. #### Unprocessable Entity (422) Returns an error response indicating that the request could not be processed. ##### Response Schema ```json { "type": "object", "properties": { "errors": { "type": "object" } } } ``` ##### Response Example ```json { "errors": { "message": "An error occurred" } } ``` ``` -------------------------------- ### Example Not Found Error Source: https://pro.skydropx.com/es-MX/api-docs An example of a 404 error response, showing the structure when a quotation is not found. ```json { "message": "Cotización no encontrada" } ``` -------------------------------- ### Request Body Example Source: https://pro.skydropx.com/es-MX/api-docs This is an example of a request body for creating or updating an address. It includes detailed address information and contact details. ```json { "area_level1": "Ciudad de México", "area_level2": "Venustiano Carranza", "area_level3": "Romero rubio", "name": "Juan", "postal_code": "15400", "country_code": "MX", "address_type": "from", "street1": "Persia 143", "company": "Company name", "phone": "3453453453453", "email": "juan@mail.com", "reference": "porton", "apartment_number": "Apartamento 404" } } ] } ] } ``` -------------------------------- ### Example Request Body Source: https://pro.skydropx.com/es-MX/api-docs This is an example of the request body structure for certain API calls. Ensure all fields are populated with appropriate data. ```json { "company": "example_company", "street1": "example_street1", "street_number": "example_street_number", "apartment_number": "example_apartment_number", "postal_code": "SUCCESS", "area_level1": "example_area_level1", "area_level2": "example_area_level2", "area_level3": "example_area_level3", "country_code": "SUCCESS", "phone": "example_phone", "email": "example_email", "reference": "example_reference", "rfc": "example_rfc", "tax_id_number": "example_tax_id_number", "tax_id_type": "example_tax_id_type" }, "verified_carriers": [ { "carrier_name": "example_carrier_name", "status": "example_status", "verification_id": "example_verification_id" } ] } ``` -------------------------------- ### Retrieve Products using Ruby Source: https://pro.skydropx.com/es-MX/api-docs Example of how to fetch products using Ruby's Net::HTTP library. Replace `{{BEARER_TOKEN}}` with your token. ```ruby require 'net/http' require 'uri' require 'json' uri = URI('https://pro.skydropx.com/api/v1/products') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = uri.scheme == 'https' request = Net::HTTP::Get.new(uri) request['Content-Type'] = 'application/json' request['Authorization'] = 'Bearer {{BEARER_TOKEN}}' response = http.request(request) puts response.body ``` -------------------------------- ### Retrieve Products using Python Source: https://pro.skydropx.com/es-MX/api-docs Example of how to fetch products using Python's requests library. Replace `{{BEARER_TOKEN}}` with your token. ```python import requests url = 'https://pro.skydropx.com/api/v1/products' headers = {"Content-Type":"application/json","Authorization":"Bearer {{BEARER_TOKEN}}"} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Get Pickup by ID using Python Source: https://pro.skydropx.com/es-MX/api-docs This Python script uses the 'requests' library to get pickup details from the SkydropX API. Make sure to install 'requests' if you haven't already ('pip install requests'). Replace 'example_id' and '{{BEARER_TOKEN}}' with your actual values. ```python import requests url = 'https://pro.skydropx.com/api/v1/pickups/example_id' headers = {"Content-Type":"application/json","Authorization":"Bearer {{BEARER_TOKEN}}"} response = requests.get(url, headers=headers) print(response.text) ``` -------------------------------- ### Retrieve Products using Node.js Source: https://pro.skydropx.com/es-MX/api-docs Example of how to fetch products using Node.js and the axios library. Replace `{{BEARER_TOKEN}}` with your token. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://pro.skydropx.com/api/v1/products', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer {{BEARER_TOKEN}}' } }; axios(options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` -------------------------------- ### Get Carrier Services Source: https://pro.skydropx.com/es-MX/api-docs This example shows how to retrieve a list of available carrier services. It makes a GET request to the /api/v1/shipments/carrier_services endpoint. The 'page' query parameter can be used for pagination. ```http GET /api/v1/shipments/carrier_services ``` -------------------------------- ### Retrieve Products using PHP Source: https://pro.skydropx.com/es-MX/api-docs Example of how to fetch products using PHP and cURL. Ensure you replace `{{BEARER_TOKEN}}` with your actual token. ```php 'https://pro.skydropx.com/api/v1/products', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array('Content-Type: application/json'), CURLOPT_HTTPHEADER => array('Authorization: Bearer {{BEARER_TOKEN}}'), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Get Pickups with Node.js (Axios) Source: https://pro.skydropx.com/es-MX/api-docs This Node.js example uses the Axios library to make a GET request to the Skydropx API for retrieving pickups. It configures the request with the correct URL and authorization headers. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://pro.skydropx.com/api/v1/pickups', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer {{BEARER_TOKEN}}' } }; axios(options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ``` -------------------------------- ### Get Shipment by ID using Node.js Source: https://pro.skydropx.com/es-MX/api-docs This Node.js example uses the axios library to make a GET request to the Skydropx API for shipment details. Remember to include your bearer token in the Authorization header. ```javascript const axios = require('axios'); const options = { method: 'GET', url: 'https://pro.skydropx.com/api/v1/shipments/example_id', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer {{BEARER_TOKEN}}' } }; axios(options) .then(response => console.log(response.data)) .catch(error => console.error(error)); ```