JustiFi API Documentation (v1)

Download OpenAPI specification:Download

Introduction

The JustiFi API is a REST-based payment processing API. Our API has predictable, resource-oriented URLs, accepts JSON, and returns JSON. We use HTTP status codes and supply detailed error codes whenever possible. You can use our API in test mode, which will not process any real transactions, or in live mode, which will execute real financial transactions.

Getting Started

To process a payment with JustiFi, follow these steps


Get Your Account

Our customer onboarding team will work with you to create your test and live accounts and gain approval for your business to process payments. Once you're up and running, you'll have access to the JustiFi API as well as the admin features at https://app.justifi.ai where you can see your account overview, payments, payouts, issue refunds, etc.


Get Your API key

Once your JustiFi accounts have been created, the JustiFi team will provision your API keys. You'll receive a client id and client secret for each environment; one set will provide access to your test environment, the other to your live environment.

Additionally, we can provide access to a sandbox environment upon request.


Authenticate With JustiFi

Example OAuth Client Credentials Grant Request
curl -X POST https://api.justifi.ai/oauth/token \
    -H 'Content-Type: application/json' \
    --data '{"client_id":"[your client id]","client_secret":"[your client secret]"}'
Example Authenticated Response
{
  "access_token": "... this will be a very long string and is valid for 24 hours"
}
Example Authenticated Request
curl -X POST https://api.justifi.ai/v1/payments \
    -H 'Authorization: Bearer [access_token]' \
    -H 'Content-Type: application/json'
    -H 'Idempotency-Key: a-unique-string-for-the-transaction'

JustiFi uses the OAuth Client Credentials authentication flow. To access, use your JustiFi client id and client secret to POST to https://api.justifi.ai/oauth/token. These are valid for 24 hours. The test key is prepended with test_ and the live key is prepended with live_. We allow one set of credentials per customer.

Next, take the access token in that response and pass it in all subsequent requests as the Authorization header.

This token is valid for 24 hours, so be sure to handle a 401 - Unauthorized response by getting a new access token via the client credentials grant API.

Idempotent Requests

Example Request with Idempotency-Key Header
curl -X POST https://api.justifi.ai/v1/payments \
    -H 'Authorization: Bearer [access_token]' \
    -H 'Accept: application/json'
    -H 'Idempotency-Key: a-unique-string-for-the-transaction'

In order to guarantee that payments and other important transactions are only ever processed a single time, we leverage the Idempotency-Key header in our payments APIs. This means that you MUST provide an Idempotency-Key header along with your request, otherwise you'll receive an error. If a second request with same idempotent key is processed concurrently, it will result in a 409 error instead of double processing.

If these requests fail with a network timeout or a 5XX error, they should be retried with the same exact parameters. Once they're fully successful, you'll receive a 2XX response. If you POST the same request and Idempotency-Key again, you'll get the response you originally received back. If you receive a 4XX error, do not retry the request, unless the response code is a 409.

If you try the same Idempotency-Key with different parameters, your request will error and won't be possible to process. The Idempotency-Key header is only meant for a single transaction; it's there to protect against processing the same exact thing more than once. Once the parameters change, a request is considered distinct from the original request.

You may use any string to identify your Idempotency-Key; we generally recommend using a generated uuid, but you may use any unique string.

Pagination

Example Paginated Request
curl -X GET https://api.justifi.ai/v1/payments?limit=25&after_cursor=token-from-page-info \
    -H 'Authorization: Bearer [access_token]' \
    -H 'Accept: application/json'
Example Paginated Response
{
    "id": null,
    "type": "array",
    "data":[
        { "id":"py_438xBom2Drh55kE1WfyGLg",
          "amount": 1000,
          ... additional response attributes based on resource schema
        }
    ],
    "page_info": {
      "has_previous": false,
      "has_next": true,
      "start_cursor": "WyIyMDIyLTAxLTExIDE1OjI3OjM2LjAyNzc3MDAwMCIsImNhNjQwMTk1LTEzYzMtNGJlZi1hZWQyLTU3ZjA1MzhjNjNiYSJd",
      "end_cursor": "WyIyMDIyLTAxLTExIDEyOjU5OjQwLjAwNTkxODAwMCIsImQ0Njg5MGE2LTJhZDItNGZjNy1iNzdkLWFiNmE3MDJhNTg3YSJd"
    }
}

All top-level API resources have support for bulk fetches via array API methods. JustiFi uses cursor-based pagination, which supports limit, before_cursor and after_cursor. Each response will have a page_info object that contains the has_next and has_previous fields, which tells you if there are more items before or after the current page. The page_info object also includes start_cursor and end_cursor values which can be used in conjunction with before_cursor and after_cursor to retrieve items from the API one page at a time.

Standard array API Request Parameters

Parameter Description
limit The number of resources to retrieve.
type: integer
default: 25
minimum: 1
maximum: 100
after_cursor Token to fetch the next page of a list.
type: string
before_cursor Token to fetch the previous page of a list.
type: string

The after_cursor/before_cursor parameter determines which page of results will be returned. If after_cursor is the encoded id of the last record in the collection has_next will be false and you'll get an empty array response. If before_cursor is the encoded id of the first record in the collection has_previous will be false and you'll get an empty array response.

The limit parameter determines the maximum number of results included in each response. If there are fewer records available than the limit value, the response will include all available records. The maximum value allowed is 100 with a default value of 25. If the limit value is an invalid type, the default value of 25 is used.

Standard API Response Structure

All of our responses are contained in the same envelope, for arrays the id field will be null and the object will be an array.

Attribute Description
id The id of the object returned. Will be null for arrays.
type: string
default: "a uuid"
type The type of object returned.
type: string
default: "array"
data The resource OR an array of the requested resources.
type: array | object
Notes: May be an empty array [] if no resources are available.
page_info The object containing pagination information.
type: object
Notes: Contains has_previous, has_next, start_cursor and end_cursor

Testing

The JustiFi platform has a test mode, which allows you to test your integration. Use these card numbers to test successful transactions as well as various error scenarios.

Successful Test Cards

Number Brand CVC Date
4242424242424242 Visa Any 3 digits Any future date
4000056655665556 Visa (debit) Any 3 digits Any future date
5555555555554444 Mastercard Any 3 digits Any future date
2223003122003222 Mastercard (2-series) Any 3 digits Any future date
5200828282828210 Mastercard (debit) Any 3 digits Any future date
5105105105105100 Mastercard (prepaid) Any 3 digits Any future date
378282246310005 American Express Any 4 digits Any future date
371449635398431 American Express Any 4 digits Any future date
6011000990139424 Discover Any 3 digits Any future date
3056930009020004 Diners Club Any 3 digits Any future date
36227206271667 Diners Club (14 digit card) Any 3 digits Any future date
3566002020360505 JCB Any 3 digits Any future date
6200000000000005 UnionPay Any 3 digits Any future date

Declined Test Cards

Number Description
4000000000000101 If a CVC number is provided, the cvc_check fails.
4000000000000341 Tokenizing this card succeeds, but attempts to make a payment fail.
4000000000000002 Payment is declined with a card_declined code.
4000000000009995 Payment is declined with a card_declined code. The decline_code attribute is insufficient_funds.
4000000000009987 Payment is declined with a card_declined code. The decline_code attribute is lost_card.
4000000000009979 Payment is declined with a card_declined code. The decline_code attribute is stolen_card.
4000000000000069 Payment is declined with an expired_card code.
4000000000000127 Payment is declined with an invalid_cvc code.
4000000000000119 Payment is declined with a gateway_error code.
4242424242424241 Payment is declined with an card_number_invalid code as the card number fails the Luhn check.

HTTP Errors

The JustiFi API may return a number of standard HTTP errors due to invalid requests. Some common errors are described below to help you build with JustiFi.

Bad Request

The server cannot process the request. This error is most likely due to malformed request syntax.

  • code: 400
  • status: Bad Request

Unauthorized

Similar to a 403 Forbidden, but specifically when authentication is provided and has failed, or has not been provided. This error is most likely due to not including your API key in the request header.

  • code: 401
  • status: Unauthorized

Payment Required

There was an error processing the payment. This response is returned when errors occur while tokenizing the payment method, such as an invalid cvc or an expiration date in the past. This can also occur when making a payment and the card is declined. In that case, the error message will provide more specific information about why the request was declined.

  • code: 402
  • status: Payment Required

Forbidden

The request was valid, but you are unable to execute the request. This error is most likely due to the API key that was used not having the necessary permissions, or attempting a prohibited action such as creating a duplicate record where one already exists.

  • code: 403
  • status: Forbidden

Not Found

The requested resource could not be found, but may be available in the future. This error is most likely due to requesting a resource by id that doesn't exist. You'll want to double check that you're referencing the correct id and that it exists on your account.

  • code: 404
  • status: Not Found

Concurrent Request Error

The request has an identical Idempotency-Key header for another request which either failed OR is processing at the same time. You can retry these requests without risk of double processing.

  • code: 409
  • status: Conflict

Unprocessable Entity

The request was well-formed, but was unable to be processed due to semantic errors. This error is most likely due to including invalid data in POST, PATCH, and PUT requests. Double check the request documentation to make sure you're supplying the required attributes, and that the attribute types are correct.

  • code: 422
  • status: Unprocessable Entity

Internal Server Error

An internal server error occurred due to an unexpected condition. This error is most likely due to an issue with our servers.

  • code: 500
  • status: Internal Server Error

Error Codes

Many of our 4XX errors will provide an error code in addition to their HTTP status. Here is a list of our error codes and a brief description of the error to provide more context when applicable.

Error Code Description
acct_last_four_required Missing required parameter: acct_last_four
amount_below_minimum Amount must be greater than 50
amount_must_be_an_integer Amount must be an integer
amount_required Missing required parameter: amount
amount_too_large The specified amount is greater than the maximum amount allowed. Use a lower amount and try again.
amount_too_small The specified amount is less than the minimum amount allowed. Use a higher amount and try again.
application_fee_rate_id_required Missing required parameter: application_fee_rate_id
application_fee_required Missing required parameter: application_fee
brand_required Missing required parameter: brand
capture_strategy_invalid Format is invalid for parameter: capture_strategy
card_decline_rate_limit_exceeded This card has been declined too many times. You can try to charge this card again after 24 hours. We suggest reaching out to your customer to make sure they have entered all of their information correctly and that there are no issues with their card.
card_declined The card has been declined. When a card is declined, the error returned also includes the decline_code attribute with the reason why the card was declined.
card_name_required Missing required parameter: card_name
card_number_invalid Format is invalid for parameter: card_number
card_number_required Missing required parameter: card_number
charge_expired_for_capture The charge cannot be captured as the authorization has expired. Auth and capture charges must be captured within 7 days.
country_invalid Format is invalid for parameter: country
currency_invalid Format is invalid for parameter: currency
currency_required Missing required parameter: currency
customer_id_required Missing required parameter: customer_id
customer_max_payment_methods The maximum number of PaymentMethods for this Customer has been reached. Either detach some PaymentMethods from this Customer or proceed with a different Customer.
email_invalid The email address is invalid (e.g., not properly formatted). Check that the email address is properly formatted and only includes allowed characters.
email_required Missing required parameter: email
expired_card The card has expired. Check the expiration date or use a different card.
gateway_account_id_required Missing required parameter: gateway_account_id
gateway_authentication_error The payment network returned an authentication error
gateway_error There was an issue processing your payment with the gateway. Please try again later.
gateway_idempotency_error The gateway detected concurrent requests using this idempotency key
gateway_rate_limit_error Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
gateway_ref_id_required Missing required parameter: gateway_ref_id
gateway_timeout_error There was a timeout with the gateway, we recommend retrying using the Should-Retry header
idempotency_concurrent_request We detected concurrent requests using this idempotency key
idempotency_key_required Idempotency-Key is a required header
idempotency_params_mismatch The request parameters do not match those of a previous request using this idempotency key
idempotency_request_in_progress Another request using this idempotency key is currently in progress
internal_server_error An unexpected error has occurred. JustiFi engineers will investigate the error and contact you if any remediation steps are necessary.
invalid_address The card’s address is incorrect. Check the card’s address or use a different card.
invalid_card_number The card number is incorrect. Check the card number or use a different card.
invalid_characters This value provided to the field contains characters that are unsupported by the field
invalid_charge_amount The specified amount is invalid. The charge amount must be a positive integer in the smallest currency unit, and not exceed the minimum or maximum amount.
invalid_cvc The card’s security code is incorrect. Check the card’s security code or use a different card.
invalid_expiry_month The card’s expiration month is incorrect. Check the expiration date or use a different card.
invalid_expiry_year The card’s expiration year is incorrect. Check the expiration date or use a different card.
invalid_zip_code The card’s postal code is incorrect. Check the card’s postal code or use a different card.
month_invalid Format is invalid for parameter: month
not_authenticated Not authenticated
not_authorized Not authorized
parameter_missing Missing required parameter
payment_fully_refunded The refund cannot be processed because the associated payment is fully refunded
payment_intent_cannot_be_captured Payment Intent status is '%{status}' so it cannot be captured
payment_intent_not_found Payment intent not found
payment_intent_unexpected_state You cannot provide a new payment method to a PaymentIntent when it has a status of requires_capture, canceled, or succeeded
payment_method_not_found Payment method not found
payment_method_required Missing required parameter: payment_method
payment_method_token_required Missing required parameter: payment_method_token
payment_outside_refund_window The refund cannot be processed because the associated payment is outside the refund window
postal_code_invalid Format is invalid for parameter: postal_code
refund_exceeds_amount_available The refund cannot be processed because the refund amount exceeds the available funds
refund_exceeds_payment_amount The refund cannot be processed because the refund amount exceeds the associated payment amount
refund_reason_invalid Refund reason must be one of the following: %{Refund::REASONS}
resource_not_found Resource not found
state_invalid Format is invalid for parameter: state
token_already_used The token provided has already been used. You must create a new token before you can retry this request.
token_in_use The token provided is currently being used in another request. This occurs if your integration is making duplicate requests simultaneously.
transfer_required Missing required parameter: transfer
unexpected_parameter Unexpected parameter for this request
verification_invalid Format is invalid for parameter: verification
year_invalid Format is invalid for parameter: year

API Credentials

Generate Access Token

To get an access token, post your client_id and client_secret. The request responds with an access token, which is valid for 24 hours. Pass the token as the Authorization header with Bearer appended before the token, e.g. Bearer {access_token}.

Request
Request Body schema: application/json
client_id
string

the client id for your (live or test) account

client_secret
string

the client secret for your (live or test) account

Responses
200

An access token has been granted

post/oauth/token
Request samples
application/json
{
  • "client_id": "test_clientId",
  • "client_secret": "test_clientSecret"
}
Response samples
application/json
{
  • "access_token": "string"
}

Hosted Onboarding *

In order to process payments, each of your customers (whom we refer to as sellers) will go through an approval process. JustiFi's hosted onboarding provides you with an easy-to-implement, user-friendly way to collect the required business and financial information from each seller, within your platform. Once approved, your sellers can process payments through JustiFi. To onboard a new seller via hosted onboarding

  1. Create a seller account
  2. Include JustiFi hosted onboarding in your application
  3. Check the seller account's approval status

Create a seller account

Create a seller account

curl -X POST https://api.justifi.ai/v1/partner_platform/seller_accounts \
    -H 'Authorization: Bearer [access_token]' \

Use the seller accounts API to create a seller on JustiFi that is associated with your platform. The seller will be created with the account_type of "live" or "test" based on the JustiFi credentials you use. You can save the account_id that is returned from the response in order to perform seller-specific actions on JustiFi.

Include JustiFi hosted onboarding in your application

To present the JustiFi hosted onboarding form to your user, create an iframe with a source of https://accounts.justifi.ai/onboarding/SELLER_ACCOUNT_ID, where SELLER_ACCOUNT_ID is the account_id that was created in the previous step. This iframe will present your user with a multi-step form where they can enter the business and financial information needed for approval. Upon submission, a success message will display.

Check the seller account approval status

Retrieve a seller account

curl -X GET https://api.justifi.ai/v1/partner_platform/seller_accounts/ACCOUNT_ID \
    -H 'Authorization: Bearer [access_token]' \
    -H 'Accept: application/json'

Once your user submits the onboarding form, we'll review their information. This approval process can take up to a few business days. In order to check whether the seller is processing_ready and payout_ready, call the Get a Seller Account endpoint or subscribe to the seller account's update webhook.

Seller Accounts *

Create a Seller Account

Create a JustiFi account for your customer, so they can process payments (once approved by JustiFi). The seller will be created as part of your platform with the account_type of "live" or "test" based on the JustiFi credentials you use.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
201

Seller account was created successfully

post/platform/seller_accounts
Request samples
curl -i -X POST \
  https://api.justifi.ai/v1/platform/seller_accounts \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "seller_account",
  • "data": {
    },
  • "page_info": null
}

List Seller Accounts

List the sellers for your account. This endpoint supports pagination.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully list seller accounts

get/platform/seller_accounts
Request samples
curl -i -X GET \
  https://api.justifi.ai/v1/platform/seller_accounts \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Seller Account

Get information about a seller account.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a seller account

get/platform/seller_accounts/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/platform/seller_accounts/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "seller_account",
  • "data": {
    },
  • "page_info": null
}

Payments

To charge a payment method the desired amount, you'll use a payment. You can choose whether to charge a payment method that's already been tokenized or tokenize a new one when you create the payment. If a payment fails, the status will reflect it and an error code will be returned. You can retrieve information about your payments and refund them if needed.

Create a Payment

Authorize, capture, and charge a payment method.

Request
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Request Body schema: application/json
amount
required
number

amount to charge in cents

currency
required
string
Value: "usd"
capture_strategy
required
string

automatic will authorize and capture the payment in the same request.

Value: "automatic"
email
required
string <email>

email address to associate with payment method

required
object
description
string

your meaningful description of the payment (e.g. an order number or other value from your system)

metadata
object <json>

any useful information you'd like to store alongside this payment

Responses
201

Payment was created successfully

post/payments
Request samples
application/json
{
  • "amount": 1000,
  • "currency": "usd",
  • "capture_strategy": "automatic",
  • "email": "example@test.com",
  • "description": "Charging $10 to the test card",
  • "payment_method": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment",
  • "data": {
    },
  • "page_info": null
}

List Payments

List the payments for your account. This endpoint supports pagination.

Request
query Parameters
created_before
string <datetime>

Filter records which were created before the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: created_before=2022-01-01T00:00:00Z
created_after
string <datetime>

Filter records which were created after the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: created_after=2022-01-01T00:00:00Z
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Responses
200

Successfully list payments

get/payments
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payments?created_before=string&created_after=string' \
  -H 'Authorization: string' \
  -H 'Seller-Account: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Payment

Get information about a payment.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a payment

get/payments/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payments/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "payment",
  • "data": {
    },
  • "page_info": null
}

Update a Payment

Change a payment's description or metadata.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
description
string

your meaningful description of the payment (e.g. an order number or other value from your system)

metadata
object <json>

any useful information you'd like to store alongside this payment; when you update metadata, any previous metadata will be overwritten

Responses
200

Payment update was successful

patch/payments/{id}
Request samples
application/json
{
  • "description": "order_xyz",
  • "metadata": { }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment",
  • "data": {
    },
  • "page_info": null
}

Capture a Payment

To charge a payment method and capture a previously authorized payment. Returns a payment_already_captured error if the payment is in a captured state.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Payment with identical idempotency key was captured

201

Payment was captured successfully

post/payments/{id}/capture
Request samples
curl -i -X POST \
  'https://api.justifi.ai/v1/payments/{id}/capture' \
  -H 'Authorization: string' \
  -H 'Idempotency-Key: 497f6eca-6276-4993-bfeb-53cbbbba6f08'
Response samples
application/json
{
  • "id": 1,
  • "type": "payment",
  • "data": {
    },
  • "page_info": null
}

Refund a Payment

Issue a refund for a payment. You may refund the full payment amount or just a portion. When refunding a portion, multiple refunds are supported up until the full payment amount has been refunded.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
amount
number

amount to refund; must be less than or equal to the amount_refundable on the payment

description
string

an optional note about this refund

reason
string

the reason this refund is being issued

Enum: "duplicate" "fraudulent" "customer_request"
metadata
object <json>

any useful information you'd like to store alongside this refund

Responses
201

Refund was created successfully

post/payments/{id}/refunds
Request samples
application/json
{
  • "amount": 10000,
  • "description": "string",
  • "reason": "duplicate",
  • "metadata": { }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "refund",
  • "data": {
    },
  • "page_info": null
}

Payment Intents

If you'd like to track the payment method and all associated payment attempts for a particular payment, you can use payment intents. Once you've tokenized a payment method and attached it to a payment intent, capturing the payment intent will let JustiFi know to charge the payment method and create a payment. If the capture fails, you can attempt again on the same payment intent.

Create a Payment Intent

Create a payment intent if you'd like a place to track the payment method along with all payment attempts for a payment.

Request
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Request Body schema: application/json
amount
required
number

amount to charge in cents

currency
required
string
Value: "usd"
description
string

your meaningful description of the payment intent (e.g. an order number or other value from your system)

metadata
object <json>

any useful information you'd like to store alongside this payment intent

object
Responses
201

Payment intent was created successfully

post/payment_intents
Request samples
application/json
{
  • "amount": 1000,
  • "currency": "usd",
  • "description": "ORDER 1235ABC: Charging $10 to the test card",
  • "metadata": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_intent",
  • "data": {
    },
  • "page_info": null
}

List Payment Intents

List the payment intents for your account. This endpoint supports pagination.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Responses
200

Successfully list payment intents

get/payment_intents
Request samples
curl -i -X GET \
  https://api.justifi.ai/v1/payment_intents \
  -H 'Authorization: string' \
  -H 'Seller-Account: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Payment Intent

Get information about a payment intent.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a payment intent

get/payment_intents/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payment_intents/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_intent",
  • "data": {
    },
  • "page_info": null
}

Update a Payment Intent

Change a payment intent's description or metadata; attach a payment method.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
description
string

your meaningful description of the payment intent (e.g. an order number or other value from your system)

metadata
object <json>

any useful information you'd like to store alongside this payment intent; when you update metadata, any previous metadata will be overwritten

object

can be updated if the payment intent status is requires_payment_method or pending

Responses
200

Payment intent update was successful

patch/payment_intents/{id}
Request samples
application/json
{
  • "description": "order_xyz",
  • "metadata": { },
  • "payment_method": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_intent",
  • "data": {
    },
  • "page_info": null
}

Capture a Payment Intent

Capturing a payment intent lets JustiFi know you intend to process a payment. JustiFi will charge the attached payment method and create a payment.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
object
Responses
201

Payment intent was captured successfully

post/payment_intents/{id}/capture
Request samples
application/json
{
  • "payment_method": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_intent",
  • "data": {
    },
  • "page_info": null
}

Get Payments for a Payment Intent

Get information about the payments associated with a payment intent.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully retrieve the payments for a payment intent

get/payment_intents/{id}/payments
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payment_intents/{id}/payments' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Payment Methods

Payment methods refer to the specific form of payment each customer uses (e.g. their credit card). Payment methods are tokenized, then charged at time of payment.

Create a Payment Method

You can create payment methods ahead of time, then pass their existing tokens to payments. Alternatively, you can create and tokenize payment methods inline when processing payments.

Request
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Request Body schema: application/json
required
object
email
string <email>

email address to associate with the payment method

Responses
201

Payment method was created successfully

post/payment_methods
Request samples
application/json
{
  • "email": "example@test.com",
  • "payment_method": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_method",
  • "data": {
    },
  • "page_info": null
}

List Payment Methods

List the payment methods for your account. This endpoint supports pagination.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Responses
200

Successfully list payment methods

get/payment_methods
Request samples
curl -i -X GET \
  https://api.justifi.ai/v1/payment_methods \
  -H 'Authorization: string' \
  -H 'Seller-Account: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Payment Method

Get information about a payment method.

Request
path Parameters
token
required
string
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a payment method

get/payment_methods/{token}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payment_methods/{token}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_method",
  • "data": {
    },
  • "page_info": null
}

Update a Payment Method

Change a payment method's expiration date, address, or metadata.

Request
path Parameters
token
required
string
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
object (UpdateCard)
object (UpdateBankAccount)

Bank Account (api preview)

Responses
200

Payment method update was successful

patch/payment_methods/{token}
Request samples
application/json
{
  • "card": {
    },
  • "bank_account": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payment_method",
  • "data": {
    },
  • "page_info": null
}

Refunds

When you refund a payment, a refund object is created. You can retrieve information about the refunds you've issued.

List Refunds

List the refunds for your account. This endpoint supports pagination.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Responses
200

Successfully list refunds

get/refunds
Request samples
curl -i -X GET \
  https://api.justifi.ai/v1/refunds \
  -H 'Authorization: string' \
  -H 'Seller-Account: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Refund

Get information about a refund.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a refund

get/refunds/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/refunds/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "refund",
  • "data": {
    },
  • "page_info": null
}

Update a Refund

Update the refund metadata.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
metadata
object <json>

any useful information you'd like to store alongside this refund; when you update metadata, any previous metadata will be overwritten

Responses
200

Refund update was successful

patch/refunds/{id}
Request samples
application/json
{
  • "metadata": { }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "refund",
  • "data": {
    },
  • "page_info": null
}

Disputes

A customer may dispute their payment with the card issuer/bank if they believe the charge is erroneous. When this happens, a dispute record is created and associated with their original payment.

List Disputes

List the disputes for your account. This endpoint supports pagination. The disputes for a specific payment are also included in the payments API response.

Request
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Seller-Account
string

For partner platforms, the id of the seller account that this request applies to.

Example: acc_2IdMEOjIG6lJAncakgdBF2
Responses
200

Successfully list disputes

get/disputes
Request samples
curl -i -X GET \
  https://api.justifi.ai/v1/disputes \
  -H 'Authorization: string' \
  -H 'Seller-Account: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Dispute

Get information about a dispute.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a dispute

get/disputes/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/disputes/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "dispute",
  • "data": {
    },
  • "page_info": null
}

Update a Dispute

Change a dispute's metadata.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
metadata
object <json>

any useful information you'd like to store alongside this dispute; when you update metadata, any previous metadata will be overwritten

Responses
200

Dispute update was successful

patch/disputes/{id}
Request samples
application/json
{
  • "metadata": { }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "dispute",
  • "data": {
    },
  • "page_info": null
}

Payouts

Each day, a payout containing that day's funds is automatically created for the purpose of distributing those funds to the active bank account. Payout amounts are calculated by summing the associated balance transactions for that specific day.

List Payouts

Request
query Parameters
created_before
string <datetime>

Filter records which were created before the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: created_before=2022-01-01T00:00:00Z
created_after
string <datetime>

Filter records which were created after the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: created_after=2022-01-01T00:00:00Z
deposits_before
string <datetime>

Filter records which deposit before the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: deposits_before=2022-01-01T00:00:00Z
deposits_after
string <datetime>

Filter records which deposit after the date or datetime specified. UTC time. Dates without time specified will default to 00:00:00

Example: deposits_after=2022-01-01T00:00:00Z
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully list payouts

get/payouts
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payouts?created_before=string&created_after=string&deposits_before=string&deposits_after=string' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "array",
  • "data": [
    ],
  • "page_info": {
    }
}

Get a Payout

Get information about a payout.

Request
path Parameters
id
required
string <uuid>
header Parameters
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Responses
200

Successfully get a payout

get/payouts/{id}
Request samples
curl -i -X GET \
  'https://api.justifi.ai/v1/payouts/{id}' \
  -H 'Authorization: string'
Response samples
application/json
{
  • "id": 1,
  • "type": "payout",
  • "data": {
    },
  • "page_info": null
}

Update a Payout

Change a payout's metadata.

Request
path Parameters
id
required
string <uuid>
header Parameters
Idempotency-Key
required
string <uuid>

a string to identify your request (we recommend using a generated uuid, but you may use any unique string) see Idempotent Requests

Example: my-request-123abc
Authorization
required
string

the access_token value returned from the JustiFi oauth/token endpoint (be sure to append Bearer before the token)

Example: Bearer {access_token}
Request Body schema: application/json
metadata
object <json>

any useful information you'd like to store alongside this payout; when you update metadata, any previous metadata will be overwritten

Responses
200

Payout update was successful

patch/payouts/{id}
Request samples
application/json
{
  • "metadata": {
    }
}
Response samples
application/json
{
  • "id": 1,
  • "type": "payout",
  • "data": {
    },
  • "page_info": null
}

PaymentsJS

Overview

PaymentsJS provides a developer-friendly experience that makes it easy to collect payment methods in a safe manner, without bringing your application into PCI (Payment Card Industry) compliance scope. By including it in your page, you'll be able to render payment method inputs, bind to their events, and tokenize the completed payment method information so that it can be used to make a payment.

Currently, PaymentsJS works with vanilla javascript and React applications. While it may work in other front-end frameworks, it has not been tested and is currently unsupported.

Get Started

Include the JavaScript module

Part of what allows PaymentsJS to keep your application out of PCI compliance scope is that the source code is hosted by JustiFi. Therefore, it's not an installable package and should be included directly from the justifi.ai domain. To do this, include the script in the head of your HTML file.

<html>
<head>
    <script
        type="text/javascript"
        src="https://js.justifi.ai/payments/v1/payments.js"></script>

Initialize PaymentsJS

Once the JavaScript has been included, it can be initialized by calling window.JustiFiPaymentsJS with the client id from your API key. Reminder: use your client id. Never share your client secret publicly.

const justifiJS = window.JustiFiPaymentsJS({ clientKey: "test_xxx" });

If you're a Platform and processing a payment on behalf of a Seller Account, you must also pass the account option to JustiFiPaymentsJS. For example:

const justifiJS = window.JustiFiPaymentsJS({
  clientKey: "test_xxx",
  account: "acc_testseller"
});

When JustiFiPaymentsJS is called, it will return an object with the following methods:

appendTo(selector)

Takes the selector of an element and appends a payment method input element to it.

 justifiJS.appendTo('#card-form');

on('ready', handler)

The 'ready' event is triggered when the payment method input has rendered, and initial validation errors will be passed to the provided event handler.

justifiJS.on('ready', (data: any) => {
  // You can use the 'ready' event to set your app's loading state
  // so that the card field does not 'pop in' when it is first rendered.
  loading = false;

  // You can also use the 'ready' event to retrieve initial errors,
  // which can then be shown if the form is submitted prematurely.
  paymentMethodErrors = data.errors;
})

on('change', handler)

The 'change' event is triggered when the payment method input's value changes. Validation will be generated and passed along to the provided event handler.

justifiJS.on('change', (data: any) => {
  paymentMethodErrors = data.errors;
});

on('blur', handler)

The 'blur' event is triggered when the payment method input is blurred/loses focus. Validation will be generated and passed along to the provided event handler.

justifiJS.on('blur', (data: any) => {
  paymentMethodErrors = data.errors;
});

tokenize(paymentMethodData)

The tokenize method returns a Promise. It will create a payment method token from sensitive payment method information entered by a user. Then, it will resolve the promise with the newly-created token. The returned token can be used when creating a payment. In order to tokenize the payment method, paymentMethodData needs to be provided.

If tokenization fails for some reason (such as invalid information being tokenized, or connectivity issues), errors will be returned instead.

const paymentMethodData = {
  email: 'john.doe@example.com',
  name: 'John Doe',
  address_line1: '123 Broadway',
  address_line2: '',
  address_city: 'Minneapolis',
  address_state: 'Minnesota',
  address_postal_code: '55413',
  address_country: 'US'
};

const tokenizeResponse = await justifiJS.tokenize(paymentMethodData);

if (tokenizeResponse.token) {
  const payment = new Payment({
    amount: 2000,
    description: 'Delicious wood fire pizza',
    payment_method: {
      token: tokenizeResponse.token // use the token as payment method
    }
  });
  // ...submit payment logic...
} else {
  console.err(tokenizeResponse.errors)
}

Process a Payment

Once you've generated a token, you can process a payment by passing that token to your own backend. (This is necessary because it's not secure to expose your JustiFi client secret in the browser.) From your server, use our Payments API to create a payment with the payment method token. This will authorize and capture the specified amount of funds.

Using PaymentsJS in React

When implementing PaymentsJS in React, there are a few 'gotchas' to look out for. The implementation details are otherwise very simliar to implementing in a vanilla JavaScript application.

If your React application uses function components, make sure to initialize PaymentsJS outside of your function component to ensure it's only initialized one time.

const justifiJS = window.JustiFiPaymentsJS({ clientKey: "test_xxx" });

function MyComponent(props) {
}

When calling appendTo, make sure to do it inside of your useEffect hook. This ensures that the element you're appending to has already been rendered.

function MyComponent(props) {
  useEffect(() => {
    justifiJS.appendTo('#card-form');
  }, []);

  return(
    <form>
      ...
      <div id="card-form"></div>
      <input type="submit" />
    </form>
  );
}

JustiFi SDK

We offer support for using our API via a Ruby SDK. The project is open source and is available on Github. You can view full documentation on usage there. As more languages are supported, they will be added to this list:

Events

Our event publishing system allows you to subscribe to certain events on the JustiFi platform. Once subscribed, your application will be notified anytime those events occur, so you can react accordingly in real time. We support two event-delivery mechanisms; you can receive them via webhooks or directly to an AWS Eventbridge Event Bus. This service is available to you whether you're operating as a Seller yourself, or as a Platform with multiple Sellers. As a Platform, you can subscribe to all of your Sellers' events.

We will publish the following events:

  • payment.created
  • payment.succeeded
  • payment.failed
  • payment.authorized
  • payment.captured
  • payment.refunded
  • payment.dispute.created
  • payment.dispute.closed
  • payment_method.created
  • payment_method.updated
  • payment_intent.requires_capture
  • payment_intent.succeeded
  • payout.created
  • payout.paid

PaymentsWebhook

Received for the following events: payment.created, payment.succeeded, payment.failed payment.pending, payment.authorized, payment.captured

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

Payment IntentsWebhook

Received for the following events: payment_intent.requires_capture, payment_intent.succeeded

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

Payment MethodsWebhook

Received for the following events: payment_method.created, payment_method.updated

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

RefundsWebhook

Received for the following events: payment.refunded

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

DisputesWebhook

Received for the following events: payment.dispute.created, payment.dispute.closed

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

PayoutsWebhook

Received for the following events: payout.created, payout.paid

Request
Request Body schema: application/json
id
string

event unique id

idempotency_key
string or null

idempotency key for request, when available

request_id
string or null

id for request, when available

account_id
string

seller account id for event

account_type
string

live or test account

platform_account_id
string or null

platform account id for event, when available

object

the attributes for the object

version
string

version of the event payload

Responses
200

Return a 200 status to indicate that the data was received successfully. You must respond within 5 seconds.

Request samples
application/json
{
  • "id": "evt_123xyz",
  • "idempotency_key": "string",
  • "request_id": "string",
  • "account_id": "acc_123xyz",
  • "account_type": "test",
  • "platform_account_id": "acc_123xyz",
  • "data": {
    },
  • "version": "v1"
}

EventBridge (AWS) Delivery

Integrate your app with Amazon EventBridge (https://aws.amazon.com/eventbridge) to manage large volumes of event notifications and receive JustiFi events using an event bus.

EventBridge lets you process events at the rate that works for your tech stack without getting overwhelmed. It is highly scalable and resilient, and lets you accept more webhook traffic while reducing your infrastructure cost and complexity.

Webhook Delivery

In addition to direct EventBridge publishing, we offer event delivery to your app via webhooks. Webhooks are a reliable method to subscribe to our published events via an API endpoint.

Webhooks are secured by signature verification. An encrypted header is sent as a POST to your API endpoint (JUSTIFI-SIGNATURE), which will need to be decrypted and verified with the signature secret provided. If you use the JustiFi Ruby gem, we provide a convenient method for doing this.

Then, you must respond with a 200 OK. In the event of a non-200 response, delivery will be attempted again. For live accounts, webhooks are retried 10 times over a 24-hour window. For test accounts, webhooks are retried 3 times over 1 hour.

When you're ready to get started:

  • Create the endpoint on your server that will receive published events
  • Add a webhook in the Developer Tools section of the app (you’ll subscribe your endpoint to the event types of your choice). We recommend starting in Test Mode.
  • Test the webhook by prompting one of the event types you chose and making sure your subscribed endpoint receives the published event