From 90d8b43e857be9a65ba366db857902a662b99255 Mon Sep 17 00:00:00 2001 From: Benjamin Collins Date: Wed, 25 Oct 2023 13:47:09 +0900 Subject: [PATCH] feat: adding in payment details --- .../credentials/EInvoiceCredential.yml | 735 +++++++++++++++++- 1 file changed, 734 insertions(+), 1 deletion(-) diff --git a/docs/openapi/components/schemas/credentials/EInvoiceCredential.yml b/docs/openapi/components/schemas/credentials/EInvoiceCredential.yml index 28aa47dad..57cd88854 100644 --- a/docs/openapi/components/schemas/credentials/EInvoiceCredential.yml +++ b/docs/openapi/components/schemas/credentials/EInvoiceCredential.yml @@ -197,6 +197,10 @@ properties: additionalProperties: false required: - type + - relatedDocuments + - buyer + - shipment + - payment type: object properties: type: @@ -210,6 +214,592 @@ properties: type: string enum: - Invoice + taxIdNumber: + title: Tax Id Number + description: Tax Id for Documents such as SAT + type: string + relatedDocuments: + title: Documents Linked or Referenced + description: References to other documents which can be used to support the claims of the current document + type: array + minItems: 0 + maxItems: 10 + items: + type: object + additionalProperties: false + required: + - type + - documentId + - documentType + properties: + type: + const: LinkedDocument + default: LinkedDocument + documentType: + title: Document Type + description: The type of the document being referenced + enum: + - MillTestReport + - PurchaseOrder + - PackingList + - BillOfLading + - CertificationOfOrigin + - LetterOfCredit + - ProFormaInvoice + - Other + documentId: + title: Document Identifier + description: The Identifier of the document being referenced + type: string + buyer: + title: Buyer + description: Importer of record. Party placing the order or paying the invoice. + additionalProperties: false + required: + - type + type: object + properties: + type: + type: array + readOnly: true + const: + - Organization + default: + - Organization + items: + type: string + enum: + - Organization + id: + title: Identifier + description: Identifier for the buyer + type: string + name: + title: Name + description: Name of the buyer + type: string + url: + title: URL + description: URL of the buyer + type: string + email: + title: Email Address + description: Buyer's primary email address. + type: string + phoneNumber: + title: Phone Number + description: Buyer's contact phone number. + type: string + location: + title: Location + description: Buyer's physical location, such as address or coordinates. + additionalProperties: false + required: + - type + type: object + properties: + type: + type: array + readOnly: true + const: + - Place + default: + - Place + items: + type: string + enum: + - Place + address: + title: Postal Address + description: The postal address for an organization or place. + additionalProperties: false + required: + - type + type: object + properties: + type: + type: array + readOnly: true + const: + - PostalAddress + default: + - PostalAddress + items: + type: string + enum: + - PostalAddress + streetAddress: + title: Street Address + description: >- + The street address expressed as free form text. The street address is + printed on paper as the first lines below the name. For example, the name + of the street and the number in the street or the name of a building. + type: string + addressLocality: + title: Address Locality + description: Text specifying the name of the locality; for example, a city. + type: string + addressRegion: + title: Address Region + description: >- + Text specifying a province or state in abbreviated format; for example, + NJ. + type: string + postalCode: + title: Postal Code + description: Text specifying the postal code for an address. + type: string + addressCountry: + title: Address Country + description: >- + The two-letter ISO 3166-1 alpha-2 country code. + type: string + itemsShipped: + title: Items Shipped + description: Itemized list of shipped goods. + type: array + minItems: 1 + maxItems: 1000 + items: + type: object + additionalProperties: false + required: + - type + properties: + type: + type: array + readOnly: true + const: + - TradeLineItem + default: + - TradeLineItem + items: + type: string + enum: + - TradeLineItem + name: + title: Name + description: Name of the Tradeline item. + type: string + description: + title: Description of product + type: string + productIdentifier: + title: Product Identifier + description: The product identifier, such as ISBN. + type: string + batchNumber: + title: Batch Number + description: A tracking number for commodities + type: string + price: + title: Price + description: >- + The offer price of a product, or of a price component when attached to + PriceSpecification and its subtypes. + type: number + count: + title: Count + description: The number of products included in the line item + type: number + priceCurrency: + title: Price Currency + description: >- + The currency of the price, or a price component when attached to + PriceSpecification and its subtypes. + type: string + netWeight: + title: Trade Line Item Net Weight + description: A measure of the net weight (mass). + type: number + netWeightUnit: + title: Net Weight Unit + description: Unit of measurement for Mass + enum: + - gram + - kilogram + - tonne + - pounds + shipment: + title: Shipment + description: Details about the shipment being made + type: object + properties: + type: + type: array + items: + type: object + properties: + type: + type: array + readOnly: true + const: + - Shipment + default: + - Shipment + items: + type: string + enum: + - Shipment + termsOfDelivery: + title: Terms of Delivery + description: The conditions agreed upon between the parties with regard to the delivery of goods and or services. + type: string + shipmentMethod: + title: Shipment Method + description: The method in which the goods in the invoice are being shipped + type: string + freightCost: + title: Freight Cost + description: Included cost of freight + type: number + freightCostCurrency: + title: Frieght Cost Currency + description: Currency in which frieght cost is calculated + type: string + shipTo: + title: Ship To (optional) + description: The organization of the party receiving the products (consignee) and their address if different from the buyer + type: array + items: + type: object + properties: + type: + type: array + readOnly: true + const: + - Organization + default: + - Organization + items: + type: string + enum: + - Organization + id: + title: Identifier + description: Identifier for the consginee. + type: string + name: + title: Name + description: Name of the consginee. + type: string + url: + title: URL + description: URL of the consignee. + type: string + email: + title: Email Address + description: Consignee's primary email address. + type: string + phoneNumber: + title: Phone Number + description: Consignee's contact phone number. + type: string + location: + title: Location + description: Consignee's physical location, such as address or coordinates. + type: object + properties: + type: + type: array + readOnly: true + const: + - Place + default: + - Place + items: + type: string + enum: + - Place + address: + title: Postal Address + description: The postal address for an organization or place. + type: object + properties: + type: + type: array + readOnly: true + const: + - PostalAddress + default: + - PostalAddress + items: + type: string + enum: + - PostalAddress + streetAddress: + title: Street Address + description: >- + The street address expressed as free form text. The street address is + printed on paper as the first lines below the name. For example, the name + of the street and the number in the street or the name of a building. + type: string + addressLocality: + title: Address Locality + description: Text specifying the name of the locality; for example, a city. + type: string + addressRegion: + title: Address Region + description: >- + Text specifying a province or state in abbreviated format; for example, + NJ. + type: string + addressCountry: + title: Address Country + description: >- + The two-letter ISO 3166-1 alpha-2 country code. + type: string + postalCode: + title: Postal Code + description: Text specifying the postal code for an address. + type: string + additionalProperties: false + required: + - type + additionalProperties: false + required: + - type + additionalProperties: false + required: + - type + minItems: 0 + maxItems: 1 + payment: + title: Payment + description: Information about payment + type: object + properties: + type: + type: array + items: + type: object + properties: + type: + type: array + readOnly: true + const: + - Payment + default: + - Payment + items: + type: string + enum: + - Payment + termsOfPayment: + title: Terms of Payment + description: Terms, conditions, and currency of settlement, as agreed upon by the vendor and purchaser per the pro forma invoice, customer purchase order, and/or the letter of credit. + type: string + payTo: + title: Pay To + description: Information about the account in which to deposit the funds + type: string + currencyOfSettlement: + title: Terms of Settlement + description: Currency agreed upon between seller and buyer as payment. + type: string + totalDue: + title: Price + description: The total sum of the invoice due + type: number + invoiceSubtotal: + title: Invoice Subtotal + description: The subtotal of line items. + type: object + additionalProperties: false + required: + - type + properties: + type: + type: array + readOnly: true + const: + - PriceSpecification + default: + - PriceSpecification + items: + type: string + enum: + - PriceSpecification + price: + title: Price + description: >- + The offer price of a product, or of a price component when attached to + PriceSpecification and its subtypes. + type: number + priceCurrency: + title: Price Currency + description: >- + The currency of the price, or a price component when attached to + PriceSpecification and its subtypes. + type: string + paymentDetails: + title: Payment Details (optional) + description: Information on the payment details to the beneficiary + type: array + items: + type: object + properties: + type: + type: array + readOnly: true + const: + - PaymentDetails + default: + - PaymentDetails + items: + type: string + enum: + - PaymentDetails + beneficiaryName: + title: Beneficiary Name + description: Name of the Beneficiary + type: string + beneficiaryAddress: + title: Beneficiary Address + description: The postal address of the Beneficiary + type: object + additionalProperties: false + required: + - type + properties: + type: + type: array + readOnly: true + const: + - PostalAddress + default: + - PostalAddress + items: + type: string + enum: + - PostalAddress + streetAddress: + title: Street Address + description: >- + The street address expressed as free form text. The street address is + printed on paper as the first lines below the name. For example, the name + of the street and the number in the street or the name of a building. + type: string + addressLocality: + title: Address Locality + description: Text specifying the name of the locality; for example, a city. + type: string + addressRegion: + title: Address Region + description: >- + Text specifying a province or state in abbreviated format; for example, + NJ. + type: string + addressCountry: + title: Address Country + description: >- + The two-letter ISO 3166-1 alpha-2 country code. + type: string + postalCode: + title: Postal Code + description: Text specifying the postal code for an address. + type: string + bankName: + title: Bank Name + description: Name of the bank + type: string + bankAddress: + title: Bank Address + description: The postal address of the bank + type: object + additionalProperties: false + required: + - type + properties: + type: + type: array + readOnly: true + const: + - PostalAddress + default: + - PostalAddress + items: + type: string + enum: + - PostalAddress + streetAddress: + title: Street Address + description: >- + The street address expressed as free form text. The street address is + printed on paper as the first lines below the name. For example, the name + of the street and the number in the street or the name of a building. + type: string + addressLocality: + title: Address Locality + description: Text specifying the name of the locality; for example, a city. + type: string + addressRegion: + title: Address Region + description: >- + Text specifying a province or state in abbreviated format; for example, + NJ. + type: string + addressCountry: + title: Address Country + description: >- + The two-letter ISO 3166-1 alpha-2 country code. + type: string + postalCode: + title: Postal Code + description: Text specifying the postal code for an address. + type: string + transitNumber: + title: Transit Number + description: A nine-digit number that helps financial institutions identify what institution issued checks or other documents financial documents + type: string + institutionNumber: + title: Institution Number + description: A unique code assigned to a certain bank or financial institution to identify them + type: string + accountNumber: + title: Account Number + description: The account number of the beneficiary at the bank + type: string + swiftCode: + title: Swift Code + description: Swift code for the financial institution + type: string + routingNumber: + title: Routing Number + description: Routing Number for the institution + type: string + minItems: 0 + maxItems: 1 + discounts: + title: Discounts (optional) + description: Reductions in price applied to the subtotal + type: array + items: + type: object + properties: + type: + type: array + readOnly: true + const: + - Discount + default: + - Discount + items: + type: string + enum: + - Discount + appliedTo: + title: Applied To + description: Defines if the discount is applied to a specific product or the subtotal + type: string + discount: + title: Discount + description: The percent or currency amount the above is reduced by + type: string + reason: + title: Reason + description: The reason the discount was applied + type: string proof: title: proof description: A JSON Web Signature proof for a credential as defined by the VC data model @@ -288,7 +878,150 @@ example: |- "credentialSubject": { "type": [ "Invoice" - ] + ], + "taxIdNumber": "88800012345", + "relatedDocuments" : [ + { + "type": "LinkedDocument", + "documentId": "a5d1ca6c-2c06-4039-9ff9-a75d7a695c8d", + "documentType": "PurchaseOrder" + }, + { + "type": "LinkedDocument", + "documentId": "63153", + "documentType": "MillTestReport" + }, + { + "type": "LinkedDocument", + "documentId": "63153", + "documentType": "CertificationOfOrigin" + } + ], + "buyer": { + "type": [ + "Organization" + ], + "id": "did:web:generic-motors.example.com", + "name": "Generic Motors of America", + "location": { + "type": [ + "Place" + ], + "address": { + "type": [ + "PostalAddress" + ], + "streetAddress": "12 Generic Motors Dr", + "addressLocality": "Detroit", + "addressRegion": "Michigan", + "postalCode": "48232-5170", + "addressCountry": "US" + } + } + }, + "itemsShipped" : [ + { + "type": ["TradeLineItem"], + "name": "Rebar", + "description": "Round Rebar used for Construction", + "productIdentifier": "rn19082-a", + "batchNumber": "010", + "price": 1000, + "count": 5, + "priceCurrency": "USD", + "netWeight": 1, + "netWeightUnit": "tonne" + } + ], + "shipment": { + "type" : [ + "Shipment" + ], + "termsOfDelivery": "full payment before shipment", + "shipmentMethod": "Tailer No. 53103", + "freightCost": 200, + "freightCostCurrency": "USD", + "shipTo": [ + { + "type": [ + "Organization" + ], + "id": "did:web:generic-motors.example.com", + "name": "Generic Motors of America", + "location": { + "type": [ + "Place" + ], + "address": { + "type": [ + "PostalAddress" + ], + "streetAddress": "12 Generic Motors Dr", + "addressLocality": "Detroit", + "addressRegion": "Michigan", + "postalCode": "48232-5170", + "addressCountry": "US" + } + } + } + ] + }, + "payment": { + "type": [ + "Payment" + ], + "termsOfPayment": "Payment made to bank account within 30 days of invoice", + "payTo": "Example Bank Acct. 1234567 Routing Number 123456789", + "currencyOfSettlement": "USD", + "totalDue": 4700, + "invoiceSubtotal": { + "type": [ + "PriceSpecification" + ], + "price": 5000, + "priceCurrency": "USD", + "discounts": [ + { + "type": ["Discount"], + "appliedTo": "subtotal", + "discount": "10%", + "reason": "First time customer" + } + ] + }, + "paymentDetails" : [ + { + "type":["PaymentDetails"], + "beneficiaryName": "American Prime Steel Inc.", + "beneficiaryAddress": { + "type": [ + "PostalAddress" + ], + "streetAddress": "1551 Keebler Knoll", + "addressLocality": "Vivianeburgh", + "addressRegion": "Oregon", + "postalCode": "47090", + "addressCountry": "US" + }, + "bankName": "Example Bank", + "bankAddress": { + "type": [ + "PostalAddress" + ], + "streetAddress": "17101 SW SUGAR PLUM LN", + "addressLocality": "BEAVERTON", + "addressRegion": "Oregon", + "postalCode": "97007", + "addressCountry": "US" + }, + "transitNumber": "123456789", + "institutionNumber": "000", + "accountNumber": "123456789", + "swiftCode": "AAAA-BB-CC-123", + "routingNumber": "123456789" + } + ] + } }, "credentialSchema": { "id": "https://w3id.org/traceability/openapi/components/schemas/credentials/EInvoiceCredential.yml",