GET /sales2/orders/bill/savedPayments?id={{billId}}
Returns the saved cards and verified ACH bank accounts that can be used to pay an invoice. These belong to the account (company) that the invoice's order is on. Pass an id from this list as saved_payment to Pay Invoice (POST /sales2/orders/bill/pay) to charge it.
Invoicing must be enabled on the store, and the invoice's order must be on an account.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The invoice (bill) ID. This is the same ID used by /sales2/orders/bill/print. |
Permissions
The API user's role needs the List Saved Payments For Invoice resource (sales/order/invoice/getBillSavedPayments).
Response
200 OK: an array of saved payments. The array is empty if the account has no saved payments that can be charged.
| Field | Type | Description |
|---|---|---|
id | string | Reference to pass as saved_payment to Pay Invoice. Format: :. |
type | string | card or ach. |
method | string | Payment method the payment is saved under: cim, authorizenet, cryozonic_stripe, gene_braintree_creditcard, cryozonic_achpayments, or cryozonic_achpayments_ach. |
label | string | Display label. Uses the nickname if one is set, otherwise e.g. Visa ending in 4242. |
brand | string | null |
last4 | string | null |
exp_month | string | null |
exp_year | string | null |
Only payment methods that AutoPay supports are listed (Authorize.Net CIM, Stripe, Braintree, Stripe ACH). ACH accounts that haven't been verified yet are left out.
Example Response
[
{
"id": "cim:11",
"type": "card",
"method": "cim",
"label": "Visa ending in 1111",
"brand": "Visa",
"last4": "1111",
"exp_month": "04",
"exp_year": "2029"
},
{
"id": "cryozonic_stripe:card_abc",
"type": "card",
"method": "cryozonic_stripe",
"label": "Office card",
"brand": "MasterCard",
"last4": "4444",
"exp_month": null,
"exp_year": null
},
{
"id": "cryozonic_achpayments:pm_bank_1",
"type": "ach",
"method": "cryozonic_achpayments",
"label": "Chase ending in 6789",
"brand": "Chase",
"last4": "6789",
"exp_month": null,
"exp_year": null
}
]
Errors
All errors return 400 Bad Request with a message.
| Cause | Message |
|---|---|
| Invoicing is not enabled on the store | Invoicing is not enabled. |
id is missing or not numeric | id must be an invoice ID. |
| No invoice with that ID | Invoice with ID {id} not found. |
| The invoice's order is not on an account | This invoice is not on an account. Saved payments can only be used for invoices on an account. |
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
200OK (no example documented yet)
