From d742b88305dd6d2d24f4d4a9e2504d3f7493c74f Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Sat, 24 Jan 2026 14:33:51 -0800 Subject: [PATCH] feat: add Customer API discriminators and consolidate customer changes --- mintlify/openapi.yaml | 177 +++++------------- openapi.yaml | 177 +++++------------- .../customers/CreateCustomerRequest.yaml | 18 ++ .../customers/IndividualCustomerUpdate.yaml | 6 +- .../customers/UpdateCustomerRequest.yaml | 18 ++ openapi/paths/customers/customers.yaml | 94 +--------- .../customers/customers_{customerId}.yaml | 38 +--- 7 files changed, 133 insertions(+), 395 deletions(-) create mode 100644 openapi/components/schemas/customers/CreateCustomerRequest.yaml create mode 100644 openapi/components/schemas/customers/UpdateCustomerRequest.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index d6cf1a5..a22d028 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -154,99 +154,7 @@ paths: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: '#/components/schemas/IndividualCustomerUpdate' - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: https://example.com/kyc - - title: New Business Customer - allOf: - - $ref: '#/components/schemas/BusinessCustomerUpdate' - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: https://example.com/kyc - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: '#/components/schemas/CreateCustomerRequest' responses: '201': description: Customer created successfully @@ -486,43 +394,7 @@ paths: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: '#/components/schemas/IndividualCustomerUpdate' - - title: Update Business Customer - $ref: '#/components/schemas/BusinessCustomerUpdate' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' - BUSINESS: '#/components/schemas/BusinessCustomerUpdate' - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: '#/components/schemas/UpdateCustomerRequest' responses: '200': description: Customer updated successfully @@ -4359,8 +4231,7 @@ components: properties: customerType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL description: Customer type fullName: type: string @@ -4377,6 +4248,10 @@ components: example: US address: $ref: '#/components/schemas/Address' + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | @@ -4418,6 +4293,25 @@ components: type: array items: $ref: '#/components/schemas/UltimateBeneficialOwner' + CreateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Error409: type: object required: @@ -4496,6 +4390,25 @@ components: details: type: object description: Additional error details + UpdateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Currency: type: object properties: diff --git a/openapi.yaml b/openapi.yaml index d6cf1a5..a22d028 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -154,99 +154,7 @@ paths: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: '#/components/schemas/IndividualCustomerUpdate' - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: https://example.com/kyc - - title: New Business Customer - allOf: - - $ref: '#/components/schemas/BusinessCustomerUpdate' - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: https://example.com/kyc - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: '#/components/schemas/CreateCustomerRequest' responses: '201': description: Customer created successfully @@ -486,43 +394,7 @@ paths: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: '#/components/schemas/IndividualCustomerUpdate' - - title: Update Business Customer - $ref: '#/components/schemas/BusinessCustomerUpdate' - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' - BUSINESS: '#/components/schemas/BusinessCustomerUpdate' - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: '#/components/schemas/UpdateCustomerRequest' responses: '200': description: Customer updated successfully @@ -4359,8 +4231,7 @@ components: properties: customerType: type: string - enum: - - INDIVIDUAL + const: INDIVIDUAL description: Customer type fullName: type: string @@ -4377,6 +4248,10 @@ components: example: US address: $ref: '#/components/schemas/Address' + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | @@ -4418,6 +4293,25 @@ components: type: array items: $ref: '#/components/schemas/UltimateBeneficialOwner' + CreateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Error409: type: object required: @@ -4496,6 +4390,25 @@ components: details: type: object description: Additional error details + UpdateCustomerRequest: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator + oneOf: + - $ref: '#/components/schemas/IndividualCustomerUpdate' + - $ref: '#/components/schemas/BusinessCustomerUpdate' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdate' + BUSINESS: '#/components/schemas/BusinessCustomerUpdate' Currency: type: object properties: diff --git a/openapi/components/schemas/customers/CreateCustomerRequest.yaml b/openapi/components/schemas/customers/CreateCustomerRequest.yaml new file mode 100644 index 0000000..3b996ef --- /dev/null +++ b/openapi/components/schemas/customers/CreateCustomerRequest.yaml @@ -0,0 +1,18 @@ +type: object +required: + - customerType +properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator +oneOf: + - $ref: ./IndividualCustomerUpdate.yaml + - $ref: ./BusinessCustomerUpdate.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdate.yaml + BUSINESS: ./BusinessCustomerUpdate.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml b/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml index 2a095cb..bfbce7e 100644 --- a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml +++ b/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml @@ -4,7 +4,7 @@ required: properties: customerType: type: string - enum: [INDIVIDUAL] + const: INDIVIDUAL description: Customer type fullName: type: string @@ -21,6 +21,10 @@ properties: example: US address: $ref: ../common/Address.yaml + platformCustomerId: + type: string + description: Platform-specific customer identifier + example: 9f84e0c2a72c4fa umaAddress: type: string description: | diff --git a/openapi/components/schemas/customers/UpdateCustomerRequest.yaml b/openapi/components/schemas/customers/UpdateCustomerRequest.yaml new file mode 100644 index 0000000..3b996ef --- /dev/null +++ b/openapi/components/schemas/customers/UpdateCustomerRequest.yaml @@ -0,0 +1,18 @@ +type: object +required: + - customerType +properties: + customerType: + type: string + enum: + - INDIVIDUAL + - BUSINESS + description: Customer type discriminator +oneOf: + - $ref: ./IndividualCustomerUpdate.yaml + - $ref: ./BusinessCustomerUpdate.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdate.yaml + BUSINESS: ./BusinessCustomerUpdate.yaml diff --git a/openapi/paths/customers/customers.yaml b/openapi/paths/customers/customers.yaml index 9bced55..66b5188 100644 --- a/openapi/paths/customers/customers.yaml +++ b/openapi/paths/customers/customers.yaml @@ -13,99 +13,7 @@ post: content: application/json: schema: - oneOf: - - title: New Individual Customer - allOf: - - $ref: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - - type: object - required: - - platformCustomerId - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your individual customer if KYC needs to be completed - example: "https://example.com/kyc" - - title: New Business Customer - allOf: - - $ref: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - - type: object - required: - - platformCustomerId - - businessInfo - properties: - platformCustomerId: - type: string - description: Platform-specific customer identifier - example: 9f84e0c2a72c4fa - kycUrl: - type: string - description: A KYC URL to be shared with your business customer if KYC needs to be completed - example: "https://example.com/kyc" - businessInfo: - type: object - required: - - legalName - properties: - legalName: - type: string - description: Legal name of the business - example: Acme Corporation, Inc. - registrationNumber: - type: string - description: Business registration number - example: BRN-123456789 - taxId: - type: string - description: Tax identification number - example: EIN-987654321 - examples: - individualCustomerWithUmaAddress: - summary: Create individual customer with UMA address, including deposit bank account information. - value: - umaAddress: $jane.doe@uma.domain.com - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: Jane Doe - birthDate: '1992-03-25' - address: - line1: 123 Pine Street - line2: Unit 501 - city: Seattle - state: WA - postalCode: '98101' - country: US - individualCustomerWithoutUmaAddress: - summary: Create individual customer without UMA address (will be generated) - value: - platformCustomerId: 7b3c5a89d2f1e0 - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-10' - address: - line1: 456 Oak Avenue - city: Portland - state: OR - postalCode: '97201' - country: US - businessCustomer: - summary: Create business customer example - value: - platformCustomerId: 6e4d2c0b8a9f3 - customerType: BUSINESS - businessInfo: - legalName: Acme Corporation - registrationNumber: BRN-456789123 - taxId: EIN-987123456 - address: - line1: 400 Commerce Way - city: Austin - state: TX - postalCode: '78701' - country: US + $ref: ../../components/schemas/customers/CreateCustomerRequest.yaml responses: '201': description: Customer created successfully diff --git a/openapi/paths/customers/customers_{customerId}.yaml b/openapi/paths/customers/customers_{customerId}.yaml index d3ed33c..5b601ba 100644 --- a/openapi/paths/customers/customers_{customerId}.yaml +++ b/openapi/paths/customers/customers_{customerId}.yaml @@ -60,43 +60,7 @@ patch: content: application/json: schema: - oneOf: - - title: Update Individual Customer - $ref: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - - title: Update Business Customer - $ref: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - discriminator: - propertyName: customerType - mapping: - INDIVIDUAL: ../../components/schemas/customers/IndividualCustomerUpdate.yaml - BUSINESS: ../../components/schemas/customers/BusinessCustomerUpdate.yaml - examples: - individualUpdate: - summary: Update individual customer example - value: - customerType: INDIVIDUAL - fullName: John Smith - birthDate: '1985-06-15' - address: - line1: 456 Market St - city: San Francisco - state: CA - postalCode: '94103' - country: US - businessUpdate: - summary: Update business customer example - value: - customerType: BUSINESS - businessInfo: - legalName: New Tech Solutions LLC - registrationNumber: BRN-987654321 - taxId: EIN-123456789 - address: - line1: 100 Technology Parkway - city: Palo Alto - state: CA - postalCode: '94304' - country: US + $ref: ../../components/schemas/customers/UpdateCustomerRequest.yaml responses: '200': description: Customer updated successfully