For the complete documentation index, see llms.txt. This page is also available as Markdown.

Confirm payment for Proforma Invoices

Use this method to confirm the payment for proforma invoices issued to your partners on the Direct Payment module.

To confirm the payment for a proforma invoice, you need to follow these steps before calling the confirmInvoicePayment API method:

  1. Authenticate to 2Checkout API based on these instructions.

  2. Set the partner for which you want to confirm the payment (method explained in the sample below).

  3. Set the proforma invoice (method explained in the sample below).

  4. Confirm the payment using the instructions below.

Requirements

You can confirm payments only for partners set with Direct business model. Learn here how to set a business model to your partners.

Request parameters

Parameter
Type / Description

sessionID

Required (string)

Session identifier, output of the Login method. An exception is thrown if the values are incorrect.

partnerCode

Required (string)

The unique identifier that you need to specify when creating a partner in the Control Panel. You can find it under the General Information area when editing partner details.

proformaNo

Required (string)

The unique identifier of a partner invoice from the 2Checkout system.

rrn

Optional (string)

The code associated with the proforma invoice payment reference (receipt registration number).

Request sample

<?php

require ('PATH_TO_AUTH');  // Authentication example: https://knowledgecenter.2checkout.com/Integration/07Channel_Manager_API/SOAP/02Authentication
require ('PATH_TO_SET_PARTNER'); // setPartner example: https://knowledgecenter.2checkout.com/Integration/07Channel_Manager_API/SOAP/06Reference/00Partner/00Set_partner

$partnerCode = 'partner_code'; // direct

try {
    $setPartner = $client->setPartner($sessionID, $partnerCode);
    var_dump($setPartner);
} catch (SoapFault $e) {
    echo "<pre>";
    echo $e->xdebug_message;
    echo $e->getMessage();
}

$proformaNo = '6';

try {
    $setProforma = $client->setProforma($sessionID, $proformaNo);
    var_dump($setProforma);
} catch (SoapFault $e) {
    echo "<pre>";

    echo $e->getMessage();
}

try {
    $confirmInvoicePayment = $client->confirmInvoicePayment($sessionID);
    var_dump($confirmInvoicePayment);
} catch (SoapFault $e) {

    echo $e->getMessage();
}

Response parameters

Type
Description

Boolean

True: method is successful.

False: method is not successful.

Error messages

Error code
Error description

INVALID_PARTNER

No partner is set or the proforma does not belong to the partner set.

PAYMENT_PROFORMA

The proforma invoice has already been paid.

INVALID_PROFORMA

The proforma invoice number is invalid.

INVALID_METHOD

The partner set is not on the Direct business model.

Last updated

Was this helpful?