NOTE: This API is under active development and subject to change
JustiFi provides a card present solution which allows you to collect a payment via a terminal provider by one of our technology partners.
To collect a payment via terminal, you must first ensure you ask the JustiFi team to enable the card present feature for your platform. Next, we will work to provision and configure terminals for your sub accounts.
Once you have configured a terminal, you must complete the following steps to complete a payment:
Create a Payment Intent with the amount you'd like to capture, and a description of the payment.
POST to the terminal pay endpoint which will be used to send a your payment intent to a terminal for processing. This process can take some time as it requires customer interaction. For this reason, the API will return immediately but the process is asynchronusly happening on a terminal.
At this point, the process is handed over to the terminal to complete. Once the payment transaction is completed, we will publish an event for you to continue the process and take further action, as noted in the next step.
Create an Event Publisher which publishes payment_intent.succeeded
events. This will provide a means to ensure the payment was successful. You can also listen to payment events, for example a payment.failed event will be published each time a payment intent is attempted to be processed but the transaction fails for some reason.
If you do not have the ability to handle event publishing, you could poll our payment intent API with the id of the payment intent you are processing. Contine to poll until the payment intent status attribute changes. We recommend using an event driven architecture.
Send a payment intent to be processed via terminal, listen for payment_intent events (recommended) or poll payment intent API for payment outcome
Payment Intent sent to terminal for processing
{- "payment_intent_id": "pi_abc123",
- "terminal_id": "trm_abc123"
}
{- "id": "tmses_abc123",
- "type": "terminal_payment_intent",
- "data": {
- "payment_intent": {
- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": 4242,
- "brand": "Visa",
- "name": "Amanda Kessel",
- "token": "pm_123xyz",
- "month": "5",
- "year": "2042",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z",
- "address_line1_check": "unchecked",
- "address_postal_code_check": "unchecked"
}, - "customer_id": "cust_xyz",
- "signature": "4guAJNkVA3lRLVlanNVoBK",
- "account_id": "acc_123"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "terminal": {
- "id": "trm_abc123"
}
}, - "page_info": "string"
}
Send an amount to be refunded via terminal, listen for payment_intent events (recommended) or poll payment intent API for payment outcome
Payment Intent sent to terminal for processing
{- "payment_intent_id": "pi_abc123",
- "terminal_id": "trm_abc123",
- "amount": 1000
}
{- "id": "tmses_abc123",
- "type": "terminal_payment_intent",
- "data": {
- "payment_intent": {
- "id": "pi_xyz",
- "account_id": "acc_xyz",
- "amount": 10000,
- "currency": "usd",
- "description": "my_order_xyz",
- "metadata": { },
- "payment_method": {
- "card": {
- "id": "pm_123xyz",
- "acct_last_four": 4242,
- "brand": "Visa",
- "name": "Amanda Kessel",
- "token": "pm_123xyz",
- "month": "5",
- "year": "2042",
- "metadata": { },
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z",
- "address_line1_check": "unchecked",
- "address_postal_code_check": "unchecked"
}, - "customer_id": "cust_xyz",
- "signature": "4guAJNkVA3lRLVlanNVoBK",
- "account_id": "acc_123"
}, - "status": "requires_payment_method",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "terminal": {
- "id": "trm_abc123"
}
}, - "page_info": "string"
}
{- "id": 1,
- "type": "array",
- "data": [
- {
- "id": "trm_abc123",
- "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}
], - "page_info": {
- "end_cursor": "WyIyMDIyLTAyLTA4IDE5OjUyOjM3LjEwNDE3MzAwMCIsIjY4MDliYTU5LTYxYjctNDg3MS05YWFiLWE2Y2MyNmY3M2M1ZCJd",
- "has_next": false,
- "has_previous": false,
- "start_cursor": "WyIyMDIyLTAyLTA4IDIwOjAxOjU4LjEyMDIzMjAwMCIsIjU5ZTFjNGI1LWFlOWQtNDIyZC04MTVkLWNjNzQ5NzdlYmFjYSJd"
}
}
{- "id": 1,
- "type": "terminal",
- "data": {
- "id": "trm_abc123",
- "account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
- "created_at": "2021-01-01T12:00:00Z",
- "updated_at": "2021-01-01T12:00:00Z"
}, - "page_info": "string"
}
{- "id": 1,
- "type": "terminal",
- "data": {
- "id": "trm_abc123",
- "status": "CONNECTED",
- "last_date_time_connected": "2021-01-01T12:00:00Z",
- "last_date_time_active": "2021-01-01T12:00:00Z"
}, - "page_info": "string"
}