Payment methods
A customer's saved cards and other methods, and which one is the default.
| Command | HTTP | Description |
|---|---|---|
payment-methods list | GET /v1/payment_methods | List payment methods |
payment-methods create | POST /v1/payment_methods | Create a payment method |
payment-methods get | GET /v1/payment_methods/{id} | Get a payment method |
payment-methods update | PATCH /v1/payment_methods/{id} | Update the card's expiry |
payment-methods delete | DELETE /v1/payment_methods/{id} | Remove a payment method |
payment-methods set-default | POST /v1/payment_methods/{id}/set-default | Set the method as default |
Examples
--params carries query and path parameters (id, page, filters); --json carries the request body; --fields limits which fields come back — worth using on every list/get to save context. See Global flags for the full reference.
# List payment methods
kobana billing payment-methods list \
--fields "id,public_id,external_id,billing_account_id,credit_card_id"
# Get a payment method
kobana billing payment-methods get --params '{"id": "PAYMENT_METHOD_ID"}'
# Create a payment method
kobana billing payment-methods create \
--json '{"billingAccountId": "BILLINGACCOUNTID", "type": "card"}'
# Update the card's expiry
kobana billing payment-methods update \
--params '{"id": "PAYMENT_METHOD_ID"}' \
--json '{"exp_month": 0, "exp_year": 0}'
# Set the method as default
kobana billing payment-methods set-default \
--params '{"id": "PAYMENT_METHOD_ID"}'
# Remove a payment method
kobana billing payment-methods delete \
--params '{"id": "PAYMENT_METHOD_ID"}' \
--dry-run
Next steps
- Credits
- Schema introspection — every parameter this resource accepts.