v1

latestOpenAPI 3.1.02026-07-241040774.6 KB

Criar pedido multicompradores

Neste caso você pode incluir um cliente (customer) dentro do nó de pagamento (payment). Caso um nó payment não possua um nó customer dentro, assumiremos que o pagador dele é o mesmo customer do pedido.

post/orders...

Request body

codestring

Código identificador do pedido no sistema da loja. Max: 52 caracteres.

customer_idstring

Código do cliente.

customerobject

Dados do cliente. Obrigatório caso o customer_id não seja informado. Saiba mais sobre clientes.

shippingobject

Dados para entrega. Saiba mais sobre entregas

closedboolean

Informa se o pedido será criado aberto ou fechado

metadatastring

Objeto chave/valor utilizado para armazenar informações adicionais sobre o pedido. Saiba mais sobre metadata.

Response

200

idstring
codestring
amountinteger
currencystring
closedboolean
statusstring
created_atstring
updated_atstring
closed_atstring

Example response

{
  "id": "or_ke7Dg2MFJt6eo52m",
  "code": "27PYCGA068",
  "amount": 2990,
  "currency": "BRL",
  "closed": true,
  "items": [
    {
      "id": "oi_6opA78NH0Ds4pPLd",
      "description": "Chaveiro do Tesseract",
      "amount": 2990,
      "quantity": 1,
      "status": "active",
      "created_at": "2017-06-23T20:21:31Z",
      "updated_at": "2017-06-23T20:21:31Z"
    }
  ],
  "customer": {
    "id": "cus_l6MdrlRIZIbknz7O",
    "name": "Tony Stark",
    "email": "tstark@avengers.com",
    "created_at": "2017-06-23T20:17:24Z",
    "updated_at": "2017-06-23T20:17:24Z"
  },
  "status": "paid",
  "created_at": "2017-06-23T20:21:31Z",
  "updated_at": "2017-06-23T20:21:32Z",
  "closed_at": "2017-06-23T20:21:32Z",
  "charges": [
    {
      "id": "ch_012oaovIlU44JzBW",
      "code": "27PYCGA068",
      "gateway_id": "56e9d2c9-7888-431e-8f6f-662c81ba0d19",
      "amount": 990,
      "status": "paid",
      "currency": "BRL",
      "payment_method": "credit_card",
      "paid_at": "2017-06-23T20:21:31Z",
      "created_at": "2017-06-23T20:21:31Z",
      "updated_at": "2017-06-23T20:21:31Z",
      "customer": {
        "id": "cus_l6MdrlRIZIbknz7O",
        "name": "Tony Stark",
        "email": "tstark@avengers.com",
        "created_at": "2017-06-23T20:17:24Z",
        "updated_at": "2017-06-23T20:17:24Z"
      },
      "last_transaction": {
        "id": "tran_zgydxzOI9FBzAe3O",
        "transaction_type": "credit_card",
        "funding_source": "prepaid",
        "gateway_id": "efa792c8-8892-475a-a294-7a1127f73771",
        "amount": 990,
        "status": "captured",
        "success": true,
        "installments": 1,
        "statement_descriptor": "AVENGERS",
        "acquirer_name": "simulator",
        "acquirer_affiliation_code": "000000000",
        "acquirer_tid": "845328",
        "acquirer_nsu": "847047",
        "acquirer_auth_code": "143559",
        "acquirer_message": "Simulator|Transação de simulação autorizada com sucesso",
        "acquirer_return_code": "0",
        "operation_type": "auth_and_capture",
        "card": {
          "id": "card_NZ4E4DYSbbsNLEDa",
          "first_six_digits": "402400",
          "last_four_digits": "9325",
          "brand": "Visa",
          "holder_name": "TONY STARK",
          "exp_month": 1,
          "exp_year": 2030,
          "status": "active",
          "created_at": "2017-06-23T20:17:25Z",
          "updated_at": "2017-06-23T20:17:25Z",
          "type": "credit"
        },
        "created_at": "2017-06-23T20:21:31Z",
        "updated_at": "2017-06-23T20:21:31Z",
        "gateway_response": {
          "code": "201"
        }
      }
    }
  ]
}