Create a Payment Notification

A payment notification represents the point in time when a payment vendor collects a payment from a customer for a Payjoy product and the payment vendor needs to alert Payjoy to this event. The payment vendor will use this endpoint to create a notification and send Payjoy the necessary data to create the notification.

Authorization

This endpoint requires a valid bearer token in the Authorization request header. If this is not present, the endpoint will return a 401 client error response.

Bearer tokens should be generated from the Authentication endpoint.

Sample Query

Query:

The paymentVendor field is the only required field in the body of the request. This will be a value agreed upon by both Pajoy and the payment vendor when creating the integration.

Based on the type of integration, more data may be sent with this request. Additional required data will be specified during the setup of the vendor-specific integration.

#!/bin/bash
curl --location --request POST 'https://api.payjoy.com/payments/v1/notification' \
--header 'Authorization: Bearer <accessToken>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "paymentVendor": "<paymentVendorName>"
}'

Successful Response

If the payment notification is created successfully, the response will include a confirmation message with a 200 response code.

Other data may be included in the response, based on the vendor-specific needs. These will be determine at the time of integration between Payjoy and the payment vendor.

Response
{
    "data": {
        "message": "Payment Confirmed"
    }
}

Client Error Response

If the request is invalid, or the accessToken has expired, you will receive an error message with a 400, 401, or 403 client error response code. These requests can be retried, once the request input has been fixed.

Response
{
    "error": {
        "message": "paymentVendor is a required field"
    }
}

Server Error Response

If a server error occurs when creating the payment notification, you will receive a confirmation message with a 500 server error response code.

Response
{
    "error": {
        "message": "Internal Server Error"
    }
}