Skip to content

Queue - Notify Delivery

Endpoint to create objects in the processing queue related to delivery notifications.

URLs

MethodURLActionDescription
POST/api/v1/integration/queueRegisterCreates an object in the processing queue for delivery notification
GET/api/v1/integration/queue/{id}ViewChecks the processing status of an object in the queue

Production:

{connect-producao}/api/v1/integration/queue

Staging:

{connect-homologacao}/api/v1/integration/queue

Authentication

All requests require an access token obtained from the Security endpoint. The token must be sent in the AccessToken header.

Create Object in Queue

Request

Endpoint: POST {connect-producao}/api/v1/integration/queue

Headers:

AccessToken: {access_token}
Content-Type: application/json

Body:

json
{
  "action": "notify-delivery",
  "data": {
    "entrega_id": 57,
    "fk_tiny_pedidos": 135,
    "order_id": "3D3E-9E1A-45329",
    "tiny_id": 1021986006,
    "deliveryOperatorName": "Delivery Operator",
    "deliveryOperatorDocument": "12345678900",
    "deliveryOperatorLocation": 54000000109,
    "status": "Delivered",
    "entrega_created_at": "2025-05-20T02:00:00Z",
    "entrega_updated_at": "2025-05-20T02:29:00Z"
  }
}

Body Fields

FieldTypeRequiredDescription
entrega_idnumberYesInternal delivery ID
fk_tiny_pedidosnumberYesOrder ID in external system
order_idstringYesUnique order ID
tiny_idnumberYesID in Tiny system
deliveryOperatorNamestringYesDelivery operator name
deliveryOperatorDocumentstringYesDelivery operator document
deliveryOperatorLocationnumberYesOperator location
statusstringYesDelivery status
entrega_created_atstringYesDelivery creation date
entrega_updated_atstringYesDelivery update date

Success Response

Status: 201 Created

json
{
  "id": "uuid-of-object",
  "created": "2025-01-01T00:00:00Z",
  "iCode": 0,
  "iMsg": "Object created successfully",
  "processDate": null,
  "processStatus": "pending",
  "processMsg": null
}

Check Processing

Request

Endpoint: GET {connect-producao}/api/v1/integration/queue/{id}

Headers:

AccessToken: {access_token}

Success Response

Status: 200 OK

json
{
  "id": "uuid-of-object",
  "created": "2025-01-01T00:00:00Z",
  "iCode": 0,
  "iMsg": "Processed successfully",
  "processDate": "2025-01-01T00:05:00Z",
  "processStatus": "completed",
  "processMsg": "Delivery notification processed",
  "data": {
    "entrega_id": 57,
    "fk_tiny_pedidos": 135,
    "order_id": "3D3E-9E1A-45329",
    "tiny_id": 1021986006,
    "deliveryOperatorName": "Delivery Operator",
    "deliveryOperatorDocument": "12345678900",
    "deliveryOperatorLocation": 54000000109,
    "status": "Delivered",
    "entrega_created_at": "2025-05-20T02:00:00Z",
    "entrega_updated_at": "2025-05-20T02:29:00Z"
  }
}

Implementation Example

javascript
async function notifyDelivery(deliveryData, accessToken) {
  const response = await fetch('{connect-producao}/api/v1/integration/queue', {
    method: 'POST',
    headers: {
      'AccessToken': accessToken,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      action: 'notify-delivery',
      data: deliveryData
    })
  });

  if (!response.ok) {
    throw new Error(`Error ${response.status}: ${response.statusText}`);
  }

  return await response.json();
}

Fanbase API Documentation