From 51732f6104292b039196e43327ce05bbb23f0387 Mon Sep 17 00:00:00 2001 From: Peng Ying Date: Fri, 30 Jan 2026 16:28:21 -0800 Subject: [PATCH] fix: separating create customer from customer response schemas --- mintlify/openapi.yaml | 272 ++++++++++-------- openapi.yaml | 272 ++++++++++-------- .../schemas/customers/BusinessCustomer.yaml | 31 +- .../BusinessCustomerCreateRequest.yaml | 7 + .../customers/BusinessCustomerFields.yaml | 16 ++ .../customers/BusinessCustomerUpdate.yaml | 33 --- .../BusinessCustomerUpdateRequest.yaml | 3 + .../schemas/customers/BusinessInfo.yaml | 15 + .../customers/BusinessInfoRequired.yaml | 17 ++ .../customers/CustomerCreateRequest.yaml | 22 ++ .../customers/CustomerCreateRequestOneOf.yaml | 10 + .../customers/CustomerUpdateRequest.yaml | 17 ++ .../customers/CustomerUpdateRequestOneOf.yaml | 10 + .../schemas/customers/IndividualCustomer.yaml | 24 +- .../IndividualCustomerCreateRequest.yaml | 3 + ...ate.yaml => IndividualCustomerFields.yaml} | 11 +- .../IndividualCustomerUpdateRequest.yaml | 3 + openapi/paths/customers/customers.yaml | 2 +- .../customers/customers_{customerId}.yaml | 11 +- 19 files changed, 430 insertions(+), 349 deletions(-) create mode 100644 openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml create mode 100644 openapi/components/schemas/customers/BusinessCustomerFields.yaml delete mode 100644 openapi/components/schemas/customers/BusinessCustomerUpdate.yaml create mode 100644 openapi/components/schemas/customers/BusinessCustomerUpdateRequest.yaml create mode 100644 openapi/components/schemas/customers/BusinessInfo.yaml create mode 100644 openapi/components/schemas/customers/BusinessInfoRequired.yaml create mode 100644 openapi/components/schemas/customers/CustomerCreateRequest.yaml create mode 100644 openapi/components/schemas/customers/CustomerCreateRequestOneOf.yaml create mode 100644 openapi/components/schemas/customers/CustomerUpdateRequest.yaml create mode 100644 openapi/components/schemas/customers/CustomerUpdateRequestOneOf.yaml create mode 100644 openapi/components/schemas/customers/IndividualCustomerCreateRequest.yaml rename openapi/components/schemas/customers/{IndividualCustomerUpdate.yaml => IndividualCustomerFields.yaml} (51%) create mode 100644 openapi/components/schemas/customers/IndividualCustomerUpdateRequest.yaml diff --git a/mintlify/openapi.yaml b/mintlify/openapi.yaml index 1ae4b5c..ee0741b 100644 --- a/mintlify/openapi.yaml +++ b/mintlify/openapi.yaml @@ -154,7 +154,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CustomerOneOf' + $ref: '#/components/schemas/CustomerCreateRequestOneOf' responses: '201': description: Customer created successfully @@ -376,16 +376,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' + $ref: '#/components/schemas/CustomerUpdateRequestOneOf' examples: individualUpdate: summary: Update individual customer example @@ -4098,29 +4089,7 @@ components: IndividualCustomer: allOf: - $ref: '#/components/schemas/Customer' - - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/IndividualCustomerFields' Customer: type: object required: @@ -4198,6 +4167,22 @@ components: type: string description: Country code (ISO 3166-1 alpha-2) example: US + BusinessInfo: + type: object + description: Additional information for business entities + 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 UltimateBeneficialOwner: type: object required: @@ -4252,41 +4237,49 @@ components: type: string description: Title at company example: CEO, COO, President + BusinessCustomerFields: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - BUSINESS + address: + $ref: '#/components/schemas/Address' + businessInfo: + $ref: '#/components/schemas/BusinessInfo' + beneficialOwners: + type: array + items: + $ref: '#/components/schemas/UltimateBeneficialOwner' + BusinessInfoRequired: + type: object + description: Additional information required for business entities + 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 BusinessCustomer: allOf: - $ref: '#/components/schemas/Customer' + - $ref: '#/components/schemas/BusinessCustomerFields' - type: object - required: - - customerType properties: - customerType: - type: string - enum: - - BUSINESS - address: - $ref: '#/components/schemas/Address' businessInfo: - type: object - required: - - legalName - description: Additional information required for business entities - 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 - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + $ref: '#/components/schemas/BusinessInfoRequired' KycStatus: type: string enum: @@ -4299,6 +4292,30 @@ components: - MANUALLY_REJECTED description: The current KYC status of a customer example: APPROVED + IndividualCustomerFields: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + address: + $ref: '#/components/schemas/Address' CustomerOneOf: oneOf: - title: Individual Customer @@ -4310,6 +4327,49 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualCustomer' BUSINESS: '#/components/schemas/BusinessCustomer' + IndividualCustomerCreateRequest: + allOf: + - $ref: '#/components/schemas/CustomerCreateRequest' + - $ref: '#/components/schemas/IndividualCustomerFields' + CustomerCreateRequest: + type: object + required: + - customerType + - platformCustomerId + properties: + platformCustomerId: + type: string + description: Platform-specific customer identifier. If not provided, one will be generated by the system. + example: 9f84e0c2a72c4fa + customerType: + $ref: '#/components/schemas/CustomerType' + umaAddress: + description: Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. If provided during customer update, the UMA address will be updated to the provided value. This is an optional identifier to route payments to the customer. This is an optional identifier to route payments to the customer. + example: $john.doe@uma.domain.com + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerCreateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerCreateRequest' + BusinessCustomerCreateRequest: + allOf: + - $ref: '#/components/schemas/CustomerCreateRequest' + - $ref: '#/components/schemas/BusinessCustomerFields' + - type: object + properties: + businessInfo: + $ref: '#/components/schemas/BusinessInfoRequired' + CustomerCreateRequestOneOf: + oneOf: + - title: Individual Customer Create Request + $ref: '#/components/schemas/IndividualCustomerCreateRequest' + - title: Business Customer Create Request + $ref: '#/components/schemas/BusinessCustomerCreateRequest' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerCreateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerCreateRequest' Error409: type: object required: @@ -4390,73 +4450,41 @@ components: details: type: object description: Additional error details - IndividualCustomerUpdate: + IndividualCustomerUpdateRequest: + allOf: + - $ref: '#/components/schemas/CustomerUpdateRequest' + - $ref: '#/components/schemas/IndividualCustomerFields' + CustomerUpdateRequest: type: object required: - customerType properties: customerType: - type: string - enum: - - INDIVIDUAL - description: Customer type - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' + $ref: '#/components/schemas/CustomerType' umaAddress: type: string - description: | - Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. - If provided during customer update, the UMA address will be updated to the provided value. This is an optional - identifier to route payments to the customer. + description: Optional UMA address identifier. If provided, the customer's UMA address will be updated. This is an optional identifier to route payments to the customer. example: $john.doe@uma.domain.com - BusinessCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - BUSINESS - description: Customer type - umaAddress: - type: string - description: Optional UMA address identifier. If not provided, will be generated by the system. - example: $acme@uma.domain.com - businessInfo: - type: object - 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 - address: - $ref: '#/components/schemas/Address' - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' + BusinessCustomerUpdateRequest: + allOf: + - $ref: '#/components/schemas/CustomerUpdateRequest' + - $ref: '#/components/schemas/BusinessCustomerFields' + CustomerUpdateRequestOneOf: + oneOf: + - title: Individual Customer Update Request + $ref: '#/components/schemas/IndividualCustomerUpdateRequest' + - title: Business Customer Update Request + $ref: '#/components/schemas/BusinessCustomerUpdateRequest' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' Currency: type: object properties: diff --git a/openapi.yaml b/openapi.yaml index 1ae4b5c..ee0741b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -154,7 +154,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CustomerOneOf' + $ref: '#/components/schemas/CustomerCreateRequestOneOf' responses: '201': description: Customer created successfully @@ -376,16 +376,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' + $ref: '#/components/schemas/CustomerUpdateRequestOneOf' examples: individualUpdate: summary: Update individual customer example @@ -4098,29 +4089,7 @@ components: IndividualCustomer: allOf: - $ref: '#/components/schemas/Customer' - - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' + - $ref: '#/components/schemas/IndividualCustomerFields' Customer: type: object required: @@ -4198,6 +4167,22 @@ components: type: string description: Country code (ISO 3166-1 alpha-2) example: US + BusinessInfo: + type: object + description: Additional information for business entities + 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 UltimateBeneficialOwner: type: object required: @@ -4252,41 +4237,49 @@ components: type: string description: Title at company example: CEO, COO, President + BusinessCustomerFields: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - BUSINESS + address: + $ref: '#/components/schemas/Address' + businessInfo: + $ref: '#/components/schemas/BusinessInfo' + beneficialOwners: + type: array + items: + $ref: '#/components/schemas/UltimateBeneficialOwner' + BusinessInfoRequired: + type: object + description: Additional information required for business entities + 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 BusinessCustomer: allOf: - $ref: '#/components/schemas/Customer' + - $ref: '#/components/schemas/BusinessCustomerFields' - type: object - required: - - customerType properties: - customerType: - type: string - enum: - - BUSINESS - address: - $ref: '#/components/schemas/Address' businessInfo: - type: object - required: - - legalName - description: Additional information required for business entities - 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 - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + $ref: '#/components/schemas/BusinessInfoRequired' KycStatus: type: string enum: @@ -4299,6 +4292,30 @@ components: - MANUALLY_REJECTED description: The current KYC status of a customer example: APPROVED + IndividualCustomerFields: + type: object + required: + - customerType + properties: + customerType: + type: string + enum: + - INDIVIDUAL + fullName: + type: string + description: Individual's full name + example: John Michael Doe + birthDate: + type: string + format: date + description: Date of birth in ISO 8601 format (YYYY-MM-DD) + example: '1990-01-15' + nationality: + type: string + description: Country code (ISO 3166-1 alpha-2) + example: US + address: + $ref: '#/components/schemas/Address' CustomerOneOf: oneOf: - title: Individual Customer @@ -4310,6 +4327,49 @@ components: mapping: INDIVIDUAL: '#/components/schemas/IndividualCustomer' BUSINESS: '#/components/schemas/BusinessCustomer' + IndividualCustomerCreateRequest: + allOf: + - $ref: '#/components/schemas/CustomerCreateRequest' + - $ref: '#/components/schemas/IndividualCustomerFields' + CustomerCreateRequest: + type: object + required: + - customerType + - platformCustomerId + properties: + platformCustomerId: + type: string + description: Platform-specific customer identifier. If not provided, one will be generated by the system. + example: 9f84e0c2a72c4fa + customerType: + $ref: '#/components/schemas/CustomerType' + umaAddress: + description: Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. If provided during customer update, the UMA address will be updated to the provided value. This is an optional identifier to route payments to the customer. This is an optional identifier to route payments to the customer. + example: $john.doe@uma.domain.com + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerCreateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerCreateRequest' + BusinessCustomerCreateRequest: + allOf: + - $ref: '#/components/schemas/CustomerCreateRequest' + - $ref: '#/components/schemas/BusinessCustomerFields' + - type: object + properties: + businessInfo: + $ref: '#/components/schemas/BusinessInfoRequired' + CustomerCreateRequestOneOf: + oneOf: + - title: Individual Customer Create Request + $ref: '#/components/schemas/IndividualCustomerCreateRequest' + - title: Business Customer Create Request + $ref: '#/components/schemas/BusinessCustomerCreateRequest' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerCreateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerCreateRequest' Error409: type: object required: @@ -4390,73 +4450,41 @@ components: details: type: object description: Additional error details - IndividualCustomerUpdate: + IndividualCustomerUpdateRequest: + allOf: + - $ref: '#/components/schemas/CustomerUpdateRequest' + - $ref: '#/components/schemas/IndividualCustomerFields' + CustomerUpdateRequest: type: object required: - customerType properties: customerType: - type: string - enum: - - INDIVIDUAL - description: Customer type - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: '#/components/schemas/Address' + $ref: '#/components/schemas/CustomerType' umaAddress: type: string - description: | - Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. - If provided during customer update, the UMA address will be updated to the provided value. This is an optional - identifier to route payments to the customer. + description: Optional UMA address identifier. If provided, the customer's UMA address will be updated. This is an optional identifier to route payments to the customer. example: $john.doe@uma.domain.com - BusinessCustomerUpdate: - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - BUSINESS - description: Customer type - umaAddress: - type: string - description: Optional UMA address identifier. If not provided, will be generated by the system. - example: $acme@uma.domain.com - businessInfo: - type: object - 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 - address: - $ref: '#/components/schemas/Address' - beneficialOwners: - type: array - items: - $ref: '#/components/schemas/UltimateBeneficialOwner' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' + BusinessCustomerUpdateRequest: + allOf: + - $ref: '#/components/schemas/CustomerUpdateRequest' + - $ref: '#/components/schemas/BusinessCustomerFields' + CustomerUpdateRequestOneOf: + oneOf: + - title: Individual Customer Update Request + $ref: '#/components/schemas/IndividualCustomerUpdateRequest' + - title: Business Customer Update Request + $ref: '#/components/schemas/BusinessCustomerUpdateRequest' + discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: '#/components/schemas/IndividualCustomerUpdateRequest' + BUSINESS: '#/components/schemas/BusinessCustomerUpdateRequest' Currency: type: object properties: diff --git a/openapi/components/schemas/customers/BusinessCustomer.yaml b/openapi/components/schemas/customers/BusinessCustomer.yaml index 9e7f507..5b1caae 100644 --- a/openapi/components/schemas/customers/BusinessCustomer.yaml +++ b/openapi/components/schemas/customers/BusinessCustomer.yaml @@ -1,34 +1,7 @@ allOf: - $ref: ./Customer.yaml + - $ref: ./BusinessCustomerFields.yaml - type: object - required: - - customerType properties: - customerType: - type: string - enum: - - BUSINESS - address: - $ref: ../common/Address.yaml businessInfo: - type: object - required: - - legalName - description: Additional information required for business entities - 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 - beneficialOwners: - type: array - items: - $ref: ./UltimateBeneficialOwner.yaml \ No newline at end of file + $ref: ./BusinessInfoRequired.yaml diff --git a/openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml b/openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml new file mode 100644 index 0000000..86f47b8 --- /dev/null +++ b/openapi/components/schemas/customers/BusinessCustomerCreateRequest.yaml @@ -0,0 +1,7 @@ +allOf: + - $ref: ./CustomerCreateRequest.yaml + - $ref: ./BusinessCustomerFields.yaml + - type: object + properties: + businessInfo: + $ref: ./BusinessInfoRequired.yaml diff --git a/openapi/components/schemas/customers/BusinessCustomerFields.yaml b/openapi/components/schemas/customers/BusinessCustomerFields.yaml new file mode 100644 index 0000000..8a4a2c1 --- /dev/null +++ b/openapi/components/schemas/customers/BusinessCustomerFields.yaml @@ -0,0 +1,16 @@ +type: object +required: + - customerType +properties: + customerType: + type: string + enum: + - BUSINESS + address: + $ref: ../common/Address.yaml + businessInfo: + $ref: ./BusinessInfo.yaml + beneficialOwners: + type: array + items: + $ref: ./UltimateBeneficialOwner.yaml diff --git a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml b/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml deleted file mode 100644 index b146b34..0000000 --- a/openapi/components/schemas/customers/BusinessCustomerUpdate.yaml +++ /dev/null @@ -1,33 +0,0 @@ -type: object -required: - - customerType -properties: - customerType: - type: string - enum: [BUSINESS] - description: Customer type - umaAddress: - type: string - description: Optional UMA address identifier. If not provided, will be generated by the system. - example: $acme@uma.domain.com - businessInfo: - type: object - 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 - address: - $ref: ../common/Address.yaml - beneficialOwners: - type: array - items: - $ref: ./UltimateBeneficialOwner.yaml diff --git a/openapi/components/schemas/customers/BusinessCustomerUpdateRequest.yaml b/openapi/components/schemas/customers/BusinessCustomerUpdateRequest.yaml new file mode 100644 index 0000000..6d05907 --- /dev/null +++ b/openapi/components/schemas/customers/BusinessCustomerUpdateRequest.yaml @@ -0,0 +1,3 @@ +allOf: + - $ref: ./CustomerUpdateRequest.yaml + - $ref: ./BusinessCustomerFields.yaml diff --git a/openapi/components/schemas/customers/BusinessInfo.yaml b/openapi/components/schemas/customers/BusinessInfo.yaml new file mode 100644 index 0000000..102e428 --- /dev/null +++ b/openapi/components/schemas/customers/BusinessInfo.yaml @@ -0,0 +1,15 @@ +type: object +description: Additional information for business entities +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 diff --git a/openapi/components/schemas/customers/BusinessInfoRequired.yaml b/openapi/components/schemas/customers/BusinessInfoRequired.yaml new file mode 100644 index 0000000..fe6d429 --- /dev/null +++ b/openapi/components/schemas/customers/BusinessInfoRequired.yaml @@ -0,0 +1,17 @@ +type: object +description: Additional information required for business entities +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 diff --git a/openapi/components/schemas/customers/CustomerCreateRequest.yaml b/openapi/components/schemas/customers/CustomerCreateRequest.yaml new file mode 100644 index 0000000..e0e7555 --- /dev/null +++ b/openapi/components/schemas/customers/CustomerCreateRequest.yaml @@ -0,0 +1,22 @@ +type: object +required: + - customerType + - platformCustomerId +properties: + platformCustomerId: + type: string + description: Platform-specific customer identifier. If not provided, one will be generated by the system. + example: 9f84e0c2a72c4fa + customerType: + $ref: ./CustomerType.yaml + umaAddress: + description: >- + Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. + If provided during customer update, the UMA address will be updated to the provided value. This is an optional identifier to route payments to the customer. + This is an optional identifier to route payments to the customer. + example: $john.doe@uma.domain.com +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerCreateRequest.yaml + BUSINESS: ./BusinessCustomerCreateRequest.yaml diff --git a/openapi/components/schemas/customers/CustomerCreateRequestOneOf.yaml b/openapi/components/schemas/customers/CustomerCreateRequestOneOf.yaml new file mode 100644 index 0000000..53e9c95 --- /dev/null +++ b/openapi/components/schemas/customers/CustomerCreateRequestOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Individual Customer Create Request + $ref: ./IndividualCustomerCreateRequest.yaml + - title: Business Customer Create Request + $ref: ./BusinessCustomerCreateRequest.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerCreateRequest.yaml + BUSINESS: ./BusinessCustomerCreateRequest.yaml diff --git a/openapi/components/schemas/customers/CustomerUpdateRequest.yaml b/openapi/components/schemas/customers/CustomerUpdateRequest.yaml new file mode 100644 index 0000000..68585c6 --- /dev/null +++ b/openapi/components/schemas/customers/CustomerUpdateRequest.yaml @@ -0,0 +1,17 @@ +type: object +required: + - customerType +properties: + customerType: + $ref: ./CustomerType.yaml + umaAddress: + type: string + description: >- + Optional UMA address identifier. If provided, the customer's UMA address will be updated. + This is an optional identifier to route payments to the customer. + example: $john.doe@uma.domain.com +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdateRequest.yaml + BUSINESS: ./BusinessCustomerUpdateRequest.yaml diff --git a/openapi/components/schemas/customers/CustomerUpdateRequestOneOf.yaml b/openapi/components/schemas/customers/CustomerUpdateRequestOneOf.yaml new file mode 100644 index 0000000..3574653 --- /dev/null +++ b/openapi/components/schemas/customers/CustomerUpdateRequestOneOf.yaml @@ -0,0 +1,10 @@ +oneOf: + - title: Individual Customer Update Request + $ref: ./IndividualCustomerUpdateRequest.yaml + - title: Business Customer Update Request + $ref: ./BusinessCustomerUpdateRequest.yaml +discriminator: + propertyName: customerType + mapping: + INDIVIDUAL: ./IndividualCustomerUpdateRequest.yaml + BUSINESS: ./BusinessCustomerUpdateRequest.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomer.yaml b/openapi/components/schemas/customers/IndividualCustomer.yaml index 6cd8a45..8c87876 100644 --- a/openapi/components/schemas/customers/IndividualCustomer.yaml +++ b/openapi/components/schemas/customers/IndividualCustomer.yaml @@ -1,25 +1,3 @@ allOf: - $ref: ./Customer.yaml - - type: object - required: - - customerType - properties: - customerType: - type: string - enum: - - INDIVIDUAL - fullName: - type: string - description: Individual's full name - example: John Michael Doe - birthDate: - type: string - format: date - description: Date of birth in ISO 8601 format (YYYY-MM-DD) - example: '1990-01-15' - nationality: - type: string - description: Country code (ISO 3166-1 alpha-2) - example: US - address: - $ref: ../common/Address.yaml \ No newline at end of file + - $ref: ./IndividualCustomerFields.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomerCreateRequest.yaml b/openapi/components/schemas/customers/IndividualCustomerCreateRequest.yaml new file mode 100644 index 0000000..2e64cfa --- /dev/null +++ b/openapi/components/schemas/customers/IndividualCustomerCreateRequest.yaml @@ -0,0 +1,3 @@ +allOf: + - $ref: ./CustomerCreateRequest.yaml + - $ref: ./IndividualCustomerFields.yaml diff --git a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml b/openapi/components/schemas/customers/IndividualCustomerFields.yaml similarity index 51% rename from openapi/components/schemas/customers/IndividualCustomerUpdate.yaml rename to openapi/components/schemas/customers/IndividualCustomerFields.yaml index 2a095cb..95616fe 100644 --- a/openapi/components/schemas/customers/IndividualCustomerUpdate.yaml +++ b/openapi/components/schemas/customers/IndividualCustomerFields.yaml @@ -4,8 +4,8 @@ required: properties: customerType: type: string - enum: [INDIVIDUAL] - description: Customer type + enum: + - INDIVIDUAL fullName: type: string description: Individual's full name @@ -21,10 +21,3 @@ properties: example: US address: $ref: ../common/Address.yaml - umaAddress: - type: string - description: | - Optional UMA address identifier. If not provided during customer creation, one will be generated by the system. - If provided during customer update, the UMA address will be updated to the provided value. This is an optional - identifier to route payments to the customer. - example: $john.doe@uma.domain.com diff --git a/openapi/components/schemas/customers/IndividualCustomerUpdateRequest.yaml b/openapi/components/schemas/customers/IndividualCustomerUpdateRequest.yaml new file mode 100644 index 0000000..e5d536f --- /dev/null +++ b/openapi/components/schemas/customers/IndividualCustomerUpdateRequest.yaml @@ -0,0 +1,3 @@ +allOf: + - $ref: ./CustomerUpdateRequest.yaml + - $ref: ./IndividualCustomerFields.yaml diff --git a/openapi/paths/customers/customers.yaml b/openapi/paths/customers/customers.yaml index 49a3113..719b3d2 100644 --- a/openapi/paths/customers/customers.yaml +++ b/openapi/paths/customers/customers.yaml @@ -13,7 +13,7 @@ post: content: application/json: schema: - $ref: ../../components/schemas/customers/CustomerOneOf.yaml + $ref: ../../components/schemas/customers/CustomerCreateRequestOneOf.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..e3ce584 100644 --- a/openapi/paths/customers/customers_{customerId}.yaml +++ b/openapi/paths/customers/customers_{customerId}.yaml @@ -60,16 +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 + $ref: ../../components/schemas/customers/CustomerUpdateRequestOneOf.yaml examples: individualUpdate: summary: Update individual customer example