Manage company credit
The company credit entity operates with the following attributes:
- Credit limit
- Available credit
- Outstanding balance
The credit limit is allocated by seller, while available credit and outstanding balance are automatically calculated by the system based on the buyer transactions (place an order, return) and seller’s transactions (refund, reimburse, update credit limit, cancel order).
Manage company credit limits
When you create a company, the credit limit is set to 0. Use the PUT /V1/companyCredits/:id
call to change this value and perform other updates to the company’s credit settings.
REST Endpoints
Company credit parameters
Name | Description | Format | Requirements |
---|---|---|---|
id |
The credit ID generated by the system | integer | Required |
company_id |
Company ID | integer | Required |
credit_limit |
The amount of credit granted to the company | Number | Required |
balance |
The amount the company currently owes the seller | Number | Optional |
currency_code |
The currency code for the company’s credit, such as USD | String | Required |
exceed_limit |
Indicates whether the company can exceed their credit limit | Boolean | Optional |
available_limit |
The amount of credit currently available to the company | Number | Optional |
credit_comment |
Describes the change being made | String | Optional |
Update a company credit limit
This call changes the company’s credit limitto $1000. The available_limit
parameter is calculated, so you cannot specify the value.
Service Name
companyCreditCreditLimitRepositoryV1
Sample Usage
PUT /V1/companyCredits/company/2
Payload
Response
Get details about a company’s credit limit using credit ID
This call returns data on the credit limit for the specified credit ID.
Service Name
companyCreditCreditLimitRepositoryV1
Sample Usage
GET /V1/companyCredits/2
Payload
Not applicable
Response
Get details about a company’s credit limit using company ID
This call returns information about the credit limit for a specified company.
Service Name
companyCreditCreditLimitManagementV1
Sample Usage
GET /V1/companyCredits/company/2
Payload
Not applicable
Response
Search credit IDs
The following call returns information for all companies whose credit balance is 0.
See Search using REST APIs for information about constructing a search query.
Sample Usage
GET /V1/companyCredits?searchCriteria[filter_groups][0][filters][0][field]=balance&searchCriteria[filter_groups][0][filters][0][value]=0&searchCriteria[filter_groups][0][filters][0][condition_type]=eq
Payload
Not applicable
Response
Balance operations
The company’s outstanding balance can be updated as the buyer makes payments, purchases, and other transactions.
Service Name
companyCreditCreditBalanceManagementV1
REST Endpoints
Balance Parameters
Name | Description | Format | Requirements |
---|---|---|---|
value |
Indicates how much money is involved in this company credit balance operation. | Nuumber | Required |
currency |
The currency of the transaction, such as USD | String | Required |
operationType |
Must be one of the following: 1 - Allocated; 2 - Updated; 3 - Purchased; 4 - Reimbursed; 5 - Refunded; 6 - Reverted | Integer | Required |
comment |
Describers the operation | String | Optional |
options |
An object that provides additional information for increasing or decreasing the credit balance | Object | Optional |
options
parameters
Name | Description | Format | Requirements |
---|---|---|---|
purchase_order |
The company’s purchase order number | String | Optional |
order_increment |
Order increment | String | Optional |
currency_display |
Currency code for displaying the operation | String | Optional |
currency_base |
The base currency | String | Optional |
Increase the company credit balance
This call increases the company credit with an Allocate, Update, Refund, Revert, or Reimburse transaction. (You cannot specify the Purchased (3) operation type.) This call also decreases the company’s outstanding balance.
Sample Usage
V1/companyCredits/2/increaseBalance
Payload
Response
true
, indicating the increase to the company credit balance succeeded
Decrease the balance
This call decreases the company credit with an Update (operation type = 2), Purchased (3), or Reimbursed (4) transaction. (You cannot specify the other operation types.) This call also increases company’s outstanding balance.
Sample Usage
V1/companyCredits/2/decreaseBalance
Payload
Response
true
, indicating the decrease to the company credit balance succeeded
Credit history
A Reimburse transaction can be updated to include a purchase order and comment.
Service Name
companyCreditCreditHistoryManagementV1
REST Endpoints
Save the credit history
This call updates the credit history to specify a purchase order number.
Sample Usage
PUT /V1/companyCredits/history/6
Payload
Response
true
, indicating the call was successful
Search credit history IDs
The following call returns a list instances in which the credit limit was set to a value higher than $500.
See Search using REST APIs for information about constructing a search query.
Sample Usage
GET /V1/companyCredits/history?searchCriteria[filter_groups][0][filters][0][field]=credit_limit&searchCriteria[filter_groups][0][filters][0][value]=500&searchCriteria[filter_groups][0][filters][0][condition_type]=gt
Payload
Not applicable
Response