Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 143 additions & 61 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -551,15 +551,9 @@ paths:
- Account
summary: Credit Card Add/Edit
description: |
Adds/edit credit card information to your Account.
**DEPRECATED**. Please use Payment Method Add ([POST /account/payment-methods](/docs/api/account/#payment-method-add)).

Only one credit card can be associated with your Account, so using this
endpoint will overwrite your currently active card information with the
new credit card.

To use this endpoint, you must have a valid `zip` entered for your Account.
Use the Account Update ([PUT /account](/docs/api/account/#account-update))
endpoint to enter a new zip code.
Comment on lines -560 to -562
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit is still valid and this endpoint will still report an error if the listed zip is not valid. Should we keep it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reworded this a bit in the Payment Method Add description to be a bit broader. Agreed that this bit is still valid -- updating that description to be specific about requiring a valid zip as well.

Adds a credit card Payment Method to your account and sets it as the default method.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this comment, it is stated "and sets it as the default method"

However, in another edit below, it states "with the option to set it as the default method."

This should be clarified to the correct statement in whichever place is incorrect.

Copy link
Contributor Author

@bbiggerr bbiggerr Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This describes the behavior of the deprecated POST /account/credit-card endpoint, which takes in a different request body that doesn't include an is_default field, so it currently sets the payment method as the default automatically in the backend.

operationId: createCreditCard
x-linode-cli-action: update-card
security:
Expand All @@ -572,15 +566,7 @@ paths:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/CreditCard'
- type: object
properties:
cvv:
type: string
description: >
The Card Verification Value on the back of the card.
example: '123'
$ref: '#/components/schemas/CreditCard'
responses:
'200':
description: Credit Card updated.
Expand Down Expand Up @@ -1676,46 +1662,7 @@ paths:
data:
type: array
items:
type: object
description: Payment Method object response.
properties:
type:
type: string
description: The type of Payment Method.
example: 'credit_card'
x-linode-cli-display: 1
is_default:
type: boolean
description: |
Whether this Payment Method is the default method for automatically processing service charges.
example: true
x-linode-cli-display: 2
created:
type: string
readOnly: true
format: date-time
description: When the Payment Method was added to the Account.
example: '2018-01-15T00:01:01'
data:
type: object
description: Credit card information.
properties:
card_type:
type: string
description: The type of credit card.
example: ""
x-linode-cli-display: 8
last_four:
type: string
description: The last four digits of the credit card number.
example: "1234"
x-linode-cli-display: 9
expiry:
type: string
format: MM/YYYY
description: The expiration month and year of the credit card.
example: 06/2022
x-linode-cli-display: 10
$ref: '#/components/schemas/PaymentMethod'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
Expand All @@ -1732,6 +1679,82 @@ paths:
- lang: CLI
source: >
linode-cli account payment-methods-list
post:
servers:
- url: https://api.linode.com/v4
x-linode-grant: read_write
tags:
- Account
summary: Payment Method Add
description: |
Adds a Payment Method to your Account with the option to set it as the default method.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the other line from the comment above


Prior to adding a Payment Method, ensure that your billing address information is up-to-date
with a valid `zip` by using the Account Update ([PUT /account](/docs/api/account/#account-update)) endpoint.
operationId: createPaymentMethod
x-linode-cli-action: payment-method-add
x-linode-cli-skip: true
security:
- personalAccessToken: []
- oauth:
- account:read_write
requestBody:
description: The details of the Payment Method to add.
required: true
content:
application/json:
schema:
type: object
description: Payment Method Request Object.
required:
- type
- data
- is_default
- card_number
- expiry_month
- expiry_year
- cvv
properties:
type:
$ref: '#/components/schemas/PaymentMethod/properties/type'
is_default:
$ref: '#/components/schemas/PaymentMethod/properties/is_default'
data:
type: object
properties:
card_number:
$ref: '#/components/schemas/CreditCard/properties/card_number'
expiry_month:
$ref: '#/components/schemas/CreditCard/properties/expiry_month'
expiry_year:
$ref: '#/components/schemas/CreditCard/properties/expiry_year'
cvv:
$ref: '#/components/schemas/CreditCard/properties/cvv'
responses:
'200':
description: Payment Method added.
content:
application/json:
schema:
type: object
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"type": "credit_card",
"is_default": true,
"data": {
"card_number": "4111111111111111",
"expiry_month": 11,
"expiry_year": 2020,
"cvv": "111"
}
}' \
https://api.linode.com/v4/account/payment-method
/account/payments:
x-linode-cli-command: account
get:
Expand Down Expand Up @@ -15991,11 +16014,14 @@ components:
card_number:
type: string
description: Your credit card number. No spaces or dashes allowed.
minLength: 13
maxLength: 23
minLength: 14
maxLength: 24
format: digits
example: 4111111111111111
expiry_month:
type: integer
minimum: 1
maximum: 12
description: >
A value from 1-12 representing the expiration month of your credit card.

Expand All @@ -16006,14 +16032,24 @@ components:
example: 12
expiry_year:
type: integer
description: >
minLength: 4
maxLength: 4
description: |
A four-digit integer representing the expiration year of
your credit card.

The combination of `expiry_month` and `expiry_year`
must result in a month/year combination of the current month or in
the future. An expiration date set in the past is invalid.
example: 2020
cvv:
type: string
minLength: 3
maxLength: 4
format: digits
description: >
CVV (Card Verification Value) of the credit card, typically found on the back of the card.
example: '123'
Device:
type: object
description: >
Expand Down Expand Up @@ -20641,6 +20677,52 @@ components:
description: The amount, in US dollars, of the Payment.
example: '120.50'
x-linode-cli-display: 3
PaymentMethod:
type: object
description: Payment Method Response Object.
properties:
type:
type: string
enum:
- credit_card
description: The type of Payment Method.
example: 'credit_card'
x-linode-cli-display: 1
is_default:
type: boolean
description: |
Whether this Payment Method is the default method for automatically processing service charges.
example: true
x-linode-cli-display: 2
created:
type: string
readOnly: true
format: date-time
description: When the Payment Method was added to the Account.
example: '2018-01-15T00:01:01'
data:
type: object
description: Credit card information.
properties:
card_type:
type: string
readOnly: true
description: The type of credit card.
example: ""
x-linode-cli-display: 8
last_four:
type: string
readOnly: true
description: The last four digits of the credit card number.
example: "1234"
x-linode-cli-display: 9
expiry:
type: string
readOnly: true
format: MM/YYYY
description: The expiration month and year of the credit card.
example: 06/2022
x-linode-cli-display: 10
PaymentRequest:
type: object
required:
Expand All @@ -20651,7 +20733,7 @@ components:
type: string
description: >
CVV (Card Verification Value) of the credit card to be used for
the Payment.
the Payment. Required if paying by credit card.
example: '123'
usd:
type: string
Expand Down