PaymentMethod - Creating and Re-using

It is optional to create a PaymentMethod and get a PaymentMethodId first before creating an invoice. Additionally if creating an invoice with a PaymentMethod, you'll also get a PaymentMethodId you can re-use for future invoices.

If you want to create the paymentMethodId first before creating an invoice:

https://api.revolv3.com/api/PaymentMethod
{
  "BillingAddress": {
    "AddressLine1": "100 Main Street",
    "AddressLine2": "",
    "City": "Santa Ana",
    "State": "CA",
    "PostalCode": "90000",
    "Country": "US"
  },
  "BillingFirstName": "John",
  "BillingLastName": "Smith",
  "CreditCard": {
    "PaymentAccountNumber": "4111111111111111",
    "ExpirationDate": "1025",
    "SecurityCode": 123
  },
  "MerchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4"
}

Response:

{
    "paymentMethodId": 16336,
    "billingAddressId": 17683,
    "billingAddress": {
        "addressId": 17683,
        "addressLine1": "100 Main Street",
        "addressLine2": "",
        "city": "Santa Ana",
        "state": "CA",
        "postalCode": "90000",
        "phoneNumber": null,
        "email": null,
        "country": "US"
    },
    "billingFirstName": "John",
    "billingLastName": "Smith",
    "merchantPaymentMethodRefId": "payment-method-ref-id_hgays-213-4rf4",
    "paymentMethodAchDetails": null,
    "paymentMethodCreditCardDetails": {
        "binNumber": "411111",
        "paymentLast4Digit": "1111",
        "paymentExpirationDate": "1025"
    }
}

To reuse a PaymentMehtodId us this call below (This can be from the call above or a previous invoice)

https://api.revolv3.com/api/Payments/sale/{paymentMethodId}
{
    "NetworkProcessing": {
        "processingType": "initialInstallment", //initialRecurring, initialInstallment , installment, recurring
        "originalNetworkTransactionId": null
    },
    "CustomerId": null, //optional add a customer ID - otherwise no customer is created
    "Invoice": {
        "MerchantInvoiceRefId": "ABC309500654810",
        "Amount": {
            "value": 1.03
        }
    }
}

Response:

{
    "customerId": null,
    "invoiceId": 186011,
    "merchantInvoiceRefId": "ABC309500654810",
    "merchantPaymentMethodRefId": null,
    "networkTransactionId": "583676276256324",
    "invoiceStatus": "Paid",
    "invoiceAttemptStatus": "Success",
    "message": "Approved",
    "amount": {
        "currency": "USD",
        "value": 1.03
    },
    "paymentMethodId": 6061,
    "paymentMethodTypeId": 1
}