Overview
Introduction to Behalf's Payment API
Glossary of terms:
Seller - The owner of the B2B eCommerce website (or any other online B2B procurement flow) who is interested in adding Behalf as a payment method to offer Buyers payment terms and financing.
Buyer - A potential or repeat customer, interested in purchasing from the B2B eCommerce website or procurement flow. By using Behalf as a payment method, the Buyer will become a new Behalf user or use an existing Behalf account.
Order - The purchase and transaction of goods and/or services which occurs within the B2B eCommerce website or procurement flow. The purchase and transaction occurs between the Buyer and Seller, where the Buyer purchases goods and/or services from the Seller.
Payment - The resource created by Behalf when a request to fund an order is submitted by the Buyer. Each Behalf Payment will coincide with one Seller’s Order.
Introduction
This guide will walk the Seller through the Behalf Payment API integration process. The Behalf Payment API was built for Sellers who are interested in offering terms and financing to their online Buyers. This can be achieved via Behalf’s JavaScript SDK ("JavaScript SDK") which injects the Behalf Payment Embedded App ("BP Embedded App") into any online checkout flow, accompanied by Behalf’s REST API ("REST API").
The Behalf Payment API Components and Methods
Client Side JavaScript SDK
Used to render and interact with the BP Embedded App and contains the following methods:
Server Side REST API
Used to verify and manage payments created by the Buyer through the BP Embedded App.
- Authorize - POST /v4/payments/{paymentToken}/authorizations
- Read - GET /v4/payments/{paymentToken}
- Capture - POST /v4/payments/{paymentToken}/captures
- Cancel - POST /v4/payments/{paymentToken}/cancelations
Integration Process
Integration Points
Buyer's Checkout Flow
- Seller adds a new Behalf payment method
- Seller writes code to allow the BP Embedded App to render with relevant context
- Seller receives paymentToken and stores it
- Seller writes code to authorize the payment, and stores the authorizationToken
- Seller allows Buyer to complete the order with authorized payment option
Seller's Order Management System
- Seller initiates charge actions (or cancel when needed)
- Seller associates Behalf captureId with internal order
- Seller marks order as paid by Behalf
Error Handling
- Seller writes code to guide Buyer when Behalf payment request is unsuccessful (when Behalf declines payment or authorization request) - "Choose a different payment method"
- Seller writes code to block order fulfillment if authorization or capture is unsuccessful
Environments and Credentials
JavaScript SDK
Sandbox URI: https://sdk.demo.behalf.com/sdk/v4/behalf_payment_sdk.js
Production URI: https://sdk.behalf.com/sdk/v4/behalf_payment_sdk.js
clientToken: provided by Behalf's integrations support team per environment
REST API
Sandbox base URL: https://api.demo.behalf.com/v4/{...}
Production base URL: https://api.behalf.com/v4/{...}
Credentials (user and password): provided by Behalf's integrations support team per environment
Updated over 4 years ago