On this page:
https://api.premepay.com/v1/stores/:id/endpoints
Parameter | Type | Description |
---|---|---|
endpoint |
string | Endpoint to which Primefy will notify |
description |
string | Description |
destination |
string | Destination |
events |
array<int> | |
type |
int | What type of notification should be sent to the Endpoint |
destination
:Parameter | Type | Destination |
---|---|---|
0 |
int | API |
1 |
int | Pluga |
2 |
int | Zappier |
3 |
int | IFTTT |
type
:Parameter | Type | Description |
---|---|---|
0 |
Transaction Created | For created purchases that are awaiting payment, such as Boleto and PIX. |
1 |
Transaction Succeded | For confirmed Payment Orders via Credit Card, Boleto, and PIX. |
2 |
Transaction Canceled | For payments that have undergone Full or Partial Refund. |
3 |
Transaction Failed | For failed Payment Orders. |
4 |
Transaction Disputed | For Payment Order where the customer decided to dispute, opening a Dispute. |
5 |
Transaction Chargedback | For when the open dispute has been lost and the payment refunded to the customer. |
6 |
Transaction Dispute Succeded | For when the customer loses the Dispute. |
This is an example of what your request to register a new webhook might look like.
If your request is successful, you will receive the return of the Voucher object.
If your request has invalid creation parameters - for example, specifying an invalid field or value - you may receive an error in response. See below for the full list of possible responses.
Below is the JSON object that the establishment will receive in its API (if registered as the destination) when a notification event is triggered:
{
"number": "P654762",
"amount": "99.00",
"status": "succeded",
"payment": {
"status": "succeded"
},
"paymentUrl": null,
"metadata": {
"test1": "test1",
"test2": "test2"
}
}
If the destination is one of the external tools, the object is a bit more comprehensive, as shown below:
{
"order": {
"number": "P735831",
"description": "Compra",
"status": "Confirmado"
},
"customer": {
"name": "Usuário Teste Exemplo 01",
"identificationNumber": "52789024006",
"email": "[email protected]",
"phone": "(11) 12345-6789",
"address": {
"street": "Rua tal",
"number": "123",
"district": "Brás",
"reference": "Casa",
"zipcode": "02814000",
"city": "São Paulo",
"state": "SP",
"country": "BR"
}
},
"payment": {
"installments": 3,
"installment": 0, // só vai preenchido se for uma PARCELA de boleto
"amount": "R$ 99,00",
"type": "Cartão de Crédito",
"status": "Confirmado",
"receivedOn": "26/03/2022 06:38:32"
},
"metadata": {
"teste1": "teste1",
"teste2": "teste2"
},
"createdOn": "26/03/2022 06:38:31",
"updatedOn": "26/03/2022 06:38:31"
}
Related Content
<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bfe6a9ef-6d9a-405e-9fbe-484666d3fb5e/PUT.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bfe6a9ef-6d9a-405e-9fbe-484666d3fb5e/PUT.png" width="40px" /> PUT - Edit a webhook
</aside>
<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e3aeb85f-a7e2-40f4-b805-7e883e3d72e2/DELETE.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e3aeb85f-a7e2-40f4-b805-7e883e3d72e2/DELETE.png" width="40px" /> DELETE - Delete webhook
</aside>