Hooks API (LATEST)

API Integration Support: integration@dintero.com License: UNLICENSED

API for managing webhooks

Changelog

All notable changes to the API.

2024-02-01

doc: Fix HookDeliveryDetail definition, the type for the response.body and details.delivery_duration was wrong, change to string and number

2023-12-01

new: Add support for approval_payout_destination_delete event. The event will be published when a seller approval is archived

2023-01-01

new: Add support for subscription on checkout_transaction event.

2022-11-01

Add support for creating subscription with fields mask. The fields property lets you explicitly select the fields you need from the event deliveries

2022-08-01

Document example for approval_payout_destination_update event

2021-04-01

Add support for subscription on shopping_order_delete events.

2021-01-01

Add support for subscription on settlement_add events.

2020-10-01

Add support for subscription on account_add and account_update events.

2019-04-31

Implement support for subscription on discount_customer_update event. The event is published after a

Webhook Events

Each event has a similar JSON schema, but a unique payload object that is determined by its event type.

Accounts

account_add / account_update / cdd_case_update

The event is sent from auth service after an account is added or updated.

The events are only available for production subscriptions

account_add events are only available for partner accounts

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: account_add
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "account_add",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "account": {
            "account_id": "12341234",
            "jwks": {
                "name": "example",
                "uri": "https://example.com"
            },
            "applicant": {
                "agreement": {
                    "accepted_at": "2022-01-01T00:00:00Z"
                },
                "email": "john.doe@example.com",
                "first_name": "John",
                "last_name": "Doe",
                "phone_number": "+1234567890",
                "promo_code": "ABC123",
                "utm": {
                    "utm_source": "google",
                    "utm_medium": "cpc",
                    "utm_campaign": "example"
                }
            },
            "billing": {
                "address": {
                    "address_line": "123 Main St",
                    "postal_place": "MainVille",
                    "country": "NO"
                },
                "business_name": "Example Inc"
            },
            "company": {
                "business_name": "Example Inc.",
                "address": {
                    "address_line": "123 Main St",
                    "postal_place": "MainVille",
                    "country": "NO"
                }
            },
            "language_code": "en-US",
            "livemode": "true",
            "partner_id": "00000000",
            "active": "true",
            "account_manager": {
                "email": "jane.doe@example.com"
            },
            "reseller_id": "reseller123",
            "progression": "live",
            "subscription": {
                "interval": "month",
                "metadata": {
                    "key": "value"
                },
                "plan": "basic",
                "support": "email"
            },
            "services": {
                "checkout": {
                    "enabled": "true",
                    "settings": {
                        "key": "value"
                    }
                },
                "customers": {
                    "enabled": "true",
                    "settings": {
                        "key": "value"
                    }
                }
            },
            "connections": {
                "collector": {
                    "invoice": {
                        "enabled": "true",
                        "settings": {
                            "key": "value"
                        }
                    }
                }
            },
            "created_by": "1234-1234-1234-1234"
        }
    }

Customers

customer_update / customer_add / customer_delete

Customer event sent from customers service after a customer is created, updated or deleted. All customer properties will be included in the event.

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: customer_update
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "customer_update",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "metadata": {
            "dob_year": 1985
        },
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "created_at": "2019-08-24T14:15:22Z",
        "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
        "updated_at": "2019-08-24T14:15:22Z",
        "first_name": "John",
        "last_name": "Doe",
        "email": "customer@example.com",
        "phone_number": "+4799999999",
        "status": "string",
        "favorite_store": "string",
        "enrolled_by": {
            "type": "url",
            "value": "https://facebook.com"
        },
        "type": "customer",
        "addresses": [
            {
                "address_line": "Sommerkroveien 34",
                "postal_place": "Oslo",
                "country": "NO"
            }
        ],
        "term": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "accepted_at": "2019-08-24T14:15:22Z"
        },
        "company": {
            "organization_number": "123456789MVA",
            "bussiness_name": "TKP tech AS",
            "department": "sales department",
            "industry": "computer industry",
        },
        "date_of_birth": "1990-09-20",
        "customer_id": "string"
    }

customer_change_password

Customer event sent from customers service after a change_password request is received. Note that the event includes a context object with audience and created_by.

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: customer_change_password
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "customer_change_password",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "metadata": {
            "dob_year": 1985
        },
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "created_at": "2019-08-24T14:15:22Z",
        "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
        "updated_at": "2019-08-24T14:15:22Z",
        "first_name": "John",
        "last_name": "Doe",
        "email": "customer@example.com",
        "phone_number": "+4799999999",
        "status": "string",
        "favorite_store": "string",
        "enrolled_by": {
            "type": "url",
            "value": "https://facebook.com"
        },
        "type": "customer",
        "addresses": [
            {
                "address_line": "Sommerkroveien 34",
                "postal_place": "Oslo",
                "country": "NO"
            }
        ],
        "term": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "accepted_at": "2019-08-24T14:15:22Z"
        },
        "company": {
            "organization_number": "123456789MVA",
            "bussiness_name": "TKP tech AS",
            "department": "sales department",
            "industry": "computer industry",
        },
        "date_of_birth": "1990-09-20",
        "customer_id": "string"
        "context": {
            "audience": "https://api.dintero.com/v1/accounts/P00000000",
            "created_by": "API_USER"
        }
    }

Discounts

discount_update / discount_add / discount_delete

Discount event sent from discount service after a discount rule is created, updated or deleted. All discount properties will be included in the event

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: discount_update
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "discount_update",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "created_at": "2019-08-24T14:15:22Z",
        "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
        "updated_at": "2019-08-24T14:15:22Z",
        "campaign_id": "string",
        "active": "true",
        "private": "false",
        "updated_by": "3d1e4824-5474-48e7-a369-4f603fa4c5b8",
        "type": "item",
        "name": "Spar 100,-",
        "receipt_text": "Mai Salg",
        "visible_from": "2019-08-24T14:15:22Z",
        "description": "Gjør et Stablestol kupp!",
        "limitation": {
            "discount_activation": [
                {
                    "type": "deactivate_if_discount_active",
                    "value": "string"
                }
            ],
            "discount_hours": {
                "timezone": "Europe/Oslo",
                "hours": [
                    {
                        "day": "mon",
                        "start": "10:00",
                        "end": "20:00"
                    }
                ]
            },
            "discount_reward_usage": 1,
            "discount_combination": -1,
            "discount_eligible": "item_eligible_for_discount",
            "discount_repeat_usage": -1,
            "stamp_expire_days": 100,
            "blacklist": [
                {
                    "id": "b714118",
                    "group_id": "B1"
                }
            ]
        },
        "requirement": {
            "customer": {
                "addresses": [
                    {
                        "country": [
                            "NO"
                        ],
                        "postal_code": [
                            "0349"
                        ],
                        "postal_place": [
                            "Oslo"
                        ],
                        "custom_type": [
                            "offsite"
                        ],
                        "type": [
                            "custom"
                        ]
                    }
                ],
                "company": {
                    "bussiness_name": [
                        "TKP tech AS"
                    ],
                    "department": [
                        "production",
                        "research"
                    ],
                    "industry": [
                        "J62.0.1",
                        "J62.0.2"
                    ],
                    "number_of_employees": [
                        "20"
                    ],
                    "organization_number": [
                        "123456789MVA"
                    ],
                    "website": [
                        "https://dintero.com"
                    ]
                },
                "date_of_birth": [
                    "1990-09-20",
                    "1990-05-10"
                ],
                "first_name": [
                    "John"
                ],
                "gender": [
                    "male"
                ],
                "last_name": [
                    "Doe"
                ],
            },
            "item": {
                "quantity": 0,
                "mixes": [
                    {
                        "items": [
                            {
                                "id": "b714118"
                            },
                            {
                                "group_id": "g4"
                            }
                        ],
                        "quantity": 0,
                        "reward_eligible": "true"
                    }
                ],
                "items": [
                    {
                        "id": "b714118",
                        "group_id": "B1"
                    }
                ]
            },
            "store_ids": [
                "sc029"
            ],
            "gross_amount": 0,
            "currencies": [
                {
                    "anything-but": [
                        "NOK"
                    ]
                }
            ],
            "stamp": 5,
            "discount_code": "TACO",
            "store": {
                "id": [
                    "sc029"
                ],
            },
            "purchase_from": "2019-08-24T14:15:22Z",
            "purchase_to": "2019-08-24T14:15:22Z"
        },
        "reward": {
            "type": "discount_amount",
            "value": 10000,
            "base": "net",
            "effect": "discount"
        },
        "metadata": {
            "campaign_id": "V101",
            "is_featured": "true",
            "dintero:private_text:kind": "Gold"
        },
        "links": [
            {
                "href": "https://example.dintero.com/c/photos/2018/6_20_thumbnail_discount_image.png",
                "rel": "thumbnail_discount_image"
            }
        ]
    }

discount_add_customers / discount_delete_customers

The event is sent from discount service after a customer is added removed from the discount. The event will originate from Add customer, Remove customer or from an automation triggered.

The receipt/automation property is only set if the customer was added to the discount by the automation.

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: discount_add_customers
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "discount_add_customers",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "created_at": "2018-01-10T08:49:20.533Z",
        "created_by": "API_USER",
        "id": "{customer_ref_discount_id}",
        "customer_id": "{customer_id}",
        "discount": {
            "id": "{discount.id}"
        },
        "receipt": { "id": "{receipt.id}" ... },
        "automation": {
            "created_at": "2018-03-19T15:04:42Z",
            "created_by": "API_USER",
            "id": "string",
            "updated_at": "2018-03-19T15:04:42Z",
            "events": ["customer_add"]
        }
    }

discount_customer_update

The event is sent from discount service after a customer discounts is updated. An update is triggered when discounts are used (receipt_add), claimed or if stamp is added to the discount (receipt_add).

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: discount_customer_update
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "discount_customer_update",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "created_by": "string",
        "created_at": "2022-01-01T00:00:00Z",
        "customer_id": "string",
        "claim": {
            "id": "string"
        },
        "receipt": {
            "id": "string"
        },
        "discounts": [
            {
                "id": "string",
                "refs": [
                    {
                        "id": "string",
                        "stamp": 1337,
                        "amount": 10,
                        "usage": 1,
                        "bonus": 0,
                        "statistics": {
                            "amount": 10,
                            "bonus": 0,
                            "debit_balance": 0,
                            "stamp": 1640995200,
                            "usage": 1
                        }
                    }
                ]
            }
        ]
    }

Locations

location_add / location_update / location_delete

Location event sent from our customer service after a location is created, updated or deleted. All locations properties will be included in the event.

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: location_add
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9
    {
        "account_id": "P12341234",
        "event": "location_add",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "location": {
            "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
            "created_at": "2019-08-24T14:15:22Z",
            "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
            "updated_at": "2019-08-24T14:15:22Z",
            "location_id": "S01923",
            "name": "TKP Store",
            "timezone": "Europe/Oslo",
            "status": "Active",
            "language_code": "string",
            "currency": "NOK",
            "phone_number": "+4799999999",
            "chain": "SuperChain",
            "email": "saleslocation@example.com",
            "mcc": "5814",
            "gln": "string",
            "organization_number": "123456789MVA",
            "business_name": "TKP technology AS",
            "franchise": "Subway",
            "type": "string",
            "website_url": "string",
            "address": {
                "address_line": "Sommerkroveien 34",
                "address_line_2": "PB 123",
                "postal_code": "0349",
                "postal_place": "Oslo",
                "country": "NO",
                "latitude": 0,
                "longitude": 0
            }
        }
    }

Receipts

receipt_add / receipt_update

Receipt event sent from receipts service after a receipt is added. The complete receipt will be included in the event.

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: receipt_add
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9
    {
        "account_id": "P12341234",
        "event": "receipt_add",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "created_at": "2018-01-10T07:57:42Z",
        "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
        "id": "2adb53e8-7f9b-44a4-8d5f-ed85d44cf02b",
        "purchase_at": "2018-01-10T07:57:42Z",
        "receipt_id": "714118",
        "store": {
            "id": "sc029"
        }
    }

Settlements

settlement_add

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: settlement_add
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "settlement_add",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "settlement": {
            "id": "string",
            "account_id": "P12341234",
            "settled_at": "2022-01-01T00:00:00.000Z",
            "email_received_at": "2022-01-02T00:00:00.000Z",
            "gateway": "vipps",
            "created_at": "2022-01-03T00:00:00.000Z",
            "updated_at": "2022-01-04T00:00:00.000Z",
            "provider_reference": "123456789",
            "payout_destination_id": "987654321",
            "metadata": {
                "attachments": [
                    {
                        "id": "attachment1",
                        "download_link": "https://example.com/attachment1",
                        "content_type": "application/pdf",
                        "extension": "pdf",
                        "created_by": "user1"
                    }
                ],
                "aggregation": [
                    {
                        "capture": 94000,
                        "amount": 30825,
                        "currency": "NOK",
                        "fee": -1175,
                        "refund": -62000
                    }
                ],
                "start_at": "2022-01-01T00:00:00.000Z",
                "end_at": "2022-01-02T00:00:00.000Z"
            }
        }
    }

Shopping

shopping_draft_add / shopping_draft_complete / shopping_draft_update

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: shopping_draft_add
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "shopping_draft_add",
        "event-delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "options": {
            "order_time_to_live": 94672800,
            "generate_order_id": "UUID",
            "order_id": "string",
            "replace": "order",
            "split_draft": "false",
            "serial_order_number_suffix": "false",
            "multiple_authorizations": "false"
        },
        "order": {
            "customer": {
                "first_name": "John",
                "last_name": "Doe",
                "id": "string",
                "email": "customer@example.com",
                "phone_number": "+4799999999",
                "addresses": [
                    {
                        "address_line": "Sommerkroveien 34",
                        "postal_place": Oslo,
                        "country": "NO"
                    }
                ],
                "enrolled_by": {
                    "type": "url",
                    "value": "https://facebook.com"
                },
                "type": "customer"
            },
            "shipping_address": {
                "address_line": "Sommerkroveien 34",
                "postal_place": "Oslo",
                "country": "NO"
            },
            "billing_address": {
                "address_line": "Sommerkroveien 34",
                "postal_place": "Oslo",
                "country": "NO"
            },
            "comment": "string",
            "salesperson_id": "string",
            "salesperson_name": "string",
            "delivery_at": "2019-08-24T14:15:22Z",
            "pickup_at": "2019-08-24T14:15:22Z",
            "courier_id": "string",
            "pre_order": "true",
            "time_to_live": 94672800,
            "items": [
                {
                    "status": "string",
                    "id": "175938",
                    "groups": [
                        {
                            "id": "B234",
                            "name": "Stol"
                        },
                        {
                            "id": "B1",
                            "name": "Møbel"
                        }
                    ],
                    "line_id": 1,
                    "quantity": 2,
                    "gross_amount": 39800,
                    "tax_lines": [
                        {
                            "amount": 5584,
                            "percentage": 25,
                            "tax_code": "3",
                            "tax_group": "Vmva-høy"
                        }
                    ],
                    "description": "Stablestol for utendørsbruk",
                    "eligible_for_discount": "true",
                    "discount_lines": [
                        {
                            "amount": 23130,
                            "percentage": 10,
                            "discount_type": "customer",
                            "discount_id": "766da0ef-9283-42bd-b012-0582344ec53c",
                            "description": "string",
                            "line_id": 1
                        }
                    ]
                }
            ],
            "type": "delivery",
            "order_number": "order123456",
            "currency": "NOK",
            "order_id": "string",
            "store": {
                "id": "SL02"
            }
        }
    }

shopping_order_update / shopping_order_event_add / shopping_order_delete

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: shopping_order_update
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "account_id": "P12341234",
        "event": "shopping_order_update",
        "event-delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "customer": {
            "first_name": "John",
            "last_name": "Doe",
            "id": "string",
            "email": "customer@example.com",
            "phone_number": "+4799999999",
            "addresses": [
                {
                    "address_line": "Sommerkroveien 34",
                    "postal_place": "Oslo",
                    "country": "NO"
                }
            ],
            "status": "string",
            "type": "customer"
        },
        "shipping_address": {
            "address_line": "Sommerkroveien 34",
            "postal_place": "Oslo",
            "country": "NO"
        },
        "billing_address": {
            "address_line": "Sommerkroveien 34",
            "postal_place": "Oslo",
            "country": "NO"
        },
        "delivery_at": "2019-08-24T14:15:22Z",
        "pickup_at": "2019-08-24T14:15:22Z",
        "courier_id": "string",
        "items": [
            {
                "status": "string",
                "line_id": 1
            }
        ]
    }

Wallet

wallet_transaction

Wallet transaction event sent from wallets service after a transaction is created

POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: wallet_transaction
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
        "event": "wallet_transaction",
        "event_delivery": "cfedde7e-b088-415e-ad5b-cbe54acbb6f9",
        "created_at": "2017-11-30T08:12:20.533Z",
        "created_by": "API_USER",
        "id": "19657e92-9165-4b4f-92ab-2cd9cdef1525",
        "metadata": { },
        "ref_id": "0000359382",
        "amount": 69900,
        "currency": "NOK",
        "parent_id": null,
        "type": "drawdown",
        "account_id": "T00000000",
        "card_id": "1234567890"
    }

Accounts

Accounts events

approval_payout_destination_update

Event is pushed to subscribers when the case_status of a seller approval changes

header Parameters
event
required
string
Example: approval_payout_destination_update
event-delivery
required
string
Example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
content-type
required
string
Example: application/json
event-signature
string
Example: f572d396fae9206628714fb2ce00f72e94f2258f
Request Body schema: application/json
required
account_id
required
string
event
required
string
Value: "approval_payout_destination_update"
event_delivery
required
string <uuid>
required
object

The seller approval case that was updated

Responses

Request samples

Content type
application/json
{
  • "account_id": "P12345678",
  • "event": "approval_payout_destination_update",
  • "event_delivery": "9ebb6d41-dca5-484e-8330-9c9fa96b60ba",
  • "payout_destination_case": {
    }
}

approval_payout_destination_delete

Event is pushed to subscribers when the approval is archived

header Parameters
event
required
string
Example: approval_payout_destination_delete
event-delivery
required
string
Example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
content-type
required
string
Example: application/json
event-signature
string
Example: f572d396fae9206628714fb2ce00f72e94f2258f
Request Body schema: application/json
required
account_id
required
string
event
required
string
Value: "approval_payout_destination_delete"
event_delivery
required
string <uuid>
required
object

The seller approval case that was deleted

Responses

Request samples

Content type
application/json
{
  • "account_id": "P12345678",
  • "event": "approval_payout_destination_delete",
  • "event_delivery": "9ebb6d41-dca5-484e-8330-9c9fa96b60ba",
  • "payout_destination_case": {
    }
}

Checkout

Checkout events

checkout_transaction

Event is pushed to subscribers when the checkout transaction is created or updated

header Parameters
event
required
string
Example: checkout_transaction_update
event-delivery
required
string
Example: 9ebb6d41-dca5-484e-8330-9c9fa96b60ba
content-type
required
string
Example: application/json
event-signature
string
Example: f572d396fae9206628714fb2ce00f72e94f2258f
Request Body schema: application/json
required
account_id
required
string
event
required
string
Value: "checkout_transaction"
event_delivery
required
string <uuid>
required
object

The transaction details, see Checkout API https://docs.dintero.com/checkout-api.html#operation/transactions_id_get for complete description of all properties that can be included in the transaction object

Responses

Request samples

Content type
application/json
{
  • "account_id": "P12345678",
  • "event": "checkout_transaction",
  • "event_delivery": "9ebb6d41-dca5-484e-8330-9c9fa96b60ba",
  • "transaction": {
    }
}

subscriptions

Create new subscription

When you create a new webhook, we'll send you a simple ping event to let you know you've set up the webhook correctly. You can trigger a ping again by calling the ping endpoint.

Receiving Webhooks

In order for Dintero to send webhook payloads, your server needs to be accessible from the Internet. We also highly suggest using SSL so that we can send encrypted payloads over HTTPS.

Respond to a webhook

Your webhook acknowledges that it received data by sending a 200 OK response. Any response outside of the 200 range will let Dintero know that you did not receive your webhook, including 301 Redirect. Dintero does not follow redirects for webhook notifications and will consider a redirection as an error response.

Dintero has implemented a 60-second timeout period and a retry period for subscriptions. We wait 120 seconds for a response to each request, and if there isn't one or we get an error, we retry the connection to a total of 5 times. A webhook will be deleted if there are consecutive failures for the exact same webhook. You should monitor the admin of your webhook tool for failing webhooks.

Webhooks Headers

Dintero will send along several HTTP headers to differentiate between event types and payload identifiers.

Name Description
event The event type
event-delivery A guid to indentify the payload and event being sent
event-signature The value of this header is computed as the HMAC SHA1 hex digest of the body, using the secret config option as the key.

scopes:

  • admin:hooks
  • write:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

Request Body schema: application/json
required

subscription configuration

required
object
events
required
Array of strings[ items non-empty ]
Items Enum: "account_add" "account_update" "receipt_add" "receipt_update" "customer_add" "customer_update" "customer_delete" "customer_change_password" "token_add" "token_remove" "transaction" "wallet_transaction" "discount_add" "discount_update" "discount_delete" "discount_add_customers" "discount_customer_update" "shopping_draft_add" "shopping_draft_update" "shopping_draft_complete" "shopping_order_update" "shopping_order_event_add" "shopping_order_delete" "settlement_add" "location_add" "location_delete" "location_update" "cdd_case_update" "approval_payout_destination_update" "approval_payout_destination_delete" "checkout_transaction"
active
boolean
Default: true

Determines whether the hook is actually triggered.

fields
string <field-mask>

Limit the event data included in the delivery

The syntax is loosely based on XPath:

  • a,b,c comma-separated list will select multiple fields
  • a/b/c path will select a field from its parent
  • a(b,c) sub-selection will select many fields from a parent
  • a/*/c the star * wildcard will select all items in a field

Responses

Request samples

Content type
application/json
{
  • "active": true,
  • "config": {
    },
  • "fields": "account(partner_id,account_id,created_at)",
  • "events": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "created_at": "2019-08-24T14:15:22Z",
  • "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "active": true,
  • "config": {
    },
  • "fields": "account(partner_id,account_id,created_at)",
  • "events": [
    ]
}

Subscriptions collection

Get all subscriptions

scopes:

  • admin:hooks
  • read:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

query Parameters
include_deleted
boolean
Default: false

include deleted subscriptions in the response.

limit
integer [ 1 .. 100 ]
Default: 10

A limit on the number of objects to be returned. Limit can range between 1 and 100 items, and the default is 10 items.

starting_after
string

cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, end the result contains paging_token=pt1, your subsequent call can include starting_after=pt1 in order to fetch the next page of the list.

total
boolean
Default: false

include total-count header in the response

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Subscription details

Get subscription details

scopes:

  • admin:hooks
  • read:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

hid
required
string <uuid>

subscription id

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "created_at": "2019-08-24T14:15:22Z",
  • "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "active": true,
  • "config": {
    },
  • "fields": "account(partner_id,account_id,created_at)",
  • "events": [
    ]
}

Delete Subscription

Delete a webhook subscription

No more events will be sent to the webhook

scopes:

  • admin:hooks
  • write:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

hid
required
string <uuid>

subscription id

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "created_at": "2019-08-24T14:15:22Z",
  • "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "active": true,
  • "config": {
    },
  • "fields": "account(partner_id,account_id,created_at)",
  • "events": [
    ]
}

subscription deliveries

Deliveries

Get recent subscription deliveries

scopes:

  • admin:hooks
  • read:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

hid
required
string <uuid>

subscription id

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Delivery details

Get subscription delivery details

scopes:

  • admin:hooks
  • read:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

hid
required
string <uuid>

subscription id

delivery_id
required
string

delivery id

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "event_delivery": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "status": 200,
  • "url": "string",
  • "request": {
    },
  • "response": {
    },
  • "details": {
    }
}

Subscription ping

This will trigger a ping event to be sent to the subscription URL.

Ping Event Payload

  POST /
    User-Agent: Dintero-Hook/0c9ad03b
    Content-Type: application/json
    event: ping
    event-delivery: cfedde7e-b088-415e-ad5b-cbe54acbb6f9

    {
      "created_at": "2017-12-06T15:36:43Z",
      "created_by": "1c92f7e1-2897-4d46-bdcc-c127a914fb4e",
      "id": "string",
      "updated_at": "2017-12-06T15:36:43Z",
      "active": true,
      "config": {
        "content_type": "application/json",
        "insecure_ssl": 0,
        "secret": { ... }
        "url": "string"
      },
      "events": ["receipt_add"]
    }

scopes:

  • admin:hooks
  • write:hooks
Authorizations:
JWT
path Parameters
aid
required
string <^[PT]{1}\d{8}$> = 9 characters

An id that uniquely identifies the account.

hid
required
string <uuid>

subscription id

Responses

Response samples

Content type
application/json
{
  • "error": {
    }
}