-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FYLE-85ztpbya4-amex-enroll-api #352
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8185,6 +8185,217 @@ components: | |
- matched_expenses | ||
- last_user_matched_at | ||
- metadata | ||
amex_account_in: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
id: | ||
$ref: '#/components/schemas/id_string' | ||
example: amacwbl222wlg | ||
nullable: true | ||
created_at: | ||
$ref: '#/components/schemas/created_at' | ||
nullable: true | ||
updated_at: | ||
$ref: '#/components/schemas/updated_at' | ||
nullable: true | ||
user_id: | ||
$ref: '#/components/schemas/user_id' | ||
nullable: true | ||
org_id: | ||
$ref: '#/components/schemas/org_id' | ||
nullable: true | ||
business_name: | ||
type: string | ||
description: | | ||
The name of the business. | ||
example: Abcd Inc. | ||
phone: | ||
type: object | ||
properties: | ||
country_code: | ||
type: string | ||
description: | | ||
The country code of the phone number. | ||
example: '001' | ||
number: | ||
type: string | ||
description: | | ||
The phone number of the business. | ||
example: '1232938490' | ||
address: | ||
type: object | ||
properties: | ||
line1: | ||
type: string | ||
description: | | ||
The address of the organization. | ||
example: 123 Main St. | ||
line2: | ||
type: string | ||
description: | | ||
The address line two of the organization, if applicable. | ||
nullable: true | ||
example: Suite A | ||
city: | ||
type: string | ||
description: | | ||
The city of the organzation's address. | ||
example: San Francisco | ||
state: | ||
type: string | ||
description: | | ||
The state of the organzation's address. | ||
example: CA | ||
country: | ||
type: string | ||
description: | | ||
The country of the organzation's address. | ||
example: US | ||
postal_code: | ||
type: string | ||
description: | | ||
The postal code of the organzation's address. | ||
example: '12345' | ||
email_address: | ||
type: string | ||
description: | | ||
The email address of the business. | ||
example: [email protected] | ||
amex_account_out: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
id: | ||
$ref: '#/components/schemas/id_string' | ||
example: amacwbl222wlg | ||
created_at: | ||
$ref: '#/components/schemas/created_at' | ||
updated_at: | ||
$ref: '#/components/schemas/updated_at' | ||
user_id: | ||
$ref: '#/components/schemas/user_id' | ||
nullable: true | ||
org_id: | ||
$ref: '#/components/schemas/org_id' | ||
nullable: true | ||
business_name: | ||
type: string | ||
description: | | ||
The name of the business. | ||
example: Abcd Inc. | ||
phone: | ||
type: object | ||
properties: | ||
country_code: | ||
type: string | ||
description: | | ||
The country code of the phone number. | ||
example: '001' | ||
number: | ||
type: string | ||
description: | | ||
The phone number of the business. | ||
example: '1232938490' | ||
address: | ||
type: object | ||
properties: | ||
line1: | ||
type: string | ||
description: | | ||
The address of the organization. | ||
example: 123 Main St. | ||
line2: | ||
type: string | ||
description: | | ||
The address line two of the organization, if applicable. | ||
nullable: true | ||
example: Suite A | ||
city: | ||
type: string | ||
description: | | ||
The city of the organzation's address. | ||
example: San Francisco | ||
state: | ||
type: string | ||
description: | | ||
The state of the organzation's address. | ||
example: CA | ||
country: | ||
type: string | ||
description: | | ||
The country of the organzation's address. | ||
example: US | ||
postal_code: | ||
type: string | ||
description: | | ||
The postal code of the organzation's address. | ||
example: '12345' | ||
email_address: | ||
type: string | ||
description: | | ||
The email address of the business. | ||
example: [email protected] | ||
buyer_id: | ||
type: string | ||
description: | | ||
The unique buyer id created for the organization by Amex. | ||
example: obasdfasdfasdfds | ||
widget_url: | ||
type: string | ||
description: | | ||
The url of the widget to be embedded in the client application. | ||
example: https://amex.com/asdfdsf | ||
account_last_synced_at: | ||
$ref: '#/components/schemas/timestamptz_utc' | ||
nullable: true | ||
description: | | ||
Signifies when this card account was last synced at. | ||
primary_account_number: | ||
type: string | ||
nullable: true | ||
description: | | ||
The last 5 digits primary card account number. | ||
example: '33456' | ||
account_verified_at: | ||
$ref: '#/components/schemas/timestamptz_utc' | ||
nullable: true | ||
description: | | ||
Signifies when this card account was verified at. | ||
account_status: | ||
type: string | ||
enum: | ||
- PENDING | ||
- SUCCESS | ||
- UNINITIALIZED | ||
- FAILED | ||
- DELETED | ||
description: | | ||
The status of the card account. | ||
example: ACTIVE | ||
account_error_message: | ||
type: string | ||
nullable: true | ||
description: | | ||
The error description provided by Amex on unsuccessfull account enrollment. | ||
example: Invalid credentials | ||
account_id: | ||
type: string | ||
nullable: true | ||
description: | | ||
The unique id for the card account provided by Amex. | ||
example: acwbl222wlg | ||
account_error_code: | ||
type: string | ||
nullable: true | ||
description: | | ||
The error code provided by Amex on unsuccessfull account enrollment. | ||
example: '1023' | ||
account_failed_at: | ||
$ref: '#/components/schemas/timestamptz_utc' | ||
nullable: true | ||
description: | | ||
Signifies when this card account was failed on unsuccessfull account enrollment. | ||
settlement_out: | ||
type: object | ||
additionalProperties: false | ||
|
@@ -16516,6 +16727,66 @@ paths: | |
application/json: | ||
schema: | ||
$ref: '#/components/schemas/404' | ||
/admin/amex_account/enroll: | ||
post: | ||
tags: | ||
- Amex account | ||
summary: Enroll amex account for a card | ||
description: | | ||
Enroll amex account for a card | ||
operationId: amex_account_enroll | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/amex_account_in' | ||
required: | ||
- data | ||
additionalProperties: false | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
$ref: '#/components/schemas/amex_account_out' | ||
'400': | ||
description: Bad request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/400' | ||
'401': | ||
description: Unauthorized request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/401' | ||
'403': | ||
description: Forbidden | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/403' | ||
'404': | ||
description: Not Found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/404' | ||
'500': | ||
description: API Server Error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/500' | ||
/admin/settlements: | ||
get: | ||
tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,10 @@ paths: | |
/admin/corporate_card_transactions/unmatch: | ||
$ref: paths/admin@[email protected] | ||
|
||
# Amex Feed | ||
/admin/amex_account/enroll: | ||
$ref: paths/admin@[email protected] | ||
|
||
# /admin/suggestions/expenses: | ||
# $ref: paths/admin@[email protected] | ||
# /admin/suggestions/corporate_card_transactions: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
post: | ||
tags: | ||
- Amex account | ||
summary: Enroll amex account for a card | ||
description: | | ||
Enroll amex account for a card | ||
operationId: amex_account_enroll | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
$ref: ../../components/schemas/amex_feed.yaml#/amex_account_in | ||
required: | ||
- data | ||
additionalProperties: False | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
data: | ||
$ref: '../../components/schemas/amex_feed.yaml#/amex_account_out' | ||
'400': | ||
description: Bad request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../components/schemas/400.yaml' | ||
'401': | ||
description: Unauthorized request | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../components/schemas/401.yaml' | ||
'403': | ||
description: Forbidden | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../components/schemas/403.yaml' | ||
'404': | ||
description: Not Found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '../../components/schemas/404.yaml' | ||
'500': | ||
description: API Server Error | ||
content: | ||
application/json: | ||
schema: | ||
$ref: ../../components/schemas/500.yaml |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we are using user_id and org_id in the request body... This should always be calculated from the auth token .