Knowledge Base / API
עברית

Ask AI

✦ AI answer

Thinking…

Sources

    Cancel Document – (Cancel Document and Refund Credit Card)

    When should this function be used?

    This function can be used to cancel an issued document and cancel the transaction associated with it.

    Unlike other functions that can issue a credit, such as Create a new Iframe Redirect page, Do Transaction, and Refund By Transaction Id, this function allows you to cancel a specific transaction and create an associated document for it.

    This function is similar to Refund By Transaction Id, but in this case it creates the appropriate document and allows only the full transaction amount to be canceled.

    The following is a link to the JSON function.

    Request method – POST.

    Create a document associated to a deal
    https://secure.cardcom.solutions/api/v11/Documents/CancelDoc

    The following parameters must be passed to the Cancel document and refund credit card function.

    Legend:

    Red parameter – Required

    Bold parameter – Recommended

    Parameter that is neither red nor bold – Optional

    NumberParameterExample valuesDescription
    1ApiNametest2025Interface username. This parameter must be obtained from the business.
    2ApiPassword"kzFKfohEvL6AOF8aMEJz"API password, intended for issuing credits and canceling transactions.
    3DocumentNumber2489Document number.
    4DocumentType

    1 – Tax invoice/receipt

    2 – Credit invoice and refund
    3 – Nonprofit/VAT-exempt receipt
    4 – Nonprofit credit receipt (refund)

    50 – Price quote

    100 – Order (without payment)

    101 – Order confirmation – from the website (internal document, not for bookkeeping) – Paid order
    102 – Order credit – from the website (internal document, not for bookkeeping) – Credited order

    200 – Delivery note
    210 – Return note

    300 – Transaction account

    301 – Payment demand

    302 – Payment demand cancellation

    305 – Tax invoice

    330 – Credit invoice
    400 – Receipt (for an invoice)

    410 – Customer refund (credit receipt)

    405 – Donation receipt

    406 – Donation receipt credit (refund)

    303 – Receipt account (similar to an invoice for a VAT-exempt business; rarely used)
    304 – Credit receipt account

    Document type number.
    5IsCancelEmailSendboolean – true / false.
    In other words, if true is passed here, the document will not be sent.
    Whether not to send the credit document by email.
    6IsSendSMSboolean – true / falseWhether to send an SMS about the issued document.
    7IsCreditCardCancelOnlyboolean – true / falseWhether to skip document cancellation when a credit-card payment method is present.

    Response from Cancel document and refund credit card.

    NumberParameterExample valuesDescription
    1ResponseCode00 – The operation was successful
    Any other value – Invalid; a development error.
    2Description"The transaction was completed successfully"Description of the response. If a different response is received, the transaction was not completed successfully.
    3NewDocumentNumber5198Number of the newly issued document.
    4NewDocumentType

    1 – Tax invoice/receipt

    2 – Credit invoice and refund
    3 – Nonprofit/VAT-exempt receipt
    4 – Nonprofit credit receipt (refund)

    50 – Price quote

    100 – Order (without payment)

    101 – Order confirmation – from the website (internal document, not for bookkeeping) – Paid order
    102 – Order credit – from the website (internal document, not for bookkeeping) – Credited order

    200 – Delivery note
    210 – Return note

    300 – Transaction account

    301 – Payment demand

    302 – Payment demand cancellation

    305 – Tax invoice

    330 – Credit invoice
    400 – Receipt (for an invoice)

    410 – Customer refund (credit receipt)

    405 – Donation receipt

    406 – Donation receipt credit (refund)

    303 – Receipt account (similar to an invoice for a VAT-exempt business; rarely used)
    304 – Credit receipt account

    Type number of the newly issued credit document.
    5AccountID"5154"Customer account number.

    The following is an example of the function together with its response.

    Request to cancel the document:

    {
      "ApiName": "test2025",
      "ApiPassword": "test5000$",
      "DocumentNumber": "586188",
      "DocumentType": "1",
      "IsCancelEmailSend": true
    }

    Received response:

    {
        "ResponseCode": 0,
        "Description": "The cancellation document issued was 2491,2 – customer no. 0 – against original document 586188,1",
        "NewDocumentNumber": 2491,
        "NewDocumentType": 2,
        "AccountID": 0
    }

    Was this article helpful?