# Update check payment status PATCH https://api-sandbox.payabli.com/api/MoneyOut/status/{transId}/{checkPaymentStatus} Updates the status of a processed check payment transaction. This endpoint handles the status transition, updates related bills, creates audit events, and triggers notifications. The transaction must meet all of the following criteria: - **Status**: Must be in Processing or Processed status. - **Payment method**: Must be a check payment method. ### Allowed status values | Value | Status | Description | |-------|--------|-------------| | `0` | Cancelled/Voided | Cancels the check transaction. Reverts associated bills to their previous state (Approved or Active), creates "Cancelled" events, and sends a `payout_transaction_voidedcancelled` notification if the notification is enabled. | | `5` | Paid | Marks the check transaction as paid. Updates associated bills to "Paid" status, creates "Paid" events, and sends a `payout_transaction_paid` notification if the notification is enabled. | Reference: https://docs.payabli.com/developers/api-reference/moneyout/update-check-payment-status ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update check payment status version: endpoint_moneyOut.UpdateCheckPaymentStatus paths: /MoneyOut/status/{transId}/{checkPaymentStatus}: patch: operationId: update-check-payment-status summary: Update check payment status description: >- Updates the status of a processed check payment transaction. This endpoint handles the status transition, updates related bills, creates audit events, and triggers notifications. The transaction must meet all of the following criteria: - **Status**: Must be in Processing or Processed status. - **Payment method**: Must be a check payment method. ### Allowed status values | Value | Status | Description | |-------|--------|-------------| | `0` | Cancelled/Voided | Cancels the check transaction. Reverts associated bills to their previous state (Approved or Active), creates "Cancelled" events, and sends a `payout_transaction_voidedcancelled` notification if the notification is enabled. | | `5` | Paid | Marks the check transaction as paid. Updates associated bills to "Paid" status, creates "Paid" events, and sends a `payout_transaction_paid` notification if the notification is enabled. | tags: - - subpackage_moneyOut parameters: - name: transId in: path description: The Payabli transaction ID for the check payment. required: true schema: type: string - name: checkPaymentStatus in: path description: >- The new status to apply to the check transaction. To mark a check as `Paid`, send 5. To mark a check as `Cancelled`, send 0. required: true schema: $ref: >- #/components/schemas/type___moneyOutTypes__:AllowedCheckPaymentStatus - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: >- #/components/schemas/type_:PayabliApiResponse00Responsedatanonobject '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} components: schemas: type___moneyOutTypes__:AllowedCheckPaymentStatus: type: string enum: - value: '0' - value: '5' type_:Responsecode: type: integer type_:PageIdentifier: type: string type_:IsSuccess: type: boolean type_:ResponseText: type: string type_:Responsedatanonobject: oneOf: - type: string - type: integer type_:PayabliApiResponse00Responsedatanonobject: type: object properties: responseCode: $ref: '#/components/schemas/type_:Responsecode' pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' roomId: type: integer format: int64 description: >- Describes the room ID. Only in use on Boarding endpoints, returns `0` when not applicable. isSuccess: $ref: '#/components/schemas/type_:IsSuccess' responseText: $ref: '#/components/schemas/type_:ResponseText' responseData: $ref: '#/components/schemas/type_:Responsedatanonobject' required: - responseText ``` ## SDK Code Examples ```typescript MarkCheckAsPaid import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.moneyOut.updateCheckPaymentStatus("TRANS123456", "5"); } main(); ``` ```python MarkCheckAsPaid from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.money_out.update_check_payment_status( trans_id="TRANS123456", check_payment_status="5" ) ``` ```csharp MarkCheckAsPaid using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.MoneyOut.UpdateCheckPaymentStatusAsync( "TRANS123456", AllowedCheckPaymentStatus.Paid ); } } ``` ```go MarkCheckAsPaid package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) client.MoneyOut.UpdateCheckPaymentStatus( context.TODO(), "TRANS123456", payabli.AllowedCheckPaymentStatusPaid.Ptr(), ) } ``` ```ruby MarkCheckAsPaid require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/5") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java MarkCheckAsPaid import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/5") .header("requestToken", "") .asString(); ``` ```php MarkCheckAsPaid request('PATCH', 'https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/5', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift MarkCheckAsPaid import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/5")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ```typescript CancelCheck import { PayabliClient, PayabliEnvironment } from "@payabli/sdk-node"; async function main() { const client = new PayabliClient({ environment: PayabliEnvironment.Sandbox, apiKey: "YOUR_API_KEY_HERE", }); await client.moneyOut.updateCheckPaymentStatus("TRANS123456", "0"); } main(); ``` ```python CancelCheck from payabli import payabli from payabli.environment import payabliEnvironment client = payabli( environment=payabliEnvironment.SANDBOX, api_key="YOUR_API_KEY_HERE" ) client.money_out.update_check_payment_status( trans_id="TRANS123456", check_payment_status="0" ) ``` ```csharp CancelCheck using PayabliApi; using System.Threading.Tasks; namespace Usage; public class Example { public async Task Do() { var client = new PayabliApiClient( apiKey: "YOUR_API_KEY_HERE", clientOptions: new ClientOptions { BaseUrl = PayabliApiEnvironment.Sandbox } ); await client.MoneyOut.UpdateCheckPaymentStatusAsync( "TRANS123456", AllowedCheckPaymentStatus.Cancelled ); } } ``` ```go CancelCheck package example import ( client "github.com/payabli/sdk-go/v/client" option "github.com/payabli/sdk-go/v/option" payabli "github.com/payabli/sdk-go/v" context "context" ) func do() { client := client.NewClient( option.WithBaseURL( payabli.Environments.Sandbox, ), option.WithApiKey( "YOUR_API_KEY_HERE", ), ) client.MoneyOut.UpdateCheckPaymentStatus( context.TODO(), "TRANS123456", payabli.AllowedCheckPaymentStatusCancelled.Ptr(), ) } ``` ```ruby CancelCheck require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/0") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["requestToken"] = '' response = http.request(request) puts response.read_body ``` ```java CancelCheck import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/0") .header("requestToken", "") .asString(); ``` ```php CancelCheck request('PATCH', 'https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/0', [ 'headers' => [ 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift CancelCheck import Foundation let headers = ["requestToken": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/MoneyOut/status/TRANS123456/0")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```