{
  "info": {
    "name": "VoltBras B2B API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://b2b.staging.voltbras.com.br"
    },
    {
      "key": "apiKey",
      "value": ""
    },
    {
      "key": "accessToken",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Exchange service account api-key for JWT access and refresh tokens",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "token"
              ],
              "query": []
            },
            "description": "Send the service account api-key in the api-key header. There is no request body. The response carries the access token, the refresh token, expiresIn in seconds, and the service account id. Sessions, consumers, charge points, and webhooks authenticate with Authorization: Bearer and that access token.",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "api-key",
                  "type": "string"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}",
                  "type": "string"
                },
                {
                  "key": "in",
                  "value": "header",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Refresh JWT by re-exchanging the service account api-key (refreshToken required for contract compatibility)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/auth/refresh",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "auth",
                "refresh"
              ],
              "query": []
            },
            "description": "Send the same api-key header and the previous refreshToken in the body. IAM is called with the api-key. refreshToken must be a non-empty string. Call this before expiresIn elapses. The response is a new pair, and expiresIn starts again from the returned value.",
            "auth": {
              "type": "apikey",
              "apikey": [
                {
                  "key": "key",
                  "value": "api-key",
                  "type": "string"
                },
                {
                  "key": "value",
                  "value": "{{apiKey}}",
                  "type": "string"
                },
                {
                  "key": "in",
                  "value": "header",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Sessions",
      "item": [
        {
          "name": "Start session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sessions/start",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sessions",
                "start"
              ],
              "query": []
            },
            "description": "Allows to start a remote session for a consumer of an external system using a ServiceAccount. A created session returns the charge identifiers. Repeating the same start returns only sessionId. A business failure returns code, message, and the fields of that result.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"consumerId\": \"\",\n  \"stationId\": \"\",\n  \"connectorId\": 1,\n  \"emspId\": \"\",\n  \"maxCostCents\": 5000\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Stop session",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/sessions/stop",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sessions",
                "stop"
              ],
              "query": []
            },
            "description": "Allows to stop a session for a consumer of an external system using a ServiceAccount. The body carries sessionId. The station is read from that session. An accepted stop returns success true. A business failure returns code, message, and the fields of that result.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"sessionId\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Retrieve sessions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sessions?limit=100&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sessions"
              ],
              "query": [
                {
                  "key": "consumerIds",
                  "value": "{\"type\":\"EXTERNAL\",\"ids\":[\"123456\"]}",
                  "description": "Consumers to include. type is INTERNAL or EXTERNAL.\nIn the query string, send JSON: {\"type\":\"EXTERNAL\",\"ids\":[\"123456\"]}.",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "100",
                  "disabled": false
                },
                {
                  "key": "offset",
                  "value": "0",
                  "disabled": false
                },
                {
                  "key": "sessionIds",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "includesStatus",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "orgIds",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "updatedAtTimeRange",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "createdAtTimeRange",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "roamingType",
                  "value": "ALL",
                  "description": "Filters sessions by roaming type.\nREAL → CPO and eMSP belong to different organization trees.\nINTERNAL → same tree, or mspId is null.\nALL → no filter (default behavior).",
                  "disabled": true
                }
              ]
            },
            "description": "Retrieve sessions",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Retrieve session",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/sessions/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "sessions",
                ":id"
              ],
              "query": []
            },
            "description": "Retrieve session",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Orders",
      "item": [
        {
          "name": "Notify order capture",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders/notify-capture",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders",
                "notify-capture"
              ],
              "query": []
            },
            "description": "Records a capture that already happened in the partner system. VoltBras updates the order status and does not charge the driver. orderId comes from the session order. Send this after the order is ready to be captured. A missing or invalid field returns 400.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orderId\": \"e6b5775e-db68-400a-b538-44378d81d528\",\n  \"emspId\": \"example-emsp\",\n  \"capturedAt\": \"2026-01-22T11:30:05.000Z\",\n  \"capturedValueCents\": 1900\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Notify order cancellation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/orders/notify-cancellation",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "orders",
                "notify-cancellation"
              ],
              "query": []
            },
            "description": "Records a cancellation that already happened in the partner system. VoltBras updates the order status and does not cancel a payment in the gateway. orderId comes from the session order. A missing or invalid field returns 400.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orderId\": \"e6b5775e-db68-400a-b538-44378d81d528\",\n  \"emspId\": \"example-emsp\",\n  \"reason\": \"Customer cancelled the payment\",\n  \"cancelledAt\": \"2026-01-22T11:30:05.000Z\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Consumers",
      "item": [
        {
          "name": "Register external consumer",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/consumers",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "consumers"
              ],
              "query": []
            },
            "description": "Register external consumer",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"consumerId\": \"consumer-123\",\n  \"identification\": \"123.456.789-00\",\n  \"fullName\": \"John Doe\",\n  \"email\": \"john.doe@example.com\",\n  \"emspId\": \"emsp-456\",\n  \"address\": \"\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Retrieve consumer",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/consumers/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "consumers",
                ":id"
              ],
              "query": []
            },
            "description": "Returns one consumer by numeric id, including name, contact data, and addresses.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    },
    {
      "name": "Charge Points",
      "item": [
        {
          "name": "Retrieve charge points",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/charge-points?limit=30&offset=0",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "charge-points"
              ],
              "query": [
                {
                  "key": "search",
                  "value": "",
                  "description": "Free-text search. Leave empty to return every charge point visible to the caller.",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "30",
                  "description": "Page size. Defaults to 100 when omitted.",
                  "disabled": false
                },
                {
                  "key": "offset",
                  "value": "0",
                  "description": "Number of charge points to skip.",
                  "disabled": false
                },
                {
                  "key": "filter",
                  "value": "",
                  "disabled": true
                },
                {
                  "key": "sort",
                  "value": "",
                  "disabled": true
                }
              ]
            },
            "description": "Returns relatively static information about each charge point visible to the api-key, for registration and for the client cache. The page size defaults to 100. The id matches the status list, the map list, and the charge point detail.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Retrieve charge point statuses",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/charge-points/status",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "charge-points",
                "status"
              ],
              "query": []
            },
            "description": "Returns the id and the operational status of each charge point. The id matches the one from the map list, so a map can show where the charge point is and whether it can be used.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Retrieve charge point map",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/charge-points/map",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "charge-points",
                "map"
              ],
              "query": []
            },
            "description": "Returns what a client needs to draw each charge point on a map: position, name, connector types and how it can be used. Send the access token from POST /v1/auth/token as Authorization: Bearer. This data changes rarely, so the response carries an ETag and can be revalidated with If-None-Match. The id matches the one from the status list, so a map can place the charge point and read its status.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Retrieve charge point",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/charge-points/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "charge-points",
                ":id"
              ],
              "query": []
            },
            "description": "Returns the current information of one charge point, including connector status and price, for the moment the client chooses where to start a charge.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Send charge point simulator command",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/charge-points/command",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "charge-points",
                "command"
              ],
              "query": []
            },
            "description": "Send charge point simulator command",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"stationId\": \"station-789\",\n  \"action\": \"Reset\",\n  \"connectorId\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List webhook subscriptions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ],
              "query": []
            },
            "description": "Returns every callback registered for organizations your service account may manage. The authorization secret is not returned.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        },
        {
          "name": "Register webhook subscription",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ],
              "query": []
            },
            "description": "Creates a subscription for one organization and one event. Use session.started, session.updated, or order.updated for new integrations. Returns 409 if that pair is already registered.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orgId\": \"voltbras\",\n  \"event\": \"session.started\",\n  \"authorization\": \"Bearer secret\",\n  \"callbackURL\": \"https://partner.example/voltbras/events\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Update webhook subscription",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks"
              ],
              "query": []
            },
            "description": "Changes the callback URL and authorization for an existing subscription. The organization and event must already be registered.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"orgId\": \"voltbras\",\n  \"event\": \"session.updated\",\n  \"authorization\": \"Bearer secret\",\n  \"callbackURL\": \"https://partner.example/voltbras/events\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          }
        },
        {
          "name": "Delete webhook subscription",
          "request": {
            "method": "DELETE",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/v1/webhooks/:orgId/:event",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "v1",
                "webhooks",
                ":orgId",
                ":event"
              ],
              "query": []
            },
            "description": "Removes the subscription for the given organization and event.",
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{accessToken}}",
                  "type": "string"
                }
              ]
            }
          }
        }
      ]
    }
  ]
}
