Skip to content
Last updated

Payments Webhooks

Overview

Ryft provides several webhook events related to payments that allow you to stay informed about the status and lifecycle of payments in your account. These webhooks can be used to automate workflows, update your database, or trigger other actions in your system.

Payment Events

These events are related to the lifecycle of a payment session, including its creation, approval, capture, decline, and voiding.

We highly recommend using these webhooks, to ensure that your system is always up-to-date with the latest information about payments.

Please note the paymentMethod field is only supplied when the payment session is created using a saved payment method.

This event is triggered when a payment session has been successfully captured. This indicates that the payment has been completed and funds have been secured.

PaymentSession.captured - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "PaymentSession.captured",
    "data": {
        "id": "ps_XXXXXXXX",
        "amount": 10000,
        "currency": "GBP",
        "paymentType": "Standard",
        "entryMode": "Online",
        "customerEmail": "test@gmail.com",
        "customerDetails": {"id": "cus_XXXXXXXX"},
        "enabledPaymentMethods": ["Card"],
        "paymentMethod": {
            "type": "Card",
            "tokenizedDetails": {
                "id": "pmt_XXXXXXXX",
                "stored": false,
            },
            "card": {"scheme": "Visa", "last4": "XXXX"},
            "wallet": {"type": "GooglePay"},
            "billingAddress": {
                "firstName": "Card",
                "lastName": "Name",
                "lineOne": "1600 Amphitheatre Parkway",
                "city": "Mountain View",
                "country": "US",
                "postalCode": "94043",
                "region": "CA",
            },
            "checks": {"avsResponseCode": "C", "cvvResponseCode": "P"},
            "id": "pmt_XXXXXXXX",
        },
        "returnUrl": "https://test.com",
        "status": "Captured",
        "refundedAmount": 0,
        "statementDescriptor": {"descriptor": "Test Descriptor", "city": "London"},
        "authorizationType": "FinalAuth",
        "captureFlow": "Manual",
        "createdTimestamp": 1759478781,
        "lastUpdatedTimestamp": 1759479339,
        "paymentTransactionId": "txn_XXXXXXXX",
        "customer": {"id": "cus_XXXXXXXX"},
    },
    "accountId": "ac_XXXXXXXX",
    "createdTimestamp": 1759479339,
    "lastUpdatedTimestamp": 1759479339,
    "deliveryStatus": "Success",
}

Platform Fee Events

These events are related to Payments of type Platform Fee.

This event is triggered when a Payment of type Platform Fee is created.

PlatformFee.created - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "PlatformFee.created",
    "data": {
        "id": "pf_XXXXXXXX",
        "paymentSessionId":"ps_XXXXXXXX",
        "amount": 500,
        "processingFee":47,
        "refundedAmount":0,
        "netAmount":-37,
        "currency":"GBP",
        "fromAccountId":"ac_XXXXXXXX",
        "createdTimestamp":1759402743,
    },
    "createdTimestamp": 1570989538,
}

Transfer Events

These events are related to the transfer of funds between a Main Account and a sub-Account when using the Transfer API, including successful transfers and failed transfer attempts.

This event is triggered when a transfer between accounts has been created. This indicates that funds are being moved from one account to another.

Transfer.created - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "Transfer.created",
    "data": {
        "id": "tfr_XXXXXXXX",
        "status": "Pending",
        "amount": 1000,
        "currency": "GBP",
        "reason": "Transfer test",
        "destination": {"accountId": "ac_XXXXXXXX"},
        "createdTimestamp": 1759483719,
        "lastUpdatedTimestamp": 1759483719,
    },
    "accountId": "ac_XXXXXXXX",
    "createdTimestamp": 1759483719,
    "lastUpdatedTimestamp": 1759483719,
    "deliveryStatus": "Success",
}

Refund Events

These events are related to the refund process of a payment session, including successful refunds and failed refund attempts.

This event is triggered when a payment session has been refunded. This indicates that the funds from a previously captured payment will be returned to the customer.

PaymentSession.refunded - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "PaymentSession.refunded",
    "data": {
        "id": "ps_XXXXXXXX",
        "amount": 500,
        "platformFee": 50,
        "currency": "GBP",
        "metadata": {"customerId": "123"},
    },
    "createdTimestamp": 1570989538,
}

Customer Events

These events are related to the lifecycle of a customer, including their creation, updates, and deletion.

This event is triggered when a customer is created in your Ryft account.

Customer.created - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "Customer.created",
    "data": {
        "id": "cus_XXXXXXXX",
        "email": "example@mail.com",
        "firstName": "Fred",
        "lastName": "Jones",
        "metadata": {"customerId": "ef8995ce-ed5c-4f77-b04e-df86de5c11b8"},
        "createdTimestamp": 1659538083,
    },
    "createdTimestamp": 1659538083,
}

Dispute Events

These events are related to the lifecycle of a dispute, including its creation, challenge, and closure.

This event is triggered when a dispute is created for a payment in your Ryft account.

Dispute.created - Payload Example
{
    "id": "ev_XXXXXXXX",
    "eventType": "Dispute.created",
    "data": {
        "id": "dsp_XXXXXXXX",
        "amount": 4531,
        "currency": "GBP",
        "status": "Open",
        "category": "Fraudulent",
        "reason": {
            "code": "10.1",
            "description": "EMV Liability Shift Counterfeit Fraud",
        },
        "respondBy": 1761091200,
        "recommendedEvidence": [
            "Receipt",
            "ShippingConfirmation",
            "ProofOfDelivery",
            "CustomerCommunication",
            "CustomerSignature",
        ],
        "paymentSession": {
            "id": "ps_XXXXXXXX",
            "paymentType": "Standard",
            "paymentMethod": {"card": {"scheme": "Visa", "last4": "XXXX"}},
        },
        "evidence": {
            "text": {
                "billingAddress": "Card Name, 1600 Amphitheatre Parkway, Mountain View, 94043, US, CA"
            }
        },
        "customer": {
            "email": "test@gmail.com",
            "id": "cus_XXXXXXXX",
            "createdTimestamp": 1757409127,
        },
        "createdTimestamp": 1758729431,
        "lastUpdatedTimestamp": 1758729431,
    },
    "createdTimestamp": 1758729432,
    "lastUpdatedTimestamp": 1758729432,
    "deliveryStatus": "None",
}