Business Guide

Business is an object representing a business account. A business account can accept payments from customers and pay out to connected bank account.

A business can be a customer, vendor or both.

Create a business account

To create a business account you can use the below endpoint:

Request

POST
api/v1/businesses
curl --request POST \
"https://payments.your-domain.com/api/v1/businesses" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
    \"name\": \"XYZ Business\",
    \"contact_first_name\": \"John\",
    \"contact_last_name\": \"Doe\",
    \"business_type\": \"company\",
    \"email\": \"john@xyz.com\",
    \"is_customer\": false,
    \"is_vendor\": true,
    \"billing_address\": {
        \"name\": \"billing address\",
        \"state\": \"CA\",
        \"city\": \"Los Angeles\",
        \"address_street_1\": \"Address Line 1\",
        \"address_street_2\": \"Address Line 2\",
        \"zip\": \"91504\",
        \"phone\": \"2345557788\"
    },
    \"shipping_address\": {
        \"name\": \"shipping address\",
        \"state\": \"CA\",
        \"city\": \"Los Angeles\",
        \"address_street_1\": \"Address Line 1\",
        \"address_street_2\": \"Address Line 2\",
        \"zip\": \"91504\",
        \"phone\": \"2345557788\"
    }
}"

Apart from the other common business details, is_vendor and is_customer are the two important fields that determine the type of business account. Atleast one of them should be set to true.

  • is_vendor: A boolean field that determines if the business account is a vendor and can accept payments.
  • is_customer: A boolean field that determines if the business account is a customer and can make payments.

You can read more about this endpoint as well as how to update a business in the Business API Reference.

Enable payments for a business

To enable payments for a business you can either use the SDK or payment onboarding links.

  1. SDK: You can use the SDK component to enable payments for a business.
  2. Payment Onboarding Links: You can use the payment onboarding links to enable payments for a business.

1. Enable payments for a business using SDK

We have SDKs for Vue and React. You can use the Payments Onboarding SDK component to enable payments for a business.

2. Enable payments for a business using payment onboarding links

You can use the below endpoint to create the payment onboarding links for a business:

Request

POST
api/v1/payment-onboarding-links
curl --request POST \
"https://payments.your-domain.com/api/v1/payment-onboarding-links" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--data "{
    \"return_url\": \"http://payments.your-domain.com/dashboard\",
}"

You will receive a payment onboarding link in the response. You can redirect the business to this link to enable payments.

Once the payments are enabled for a business, you can create invoices and accept payments from customers.

You can use the below endpoint to upload a business logo:

Request

POST
api/v1/business
curl --request POST \
"https://payments.your-domain.com/api/v1/business/upload-logo" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--form 'logo=@"{PATH_TO_YOUR_LOGO}"'

Get current business

You can use the below endpoint to get the current business:

Request

GET
api/v1/business
curl --request GET \
"https://payments.your-domain.com/api/v1/business" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d"

Update current business

You can use the below endpoint to update the current business:

Request

PUT
api/v1/business
curl --request PUT \
"https://payments.your-domain.com/api/v1/business" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--data "{
    \"name\": \"XYZ Business\",
    \"contact_first_name\": \"John\",
    \"contact_last_name\": \"Doe\",
    \"business_type\": \"company\",
    \"email\": \"john@xyz.com\",
    \"billing_address\": {
        \"name\": \"billing address\",
        \"state\": \"CA\",
        \"city\": \"Los Angeles\",
        \"address_street_1\": \"Address Line 1\",
        \"address_street_2\": \"Address Line 2\",
        \"zip\": \"91504\",
        \"phone\": \"2345557788\"
    },
    \"shipping_address\": {
        \"name\": \"shipping address\",
        \"state\": \"CA\",
        \"city\": \"Los Angeles\",
        \"address_street_1\": \"Address Line 1\",
        \"address_street_2\": \"Address Line 2\",
        \"zip\": \"91504\",
        \"phone\": \"2345557788\"
    }
}"

Get current business settings

You can use the below endpoint to get the current business settings:

Request

GET
api/v1/business/settings
curl --request GET \
"https://payments.your-domain.com/api/v1/business/settings" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--data "{
  \"settings\":  [
    \"invoice_business_address_format\",
    \"invoice_shipping_address_format\",
    \"invoice_billing_address_format\",
    \"estimate_business_address_format\",
    \"estimate_shipping_address_format\",
    \"estimate_billing_address_format\",
    \"payment_business_address_format\",
    \"payment_from_customer_address_format\",
    \"currency\",
    \"tax_per_item_enabled\",
    \"discount_per_item_enabled\"
  ]
}"

Update current business settings

You can use the below endpoint to update the current business settings:

Request

POST
api/v1/business/settings
curl --request POST \
"https://payments.your-domain.com/api/v1/business/settings" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--data "{
  \"tax_per_item_enabled\": false,
  \"discount_per_item_enabled\": true
}"

Get current business stats

You can use the below endpoint to update the current business settings:

Request

GET
api/v1/business/stats
curl --request GET \
"https://payments.your-domain.com/api/v1/business/stats" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Business: 995c98ce-cdd9-4ef6-b018-9c696cb07e9d" \
--data "{
  \"type\": \"invoice_count\"
}"