### List Orders Example (JSON) Source: https://connect-stone.stone.com.br/reference/criar-pedido-para-maquininha-copy An example demonstrating how to structure a request to list orders. It includes item details, payment settings, and customer information. ```json { "items": [ { "amount": 100, "description": "Chaveiro do Tesseract", "quantity": 1, "code": "123" } ], "closed": "false", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": false, "devices_serial_number": [ "PB0921C470442" ], "payment_setup": { "type": "debit", "installments": 1, "installment_type": "merchant", "split": [ { "amount": 50, "recipient_id": "re_cm5pr6n8802ba0l9tpggs0tp6", "type": "flat", "options": { "liable": true, "charge_remainder_fee": true, "charge_processing_fee": true } }, { "amount": 50, "recipient_id": "re_cm5pgy35x1e6p0l9tiewsbra7", "type": "flat", "options": { "liable": false, "charge_remainder_fee": false, "charge_processing_fee": false } } ] } }, "customer": { "name": "Tony Stark", "email": "testes@gmail.com" } } ``` -------------------------------- ### Direct Payment Example (JSON) Source: https://connect-stone.stone.com.br/reference/criar-pedido-para-maquininha-copy An example illustrating the structure for processing a direct payment. It specifies items, payment configurations, and customer details. ```json { "items": [ { "amount": 100, "description": "Chaveiro do Tesseract", "quantity": 1, "code": "123" } ], "closed": "false", "poi_payment_settings": { "visible": true, "print_order_receipt": false, "devices_serial_number": [ "PB0921C470442" ], "payment_setup": { "type": "debit", "installments": 1, "installment_type": "merchant", "split": [ { "amount": 50, "recipient_id": "re_cm5pr6n8802ba0l9tpggs0tp6", "type": "flat", "options": { "liable": true, "charge_remainder_fee": true, "charge_processing_fee": true } }, { "amount": 50, "recipient_id": "re_cm5pgy35x1e6p0l9tiewsbra7", "type": "flat", "options": { "liable": false, "charge_remainder_fee": false, "charge_processing_fee": false } } ] } }, "customer": { "name": "Tony Stark", "email": "testes@gmail.com" } } ``` -------------------------------- ### Order Response Example (JSON) Source: https://connect-stone.stone.com.br/reference/criar-pedido Provides an example of a successful response when listing orders. It includes the order ID, code, amount, currency, items, customer details, and status. ```json { "id": "or_3yqQpAbfBhlzgpY5", "code": "WXQV9A5BOR", "amount": 400, "currency": "BRL", "closed": false, "items": [ { "id": "oi_4nmqZgDu1hGVk1Al", "type": "product", "description": "Produto 1", "amount": 400, "quantity": 1, "status": "active", "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z" } ], "customer": { "id": "cus_75zwoLsn3U1paBqK", "name": "exemplo", "email": "exemplo1@exemplo.com", "delinquent": false, "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z", "phones": {} }, "status": "pending", "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": true, "devices_serial_number": [ "a98765-4321", "b98763-54322" ], "updated_at": "2021-09-09T19:19:29Z", "created_at": "2021-09-09T19:19:29Z" } } ``` -------------------------------- ### Example Order Payloads Source: https://connect-stone.stone.com.br/reference/criar-pedido-para-maquininha-copy Sample JSON payloads representing pending orders in the Stone API. These examples demonstrate the inclusion of customer data and POI payment settings for specific devices. ```json { "id": "or_3yqQpAbfBhlzgpY5", "code": "WXQV9A5BOR", "amount": 400, "currency": "BRL", "status": "pending", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "devices_serial_number": ["a98765-4321", "b98763-54322"] } } ``` -------------------------------- ### Direct Payment Order Response (JSON) Source: https://connect-stone.stone.com.br/reference/criar-pedido Illustrates a response for an order processed with direct payment, specifically highlighting credit card installments. It includes payment setup details like installments and installment type. ```json { "id": "or_Zw1n0zSWQuOBYRPE", "code": "8YQEH1T0ZR", "amount": 400, "currency": "BRL", "closed": false, "items": [ { "id": "oi_Qq4Z1D2HOfqnO2D6", "type": "product", "description": "Produto 1", "amount": 400, "quantity": 1, "status": "active", "created_at": "2021-09-09T19:21:04Z", "updated_at": "2021-09-09T19:21:04Z" } ], "customer": { "id": "cus_75zwoLsn3U1paBqK", "name": "exemplo", "email": "exemplo1@exemplo.com", "delinquent": false, "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z", "phones": {} }, "status": "pending", "created_at": "2021-09-09T19:21:04Z", "updated_at": "2021-09-09T19:21:04Z", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": true, "payment_setup": { "type": "credit", "installments": 6, "installment_type": "merchant" }, "devices_serial_number": [ "a98765-4321" ], "updated_at": "2021-09-09T19:21:04Z", "created_at": "2021-09-09T19:21:04Z" } } ``` -------------------------------- ### POST /websites/connect-stone_stone_br Source: https://connect-stone.stone.com.br/reference/criar-pedido This endpoint allows for the creation of orders with various payment settings, including installments and direct payment options. It supports product listings and customer information. ```APIDOC ## POST /websites/connect-stone_stone_br ### Description Creates a new order with specified items, customer details, and payment configurations. Supports different payment types like credit and Pix, including installment options. ### Method POST ### Endpoint /websites/connect-stone_stone_br ### Parameters #### Request Body - **items** (array) - Required - List of items in the order. - **amount** (integer) - Required - The price of the item. - **description** (string) - Required - The name of the item. - **quantity** (integer) - Required - The number of units of the item. - **customer** (object) - Required - Information about the customer. - **name** (string) - Required - The customer's name. - **email** (string) - Required - The customer's email address. - **closed** (string) - Optional - Indicates if the order is closed ('true' or 'false'). - **poi_payment_settings** (object) - Optional - Settings for Point of Interaction payments. - **visible** (boolean) - Optional - Whether the payment option is visible. - **display_name** (string) - Optional - The name displayed for the payment option. - **print_order_receipt** (boolean) - Optional - Whether to print an order receipt. - **devices_serial_number** (array) - Optional - Serial numbers of devices to use. - **payment_setup** (object) - Optional - Configuration for payment setup. - **type** (string) - Required - The type of payment (e.g., 'credit', 'pix'). - **installments** (integer) - Optional - The number of installments for credit payments. - **installment_type** (string) - Optional - The type of installment ('merchant' or 'issuer'). ### Request Example ```json { "items": [ { "amount": 400, "description": "Produto 1", "quantity": 1 } ], "customer": { "name": "exemplo", "email": "exemplo1@exemplo.com" }, "closed": "false", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": true, "devices_serial_number": [ "a98765-4321", "b98763-54322" ] } } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the order. - **code** (string) - A short code for the order. - **amount** (integer) - The total amount of the order. - **currency** (string) - The currency of the order (e.g., 'BRL'). - **closed** (boolean) - Indicates if the order is closed. - **items** (array) - Details of the items in the order. - **id** (string) - Item identifier. - **type** (string) - Type of the item. - **description** (string) - Description of the item. - **amount** (integer) - Amount of the item. - **quantity** (integer) - Quantity of the item. - **status** (string) - Status of the item. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. - **customer** (object) - Details of the customer. - **id** (string) - Customer identifier. - **name** (string) - Customer name. - **email** (string) - Customer email. - **delinquent** (boolean) - Indicates if the customer is delinquent. - **created_at** (string) - Timestamp of creation. - **updated_at** (string) - Timestamp of last update. - **phones** (object) - Customer phone numbers. - **status** (string) - The current status of the order. - **created_at** (string) - Timestamp of order creation. - **updated_at** (string) - Timestamp of order last update. - **poi_payment_settings** (object) - Payment settings for the order. - **visible** (boolean) - Whether the payment option is visible. - **display_name** (string) - The name displayed for the payment option. - **print_order_receipt** (boolean) - Whether to print an order receipt. - **payment_setup** (object) - Configuration for payment setup (if applicable). - **type** (string) - Type of payment. - **installments** (integer) - Number of installments. - **installment_type** (string) - Type of installment. - **devices_serial_number** (array) - Serial numbers of devices used. - **updated_at** (string) - Timestamp of last update for payment settings. - **created_at** (string) - Timestamp of creation for payment settings. #### Response Example ```json { "id": "or_3yqQpAbfBhlzgpY5", "code": "WXQV9A5BOR", "amount": 400, "currency": "BRL", "closed": false, "items": [ { "id": "oi_4nmqZgDu1hGVk1Al", "type": "product", "description": "Produto 1", "amount": 400, "quantity": 1, "status": "active", "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z" } ], "customer": { "id": "cus_75zwoLsn3U1paBqK", "name": "exemplo", "email": "exemplo1@exemplo.com", "delinquent": false, "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z", "phones": {} }, "status": "pending", "created_at": "2021-09-09T19:19:29Z", "updated_at": "2021-09-09T19:19:29Z", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": true, "devices_serial_number": [ "a98765-4321", "b98763-54322" ], "updated_at": "2021-09-09T19:19:29Z", "created_at": "2021-09-09T19:19:29Z" } } ``` ``` -------------------------------- ### Authenticate with API using Basic Auth Source: https://connect-stone.stone.com.br/reference/autentica%C3%A7%C3%A3o Demonstrates how to authenticate requests to the Pagar.me API by providing the SecretKey in the Authorization header. The SecretKey is used as the username with an empty password, encoded in Base64. ```curl curl --location --request POST https://api.pagar.me/core/v5/orders' \ -H 'Authorization: Basic c2tfdGVzdF9*Og==' \ -H 'Content-Type: application/json' ``` ```javascript var fs = require('fs'); const request = require("request"); var body = JSON.parse(fs.readFileSync('body.json', 'utf8')); var options = { method: 'POST', uri: 'https://api.pagar.me/core/v5/orders', headers: { 'Authorization': 'Basic ' + Buffer.from("sk_test_*:").toString('base64'), 'Content-Type': 'application/json' }, json : body }; request(options, function(error, response, body) { console.log(response.body); }); ``` -------------------------------- ### Get Order Details using OpenAPI Source: https://connect-stone.stone.com.br/reference/obter-pedido This snippet demonstrates how to retrieve order details from the Connect 2.0 API using the OpenAPI definition. It requires an order ID as a path parameter and returns a JSON object containing comprehensive order information, including items, customer details, and payment settings. ```json { "openapi": "3.1.0", "info": { "title": "Connect 2.0", "version": "1.0" }, "servers": [ { "url": "https://api.pagar.me" } ], "security": [ {} ], "paths": { "/core/v5/orders/{order_id}": { "get": { "summary": "Obter pedido", "description": "", "operationId": "obter-pedido", "parameters": [ { "name": "order_id", "in": "path", "description": "Id do pedido criado", "schema": { "type": "string" }, "required": true } ], "responses": { "200": { "description": "200", "content": { "application/json": { "examples": { "Result": { "value": "{\n \"id\": \"or_WwQN2zKtaSOXaaaa\",\n \"code\": \"PD73A4YHMO\",\n \"amount\": 200,\n \"currency\": \"BRL\",\n \"closed\": false,\n \"items\": [\n {\n \"id\": \"oi_B1EQVZHdzhJJaaaa\",\n \"type\": \"product\",\n \"description\": \"Produto teste\",\n \"amount\": 200,\n \"quantity\": 1,\n \"status\": \"active\",\n \"created_at\": \"2022-09-13T14:22:23Z\",\n \"updated_at\": \"2022-09-13T14:22:23Z\",\n \"code\": \"1\"\n }\n ],\n \"customer\": {\n \"id\": \"cus_4r8eZzvtwh6aaaa\",\n \"name\": \"Customer 1\",\n \"email\": \"customer1@email.com\",\n \"document\": \"13621248773\",\n \"type\": \"individual\",\n \"delinquent\": false,\n \"created_at\": \"2022-09-13T14:19:11Z\",\n \"updated_at\": \"2022-09-13T14:19:11Z\",\n \"phones\": {\n \"home_phone\": {\n \"country_code\": \"55\",\n \"number\": \"000000000\",\n \"area_code\": \"21\"\n },\n \"mobile_phone\": {\n \"country_code\": \"55\",\n \"number\": \"000000000\",\n \"area_code\": \"21\"\n }\n }\n },\n \"status\": \"pending\",\n \"created_at\": \"2022-09-13T14:22:23Z\",\n \"updated_at\": \"2022-09-13T14:22:23Z\",\n \"poi_payment_settings\": {\n \"visible\": true,\n \"display_name\": \"#pedido1\",\n \"payment_setup\": {\n \"type\": \"credit\",\n \"installments\": 1,\n \"installment_type\": \"merchant\"\n },\n \"devices_serial_number\": [\n \"123456789\"\n ],\n \"updated_at\": \"2022-09-13T14:22:23Z\",\n \"created_at\": \"2022-09-13T14:22:23Z\"\n },\n \"checkouts\": []\n}" } }, "schema": { "type": "object", "properties": { "id": { "type": "string", "example": "or_WwQN2zKtaSOXaaaa" }, "code": { "type": "string", "example": "PD73A4YHMO" }, "amount": { "type": "integer", "example": 200, "default": 0 }, "currency": { "type": "string", "example": "BRL" }, "closed": { "type": "boolean", "example": false, "default": true }, "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "example": "oi_B1EQVZHdzhJJaaaa" }, "type": { "type": "string", "example": "product" }, "description": { "type": "string", "example": "Produto teste" }, "amount": { "type": "integer", "example": 200, "default": 0 }, "quantity": { "type": "integer", "example": 1, "default": 0 }, "status": { "type": "string", "example": "active" }, "created_at": { "type": "string", "example": "2022-09-13T14:22:23Z" }, "updated_at": { "type": "string", "example": "2022-09-13T14:22:23Z" }, "code": { "type": "string", "example": "1" } } } }, "customer": { "type": "object", "properties": { "id": { "type": "string", "example": "cus_4r8eZzvtwh6aaaa" }, "name": { "type": "string", "example": "Customer 1" }, "email": { "type": "string", "example": "customer1@email.com" }, "document": { "type": "string", "example": "13621248773" }, "type": { "type": "string", "example": "individual" }, "delinquent": { "type": "boolean", "example": false }, "created_at": { "type": "string", "example": "2022-09-13T14:19:11Z" }, "updated_at": { "type": "string", "example": "2022-09-13T14:19:11Z" }, "phones": { "type": "object", "properties": { "home_phone": { "type": "object", "properties": { "country_code": { "type": "string", "example": "55" }, "number": { "type": "string", "example": "000000000" }, "area_code": { "type": "string", "example": "21" } } }, "mobile_phone": { "type": "object", "properties": { "country_code": { "type": "string", "example": "55" }, "number": { "type": "string", "example": "000000000" }, "area_code": { "type": "string", "example": "21" } } } } } } }, "status": { "type": "string", "example": "pending" }, "created_at": { "type": "string", "example": "2022-09-13T14:22:23Z" }, "updated_at": { "type": "string", "example": "2022-09-13T14:22:23Z" }, "poi_payment_settings": { "type": "object", "properties": { "visible": { "type": "boolean", "example": true }, "display_name": { "type": "string", "example": "#pedido1" }, "payment_setup": { "type": "object", "properties": { "type": { "type": "string", "example": "credit" }, "installments": { "type": "integer", "example": 1 }, "installment_type": { "type": "string", "example": "merchant" } } }, "devices_serial_number": { "type": "array", "items": { "type": "string", "example": "123456789" } }, "updated_at": { "type": "string", "example": "2022-09-13T14:22:23Z" }, "created_at": { "type": "string", "example": "2022-09-13T14:22:23Z" } } }, "checkouts": { "type": "array", "items": {} } } } } } } } } } } } ``` -------------------------------- ### POI Payment Settings JSON Structure Source: https://connect-stone.stone.com.br/reference/poi-payment-settings A JSON object representation of the POI payment settings configuration. It includes visibility toggles, device serial numbers, and specific payment setup details like transaction type and installment options. ```json { "poi_payment_settings": { "visible": true, "display_name": "Mesa 3", "print_order_receipt": true, "devices_serial_number": ["6C582505"], "payment_setup": { "type": "credit", "installments": 1, "installment_type": "issuer" } } } ``` -------------------------------- ### POST /core/v5/orders/ Source: https://connect-stone.stone.com.br/reference/criar-pedido-para-maquininha-copy Creates a new order to be processed on an integrated POS terminal. Orders must be created as 'open' (closed=false) and include 'poi_payment_settings' to be sent to the device. ```APIDOC ## POST /core/v5/orders/ ### Description Creates a new order to be processed on an integrated POS terminal. Orders must be created as 'open' (closed=false) and include 'poi_payment_settings' to be sent to the device. ### Method POST ### Endpoint https://api.pagar.me/core/v5/orders/ ### Parameters #### Header Parameters - **ServiceRefererName** (string) - Required - ID unique reference for the partner company. - **Authorization** (string) - Required - Basic Auth encoded SK key. - **Content-Type** (string) - Required - Must be application/json. #### Request Body - **customer** (object) - Required - Customer details. - **items** (array) - Required - List of items in the order. - **closed** (boolean) - Required - Set to false to ensure the order appears on the POS. - **poi_payment_settings** (object) - Required - Configuration for POS payment transactions. ### Request Example { "customer": { "Name": "Nome do Cliente", "email": "cliente@email.com" }, "items": [ { "amount": 1990, "description": "Chaveiro do Tesseract", "quantity": "1" } ], "closed": false, "poi_payment_settings": { "type": "credit", "installments": 1 } } ### Response #### Success Response (200) - **id** (string) - The unique identifier of the created order. #### Response Example { "id": "or_1234567890", "status": "open" } ``` -------------------------------- ### POST /core/v5/orders/ Source: https://connect-stone.stone.com.br/reference/criar-pedido Creates an order to be paid on an integrated POS machine. Orders created with `closed` set to `false` and with `poi_payment_settings` populated will be sent to integrated POS devices. ```APIDOC ## POST /core/v5/orders/ ### Description Creates an order to be paid on an integrated POS machine. Orders created with `closed` set to `false` and with `poi_payment_settings` populated will be sent to integrated POS devices. ### Method POST ### Endpoint https://api.pagar.me/core/v5/orders/ ### Parameters #### Header Parameters - **ServiceRefererName** (string) - Optional - ID único de referencia da empresa parceria com o Stone Partner program. Consulte o seu com o time de Integrações ou seu Bizdev - **Authorization** (string) - Optional - Sua chave SK criptografada com o Basic Auth - **Content-Type** (string) - Optional - Default: application/json #### Request Body - **customer** (object) - Required - Dados do cliente. Para mais informações [Criar um customer](https://docs.pagar.me/reference#criar-cliente-1) - **name** (string) - Required - Nome do cliente. Max: 64 caracteres. - **email** (string) - Optional - E-mail do cliente. Max: 64 caracteres - **items** (array) - Required - Itens do pedido. - **amount** (integer) - Optional - Valor unitário. Default: 1990 - **description** (string) - Optional - Descrição do item. Default: Chaveiro do Tesseract - **quantity** (integer) - Optional - Default: 1 - **code** (string) - Optional - Código do item no sistema da loja. - **closed** (boolean) - Required - Informa se o pedido será criado **aberto** ou **fechado**. Pare o pedido aparecer no POS, é preciso que o pedido seja criado aberto. Default: false - **poi_payment_settings** (object) - Required - Objeto que contém as informações de transações necessárias para pedidos pagos na maquininha (POS). - **type** (string) - Optional - Tipo da transação a ser realizada pelo POS. Se o campo for enviado vazio/nulo, o operador do POS irá poder selecionar o tipo de pagamento. Valores possíveis: ("debit", "credit", "voucher" e "pix (Disponível versão 6.4 do app de pagamentos)). - **installments** (integer) - Optional - Número de parcelas para a transação. ### Request Example ```json { "customer": { "name": "Nome do Cliente", "email": "email@cliente.com" }, "items": [ { "amount": 1990, "description": "Chaveiro do Tesseract", "quantity": 1, "code": "TESSERACT_KEYCHAIN" } ], "closed": false, "poi_payment_settings": { "type": "credit", "installments": 2 } } ``` ### Response #### Success Response (200) - **id** (string) - ID do pedido. - **customer** (object) - Dados do cliente. - **items** (array) - Itens do pedido. - **closed** (boolean) - Indica se o pedido está fechado. - **poi_payment_settings** (object) - Configurações de pagamento do POS. - **created_at** (string) - Data de criação do pedido. - **updated_at** (string) - Data de atualização do pedido. #### Response Example ```json { "id": "ord_abc123xyz", "customer": { "name": "Nome do Cliente", "email": "email@cliente.com" }, "items": [ { "amount": 1990, "description": "Chaveiro do Tesseract", "quantity": 1, "code": "TESSERACT_KEYCHAIN" } ], "closed": false, "poi_payment_settings": { "type": "credit", "installments": 2 }, "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ``` -------------------------------- ### GET /core/v5/orders/{order_id} Source: https://connect-stone.stone.com.br/reference/obter-pedido Retrieves the details of a specific order using its unique ID. ```APIDOC ## GET /core/v5/orders/{order_id} ### Description Retrieves the details of a specific order using its unique ID. ### Method GET ### Endpoint /core/v5/orders/{order_id} ### Parameters #### Path Parameters - **order_id** (string) - Required - Id do pedido criado ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **id** (string) - Id do pedido criado - **code** (string) - Código do pedido - **amount** (integer) - Valor total do pedido em centavos - **currency** (string) - Moeda do pedido (ex: BRL) - **closed** (boolean) - Indica se o pedido está fechado - **items** (array) - Lista de itens do pedido - **id** (string) - ID do item - **type** (string) - Tipo do item (ex: product) - **description** (string) - Descrição do item - **amount** (integer) - Valor do item em centavos - **quantity** (integer) - Quantidade do item - **status** (string) - Status do item (ex: active) - **created_at** (string) - Data de criação do item - **updated_at** (string) - Data de atualização do item - **code** (string) - Código do item - **customer** (object) - Informações do cliente - **id** (string) - ID do cliente - **name** (string) - Nome do cliente - **email** (string) - Email do cliente - **document** (string) - Documento do cliente - **type** (string) - Tipo do cliente (ex: individual) - **delinquent** (boolean) - Indica se o cliente está inadimplente - **created_at** (string) - Data de criação do cliente - **updated_at** (string) - Data de atualização do cliente - **phones** (object) - Informações de telefone do cliente - **home_phone** (object) - Telefone residencial - **country_code** (string) - Código do país - **number** (string) - Número de telefone - **area_code** (string) - Código de área - **mobile_phone** (object) - Telefone celular - **country_code** (string) - Código do país - **number** (string) - Número de telefone - **area_code** (string) - Código de área - **status** (string) - Status do pedido (ex: pending) - **created_at** (string) - Data de criação do pedido - **updated_at** (string) - Data de atualização do pedido - **poi_payment_settings** (object) - Configurações de pagamento do Ponto de Venda - **visible** (boolean) - Indica se as configurações de pagamento são visíveis - **display_name** (string) - Nome de exibição das configurações de pagamento - **payment_setup** (object) - Configuração do pagamento - **type** (string) - Tipo de pagamento (ex: credit) - **installments** (integer) - Número de parcelas - **installment_type** (string) - Tipo de parcela (ex: merchant) - **devices_serial_number** (array) - Lista de números de série dos dispositivos - **updated_at** (string) - Data de atualização das configurações de pagamento - **created_at** (string) - Data de criação das configurações de pagamento - **checkouts** (array) - Lista de checkouts associados ao pedido #### Response Example ```json { "id": "or_WwQN2zKtaSOXaaaa", "code": "PD73A4YHMO", "amount": 200, "currency": "BRL", "closed": false, "items": [ { "id": "oi_B1EQVZHdzhJJaaaa", "type": "product", "description": "Produto teste", "amount": 200, "quantity": 1, "status": "active", "created_at": "2022-09-13T14:22:23Z", "updated_at": "2022-09-13T14:22:23Z", "code": "1" } ], "customer": { "id": "cus_4r8eZzvtwh6aaaa", "name": "Customer 1", "email": "customer1@email.com", "document": "13621248773", "type": "individual", "delinquent": false, "created_at": "2022-09-13T14:19:11Z", "updated_at": "2022-09-13T14:19:11Z", "phones": { "home_phone": { "country_code": "55", "number": "000000000", "area_code": "21" }, "mobile_phone": { "country_code": "55", "number": "000000000", "area_code": "21" } } }, "status": "pending", "created_at": "2022-09-13T14:22:23Z", "updated_at": "2022-09-13T14:22:23Z", "poi_payment_settings": { "visible": true, "display_name": "#pedido1", "payment_setup": { "type": "credit", "installments": 1, "installment_type": "merchant" }, "devices_serial_number": [ "123456789" ], "updated_at": "2022-09-13T14:22:23Z", "created_at": "2022-09-13T14:22:23Z" }, "checkouts": [] } ``` ``` -------------------------------- ### Create Order with Payment Settings (JSON) Source: https://connect-stone.stone.com.br/reference/criar-pedido Defines the structure for creating an order, including item details, customer information, and specific payment settings. This is a mandatory field for types like 'credit' and 'pix'. ```json { "items": [ { "amount": 400, "description": "Produto 1", "quantity": 1 } ], "customer": { "name": "exemplo", "email": "exemplo1@exemplo.com" }, "closed": "false", "poi_payment_settings": { "visible": true, "display_name": "Mesa 1", "print_order_receipt": true, "devices_serial_number": [ "a98765-4321", "b98763-54322" ] } } ``` -------------------------------- ### POST /orders Source: https://connect-stone.stone.com.br/reference/criar-pedido-para-maquininha-copy Creates a new order with items, customer details, and specific payment configurations for POI devices. ```APIDOC ## POST /orders ### Description Creates a new order in the system, allowing for itemization, customer association, and complex payment splitting across multiple recipients. ### Method POST ### Endpoint /orders ### Request Body - **items** (array) - Required - List of products in the order. - **closed** (boolean) - Optional - Order status. - **poi_payment_settings** (object) - Required - Configuration for payment terminal integration. - **customer** (object) - Required - Customer contact information. ### Request Example { "items": [{"amount": 100, "description": "Chaveiro do Tesseract", "quantity": 1, "code": "123"}], "closed": "false", "poi_payment_settings": { "visible": true, "payment_setup": { "type": "debit", "installments": 1, "installment_type": "merchant" } }, "customer": { "name": "Tony Stark", "email": "testes@gmail.com" } } ### Response #### Success Response (200) - **status** (string) - Order processing status. #### Response Example { "status": "success" } ``` -------------------------------- ### GET /pagamento-direto Source: https://connect-stone.stone.com.br/reference/criar-pedido Retrieves the details of a direct payment transaction including order status, items, and customer information. ```APIDOC ## GET /pagamento-direto ### Description Retrieves the details of a specific direct payment transaction. ### Method GET ### Endpoint /pagamento-direto ### Response #### Success Response (200) - **id** (string) - Unique identifier for the payment - **code** (string) - Transaction code - **amount** (integer) - Total amount in cents - **currency** (string) - Currency code (e.g., BRL) - **closed** (boolean) - Status indicating if the payment is closed - **items** (array) - List of items included in the payment - **customer** (object) - Customer details associated with the payment #### Response Example { "id": "or_Zw1n0zSWQuOBYRPE", "code": "8YQEH1T0ZR", "amount": 400, "currency": "BRL", "closed": false, "items": [ { "id": "oi_Qq4Z1D2HOfqnO2D6", "type": "product", "description": "Produto 1", "amount": 400, "quantity": 1 } ], "customer": { "id": "cus_75zwoLsn3U1paBqK", "name": "exemplo", "email": "exemplo1@exemplo.com" } } ```