HomeGuidesAPI ReferenceChangelog
Log In

Authorization, Captures and Reversals

Authorization

To create an authorization use the API call Authorize Payment Method . In this response you will get an PaymentMethodAuthorizationId. You can then use this ID for the capture or a reversal

{Api Root}/api/Payments/authorization

{
  "PaymentMethod": {
    "BillingAddress": {
      "AddressLine1": "100 Main",
      "AddressLine2": null,
      "City": "Santa Ana",
      "State": "CA",
      "PostalCode": "91111",
      "Country": "US"
    },
    "BillingFirstName": "Joe",
    "BillingLastName": "Doe",
    "CreditCard": {
      "PaymentAccountNumber": "4111111111111111",
      "ExpirationDate": "1025",
    }
  },
  "NetworkProcessing": {
    "ProcessingType": "initialInstallment",
    "OriginalNetworkTransactionId": null
  },
  "Amount": {
    "Value": 30.99
  }
}

Or with a PaymentMethodId

{Api Root}/api/Payments/authorization/{paymentMethodId}

{
    "NetworkProcessing": {
        "processingType": "initialInstallment", //initialRecurring, initialInstallment , installment, recurring
        "originalNetworkTransactionId": null
    },
    "Amount": {
        "value": 1.03
    }
}

Response

{
    "networkTransactionId": "431241081661798",
    "paymentMethodAuthorizationId": 2055,
    "paymentMethod": {
        "paymentMethodId": 6061,
        "billingAddressId": 7056,
        "billingAddress": {
            "addressId": 7056,
            "addressLine1": "381 Forest Ave. Suite C",
            "addressLine2": null,
            "city": "Laguna Beach",
            "state": "CA",
            "postalCode": "92651",
            "phoneNumber": null,
            "email": null,
            "country": "US"
        },
        "billingFirstName": "Joe",
        "billingLastName": "Smith",
        "merchantPaymentMethodRefId": null,
        "paymentMethodAchDetails": null,
        "paymentMethodCreditCardDetails": {
            "paymentLast4Digit": "1111",
            "paymentExpirationDate": "0330"
        }
    }
}

Capture

For a Capture (charge the customer after authorization) , use either the One Time Payment API or Subscription API call and use the PaymentMethodAuthorizationId instead of PaymentMethod

{Api Root}}/api/Payments/capture/{paymentMethodAuthorizationId}

{
    "CustomerId": null, //optional add a customer ID - otherwise no customer is created
    "Invoice": {
        "MerchantInvoiceRefId": "ABC309500654810",
        "Amount": {
            "value": 1.03
        }
    }
}

Authorization Reversal

To do a Reversal of an authorization use the API call Reverse Authorization use the PaymentMethodAuthorizationId from the previous API call

{{Api Root}}/api/PaymentMethod/reverse-auth

{
	"PaymentMethodAuthorizationId": 1234
}