Skip to content

Order_Authorize#


Description#

This function allows you to authorize (or authorize+capture depending on gateway settings) a new transaction for an order. Each Payment Gateway is going to have its own payment fields required to be passed.

Request Body Parameters#

Parameter
Type Description
Order_ID Number ID of the Order to do the authorization against
Module_ID Number Module Id of the Payment Module to use for the transaction. The module_id is returned using PaymentMethodList_Load
Amount Number Amount to authorize. No currency sign
Module_Data String Typically the Payment Method Code, but varies from Gateway to Gateway

Response Parameters#

Parameter
Type Description
valid Boolean true/false response whether the transaction was valid
total_auth Number Total Amount Authorized
formatted_total_auth String Currency Formatted Total Amount Authorized
total_cap Number Total Amount Captured
formatted_total_capt String Currency Formatted Total Amount Captured
total_rfnd Number Total Amount Refunded
formatted_total_rfnd String Currency Formatted Total Amount Refunded
net_capt Number Total amount captured minus total amount refunded
formatted_net_capt String Formatted total amount captured minus total amount refunded

Example Requests#

Miva Pay Example#

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "Order_Authorize",
    "Order_ID": 200102,
    "Module_ID": 0,
    "Amount": 10.0,
    "Module_Data": "paymentcard:1"
}

Authorize.net (non-MivaPay) Example#

Note

Each gateway will have their own specific required fields which need to be passed in this request.

{
    "Store_Code": "{{Store_Code}}",
    "Miva_Request_Timestamp": "{{$timestamp}}",
    "Function": "Order_Authorize",
    "Order_ID": 200102,
    "Module_ID": 58,
    "Amount": 1.11,
    "Module_Data": "Visa",
    "AuthorizeNet_First_Name": "John",
    "AuthorizeNet_Last_Name": "Smith",
    "AuthorizeNet_Card_Num": "4111111111111111",
    "AuthorizeNet_Method_Type": "CC",
    "AuthorizeNet_CardExp_Month": 2,
    "AuthorizeNet_CardExp_Year": 2021
}

Note

The response will contain information about all order transactions. If there were previous transactions against the order they will be reflected in the response as well.

Example Response#

{
    "success": 1,
    "data": {
        "valid": true,
        "total_auth": 19.74,
        "formatted_total_auth": "$19.74",
        "total_capt": 19.74,
        "formatted_total_capt": "$19.74",
        "total_rfnd": 0.0,
        "formatted_total_rfnd": "$0.00",
        "net_capt": 19.74,
        "formatted_net_capt": "$19.74"
    }
}