Exemplos

Depois de ter configurado suas Preferências de Notificação você estará pronto para receber os webhooks em formato JSON. Veja abaixo alguns exemplos dos webhooks.

Webhooks Pedido
Webhook Pagamento
Webhook Reembolso

#Webhooks Pedido

//Pedido criado 
//ORDER.CREATED

{  
   "date":"",
   "env":"",
   "event":"ORDER.CREATED",
   "resource":{  
      "order":{  
         "_links":{  
            "checkout":{  
               "payBoleto":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=boleto"
               },
               "payCheckout":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK"
               },
               "payCreditCard":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=credit-card"
               },
               "payOnlineBankDebitItau":{  
                  "redirectHref":"https://checkout-sandbox.moip.com.br/debit/itau/ORD-5ORUUQ5HV2SK"
               }
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK"
            }
         },
         "addresses":[  
            {  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "type":"SHIPPING",
               "zipCode":"01234000"
            }
         ],
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "liquid":0,
            "otherReceivers":0,
            "paid":0,
            "refunds":0,
            "subtotals":{  
               "addition":0,
               "discount":0,
               "items":9500,
               "shipping":1500
            },
            "total":11000
         },
         "createdAt":"2017-10-23T15:00:58.558-02",
         "customer":{  
            "_links":{  
               "hostedAccount":{  
                  "redirectHref":"https://hostedaccount-sandbox.moip.com.br?token=e5d653fd-7bab-4f52-aeaf-0d0a3d0c3d59\u0026id=CUS-SB5W39JUOLUV\u0026mpa=MPA-B4DEE9F7589B"
               },
               "self":{  
                  "href":"https://sandbox.moip.com.br/v2/customers/CUS-SB5W39JUOLUV"
               }
            },
            "addresses":[  
               {  
                  "city":"São Paulo",
                  "complement":"10",
                  "country":"BRA",
                  "district":"Itaim Bibi",
                  "state":"SP",
                  "street":"Avenida Faria Lima",
                  "streetNumber":"500",
                  "type":"SHIPPING",
                  "zipCode":"01234000"
               }
            ],
            "birthDate":"1995-01-30",
            "createdAt":"2017-10-23T14:58:57.000-02",
            "email":"[email protected]",
            "fullname":"José Silva",
            "id":"CUS-SB5W39JUOLUV",
            "ownId":"customer_id_01",
            "phone":{  
               "areaCode":"11",
               "countryCode":"55",
               "number":"55552266"
            },
            "shippingAddress":{  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "zipCode":"01234000"
            },
            "taxDocument":{  
               "number":"22288866644",
               "type":"CPF"
            }
         },
         "entries":[  

         ],
         "escrows":[  

         ],
         "events":[  
            {  
               "createdAt":"2017-10-23T15:00:58.558-02",
               "description":"",
               "type":"ORDER.CREATED"
            }
         ],
         "id":"ORD-5ORUUQ5HV2SK",
         "items":[  
            {  
               "category":"CLOTHING",
               "detail":"Casaco moletom",
               "price":9500,
               "product":"Descrição do pedido",
               "quantity":1
            }
         ],
         "ownId":"order_id_01",
         "payments":[  

         ],
         "platform":"V2",
         "receivers":[  
            {  
               "amount":{  
                  "fees":0,
                  "refunds":0,
                  "total":11000
               },
               "feePayor":true,
               "moipAccount":{  
                  "fullname":"Rogério Oliveira",
                  "id":"MPA-B4DET9F7589B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "refunds":[  

         ],
         "status":"CREATED",
         "updatedAt":"2017-10-23T15:00:58.558-02"
      }
   }
}
//Pedido aguardando pagamento
//ORDER.WAITING

{  
   "date":"",
   "env":"",
   "event":"ORDER.WAITING",
   "resource":{  
      "order":{  
         "_links":{  
            "checkout":{  
               "payBoleto":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=boleto"
               },
               "payCheckout":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK"
               },
               "payCreditCard":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=credit-card"
               },
               "payOnlineBankDebitItau":{  
                  "redirectHref":"https://checkout-sandbox.moip.com.br/debit/itau/ORD-5ORUUQ5HV2SK"
               }
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK"
            }
         },
         "addresses":[  
            {  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "type":"SHIPPING",
               "zipCode":"01234000"
            }
         ],
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "liquid":11000,
            "otherReceivers":0,
            "paid":11000,
            "refunds":0,
            "subtotals":{  
               "addition":0,
               "discount":0,
               "items":9500,
               "shipping":1500
            },
            "total":11000
         },
         "createdAt":"2017-10-23T15:00:58.000-02",
         "customer":{  
            "_links":{  
               "hostedAccount":{  
                  "redirectHref":"https://hostedaccount-sandbox.moip.com.br?token=e5d653fd-7bab-4f52-aeaf-0d0a3d0c3d59\u0026id=CUS-SB5W39JUOLUV\u0026mpa=MPA-B4DEE9F7589B"
               },
               "self":{  
                  "href":"https://sandbox.moip.com.br/v2/customers/CUS-SB5W39JUOLUV"
               }
            },
            "addresses":[  
               {  
                  "city":"São Paulo",
                  "complement":"10",
                  "country":"BRA",
                  "district":"Itaim Bibi",
                  "state":"SP",
                  "street":"Avenida Faria Lima",
                  "streetNumber":"500",
                  "type":"SHIPPING",
                  "zipCode":"01234000"
               }
            ],
            "birthDate":"1995-01-30",
            "createdAt":"2017-10-23T14:58:57.000-02",
            "email":"[email protected]",
            "fullname":"José Silva",
            "id":"CUS-SB5W39JUOLUV",
            "ownId":"customer_id_01",
            "phone":{  
               "areaCode":"11",
               "countryCode":"55",
               "number":"55552266"
            },
            "shippingAddress":{  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "zipCode":"01234000"
            },
            "taxDocument":{  
               "number":"22288866644",
               "type":"CPF"
            }
         },
         "entries":[  

         ],
         "escrows":[  

         ],
         "events":[  
            {  
               "createdAt":"2017-10-23T15:00:58.000-02",
               "description":"",
               "type":"ORDER.CREATED"
            }
         ],
         "id":"ORD-5ORUUQ5HV2SK",
         "items":[  
            {  
               "category":"CLOTHING",
               "detail":"Casado moletom",
               "price":9500,
               "product":"Descrição do pedido",
               "quantity":1
            }
         ],
         "ownId":"order_id_01",
         "payments":[  
            {  
               "_links":{  
                  "order":{  
                     "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK",
                     "title":"ORD-5ORUUQ5HV2SK"
                  },
                  "self":{  
                     "href":"https://sandbox.moip.com.br/v2/payments/PAY-VR4ZT5ANUP8B"
                  }
               },
               "amount":{  
                  "currency":"BRL",
                  "fees":0,
                  "gross":11000,
                  "liquid":11000,
                  "refunds":0,
                  "total":11000
               },
               "createdAt":"2017-10-23T15:08:09.208-02",
               "delayCapture":false,
               "events":[  
                  {  
                     "createdAt":"2017-10-23T15:08:09.211-02",
                     "type":"PAYMENT.CREATED"
                  }
               ],
               "fees":[  
                  {  
                     "amount":0,
                     "type":"TRANSACTION"
                  }
               ],
               "fundingInstrument":{  
                  "creditCard":{  
                     "brand":"MASTERCARD",
                     "first6":"555566",
                     "holder":{  
                        "billingAddress":{  
                           "city":"Belo Horizonte",
                           "country":"BRA",
                           "district":"Savassi",
                           "state":"MG",
                           "street":"Avenida Contorno",
                           "streetNumber":"400",
                           "zipCode":"76932800"
                        },
                        "birthDate":"1988-12-30",
                        "birthdate":"1988-12-30",
                        "fullname":"Roberto Oliveira",
                        "taxDocument":{  
                           "number":"84302739506",
                           "type":"CPF"
                        }
                     },
                     "id":"CRC-MIPNTSJ28WIA",
                     "last4":"8884",
                     "store":true
                  },
                  "method":"CREDIT_CARD"
               },
               "id":"PAY-VR4ZT5ANUP8B",
               "installmentCount":1,
               "receivers":[  
                  {  
                     "amount":{  
                        "fees":0,
                        "refunds":0,
                        "total":11000
                     },
                     "feePayor":true,
                     "moipAccount":{  
                        "fullname":"Iandro Simões da Silva",
                        "id":"MPA-B4DEE9F7589B",
                        "login":"[email protected]"
                     },
                     "type":"PRIMARY"
                  }
               ],
               "statementDescriptor":"Minha Loja",
               "status":"WAITING",
               "updatedAt":"2017-10-23T15:08:09.208-02"
            }
         ],
         "platform":"V2",
         "receivers":[  
            {  
               "amount":{  
                  "fees":0,
                  "refunds":0,
                  "total":11000
               },
               "feePayor":true,
               "moipAccount":{  
                  "fullname":"Joé Silva",
                  "id":"MPA-B4DEE9F2359B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "refunds":[  

         ],
         "status":"WAITING",
         "updatedAt":"2017-10-23T15:08:09.211-02"
      }
   }
}
//Pedido pago
//ORDER.PAID

{  
   "date":"",
   "env":"",
   "event":"ORDER.PAID",
   "resource":{  
      "order":{  
         "_links":{  
            "checkout":{  
               "payBoleto":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=boleto"
               },
               "payCheckout":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK"
               },
               "payCreditCard":{  
                  "redirectHref":"https://checkout-new-sandbox.moip.com.br?token=23e2622d-b8bb-44a6-97c3-e5c670273dc6\u0026id=ORD-5ORUUQ5HV2SK\u0026payment-method=credit-card"
               },
               "payOnlineBankDebitItau":{  
                  "redirectHref":"https://checkout-sandbox.moip.com.br/debit/itau/ORD-5ORUUQ5HV2SK"
               }
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK"
            }
         },
         "addresses":[  
            {  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "type":"SHIPPING",
               "zipCode":"01234000"
            }
         ],
         "amount":{  
            "currency":"BRL",
            "fees":673,
            "liquid":10327,
            "otherReceivers":0,
            "paid":11000,
            "refunds":0,
            "subtotals":{  
               "addition":0,
               "discount":0,
               "items":9500,
               "shipping":1500
            },
            "total":11000
         },
         "createdAt":"2017-10-23T15:00:58.000-02",
         "customer":{  
            "_links":{  
               "hostedAccount":{  
                  "redirectHref":"https://hostedaccount-sandbox.moip.com.br?token=e5d653fd-7bab-4f52-aeaf-0d0a3d0c3d59\u0026id=CUS-SB5W39JUOLUV\u0026mpa=MPA-B4DEE9F7589B"
               },
               "self":{  
                  "href":"https://sandbox.moip.com.br/v2/customers/CUS-SB5W39JUOLUV"
               }
            },
            "addresses":[  
               {  
                  "city":"São Paulo",
                  "complement":"10",
                  "country":"BRA",
                  "district":"Itaim Bibi",
                  "state":"SP",
                  "street":"Avenida Faria Lima",
                  "streetNumber":"500",
                  "type":"SHIPPING",
                  "zipCode":"01234000"
               }
            ],
            "birthDate":"1995-01-30",
            "createdAt":"2017-10-23T14:58:57.000-02",
            "email":"[email protected]",
            "fullname":"José Silva",
            "fundingInstrument":{  
               "creditCard":{  
                  "brand":"MASTERCARD",
                  "first6":"555566",
                  "id":"CRC-MIPNTSJ28WIA",
                  "last4":"8884",
                  "store":true
               },
               "method":"CREDIT_CARD"
            },
            "fundingInstruments":[  
               {  
                  "creditCard":{  
                     "brand":"MASTERCARD",
                     "first6":"555566",
                     "id":"CRC-MIPNTSJ28WIA",
                     "last4":"8884",
                     "store":true
                  },
                  "method":"CREDIT_CARD"
               }
            ],
            "id":"CUS-SB5W39JUOLUV",
            "ownId":"customer_id_01",
            "phone":{  
               "areaCode":"11",
               "countryCode":"55",
               "number":"55552266"
            },
            "shippingAddress":{  
               "city":"São Paulo",
               "complement":"10",
               "country":"BRA",
               "district":"Itaim Bibi",
               "state":"SP",
               "street":"Avenida Faria Lima",
               "streetNumber":"500",
               "zipCode":"01234000"
            },
            "taxDocument":{  
               "number":"22288866644",
               "type":"CPF"
            }
         },
         "entries":[  

         ],
         "escrows":[  

         ],
         "events":[  
            {  
               "createdAt":"2017-10-23T15:08:39.718-02",
               "description":"",
               "type":"ORDER.PAID"
            },
            {  
               "createdAt":"2017-10-23T15:00:58.000-02",
               "description":"",
               "type":"ORDER.CREATED"
            }
         ],
         "id":"ORD-5ORUUQ5HV2SK",
         "items":[  
            {  
               "category":"CLOTHING",
               "detail":"Casado moletom",
               "price":9500,
               "product":"Descrição do pedido",
               "quantity":1
            }
         ],
         "ownId":"order_id_01",
         "payments":[  
            {  
               "_links":{  
                  "order":{  
                     "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK",
                     "title":"ORD-5ORUUQ5HV2SK"
                  },
                  "self":{  
                     "href":"https://sandbox.moip.com.br/v2/payments/PAY-VR4ZT5ANUP8B"
                  }
               },
               "amount":{  
                  "currency":"BRL",
                  "fees":673,
                  "gross":11000,
                  "liquid":10327,
                  "refunds":0,
                  "total":11000
               },
               "createdAt":"2017-10-23T15:08:09.000-02",
               "delayCapture":false,
               "events":[  
                  {  
                     "createdAt":"2017-10-23T15:08:39.718-02",
                     "type":"PAYMENT.AUTHORIZED"
                  },
                  {  
                     "createdAt":"2017-10-23T15:08:39.000-02",
                     "type":"PAYMENT.IN_ANALYSIS"
                  },
                  {  
                     "createdAt":"2017-10-23T15:08:09.000-02",
                     "type":"PAYMENT.CREATED"
                  }
               ],
               "fees":[  
                  {  
                     "amount":673,
                     "type":"TRANSACTION"
                  }
               ],
               "fundingInstrument":{  
                  "creditCard":{  
                     "brand":"MASTERCARD",
                     "first6":"555566",
                     "holder":{  
                        "billingAddress":{  
                           "city":"Belo Horizonte",
                           "country":"BRA",
                           "district":"Savassi",
                           "state":"MG",
                           "street":"Avenida Contorno",
                           "streetNumber":"400",
                           "zipCode":"76932800"
                        },
                        "birthDate":"1988-12-30",
                        "birthdate":"1988-12-30",
                        "fullname":"Roberto Oliveira",
                        "taxDocument":{  
                           "number":"84302739506",
                           "type":"CPF"
                        }
                     },
                     "id":"CRC-MIPNTSJ28WIA",
                     "last4":"8884",
                     "store":true
                  },
                  "method":"CREDIT_CARD"
               },
               "id":"PAY-VR4ZT5ANUP8B",
               "installmentCount":1,
               "receivers":[  
                  {  
                     "amount":{  
                        "fees":673,
                        "refunds":0,
                        "total":11000
                     },
                     "feePayor":true,
                     "moipAccount":{  
                        "fullname":"Iandro Simões da Silva",
                        "id":"MPA-B4DEE9F7589B",
                        "login":"[email protected]"
                     },
                     "type":"PRIMARY"
                  }
               ],
               "statementDescriptor":"Minha Loja",
               "status":"AUTHORIZED",
               "updatedAt":"2017-10-23T15:08:39.718-02"
            }
         ],
         "platform":"V2",
         "receivers":[  
            {  
               "amount":{  
                  "fees":673,
                  "refunds":0,
                  "total":11000
               },
               "feePayor":true,
               "moipAccount":{  
                  "fullname":"José Silva",
                  "id":"MPA-B4DEE2355589B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "refunds":[  

         ],
         "status":"PAID",
         "updatedAt":"2017-10-23T15:08:39.718-02"
      }
   }
}

👍

DICA

Caso esteja usando Request Bin para receber as notificações você deve visualizar o webhook no formato destacado na imagem abaixo:

Exemplo de webhook recebido via RequestBinExemplo de webhook recebido via RequestBin

Exemplo de webhook recebido via RequestBin

#Webhooks Pagamento

//Aguardando pagamento
//PAYMENT.WAITING

{  
   "date":"",
   "env":"",
   "event":"PAYMENT.WAITING",
   "resource":{  
      "payment":{  
         "_links":{  
            "order":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK",
               "title":"ORD-5ORUUQ5HV2SK"
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/payments/PAY-VR4ZT5ANUP8B"
            }
         },
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "gross":11000,
            "liquid":11000,
            "refunds":0,
            "total":11000
         },
         "createdAt":"2017-10-23T15:08:09.208-02",
         "delayCapture":false,
         "events":[  
            {  
               "createdAt":"2017-10-23T15:08:09.211-02",
               "type":"PAYMENT.CREATED"
            }
         ],
         "fees":[  
            {  
               "amount":0,
               "type":"TRANSACTION"
            }
         ],
         "fundingInstrument":{  
            "creditCard":{  
               "brand":"MASTERCARD",
               "first6":"555566",
               "holder":{  
                  "billingAddress":{  
                     "city":"Belo Horizonte",
                     "country":"BRA",
                     "district":"Savassi",
                     "state":"MG",
                     "street":"Avenida Contorno",
                     "streetNumber":"400",
                     "zipCode":"76932800"
                  },
                  "birthDate":"1988-12-30",
                  "birthdate":"1988-12-30",
                  "fullname":"Roberto Oliveira",
                  "taxDocument":{  
                     "number":"84302739506",
                     "type":"CPF"
                  }
               },
               "id":"CRC-MIPNTSJ28WIA",
               "last4":"8884",
               "store":true
            },
            "method":"CREDIT_CARD"
         },
         "id":"PAY-VR4ZT5ANUP8B",
         "installmentCount":1,
         "receivers":[  
            {  
               "amount":{  
                  "refunds":0,
                  "total":11000
               },
               "moipAccount":{  
                  "fullname":"José Silva",
                  "id":"MPA-B4DEE3245589B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "statementDescriptor":"Minha Loja",
         "status":"WAITING",
         "updatedAt":"2017-10-23T15:08:09.208-02"
      }
   }
}
//Pagamento em análise
//PAYMENT.IN_ANALYSIS

{  
   "date":"",
   "env":"",
   "event":"PAYMENT.IN_ANALYSIS",
   "resource":{  
      "payment":{  
         "_links":{  
            "order":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK",
               "title":"ORD-5ORUUQ5HV2SK"
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/payments/PAY-VR4ZT5ANUP8B"
            }
         },
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "gross":11000,
            "liquid":11000,
            "refunds":0,
            "total":11000
         },
         "createdAt":"2017-10-23T15:08:09.208-02",
         "delayCapture":false,
         "events":[  
            {  
               "createdAt":"2017-10-23T15:08:39.418-02",
               "type":"PAYMENT.IN_ANALYSIS"
            },
            {  
               "createdAt":"2017-10-23T15:08:09.211-02",
               "type":"PAYMENT.CREATED"
            }
         ],
         "fees":[  
            {  
               "amount":0,
               "type":"TRANSACTION"
            }
         ],
         "fundingInstrument":{  
            "creditCard":{  
               "brand":"MASTERCARD",
               "first6":"555566",
               "holder":{  
                  "billingAddress":{  
                     "city":"Belo Horizonte",
                     "country":"BRA",
                     "district":"Savassi",
                     "state":"MG",
                     "street":"Avenida Contorno",
                     "streetNumber":"400",
                     "zipCode":"76932800"
                  },
                  "birthDate":"1988-12-30",
                  "birthdate":"1988-12-30",
                  "fullname":"Roberto Oliveira",
                  "taxDocument":{  
                     "number":"84302739506",
                     "type":"CPF"
                  }
               },
               "id":"CRC-MIPNTSJ28WIA",
               "last4":"8884",
               "store":true
            },
            "method":"CREDIT_CARD"
         },
         "id":"PAY-VR4ZT5ANUP8B",
         "installmentCount":1,
         "receivers":[  
            {  
               "amount":{  
                  "refunds":0,
                  "total":11000
               },
               "moipAccount":{  
                  "fullname":"José Silva",
                  "id":"MPA-B4DEE9F23459B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "statementDescriptor":"Minha Loja",
         "status":"IN_ANALYSIS",
         "updatedAt":"2017-10-23T15:08:39.418-02"
      }
   }
}
//Pagamento autorizado
//PAYMENT.AUTHORIZED

{  
   "date":"",
   "env":"",
   "event":"PAYMENT.AUTHORIZED",
   "resource":{  
      "payment":{  
         "_links":{  
            "order":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-5ORUUQ5HV2SK",
               "title":"ORD-5ORUUQ5HV2SK"
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/payments/PAY-VR4ZT5ANUP8B"
            }
         },
         "amount":{  
            "currency":"BRL",
            "fees":673,
            "gross":11000,
            "liquid":10327,
            "refunds":0,
            "total":11000
         },
         "createdAt":"2017-10-23T15:08:09.000-02",
         "delayCapture":false,
         "events":[  
            {  
               "createdAt":"2017-10-23T15:08:39.718-02",
               "type":"PAYMENT.AUTHORIZED"
            },
            {  
               "createdAt":"2017-10-23T15:08:39.000-02",
               "type":"PAYMENT.IN_ANALYSIS"
            },
            {  
               "createdAt":"2017-10-23T15:08:09.000-02",
               "type":"PAYMENT.CREATED"
            }
         ],
         "fees":[  
            {  
               "amount":673,
               "type":"TRANSACTION"
            }
         ],
         "fundingInstrument":{  
            "creditCard":{  
               "brand":"MASTERCARD",
               "first6":"555566",
               "holder":{  
                  "billingAddress":{  
                     "city":"Belo Horizonte",
                     "country":"BRA",
                     "district":"Savassi",
                     "state":"MG",
                     "street":"Avenida Contorno",
                     "streetNumber":"400",
                     "zipCode":"76932800"
                  },
                  "birthDate":"1988-12-30",
                  "birthdate":"1988-12-30",
                  "fullname":"Roberto Oliveira",
                  "taxDocument":{  
                     "number":"84302739506",
                     "type":"CPF"
                  }
               },
               "id":"CRC-MIPNTSJ28WIA",
               "last4":"8884",
               "store":true
            },
            "method":"CREDIT_CARD"
         },
         "id":"PAY-VR4ZT5ANUP8B",
         "installmentCount":1,
         "receivers":[  
            {  
               "amount":{  
                  "refunds":0,
                  "total":11000
               },
               "moipAccount":{  
                  "fullname":"José Silva",
                  "id":"MPA-B4DEE9F24356B",
                  "login":"[email protected]"
               },
               "type":"PRIMARY"
            }
         ],
         "statementDescriptor":"Minha Loja",
         "status":"AUTHORIZED",
         "updatedAt":"2017-10-23T15:08:39.718-02"
      }
   }
}

#Webhooks Reembolso

//Reembolso Aguardando
//REFUND.WAITING

{
    "_id": {
        "$oid": "5b29a8926724c76f2cef0f84"
    },
    "_class": "notificador.domain.entity.mongodb.WebhookNotification", 
    "externalId": "EVE-XXXXXXXXXXXX",
    "resourceId": "REF-XXXXXXXXXXXX",
    "accountId": "MPA-XXXXXXXXXXXX",
    "channelId": "APP-XXXXXXXXXXXX",
    "event": "REFUND.WAITING",
    "url": "{{url}}",
    "token": "{{token}}",
    "resource": {
        "createdAt": "2018-06-17T20:37:11.000-03",
        "amount": {
            "total": 0000,
            "fees": 0,
            "currency": "BRL"
        },
        "_links": {
            "self": {
                "href": "https://api.moip.com.br/v2/refunds/REF-XXXXXXXXXXXX"
            },
            "order": {
                "href": "https://api.moip.com.br/v2/orders/ORD-XXXXXXXXXXXX",
                "title": "ORD-XXXXXXXXXXXX"
            },
            "payment": {
                "href": "https://api.moip.com.br/v2/payments/PAY-XXXXXXXXXXXX",
                "title": "PAY-XXXXXXXXXXXX"
            }
        },
        "refundingInstrument": {
            "bankAccount": {
                "bankNumber": "000",
                "bankName": "{{BANK}}",
                "agencyNumber": "0000",
                "agencyCheckNumber": "",
                "accountNumber": "00000",
                "accountCheckNumber": "0",
                "type": "CHECKING",
                "holder": {
                    "taxDocument": {
                        "type": "CPF",
                        "number": "{{NUMBER}}"
                    },
                    "fullname": "{{CUSTOMER}}"
                }
            },
            "method": "BANK_ACCOUNT"
        },
        "id": "REF-XXXXXXXXXXXX",
        "type": "FULL",
        "events": [
            {
                "type": "REFUND.WAITING",
                "createdAt": "2018-06-19T22:06:16.000-03",
                "description": "Pagamento agendado"
            },
            {
                "type": "REFUND.REQUESTED",
                "createdAt": "2018-06-17T20:37:11.000-03"
            }
        ],
        "status": "WAITING"
    },
    "status": "SENT",
    "response": {
        "headers": {},
        "status": 200
    },
    "createdAt": {
        "$date": "2018-06-20T01:06:26.950Z"
    },
    "updatedAt": {
        "$date": "2018-06-20T01:06:27.153Z"
    },
    "webhookToFire": {
        "$ref": "webhook_to_fire",
        "$id": {
            "$oid": "5b29a8926724c76f2cef0f83"
        }
    }
}
//Reembolso solicitado
//REFUND.REQUESTED

{  
   "date":"",
   "env":"",
   "event":"REFUND.REQUESTED",
   "resource":{  
      "refund":{  
         "_links":{  
            "order":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-QKBOXT978YCX",
               "title":"ORD-QKBOXT978YCX"
            },
            "payment":{  
               "href":"https://sandbox.moip.com.br/v2/payments/PAY-0OBNUIQZAGGP",
               "title":"PAY-0OBNUIQZAGGP"
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/refunds/REF-8QPX618C5PHZ"
            }
         },
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "total":2000
         },
         "createdAt":"2018-06-05T19:19:56.000-03",
         "events":[  
            {  
               "createdAt":"2018-06-05T19:19:56.000-03",
               "type":"REFUND.COMPLETED"
            },
            {  
               "createdAt":"2018-06-05T16:20:06.678-03",
               "type":"REFUND.REQUESTED"
            }
         ],
         "id":"REF-8QPX618C5PHZ",
         "refundingInstrument":{  
            "creditCard":{  
               "brand":"MASTERCARD",
               "first6":"555566",
               "last4":"8884",
               "store":true
            },
            "method":"CREDIT_CARD"
         },
         "status":"REQUESTED",
         "type":"FULL"
      }
   }
}
//Reembolso concluído
//REFUND.COMPLETED

{  
   "date":"",
   "env":"",
   "event":"REFUND.COMPLETED",
   "resource":{  
      "refund":{  
         "_links":{  
            "order":{  
               "href":"https://sandbox.moip.com.br/v2/orders/ORD-QKBOXT978YCX",
               "title":"ORD-QKBOXT978YCX"
            },
            "payment":{  
               "href":"https://sandbox.moip.com.br/v2/payments/PAY-0OBNUIQZAGGP",
               "title":"PAY-0OBNUIQZAGGP"
            },
            "self":{  
               "href":"https://sandbox.moip.com.br/v2/refunds/REF-8QPX618C5PHZ"
            }
         },
         "amount":{  
            "currency":"BRL",
            "fees":0,
            "total":2000
         },
         "createdAt":"2018-06-05T19:19:56.000-03",
         "events":[  
            {  
               "createdAt":"2018-06-05T19:19:56.000-03",
               "type":"REFUND.COMPLETED"
            },
            {  
               "createdAt":"2018-06-05T19:19:56.000-03",
               "type":"REFUND.REQUESTED"
            }
         ],
         "id":"REF-8QPX618C5PHZ",
         "refundingInstrument":{  
            "creditCard":{  
               "brand":"MASTERCARD",
               "first6":"555566",
               "last4":"8884",
               "store":true
            },
            "method":"CREDIT_CARD"
         },
         "status":"COMPLETED",
         "type":"FULL"
      }
   }
}
//Reembolso Falho
//REFUND.FAILED

{
    "_id": {
        "$oid": "5b0f59a7e41e4607b01dec49"
    },
    "_class": "notificador.domain.entity.mongodb.WebhookNotification",
    "externalId": "EVE-XXXXXXXXXXXX",
    "resourceId": "REF-XXXXXXXXXXXX",
    "accountId": "MPA-XXXXXXXXXXXX",
    "channelId": "APP-XXXXXXXXXXXX",
    "event": "REFUND.FAILED",
    "url": "{{url}}",
    "token": "{{token}}",
    "resource": {
        "createdAt": "2018-05-28T13:53:47.000-03",
        "amount": {
            "total": 0000,
            "fees": 0,
            "currency": "BRL"
        },
        "_links": {
            "self": {
                "href": "https://api.moip.com.br/v2/refunds/REF-XXXXXXXXXXXX"
            },
            "order": {
                "href": "https://api.moip.com.br/v2/orders/ORD-XXXXXXXXXXXX",
                "title": "ORD-XXXXXXXXXXXX"
            },
            "payment": {
                "href": "https://api.moip.com.br/v2/payments/PAY-XXXXXXXXXXXX",
                "title": "PAY-XXXXXXXXXXXX"
            }
        },
        "refundingInstrument": {
            "bankAccount": {
                "bankNumber": "000",
                "bankName": "{{BANK}}",
                "agencyNumber": "0000",
                "agencyCheckNumber": "",
                "accountNumber": "000000",
                "accountCheckNumber": "0",
                "type": "CHECKING",
                "holder": {
                    "taxDocument": {
                        "type": "CPF",
                        "number": "{{NUMBER}}"
                    },
                    "fullname": "{{CUSTOMER}}"
                }
            },
            "method": "BANK_ACCOUNT"
        },
        "id": "REF-XXXXXXXXXXXX",
        "type": "FULL",
        "events": [
            {
                "type": "REFUND.FAILED",
                "createdAt": "2018-05-30T23:10:37.000-03",
                "description": "Processamento negado pelo banco destinatário"
            },
            {
                "type": "REFUND.REQUESTED",
                "createdAt": "2018-05-28T13:53:47.000-03"
            }
        ],
        "status": "FAILED"
    },
    "status": "SENT",
    "response": {
        "headers": {},
        "status": 200
    },
    "createdAt": {
        "$date": "2018-05-31T02:10:47.416Z"
    },
    "updatedAt": {
        "$date": "2018-05-31T02:10:47.681Z"
    },
    "webhookToFire": {
        "$ref": "webhook_to_fire",
        "$id": {
            "$oid": "5b0f59a7e41e4607b01dec48"
        }
    }
}