addConnectContractorCreditSettlement
The method allows you to add a manual credit settlement (repayment) for a chosen contractor in BaseLinker Connect. A settlement reduces the blocked credit amount for the contractor, effectively recording a payment received for previously charged orders. The settlement amount cannot exceed the contractor's currently blocked credit amount (credit_to_pay).
Input parameters
Output data:
A sample request in PHP:
| connect_contractor_id | int | Contractor ID. The list of contractor identifiers can be retrieved using the getConnectIntegrationContractors method |
| amount | float | Settlement amount. Must be a positive value and cannot exceed the contractor's currently blocked credit amount (credit_to_pay). Can be passed as string or number in JSON |
| message | varchar(255) | Settlement note/comment describing the repayment, e.g., payment reference, bank transfer ID, etc. Maximum 255 characters |
| order_id | int | Related order ID if the settlement is connected to a specific order. Use 0 or omit if not related to any specific order |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| credit_entry_id | int | The ID of the created credit settlement entry in the trade credit history |
| new_blocked_credit | float | The contractor's new blocked credit amount (credit_to_pay) after the settlement |
| new_available_credit | float | The contractor's new available credit amount after the settlement |
Sample
Input data:Output data:
A sample request in PHP: