v1

latestOpenAPI 3.1.02026-07-26477322.4 KB

Criar pedido com split

Para realizar pedidos com split, você deve criar um objeto order com o objeto split. Para formar o objeto split, você deve primeiramente cadastrar recebedores. O objeto order com split possui os seguintes atributos:

post/orders

Request body

codestring

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

customer_idstring

Código do cliente.

closedboolean

Informa se o pedido será criado aberto ou fechado

metadatastring

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

Response

200

idstring
codestring
gateway_idstring
amountinteger
paid_amountinteger
statusstring
currencystring
payment_methodstring
paid_atstring
created_atstring
updated_atstring

Example response

{
  "id": "ch_NW0ABG5HQikn3Lv4",
  "code": "487FO9HYV3",
  "gateway_id": "3554818",
  "amount": 100,
  "paid_amount": 100,
  "status": "paid",
  "currency": "BRL",
  "payment_method": "credit_card",
  "paid_at": "2018-05-22T18:38:22Z",
  "created_at": "2018-05-22T18:38:08Z",
  "updated_at": "2018-05-22T18:38:08Z",
  "customer": {
    "id": "cus_dgLJ8jmURSe0DQ0N",
    "name": "Tony Stark",
    "email": "tony0@avengers.com",
    "created_at": "2018-05-22T18:38:06Z",
    "updated_at": "2018-05-22T18:38:06Z"
  },
  "last_transaction": {
    "id": "tran_1lLxVjc3JCXVxnED",
    "transaction_type": "credit_card",
    "gateway_id": "3554818",
    "amount": 100,
    "status": "captured",
    "success": true,
    "installments": 1,
    "statement_descriptor": "AVENGERS",
    "acquirer_name": "pagarme",
    "acquirer_tid": "3554818",
    "acquirer_nsu": "3554818",
    "acquirer_return_code": "0000",
    "operation_type": "auth_and_capture",
    "card": {
      "id": "card_nKojDZnNIjh9D5z1",
      "first_six_digits": "401118",
      "last_four_digits": "5580",
      "brand": "Visa",
      "holder_name": "Tony Stark",
      "exp_month": 1,
      "exp_year": 2030,
      "status": "active",
      "created_at": "2018-05-22T18:38:11Z",
      "updated_at": "2018-05-22T18:38:11Z",
      "type": "credit"
    },
    "created_at": "2018-05-22T18:38:13Z",
    "updated_at": "2018-05-22T18:38:13Z",
    "gateway_response": {
      "code": "200"
    },
    "split": [
      {
        "id": "sr_1qeQrB3s1synMW45",
        "type": "percentage",
        "gateway_id": "sr_ck5gv9dr3005di96euc53hcsc",
        "amount": 50,
        "recipient": {
          "id": "rp_5yGwpMGckBHVYmb6",
          "name": "First recipient",
          "email": "first_recipient@pagar.me",
          "document": "12728994706",
          "description": "Descrição do recebedor 1",
          "type": "individual",
          "status": "active",
          "created_at": "2020-01-02T20:23:14Z",
          "updated_at": "2020-01-02T20:23:14Z"
        },
        "options": {
          "liable": true,
          "charge_processing_fee": true,
          "charge_remainder_fee": true
        }
      }
    ]
  },
  "metadata": {
    "code": "123"
  }
}