### Create Sale Payload Example Source: https://docs.spedy.com.br/index This is a JSON payload example for creating a new sale. It requires transaction details, customer information, amount, date, and items. Optional fields like discount, freight, and warranty date can also be included. ```json { "transactionId": "string", "customer": { "name": "string", "legalName": "string", "federalTaxNumber": "string", "stateTaxNumber": "string", "cityTaxNumber": "string", "email": "string", "phone": "string", "mobilePhone": "string", "address": { "street": "string", "district": "string", "postalCode": "string", "number": "string", "additionalInformation": "string", "city": { "code": "string", "name": "string", "state": "ro" }, "country": { "name": "string", "code": 0 }, "cityName": "string" } }, "amount": 0.0, "discountAmount": 0.0, "freightAmount": 0.0, "date": "string", "warrantyDate": "string", "sendEmailToCustomer": true, "status": "created", "autoIssueMode": "disabled", "paymentMethod": "billetBank", "profileType": "producer", "items": [ { "productId": "string", "quantity": 0, "price": 0.0, "discountAmount": 0.0, "observation": "string" } ], "invoices": [ { "key": "string", "accessKey": "string", "number": "string", "issueDate": "string", "totalValue": 0.0, "status": "string", "type": "string", "xml": "string" } ] } ``` -------------------------------- ### GET /v1/products/{id} Source: https://docs.spedy.com.br/index Retrieves details for a specific product by its ID. ```APIDOC ## Obter Produto ### Description Retrieves details for a specific product by its ID. ### Method GET ### Endpoint /v1/products/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the product to retrieve. ### Response #### Success Response (200) - **code** (string) - The product code. - **name** (string) - The product name. - **price** (number) - The product price. - **invoiceModel** (string) - The invoice model for the product. - **warrantyDays** (number) - The number of warranty days for the product. #### Response Example ```json { "code": "string", "name": "string", "price": 0.1, "invoiceModel": "productInvoice", "warrantyDays": 0 } ``` ``` -------------------------------- ### Response Sample for Getting a Product Source: https://docs.spedy.com.br/index This is a sample JSON response when successfully retrieving product details. It includes product code, name, price, invoice model, and warranty days. ```json { "code": "string", "name": "string", "price": 0.1, "invoiceModel": "productInvoice", "warrantyDays": 0 } ``` -------------------------------- ### GET /v1/products Source: https://docs.spedy.com.br/index Retrieves a list of products with optional pagination. Supports query parameters for page number and page size. ```APIDOC ## List Products ### Description Retrieves a list of all products, with options to paginate the results. ### Method GET ### Endpoint /v1/products ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **pageSize** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - Returns a list of products, each with its code, name, price, invoice model, warranty days, and invoice settings. ### Response Example ```json { "code": "string", "name": "string", "price": 0.1, "invoiceModel": "productInvoice", "warrantyDays": 0, "serviceInvoiceSettings": { "fiscalDescription": "string", "cityServiceCode": "string", "federalServiceCode": "string", "cnaeCode": "string", "useSpecificNumering": true, "series": "string", "nextNumber": 0, "nextBatchNumber": 0, "nbsCode": "string" }, "productInvoiceSettings": { "gtinCode": "string", "cfopIn": "string", "cfopInterstate": "string", "cfopTaxpayerInterstate": "string", "cfopInternational": "string", "cest": "string", "ncm": "string", "unitOfMeasurement": "string", "taxUnitOfMeasurement": "string", "exportationTaxUnitOfMeasurement": "string", "additionalInformation": "string", "fiscalDescription": "string", "useSpecificNumering": true, "series": "string", "nextNumber": 0 } } ``` ``` -------------------------------- ### Get Customer Source: https://docs.spedy.com.br/index Retrieves a specific customer by their ID. ```APIDOC ## GET /v1/customers/{id} ### Description Retrieves a specific customer by their ID. ### Method GET ### Endpoint /v1/customers/{id} ### Parameters #### Path Parameters - **id** (string) - Required - Customer ID ### Response #### Success Response (200) - **id** (string) - The customer's unique identifier. - **name** (string) - The customer's name or trading name. - **legalName** (string) - The customer's legal name (Razão Social). - **federalTaxNumber** (string) - The customer's federal tax number (CPF/CNPJ). - **cityTaxNumber** (string) - The customer's municipal tax number (Inscrição Municipal). - **stateTaxNumber** (string) - The customer's state tax number (Inscrição Estadual). - **email** (string) - The customer's email address. - **phone** (string) - The customer's phone number. - **mobilePhone** (string) - The customer's mobile phone number. - **address** (object) - The customer's address details. - **street** (string) - Street name. - **district** (string) - District or neighborhood. - **postalCode** (string) - Postal code. - **number** (string) - Building number. - **additionalInformation** (string) - Additional address information. - **city** (object) - City details. - **code** (string) - City code. - **name** (string) - City name. - **state** (string) - State abbreviation (e.g., 'ro'). - **country** (object) - Country details. - **name** (string) - Country name. - **code** (integer) - Country code. - **cityName** (string) - City name (redundant, consider using city.name). #### Response Example ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "legalName": "string", "federalTaxNumber": "string", "cityTaxNumber": "string", "stateTaxNumber": "string", "email": "string", "phone": "string", "mobilePhone": "string", "address": { "street": "string", "district": "string", "postalCode": "string", "number": "string", "additionalInformation": "string", "city": { "code": "string", "name": "string", "state": "ro" }, "country": { "name": "string", "code": 0 }, "cityName": "string" } } ``` ``` -------------------------------- ### GET /v1/companies Source: https://docs.spedy.com.br/index Retrieves a list of all companies, with optional pagination. ```APIDOC ## List Companies ### Description Retrieves a paginated list of all companies registered in the system. ### Method GET ### Endpoint `/v1/companies` ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **pageSize** (integer) - Optional - The number of companies to return per page. ### Response #### Success Response (200) OK ``` -------------------------------- ### GET /v1/companies/{id}/certificates Source: https://docs.spedy.com.br/index Retrieves the certificates for a specific company. ```APIDOC ## GET /v1/companies/{id}/certificates ### Description Retrieves the certificates for a specific company. ### Method GET ### Endpoint `/v1/companies/{id}/certificates` ### Parameters #### Path Parameters - **id** (string) - Required - ID of the company (uuid) #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) OK #### Response Example None ``` -------------------------------- ### Get Webhook by ID Source: https://docs.spedy.com.br/index Retrieves a specific webhook configuration using its unique identifier. ```APIDOC ## GET /v1/webhooks/{id} ### Description Retrieves a specific webhook configuration using its unique identifier. ### Method GET ### Endpoint https://api.spedy.com.br/v1/webhooks/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the webhook. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the webhook. - **event** (string) - The event that triggers the webhook. - **url** (string) - The URL to which the webhook event will be sent. - **enabled** (boolean) - Indicates if the webhook is currently enabled. #### Response Example ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "event": "string", "url": "string", "enabled": true } ``` ``` -------------------------------- ### Get Webhook Response Sample - JSON Source: https://docs.spedy.com.br/index This is a sample JSON response when retrieving webhook details. It includes the webhook's ID, event type, URL, and enabled status. ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "event": "string", "url": "string", "enabled": true } ``` -------------------------------- ### API Configuration Update for National NFS-e Source: https://docs.spedy.com.br/index This example demonstrates how to update a company's configuration via the API to use the National NFS-e environment. It involves calling the 'Alterar configurações' endpoint and setting the 'IssueType' field to 'annfs'. This is relevant for municipalities that have already adopted the National Issuer. ```http PUT /api/v1/companies/{companyId}/settings Content-Type: application/json { "IssueType": "annfs" } ``` -------------------------------- ### Get Customer Response JSON Source: https://docs.spedy.com.br/index This snippet illustrates the JSON response structure when retrieving customer details using their ID. It includes customer information such as name, tax numbers, contact details, and address. Requires API key authorization. ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "legalName": "string", "federalTaxNumber": "string", "cityTaxNumber": "string", "stateTaxNumber": "string", "email": "string", "phone": "string", "mobilePhone": "string", "address": { "street": "string", "district": "string", "postalCode": "string", "number": "string", "additionalInformation": "string", "city": { "code": "string", "name": "string", "state": "ro" }, "country": { "name": "string", "code": 0 }, "cityName": "string" } } ``` -------------------------------- ### Create Customer Source: https://docs.spedy.com.br/index Creates a new customer. ```APIDOC ## POST /v1/customers ### Description Creates a new customer. ### Method POST ### Endpoint /v1/customers ### Parameters #### Request Body - **name** (string) - Required - Max 80 characters. Customer's name or trading name. - **legalName** (string) - Optional - Max 80 characters. Legal name (Razão Social). - **federalTaxNumber** (string) - Optional - Max 14 characters. Federal tax number (CPF/CNPJ). - **stateTaxNumber** (string) - Optional - Max 20 characters. State tax number (Inscrição Estadual). - **cityTaxNumber** (string) - Optional - Max 20 characters. Municipal tax number (Inscrição Municipal). - **email** (string) - Optional - Max 50 characters. Email address. - **phone** (string) - Optional - Max 15 characters. Phone number. - **mobilePhone** (string) - Optional - Max 15 characters. Mobile phone number. - **address** (object) - Optional - Address details. - **street** (string) - Street name. - **district** (string) - District or neighborhood. - **postalCode** (string) - Postal code. - **number** (string) - Building number. - **additionalInformation** (string) - Additional address information. - **city** (object) - City details. - **code** (string) - City code. - **name** (string) - City name. - **state** (string) - State abbreviation (e.g., 'ro'). - **country** (object) - Country details. - **name** (string) - Country name. - **code** (integer) - Country code. - **cityName** (string) - City name. ``` -------------------------------- ### POST /v1/customers Source: https://docs.spedy.com.br/index Creates a new customer with the provided details. ```APIDOC ## POST /v1/customers ### Description Creates a new customer with the provided details. ### Method POST ### Endpoint /v1/customers ### Parameters #### Request Body - **name** (string) - Required - Nome / Nome Fantasia (max 80 characters) - **legalName** (string) - Optional - Razão Social (max 80 characters) - **federalTaxNumber** (string) - Optional - CPF / CNPJ / Doc estrangeiro (max 14 characters) - **stateTaxNumber** (string) - Optional - Inscrição Estadual (max 20 characters) - **cityTaxNumber** (string) - Optional - Inscrição Municipal (max 20 characters) - **email** (string) - Optional - E-mail (max 50 characters) - **phone** (string) - Optional - Telefone (max 15 characters) - **mobilePhone** (string) - Optional - Celular (max 15 characters) - **address** (object) - Optional - Endereço - **street** (string) - Description for street - **district** (string) - Description for district - **postalCode** (string) - Description for postalCode - **number** (string) - Description for number - **additionalInformation** (string) - Description for additionalInformation - **city** (object) - Description for city - **code** (string) - Description for city code - **name** (string) - Description for city name - **state** (string) - Description for city state (e.g., "ro") - **country** (object) - Description for country - **name** (string) - Description for country name - **code** (integer) - Description for country code - **cityName** (string) - Description for cityName ### Request Example ```json { "name": "string", "legalName": "string", "federalTaxNumber": "string", "stateTaxNumber": "string", "cityTaxNumber": "string", "email": "string", "phone": "string", "mobilePhone": "string", "address": { "street": "string", "district": "string", "postalCode": "string", "number": "string", "additionalInformation": "string", "city": { "code": "string", "name": "string", "state": "ro" }, "country": { "name": "string", "code": 0 }, "cityName": "string" } } ``` ### Response #### Success Response (200) OK ``` -------------------------------- ### GET /v1/companies/{id} Source: https://docs.spedy.com.br/index Retrieves details for a specific company by its ID. ```APIDOC ## Get Company ### Description Retrieves detailed information about a specific company using its unique identifier. ### Method GET ### Endpoint `/v1/companies/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the company to retrieve. ### Response #### Success Response (200) OK ``` -------------------------------- ### POST /v1/products Source: https://docs.spedy.com.br/index Creates a new product with the specified details. Requires a JSON payload in the request body. ```APIDOC ## Create Product ### Description Creates a new product in the system. The request body includes all necessary product details. ### Method POST ### Endpoint /v1/products ### Parameters #### Request Body - **code** (string or null) - Optional - The product code (max 40 characters). - **name** (string) - Required - The product name (max 120 characters). - **price** (number or null) - Optional - The product price. - **invoiceModel** (string) - Optional - The invoicing model. Enum: "productInvoice", "consumerInvoice", "serviceInvoice". - **warrantyDays** (integer or null) - Optional - The number of warranty days. - **serviceInvoiceSettings** (object) - Optional - Settings for service invoices. - **productInvoiceSettings** (object) - Optional - Settings for product invoices. ### Request Example ```json { "code": "string", "name": "string", "price": 0.1, "invoiceModel": "productInvoice", "warrantyDays": 0, "serviceInvoiceSettings": { "fiscalDescription": "string", "cityServiceCode": "string", "federalServiceCode": "string", "cnaeCode": "string", "useSpecificNumering": true, "series": "string", "nextNumber": 0, "nextBatchNumber": 0, "nbsCode": "string" }, "productInvoiceSettings": { "gtinCode": "string", "cfopIn": "string", "cfopInterstate": "string", "cfopTaxpayerInterstate": "string", "cfopInternational": "string", "cest": "string", "ncm": "string", "unitOfMeasurement": "string", "taxUnitOfMeasurement": "string", "exportationTaxUnitOfMeasurement": "string", "additionalInformation": "string", "fiscalDescription": "string", "useSpecificNumering": true, "series": "string", "nextNumber": 0 } } ``` ### Response #### Success Response (200) OK ``` -------------------------------- ### POST /v1/product-invoices Source: https://docs.spedy.com.br/index Creates a new product invoice with detailed information. ```APIDOC ## POST /v1/product-invoices ### Description Creates a new product invoice with detailed information, including items, payments, and customer details. ### Method POST ### Endpoint https://api.spedy.com.br/v1/product-invoices ### Parameters #### Request Body - **integrationId** (string or null) - ID de integração (max 36 characters). - **issuedOn** (string or null) - Data de emissão (date-time). - **effectiveDate** (string) - Data de competência (date-time). - **number** (integer or null) - Número da NF (int64). - **status** (string) - Enum: "created", "enqueued", "received", "authorized", "inContingent", "rejected", "canceled", "denied", "removed", "disabled". - **additionalInformation** (string or null) - Informações adicionais. - **sendEmailToCustomer** (boolean) - Enviar e-mail para o cliente / tomador. - **series** (string or null) - Série. - **printingType** (string) - Enum: "none", "portrait", "landscape", "simplified", "consumerInvoice", "electronicMessage". - **operationType** (string) - Enum: "incoming", "outgoing". - **purposeType** (string) - Enum: "normal", "complement", "adjustment", "devolution", "credit", "debit". - **issueType** (string) - Enum: "normal", "fsia", "scan", "epec", "fsda", "svcan", "svcrs", "offLine", "website", "annfs", "alt". Forma de emissão da NF-e. - **operationNature** (string or null) - Natureza de Operação. - **operationDate** (string or null) - (date-time). - **destination** (string) - Enum: "internal", "interstate", "international". - **presenceType** (string) - Enum: "none", "presence", "internet", "telephone", "delivery", "othersNonPresenceOperation". - **receiver** (object) - SefazInvoiceReceiverDto. - **transport** (object) - SefazInvoiceTransportDto. - **billing** (object) - SefazInvoiceBillingDto. - **duplicates** (Array of objects or null) - Faturas. - **payments** (Array of objects or null) - Pagamentos [pag]. - **items** (Array of objects or null) - Itens da nota [det]. - **referencedDocuments** (Array of objects or null) - Documentos Fiscais Referenciados [NFref]. - **total** (object) - SefazInvoiceTotalDto. - **accessKey** (string or null) - Chave de acesso [Id]. - **code** (string or null) - Código Numérico [cNF]. - **isFinalCustomerrequired** (boolean) - Consumidor Final [indFinal]. - **debitType** (string) - Enum: "creditTransferToCooperatives", "creditReversalForExemptOrImmuneOutputs", "unprocessedInvoiceDebitInAssessment", "penaltyAndInterest", "creditTransferBySuccession", "advancePayment", "inventoryLoss". Tipo de Nota de Débito [tpNFDebito]. - **creditType** (string) - Enum: "finesAndInterest", "appropriation". Tipo de Nota de Crédito [tpNFCredito]. - **govPurchase** (object) - SefazInvoiceGovPurchaseDto. - **govOperationType** (string) - Enum: "supply", "receipt". Tipo de operação com o ente governamental [tpOperGov]. ### Request Example ```json { "integrationId": "string", "issuedOn": "2023-10-27T10:00:00Z", "effectiveDate": "2023-10-27T10:00:00Z", "number": 12345, "status": "created", "additionalInformation": "Some additional info", "sendEmailToCustomer": true, "series": "1", "printingType": "portrait", "operationType": "outgoing", "purposeType": "normal", "issueType": "normal", "operationNature": "Venda de mercadorias", "operationDate": "2023-10-27T10:00:00Z", "destination": "internal", "presenceType": "internet", "receiver": { "name": "John Doe", "document": "12345678901", "stateRegistration": "ISENT", "email": "john.doe@example.com", "phone": "11999999999", "address": { "street": "Rua Exemplo", "number": "123", "complement": "Apto 1", "neighborhood": "Centro", "city": { "code": "3550308", "name": "São Paulo", "state": "SP" }, "zipCode": "01000000" } }, "transport": { "type": "road", "carrier": { "document": "12345678901", "name": "Transportadora Exemplo", "stateRegistration": "ISENT", "address": { "street": "Rua Transportadora", "number": "456", "neighborhood": "Centro", "city": { "code": "3550308", "name": "São Paulo", "state": "SP" }, "zipCode": "01000000" } }, "vehicle": { "plate": "ABC1234", "uf": "SP", "type": "truck", "owner": { "document": "12345678901", "name": "Proprietário Veículo", "stateRegistration": "ISENT", "address": { "street": "Rua Veículo", "number": "789", "neighborhood": "Centro", "city": { "code": "3550308", "name": "São Paulo", "state": "SP" }, "zipCode": "01000000" } } }, "volumes": [ { "type": "box", "quantity": 10, "species": "Caixas", "marks": "Marcação 1", "number": "123", "weight": { "gross": 100.5, "net": 100.0 } } ] }, "billing": { "invoices": [ { "number": "INV001", "series": "1", "amount": 1000.00 } ] }, "duplicates": [ { "invoice": { "number": "DUP001", "series": "1", "amount": 500.00 } } ], "payments": [ { "type": "cash", "amount": 1000.00, "paymentMethod": "01", "cardDetails": { "type": "credit", "brand": "Visa" } } ], "items": [ { "product": { "code": "PROD001", "description": "Produto Exemplo", "unit": "UN", "gtin": "12345678901234", "ncm": "00000000" }, "quantity": 2, "unitValue": 500.00, "discount": 0.00, "taxes": { "icms": { "origin": "0", "icms": { "value": 18.0, "amount": 90.00 } } }, "totalValue": 1000.00 } ], "referencedDocuments": [ { "type": "nfce", "key": " chave-de-acesso-nfce-referenciada" } ], "total": { "products": 1000.00, "taxes": { "icms": 90.00 }, "discounts": 0.00, "total": 1000.00 }, "accessKey": " chave-de-acesso-gerada", "code": 123, "isFinalCustomerrequired": true, "debitType": "penaltyAndInterest", "creditType": "finesAndInterest", "govPurchase": { "type": "supply", "number": "GOV001" }, "govOperationType": "supply" } ``` ### Response #### Success Response (200) - **accessKey** (string) - The access key of the created invoice. - **code** (integer) - The numeric code of the invoice. #### Response Example ```json { "accessKey": " chave-de-acesso-gerada", "code": 123 } ``` ``` -------------------------------- ### GET /v1/service-invoices/{id}/xml Source: https://docs.spedy.com.br/index Downloads the XML of a specific service invoice using its ID. ```APIDOC ## GET /v1/service-invoices/{id}/xml ### Description Downloads the XML of a specific service invoice using its ID. ### Method GET ### Endpoint /v1/service-invoices/{id}/xml ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier (UUID) of the service invoice. ### Request Example (No specific request body or query parameters) ### Response #### Success Response (200) OK (Returns the XML content of the invoice) #### Response Example (No specific example provided in the source text for success response body) ``` -------------------------------- ### Create Webhook Source: https://docs.spedy.com.br/index Creates a new webhook configuration, specifying the event to trigger and the target URL. ```APIDOC ## POST /v1/webhooks ### Description Creates a new webhook configuration, specifying the event to trigger and the target URL. ### Method POST ### Endpoint https://api.spedy.com.br/v1/webhooks ### Parameters #### Request Body - **id** (string) - Optional - The unique identifier for the webhook. If not provided, it will be auto-generated. - **event** (string) - Required - The event that triggers the webhook (max 80 characters). - **url** (string) - Required - The URL to which the webhook event will be sent (max 200 characters). ### Request Example ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "event": "string", "url": "string" } ``` ### Response #### Success Response (200) OK ``` -------------------------------- ### GET /v1/orders Source: https://docs.spedy.com.br/index Retrieves a list of sales orders with optional filtering by date and transaction ID. ```APIDOC ## GET /v1/orders ### Description Retrieves a list of sales orders with optional filtering by date and transaction ID. ### Method GET ### Endpoint /v1/orders ### Parameters #### Query Parameters - **initialDate** (string) - Optional - Filter by initial date (date-time format). - **endDate** (string) - Optional - Filter by end date (date-time format). - **transactionId** (string) - Optional - Filter by transaction ID. - **page** (integer) - Optional - Page number for pagination (int32). - **pageSize** (integer) - Optional - Number of items per page (int32). ### Response #### Success Response (200) OK ``` -------------------------------- ### Spedy API (v1) Overview Source: https://docs.spedy.com.br/index This section provides an overview of the Spedy API, including base URLs for production and testing environments, and details on authentication and rate limiting. ```APIDOC ## Spedy API (v1) ### Introduction **Welcome to the Spedy API reference documentation!** We provide a RESTful API to allow you to issue product invoices (NF-e) or service invoices (NFS-e) throughout Brazil. For NFS-e issuance, consult the integrated municipalities. The base URL for the production environment is `api.spedy.com.br` always preceded by the secure protocol `https://`. API versions are grouped by directory, suffixed to the base URL (`https://api.spedy.com.br/v1_`). ### Test Environment Spedy also offers a testing environment, which is completely isolated from the production environment. Therefore, you need to create a new account to use it, choosing the _Developer Plan_ (free of charge). The test environment URLs are listed below: API: `https://sandbox-api.spedy.com.br/v1` Backoffice: `https://sandbox-app.spedy.com.br` ### Request Examples We provide request examples in an Insomnia Collection. To download it, click the button below. ### Authentication Authentication is performed using an API Key, which must be sent in a parameter named `X-Api-Key` in the Header of each request. The API key will only be available upon creation of a new company via API, in an attribute called `apiCredencials` which will be returned, or can be viewed in the Backoffice by accessing **Profile > My Company > API Credentials**. Our authentication mechanism is per Company, meaning each registered company will have its own API Key. The main company of the account has the unique API Key with permission to manage other companies (create, edit, or delete). The keys of other companies only allow operations related to fiscal notes. ### Rate Limit To ensure the **stability**, **performance**, and **security** of our services, the API imposes limits on the number of requests that can be made per user or application within a given time interval. #### **Default Limits** * **60 requests per minute** * **Maximum of 5 requests per second** * Applies to all operations (read and write) If the client exceeds these limits, the API will respond with **HTTP status 429 (Too Many Requests)**. In this case, we recommend waiting for the time indicated in the `x-rate-limit-reset` header before trying again. #### **Rate Limit Headers** With each request, the API returns the following headers: Header | Description ---|--- `x-rate-limit-limit` | Time window used in limit control (e.g., `1m` for 1 minute) `x-rate-limit-remaining` | Number of remaining requests before reaching the limit `x-rate-limit-reset` | Date/time (in UTC) when the limit will be reset ``` -------------------------------- ### GET /v1/service-invoices/{id}/pdf Source: https://docs.spedy.com.br/index Downloads the PDF of a specific service invoice using its ID. ```APIDOC ## GET /v1/service-invoices/{id}/pdf ### Description Downloads the PDF of a specific service invoice using its ID. ### Method GET ### Endpoint /v1/service-invoices/{id}/pdf ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier (UUID) of the service invoice. ### Request Example (No specific request body or query parameters) ### Response #### Success Response (200) OK (Returns the PDF content of the invoice) #### Response Example (No specific example provided in the source text for success response body) ``` -------------------------------- ### POST /v1/companies Source: https://docs.spedy.com.br/index Creates a new company with the provided details. ```APIDOC ## Create Company ### Description Registers a new company in the system. Requires all necessary company details in the request body. ### Method POST ### Endpoint `/v1/companies` ### Parameters #### Request Body - **id** (string) - Required - The ID of the company. - **name** (string [0..80 chars]) - Required - The company's trade name. - **legalName** (string [0..80 chars]) - Required - The company's legal name. - **federalTaxNumber** (string) - Required - The company's CNPJ. - **stateTaxNumber** (string | null) - Optional - The company's state registration number. - **cityTaxNumber** (string | null) - Optional - The company's municipal registration number. - **email** (string | null [0..80 chars]) - Optional - The company's email address. - **phone** (string | null) - Optional - The company's phone number. - **mobilePhone** (string | null) - Optional - The company's mobile phone number. - **address** (object) - Required - The company's address details (AddressDto). - **street** (string) - **district** (string) - **postalCode** (string) - **number** (string) - **additionalInformation** (string) - **city** (object) - **code** (string) - **name** (string) - **state** (string) - **country** (object) - **name** (string) - **code** (integer) - **cityName** (string) - **taxRegime** (string) - Enum: "simplesNacional", "simplesNacionalExcessoSublimite", "regimeNormal", "simplesNacionalMEI" - The company's tax regime. - **specialTaxRegime** (string) - Enum: "municipalMicroenterprise", "estimate", "societyOfProfessionals", "cooperative", "individualMicroenterprise", "microenterpriseAndSmallBusiness", "noSpecialRegime" - The company's special tax regime. ### Request Example ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "legalName": "string", "federalTaxNumber": "string", "stateTaxNumber": "string", "cityTaxNumber": "string", "email": "string", "phone": "string", "mobilePhone": "string", "address": { "street": "string", "district": "string", "postalCode": "string", "number": "string", "additionalInformation": "string", "city": { "code": "string", "name": "string", "state": "ro" }, "country": { "name": "string", "code": 0 }, "cityName": "string" }, "taxRegime": "simplesNacional", "specialTaxRegime": "municipalMicroenterprise" } ``` ### Response #### Success Response (200) OK ``` -------------------------------- ### Get Company Details Source: https://docs.spedy.com.br/index Retrieves detailed information about a specific company using its ID. This endpoint is protected by an API Key. ```HTTP GET /v1/companies/{id} Authorization: ApiKey ``` -------------------------------- ### List Webhooks Source: https://docs.spedy.com.br/index Retrieves a list of all configured webhooks, with support for pagination. ```APIDOC ## GET /v1/webhooks ### Description Retrieves a list of all configured webhooks, with support for pagination. ### Method GET ### Endpoint https://api.spedy.com.br/v1/webhooks ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **pageSize** (integer) - Optional - The number of webhooks to return per page. ### Response #### Success Response (200) - **id** (string) - The unique identifier of the webhook. - **event** (string) - The event that triggers the webhook. - **url** (string) - The URL to which the webhook event will be sent. #### Response Example ```json { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "event": "string", "url": "string" } ``` ``` -------------------------------- ### Request Sample for Issuing Invoices Source: https://docs.spedy.com.br/index This is a sample JSON payload for requesting to issue invoices for a sale. It requires the effective date of the invoice. ```json { "effectiveDate": "2019-08-24T14:15:22Z" } ``` -------------------------------- ### GET /v1/service-invoices Source: https://docs.spedy.com.br/index Lists electronic service invoices (NFS-e) based on specified filter criteria. Requires API Key authorization. ```APIDOC ## Listar Notas Fiscais ### Description Lists electronic service invoices (NFS-e) based on specified filter criteria. ### Method GET ### Endpoint /v1/service-invoices ### Authorizations _ApiKey_ ### Query Parameters - **effectiveDateStart** (string, date-time) - Optional - Start date for the invoice competence period. - **effectiveDateEnd** (string, date-time) - Optional - End date for the invoice competence period. - **transactionId** (string) - Optional - Filters by transaction ID. - **receiverFederalTaxNumber** (string) - Optional - Filters by receiver's CPF/CNPJ/Foreign Document (1 to 14 characters). - **receiverName** (string) - Optional - Filters by receiver's name or trade name. - **receiverEmail** (string) - Optional - Filters by receiver's email address. - **page** (integer) - Optional - The page number for pagination. - **pageSize** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) OK (Returns a list of service invoices matching the criteria) #### Response Example (Response structure is similar to the successful response of 'Criar NFS-e' but returned as an array, with additional fields like `issuedOn`, `company`, `order`, etc. as shown in the provided sample JSON for response samples.) ``` -------------------------------- ### POST /v1/orders Source: https://docs.spedy.com.br/index Creates a new sales order with details about the customer, items, and payment. ```APIDOC ## POST /v1/orders ### Description Creates a new sales order with details about the customer, items, and payment. ### Method POST ### Endpoint /v1/orders ### Parameters #### Request Body - **transactionId** (string) - Optional - Código da Transação / Venda. - **customer** (object) - Optional - Customer data (CustomerDto). - **amount** (number) - Required - Valor total da venda (double). - **discountAmount** (number) - Optional - Valor total de desconto (double). - **freightAmount** (number) - Optional - Valor total de frete (double). - **date** (string) - Required - Data da venda (date-time format). - **warrantyDate** (string) - Optional - Data da Garantia (date-time format). - **sendEmailToCustomer** (boolean) - Optional - Enviar e-mail para cliente. - **status** (string) - Required - Situação da venda. Enum: "created", "awaitingPayment", "approved", "refundRequested", "completed", "chargeback", "canceled", "refunded", "expired", "refused", "deleted". - **autoIssueMode** (string) - Optional - Enum: "disabled", "immediately", "afterPayment", "afterWarrency". - **paymentMethod** (string) - Optional - Forma de pagamento. Enum: "billetBank", "creditCard", "debitCard", "pix", "paypal", "bankTransfer", "balanceWallets", "other", "cash". - **profileType** (string) - Optional - Tipo do Perfil. Enum: "producer", "coproducer", "affiliate". - **items** (array of objects) - Required - Itens da venda (OrderItemDto). - **invoices** (array of objects) - Optional - Notas fiscais (PostInvoiceDto). Informar somente quando necessário personalizar alguma informação da NF a ser gerada. ### Response #### Success Response (200) OK ```