From b82da8fa9927193ec73efb450d7d297a10c04fe1 Mon Sep 17 00:00:00 2001 From: chdeskur Date: Wed, 24 Jul 2024 11:05:52 -0400 Subject: [PATCH 1/6] (chore): initial updates --- fern/apis/admin/AdminAPIs.yaml | 153 + fern/apis/admin/generators.yml | 1 + .../apis/api/definition/admin/__package__.yml | 1 + fern/apis/api/definition/api.yml | 10 + .../api/definition/headless/__package__.yml | 1 + .../api/definition/minting/__package__.yml | 1 + .../api/definition/payments/__package__.yml | 1 + .../verifiable-credentials/__package__.yml | 1 + .../api/definition/wallets/__package__.yml | 1 + fern/apis/api/dependencies.yml | 8 + fern/{ => apis/api}/generators.yml | 5 +- fern/apis/headless/HeadlessAPIs.yaml | 639 ++++ fern/apis/headless/generators.yml | 1 + fern/apis/minting/MintingAPIs.yaml | 2776 +++++++++++++++++ fern/apis/minting/generators.yml | 1 + fern/apis/payments/PaymentsAPIs.yaml | 605 ++++ fern/apis/payments/generators.yml | 1 + .../VerifiableCredentialsAPIs.yaml | 839 +++++ .../verifiable-credentials/generators.yml | 1 + fern/apis/wallets/WalletsAPIs.yaml | 746 +++++ fern/apis/wallets/generators.yml | 1 + .../openapi => openapi}/openapi-overrides.yml | 10 +- {fern/openapi => openapi}/openapi.yaml | 40 +- 23 files changed, 5814 insertions(+), 29 deletions(-) create mode 100644 fern/apis/admin/AdminAPIs.yaml create mode 100644 fern/apis/admin/generators.yml create mode 100644 fern/apis/api/definition/admin/__package__.yml create mode 100644 fern/apis/api/definition/api.yml create mode 100644 fern/apis/api/definition/headless/__package__.yml create mode 100644 fern/apis/api/definition/minting/__package__.yml create mode 100644 fern/apis/api/definition/payments/__package__.yml create mode 100644 fern/apis/api/definition/verifiable-credentials/__package__.yml create mode 100644 fern/apis/api/definition/wallets/__package__.yml create mode 100644 fern/apis/api/dependencies.yml rename fern/{ => apis/api}/generators.yml (73%) create mode 100644 fern/apis/headless/HeadlessAPIs.yaml create mode 100644 fern/apis/headless/generators.yml create mode 100644 fern/apis/minting/MintingAPIs.yaml create mode 100644 fern/apis/minting/generators.yml create mode 100644 fern/apis/payments/PaymentsAPIs.yaml create mode 100644 fern/apis/payments/generators.yml create mode 100644 fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml create mode 100644 fern/apis/verifiable-credentials/generators.yml create mode 100644 fern/apis/wallets/WalletsAPIs.yaml create mode 100644 fern/apis/wallets/generators.yml rename {fern/openapi => openapi}/openapi-overrides.yml (93%) rename {fern/openapi => openapi}/openapi.yaml (95%) diff --git a/fern/apis/admin/AdminAPIs.yaml b/fern/apis/admin/AdminAPIs.yaml new file mode 100644 index 0000000..284f6a1 --- /dev/null +++ b/fern/apis/admin/AdminAPIs.yaml @@ -0,0 +1,153 @@ +--- +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +security: + - apiKey: [] +info: + description: N/A + version: 1.0.0 + title: Admin API + contact: + name: Crossmint Admin APIs + url: https://www.crossmint.com + email: support@crossmint.io +paths: + "/v1-alpha1/projects/{projectId}/usage": + get: + responses: + "200": + description: Success. + content: + application/json: + schema: + "$ref": "#/components/schemas/UsageResponse" + "400": + description: Invalid arguments, please make sure you're following the api + specification. + content: + application/json: + schema: + "$ref": "#/components/schemas/BatchError" + "403": + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + "503": + description: Please try again in a few minutes. If the issue still persists, + please contact Crossmint support. + content: + application/json: + schema: + "$ref": "#/components/schemas/Error" + summary: Get Usage + description: | + Get usage data for a project. + + **API scope required** `projects:usage.read` + operationId: get-usage + parameters: + - name: projectId + in: path + description: You can find your project ID in the Crossmint + console. + required: true + example: 94d09d19-25b4-45f7-8103-b48b7a2ae3cc + schema: + type: string + default: default + - name: dimension + in: query + description: The `dimension` you want to query, for example `monthly_active_wallets`. + required: true + schema: + type: string + description: The type of usage data to return. + default: monthly_active_wallets + enum: + - monthly_active_wallets + - name: startDate + in: query + description: The `startDate` you want to query in YYYY-MM format, for example `2023-11` for November 2023. + required: true + schema: + type: string + description: The `startDate` of usage data to return. + - name: endDate + in: query + description: The `endDate` you want to query in YYYY-MM format, for example `2023-12` for December 2023. + schema: + type: string + description: The `endDate` of usage data to return. +components: + securitySchemes: + apiKey: + type: apiKey + in: header + name: X-API-KEY + + schemas: + UsageResponse: + type: object + properties: + data: + type: object + properties: + dimension: + type: string + description: The type of usage data returned. + usage: + type: object + description: The usage data for the specified dimension. + properties: + month: + type: string + description: YYYY-MM format indicating the month + activeWallets: + type: integer + description: The number of active wallets for the given month + + Error: + type: object + properties: + error: + type: string + message: + type: string + ValidationError: + type: object + properties: + index: + type: integer + description: The index of the NFT that caused the validation error. + id: + type: string + description: The idempotent identifier for the NFT, if available. + message: + type: string + description: The validation error message. + required: + - message + + BatchError: + type: object + properties: + error: + type: boolean + description: Flag indicating whether an error occurred. Always `true` for error responses. + message: + type: string + description: A general error message. + validationErrors: + type: array + items: + "$ref": "#/components/schemas/ValidationError" + description: A list of specific validation errors. + required: + - error + - message diff --git a/fern/apis/admin/generators.yml b/fern/apis/admin/generators.yml new file mode 100644 index 0000000..68afe92 --- /dev/null +++ b/fern/apis/admin/generators.yml @@ -0,0 +1 @@ +openapi: ./AdminAPIs.yaml \ No newline at end of file diff --git a/fern/apis/api/definition/admin/__package__.yml b/fern/apis/api/definition/admin/__package__.yml new file mode 100644 index 0000000..32cd6e6 --- /dev/null +++ b/fern/apis/api/definition/admin/__package__.yml @@ -0,0 +1 @@ +export: admin \ No newline at end of file diff --git a/fern/apis/api/definition/api.yml b/fern/apis/api/definition/api.yml new file mode 100644 index 0000000..bc6f484 --- /dev/null +++ b/fern/apis/api/definition/api.yml @@ -0,0 +1,10 @@ +name: api +display-name: Crossmint + +error-discrimination: + strategy: status-code + +default-environment: Production +environments: + Production: "https://www.crossmint.com/api" + Staging: "https://staging.crossmint.com/api" \ No newline at end of file diff --git a/fern/apis/api/definition/headless/__package__.yml b/fern/apis/api/definition/headless/__package__.yml new file mode 100644 index 0000000..7512be8 --- /dev/null +++ b/fern/apis/api/definition/headless/__package__.yml @@ -0,0 +1 @@ +export: headless \ No newline at end of file diff --git a/fern/apis/api/definition/minting/__package__.yml b/fern/apis/api/definition/minting/__package__.yml new file mode 100644 index 0000000..49249f3 --- /dev/null +++ b/fern/apis/api/definition/minting/__package__.yml @@ -0,0 +1 @@ +export: minting \ No newline at end of file diff --git a/fern/apis/api/definition/payments/__package__.yml b/fern/apis/api/definition/payments/__package__.yml new file mode 100644 index 0000000..b20c506 --- /dev/null +++ b/fern/apis/api/definition/payments/__package__.yml @@ -0,0 +1 @@ +export: payments \ No newline at end of file diff --git a/fern/apis/api/definition/verifiable-credentials/__package__.yml b/fern/apis/api/definition/verifiable-credentials/__package__.yml new file mode 100644 index 0000000..96c5505 --- /dev/null +++ b/fern/apis/api/definition/verifiable-credentials/__package__.yml @@ -0,0 +1 @@ +export: verifiable-credentials \ No newline at end of file diff --git a/fern/apis/api/definition/wallets/__package__.yml b/fern/apis/api/definition/wallets/__package__.yml new file mode 100644 index 0000000..bef3709 --- /dev/null +++ b/fern/apis/api/definition/wallets/__package__.yml @@ -0,0 +1 @@ +export: wallets \ No newline at end of file diff --git a/fern/apis/api/dependencies.yml b/fern/apis/api/dependencies.yml new file mode 100644 index 0000000..9f67ea7 --- /dev/null +++ b/fern/apis/api/dependencies.yml @@ -0,0 +1,8 @@ +dependencies: + admin: ../admin + headless: ../headless + minting: ../minting + payments: ../payments + verifiable-credentials: ../verifiable-credentials + wallets: ../wallets + \ No newline at end of file diff --git a/fern/generators.yml b/fern/apis/api/generators.yml similarity index 73% rename from fern/generators.yml rename to fern/apis/api/generators.yml index 2d5e43e..00d24e3 100644 --- a/fern/generators.yml +++ b/fern/apis/api/generators.yml @@ -1,6 +1,3 @@ -api: - path: ./openapi/openapi.yaml - overrides: ./openapi/openapi-overrides.yml groups: ts-sdk: generators: @@ -11,7 +8,7 @@ groups: package-name: "crossmint" token: ${NPM_TOKEN} github: - repository: fern-demo/crossmint-typescript-sdk + repository: Paella-Labs/typescript-sdk smart-casing: true config: namespaceExport: Crossmint diff --git a/fern/apis/headless/HeadlessAPIs.yaml b/fern/apis/headless/HeadlessAPIs.yaml new file mode 100644 index 0000000..19a39dd --- /dev/null +++ b/fern/apis/headless/HeadlessAPIs.yaml @@ -0,0 +1,639 @@ +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +info: + description: | + N/A + version: 1.0.0 + title: Headless Checkout + contact: + name: Crossmint Headless NFT Checkout APIs + url: "https://www.crossmint.com" + email: support@crossmint.io +tags: + - name: Headless Checkout + description: APIs to use the headless checkout + +paths: + ################################################ + ### HEADLESS + ################################################ + + /2022-06-09/orders: + # CREATE ORDER + post: + summary: Create Order + description: Creates a new order that can be used to complete a headless checkout. + operationId: create-order + security: + - apiKey: [] + tags: + - Headless + requestBody: + required: true + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - payment + - lineItems + properties: + recipient: + $ref: "#/components/schemas/Recipient" + locale: + $ref: "#/components/schemas/Locale" + payment: + $ref: "#/components/schemas/Payment" + lineItems: + $ref: "#/components/schemas/LineItems" + responses: + 201: + description: "Order successfully created." + content: + application/json: + schema: + $ref: "#/components/schemas/CreateOrderResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + 524: + description: A timeout occurred. + content: + application/json: + schema: + $ref: "#/components/schemas/Error524Response" + + /2022-06-09/orders/{orderId}: + # GET ORDER + get: + summary: Get Order + description: Get specific order by ID + operationId: get-order + security: + - apiKey: [] + - orderClientSecret: [] + tags: + - Headless + parameters: + - $ref: "#/components/parameters/orderId" + responses: + 200: + description: "Order successfully created." + content: + application/json: + schema: + $ref: "#/components/schemas/OrderObject" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + 524: + description: A timeout occurred. + content: + application/json: + schema: + $ref: "#/components/schemas/Error524Response" + + # EDIT ORDER + patch: + summary: Edit Order + description: >- + Edit an existing order. You can update the recipient, the payment + method, and/or the locale. + operationId: edit-order + security: + - apiKey: [] + - orderClientSecret: [] + tags: + - Headless + parameters: + - $ref: "#/components/parameters/orderId" + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/OrderDTO" + responses: + 200: + description: "Order successfully created." + content: + application/json: + schema: + $ref: "#/components/schemas/OrderObject" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + 524: + description: A timeout occurred. + content: + application/json: + schema: + $ref: "#/components/schemas/Error524Response" + +components: + securitySchemes: + apiKey: + type: apiKey + name: X-API-KEY + in: header + orderClientSecret: + type: apiKey + name: Authorization + in: header + + parameters: + orderId: + name: orderId + in: path + description: | + This is the identifier for the order with UUID format. + + **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` + required: true + schema: + type: string + + schemas: + ################################################ + ### REQUEST BODY SCHEMAS + ################################################ + + OrderDTO: + type: object + additionalProperties: false + properties: + recipient: + $ref: "#/components/schemas/Recipient" + locale: + $ref: "#/components/schemas/Locale" + payment: + $ref: "#/components/schemas/Payment" + + Recipient: + oneOf: + - type: object + title: Email + properties: + email: + type: string + format: email + required: + - email + additionalProperties: false + description: >- + Recipient of the items being purchased. Crossmint will create a custodial wallet address for + the user on the fly, that they can later log in to. If no recipient + is passed, an order will be created with the status + 'requires-recipient', until you pass one. + - type: object + title: Wallet + properties: + walletAddress: + type: string + required: + - walletAddress + additionalProperties: false + description: >- + Recipient of the items being purchased. If specifying a recipient by wallet address, + ensure the address is valid for the chain your **collection** is on, + which may differ from the chain the payment is performed on. + Locale: + default: en-US + type: string + enum: + - en-US + - es-ES + - fr-FR + - it-IT + - ko-KR + - pt-PT + - ja-JP + - zh-CN + - zh-TW + - de-DE + - ru-RU + - tr-TR + - uk-UA + - th-TH + - vi-VN + - Klingon + example: en-US + description: >- + Locale for the checkout, in IETF BCP 47. It impacts the email + receipt language. Ensure your UI is set to the same language as + specified here. Throws an error if passed an invalid language. + + Payment: + discriminator: + propertyName: method + oneOf: + - type: object + title: EVM + additionalProperties: false + properties: + receiptEmail: + type: string + format: email + description: Email that the receipt will be sent to. + method: + type: string + enum: + - arbitrum-sepolia + - base-sepolia + - ethereum-sepolia + - optimism-sepolia + - arbitrum + - bsc + - ethereum + - optimism + currency: + type: string + enum: + - eth + - usdc + - degen + - brett + - toshi + payerAddress: + type: string + pattern: ^0x[0-9a-fA-F]{40}$ + description: An EVM wallet address. + required: + - method + - currency + - type: object + title: Solana + additionalProperties: false + properties: + receiptEmail: + type: string + format: email + description: Email that the receipt will be sent to. + method: + type: string + enum: + - solana + currency: + type: string + enum: + - sol + - usdc + - bonk + - wif + - mother + payerAddress: + type: string + pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ + description: A Solana public key. + required: + - method + - currency + - type: object + title: Fiat + additionalProperties: false + properties: + receiptEmail: + type: string + format: email + description: Email that the receipt will be sent to. + method: + type: string + enum: + - stripe-payment-element + currency: + default: usd + type: string + enum: + - usd + - eur + - aud + - gbp + - jpy + - sgd + - hkd + - krw + - inr + - vnd + required: + - method + LineItems: + oneOf: + - type: object + title: Single Line Item + additionalProperties: false + properties: + collectionLocator: + description: >- + The collection locator of the line item. For example: + 'crossmint:'. These fields can be retrieved + from the Crossmint console. + type: string + example: crossmint: + callData: + type: object + additionalProperties: {} + description: Information that you pass to your contract mint function. + properties: + totalPrice: + description: >- + The total price of the line item. It must be the same as the + contract expects to receive. Read + https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig + type: string + required: + - collectionLocator + - type: array + title: Multiple Line Items + items: + type: object + additionalProperties: false + properties: + collectionLocator: + description: >- + The collection locator of the line item. Eg. + 'crossmint::', + 'crossmint:'. These fields can be retrieved + from the Crossmint console. + type: string + callData: + type: object + additionalProperties: {} + description: Information that you pass to your contract mint function. + properties: + totalPrice: + description: >- + The total price of the line item. It must be the same as + the contract expects to receive. Read + https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig + type: string + required: + - collectionLocator + + ################################################ + ### RESPONSE OBJECTS + ################################################ + + CreateOrderResponse: + type: object + properties: + clientSecret: + type: string + description: >- + A token exclusively scoped to a particular order, allowing for the reading or updating of that order. + example: "_removed_" + order: + $ref: "#/components/schemas/OrderObject" + + OrderObject: + type: object + properties: + orderId: + type: string + example: "b2959ca5-65e4-466a-bd26-1bd05cb4f837" + phase: + type: string + example: "payment" + locale: + type: string + example: "en-US" + lineItems: + type: array + items: + type: object + properties: + chain: + type: string + example: "polygon-amoy" + quantity: + type: number + example: 1 + callData: + type: object + properties: + quantity: + type: number + example: 1 + ADDITIONAL_PROPERTIES: + type: string + example: "Your other mint function arguments" + metadata: + type: object + properties: + name: + type: string + example: "Headless Checkout Demo" + description: + type: string + example: "NFT Description" + imageUrl: + type: string + example: "https://cdn.io/image.png" + quote: + type: object + properties: + status: + type: string + example: "valid" + charges: + type: object + properties: + unit: + type: object + properties: + amount: + type: string + example: "0.0001" + currency: + type: string + example: "eth" + totalPrice: + type: object + properties: + amount: + type: string + example: "0.0001" + currency: + type: string + example: "eth" + delivery: + type: object + properties: + status: + type: string + example: "awaiting-payment" + recipient: + type: object + properties: + locator: + type: string + example: "email::" + email: + type: string + example: "testy@crossmint.com" + walletAddress: + type: string + example: "0x1234abcd..." + quote: + type: object + properties: + status: + type: string + example: "valid" + quotedAt: + type: string + example: "2024-06-07T16:55:44.653Z" + expiresAt: + type: string + example: "2024-06-07T17:55:44.653Z" + totalPrice: + type: object + properties: + amount: + type: string + example: "0.0001375741" + currency: + type: string + example: "eth" + payment: + type: object + properties: + status: + type: string + example: "awaiting-payment" + method: + type: string + example: "base-sepolia" + currency: + type: string + example: "eth" + preparation: + type: object + properties: + chain: + type: string + example: "base-sepolia" + payerAddress: + type: string + example: "0x1234abcd..." + serializedTransaction: + type: string + example: "0x02f90....." + + Error400Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Invalid arguments or empty parameter ." + + Error403Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: Malformed API key. / API key provided doesn't have required scopes. + + Error404Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Not found" + + Error503Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Please try again in a few minutes. If the issue still persists, contact Crossmint support." + + Error524Response: + x-fern-type-name: TimeoutResponse + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "A timeout occurred." diff --git a/fern/apis/headless/generators.yml b/fern/apis/headless/generators.yml new file mode 100644 index 0000000..282243f --- /dev/null +++ b/fern/apis/headless/generators.yml @@ -0,0 +1 @@ +openapi: ./HeadlessAPIs.yaml \ No newline at end of file diff --git a/fern/apis/minting/MintingAPIs.yaml b/fern/apis/minting/MintingAPIs.yaml new file mode 100644 index 0000000..903b020 --- /dev/null +++ b/fern/apis/minting/MintingAPIs.yaml @@ -0,0 +1,2776 @@ +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +security: + - apiKey: [] +info: + description: N/A + version: 1.0.0 + title: NFT Minting + contact: + name: Crossmint NFT Minting APIs + url: https://www.crossmint.com + email: support@crossmint.io + +paths: + ################################################ + ### MINTING + ################################################ + + /2022-06-09/collections/{collectionId}/nfts/: + # BATCH MINT NFTS + post: + summary: Batch Mint NFTs + description: | + Mint multiple NFTs with a single call and deliver them to a web3 wallet or an email address + + **API scope required** `nfts.create` + operationId: batch-mint-nft + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - nfts + properties: + nfts: + type: array + description: Array of objects describing the NFTs to mint to recipients. + items: + additionalProperties: false + type: object + properties: + recipient: + $ref: "#/components/schemas/Recipient" + metadata: + $ref: "#/components/schemas/NFTMetadataOptions" + compressed: + $ref: "#/components/schemas/Compressed" + id: + type: string + description: "**Optional** The idempotent identifier for the NFT" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/BatchMintResponse" + 400: + description: Invalid arguments, please make sure you're following the API specification. + content: + application/json: + schema: + $ref: "#/components/schemas/BatchError" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 503: + description: | + Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /2022-06-09/collections/{collectionId}/nfts: + # MINT NFT + post: + summary: Mint NFT + description: | + Mint your NFTs and deliver them to a web3 wallet or an email address + + **API scope required**: `nfts.create` + operationId: mint-nft + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - recipient + properties: + recipient: + $ref: "#/components/schemas/Recipient" + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + compressed: + $ref: "#/components/schemas/Compressed" + anyOf: + - title: Metadata + type: object + required: [metadata] + properties: + metadata: + $ref: "#/components/schemas/NFTMetadataOptions" + - title: Template Id + type: object + required: [templateId] + properties: + templateId: + type: string + responses: + 200: + description: Success. + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/MintResponseSolana200" + - $ref: "#/components/schemas/MintResponseEVM200" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # GET ALL NFTs + get: + summary: Get All NFTs + description: | + Get a list of all the NFTs in a given collection. + + **API scope required**: `nfts.read` + operationId: mint-status-list + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" + responses: + 200: + description: Success. Returns an array of objects describing the NFTs minted from this collection. + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/NFTObjectEVM" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + /2022-06-09/collections/{collectionId}/sfts: + # MINT SFT + post: + summary: Mint SFT + description: | + Mint your SFTs and deliver them to a web3 wallet or an email address + + **API scope required**: `nfts.create` + operationId: mint-sft + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/idempotencyKeyHeader" + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - templateId + - recipient + properties: + templateId: + type: string + description: Identifier of the template + example: silver-pass + recipient: + $ref: "#/components/schemas/Recipient" + amount: + type: integer + description: (Optional) Amount to mint + example: 10 + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + example: a91c15e3-60f2-4a45-bf1a-cee508981667 + action: + type: string + example: nfts.create + status: + type: string + example: pending + data: + type: object + properties: + chain: + type: string + example: polygon + collection: + type: object + properties: + id: + type: string + example: 84e3d617-9c1b-4e7a-9686-522a9ea7c520 + contractAddress: + type: string + example: 0x9b8ab8949bd7E73E61945b88F7fe12151f98ad3C + recipient: + type: object + properties: + walletAddress: + type: string + example: 0xcFDc00Cf926A5053f9Cdf004e6DF17e6dEB2E146 + email: + type: string + example: testy@crossmint.io + token: + type: object + properties: + id: + type: string + example: a91c15e3-60f2-4a45-bf1a-cee508981667 + startedAt: + type: string + example: 2024-01-02T22:05:01.000Z + resource: + type: string + example: https://staging.crossmint.com/api/2022-06-09/actions/a91c15e3-60f2-4a45-bf1a-cee508981667 + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + /2022-06-09/collections/{collectionId}/nfts/{id}: + # MINT STATUS + get: + summary: Mint Status + description: | + Get the status and associated information for a mint operation. + + **API scope required**: `nfts.read` + operationId: mint-status + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/nftId" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/MintStatusSolana200" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # EDIT NFT + patch: + summary: Edit NFT + description: | + Edit a minted NFT's metadata on IPFS. + + If you are using a custom baseURI, invoking this will overwrite the specific tokenURI for the edited token. + + **API scope required**: `nfts.update` + operationId: edit-nft + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/nftId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - recipient + - metadata + properties: + metadata: + $ref: "#/components/schemas/NFTMetadataOptions" + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + responses: + 200: + description: The NFT metadata update action has been successfully been created. + content: + application/json: + schema: + $ref: "#/components/schemas/EditNFTResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # MINT NFT IDEMPOTENT + put: + summary: Mint NFT with ID + description: | + This pathway allows you to mint NFTs and guarantee idempotency + to ensure you never double mint for the same NFT. + + **API scope required**: `nfts.create` + operationId: mint-nft-idempotent + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + - name: id + in: path + description: Custom ID of the NFT, which is used as an idempotency key + required: true + example: default + schema: + type: string + example: my-idempotency-key + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + recipient: + $ref: "#/components/schemas/Recipient" + metadata: + $ref: "#/components/schemas/NFTMetadataOptions" + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + compressed: + $ref: "#/components/schemas/Compressed" + required: + - recipient + - metadata + responses: + 200: + description: The request has been accepted. + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/MintResponseSolana200" + - $ref: "#/components/schemas/MintResponseSolana200Subsequent" + - $ref: "#/components/schemas/MintResponseEVM200" + - $ref: "#/components/schemas/MintResponseEVM200Subsequent" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # BURN NFT + delete: + summary: Burn NFT + description: | + Burn a minted NFT. + + **API scope required**: `nfts.delete` + operationId: burn-nft + tags: + - NFTs + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/nftId" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/BurnNFTResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + ################################################ + ### NFT By Locator + ################################################ + + /v1-alpha1/nfts/{locator}: + # EDIT NFT BY LOCATOR + patch: + summary: Edit NFT by Locator + description: | + Edit a minted NFT's metadata using a Crossmint NFT locator. + + **API scope required**: `nfts.update` + operationId: edit-nft-by-locator + tags: + - NFTs + parameters: + - name: locator + in: path + description: The locator of the NFT, which includes the blockchain, contract address, and token ID. + required: true + schema: + type: string + example: "polygon:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045:52" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - metadata + - reuploadLinkedFiles + properties: + metadata: + $ref: "#/components/schemas/NFTMetadata" + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/EditNFTResponse" + 400: + description: Invalid Locator or Collection Type + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "The specified NFT locator is invalid. See the valid format on https://docs.crossmint.com/api-reference/." + 403: + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Couldn't find Crossmint managed NFT {locator}" + 501: + description: Not Implemented + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Currently, only EVM Locators are supported for this route." + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # BURN NFT + delete: + summary: Burn NFT by Locator + description: | + Burn a minted NFT using a Crossmint NFT locator. + + **API scope required**: `nfts.delete` + operationId: burn-nft-by-locator + tags: + - NFTs + parameters: + - name: locator + in: path + description: The locator of the NFT, which includes the blockchain, contract address, and token ID. + required: true + schema: + type: string + example: "polygon:0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045:52" + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/BurnNFTResponse" + 400: + description: Invalid Locator or Collection Type + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "The specified NFT locator is invalid. See the valid format on https://docs.crossmint.com/api-reference/." + 403: + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Couldn't find Crossmint managed NFT {locator}" + 501: + description: Not Implemented + content: + application/json: + schema: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Currently, only EVM Locators are supported for this route." + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + ################################################ + ### COLLECTIONS + ################################################ + + /2022-06-09/collections/: + # GET ALL COLLECTIONS + get: + summary: Get All Collections + description: | + List all collections created under the current Crossmint project + + **API scope required**: `collections.read` + operationId: list-collections + tags: + - NFT Collections + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + results: + type: array + items: + $ref: "#/components/schemas/GetCollectionResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # CREATE COLLECTION + post: + tags: + - NFT Collections + operationId: create-collection + summary: Create Collection + description: | + Create a collection that you can mint NFTs/SFTs from + + **API scope required**: `collections.create` + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCollectionBody" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCollectionResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + /2022-06-09/collections/{collectionId}: + # CREATE COLLECTION IDEMPOTENT + put: + summary: Create Collection with ID + description: | + Create a collection that you can mint NFTs/SFTs from. This API is idempotent, + if you call it multiple times with the same ID, only one will be created. + + **API scope required**: `collections.create` + operationId: create-collection-custom + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCollectionBody" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/CreateCollectionResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # UPDATE COLLECTION INFO + patch: + summary: Update Collection Info + description: | + Update the sales details of a collection + + **API scope required**: `collections.update` + operationId: update-collection + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + supplyLimit: + type: number + description: "The maximum number of NFTs that can be minted for this collection" + payments: + $ref: "#/components/schemas/PaymentsObject" + responses: + 200: + description: A JSON object containing transactionId and status + content: + application/json: + schema: + $ref: "#/components/schemas/UpdateCollectionResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # GET COLLECTION INFO + get: + summary: Get Collection Info + description: | + Get information about a specific collection. + + **API scope required**: `collections.read` + operationId: collection-info + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + responses: + 200: + description: Success. + content: + application/json: + schema: + $ref: "#/components/schemas/GetCollectionResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + "/v1-alpha1/minting/collections/{collectionId}/royalties": + # GET ROYALTIES CONFIG + get: + summary: Get Royalties Config + description: | + Fetch the royalty configuration for a collection, from its current state + in the blockchain. + + This API is only supported on EVM chains. + + If you call GET too soon after PUT/DELETE, + you may not yet see your latest changes, as they can take a few seconds to + record on the blockchain. + + **API scope required**: `collections.read` + operationId: get-royalty-information + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + recipients: + type: array + items: + type: object + properties: + address: + type: string + description: Recipient address. e.g., 0x71C... + example: 0x71C... + basisPoints: + type: integer + description: | + A basis point is a standard measure for percentages in finance. One basis point equals 1/100th of 1%, or 0.01%. + example: 100 + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # SET ROYALTIES + put: + summary: Set Royalties + description: | + Configure royalties for all NFTs in a collection. + + This API is only supported for EVM chains and implements the EIP-2981 standard. + + **API scope required**: `collections.update` + operationId: edit-royalty-information + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + recipients: + description: "List of royalty recipients. Note: EVM collections only support a single recipient. Use a contract splitter as recipient in order to send payments to multiple addresses." + type: array + items: + type: object + additionalProperties: false + properties: + address: + type: string + description: | + Address where the payments will be received. + Note: ENS addresses are not supported. + example: 0x71C... + basisPoints: + type: integer + description: | + Percentage of the sale price that will go to the recipient address. A basis point is a standard measure for percentages in finance. One basis point equals 1/100th of 1%, or 0.01%. + example: 100 + required: + - basisPoints + - recipient + responses: + 204: + description: No-content success response indicating that the request is being processed. + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 409: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/MintAPIFeatureCollectionNotDeployed" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # REMOVE ROYALTIES + delete: + summary: Remove Royalties + description: | + Remove all royalties from a given collection. No new NFT sales will yield royalties to the creator. + + This API is only supported on EVM Chains. + + **API scope required**: `collections.update` + operationId: disable-royalty-information + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + responses: + 204: + description: No-content success response indicating that the request is being processed. + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + "/v1-alpha1/minting/collections/{collectionId}/base-uri": + # GET BASE URI + get: + summary: Get Base URI + description: | + Get the Base URI of a collection as it appears on-chain. + + **API scope required**: `collections.read` + operationId: get-base-uri + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + responses: + 200: + description: Base URI of a collection as it appears on-chain + content: + application/json: + schema: + type: object + properties: + uri: + type: string + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - title: OutdatedContract + type: object + properties: + message: + type: string + example: Setting the base URI is not supported on contracts deployed before 06/09/2023 + - title: OldCollection + type: object + properties: + message: + type: string + example: Setting the base URI is not supported on contracts deployed before 06/09/2023 + - title: SolanaNotSupported + type: object + properties: + message: + type: string + example: Getting the base URI is not yet available on Solana + - title: ExternalCollection + type: object + properties: + message: + type: string + example: Getting the base URI is not available on external collections + - title: SFTCollection + type: object + properties: + message: + type: string + example: Setting the base URI is not available on SFT collections + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # SET BASE URI + put: + summary: "Set Base URI" + description: | + Update the Base URI of a collection. Setting the baseURI enables + excluding the metadata param when minting. Tokens minted without the metadata + param will have a tokenURI of: + + `{BASE_URI}/{TOKEN_ID}` + + This API is currently only supported on EVM Chains. + + **API scope required**: `collections.update` + operationId: set-base-uri + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + uri: + type: string + description: The new Base URI + example: https://www.example.com + responses: + 204: + description: | + No-content success response indicating that the request is being processed + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 409: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/MintAPIFeatureCollectionNotDeployed" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + /v1-alpha1/minting/collections/{collectionId}/transferable: + # GET TRANSFERABILITY STATUS + get: + summary: Get Transferability + description: | + Get the transferable status of a collection. + + This API is only supported on EVM chains. + + You must contact sales to gain access to this API. + + **API scope required**: `collections.read` + operationId: get-transferability + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + value: + type: boolean + example: true + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # SET TRANSFERABILITY STATUS + put: + summary: Set Transferability + description: | + Update the transferable status of a collection. + + This API is only supported on EVM chains. + You must contact sales to gain access to this API. + + **API scope required**: `collections.update` + operationId: set-transferability + tags: + - NFT Collections + parameters: + - $ref: "#/components/parameters/collectionId" + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + required: + - value + properties: + value: + type: boolean + description: Toggles the transferability of NFTs within the collection. Set to `false` to disable transfers. + example: true + responses: + 204: + description: Success + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 409: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/MintAPIFeatureCollectionNotDeployed" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + ################################################ + ### TEMPLATES + ################################################ + + /2022-06-09/collections/{collectionId}/templates: + # GET ALL TEMPLATES + get: + summary: Get All Templates + description: | + Get all of the templates for a collection + + **API scope required**: `nfts.read` + operationId: get-all-templates + tags: + - NFT Templates + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/page" + - $ref: "#/components/parameters/perPage" + responses: + 200: + description: success + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/TemplateResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # CREATE TEMPLATE + post: + summary: Create Template + description: | + Create a token template, that NFTs or SFTs may be minted from + + **API scope required**: `nfts.create` + operationId: create-template + tags: + - NFT Templates + parameters: + - name: collectionId + in: path + description: The ID of the named collection, used to create new tokens + required: true + schema: + type: string + example: idempotent-collection-name + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTemplateBody" + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/TemplateResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 409: + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/409Response" + 424: + description: Failed Dependency + content: + application/json: + schema: + $ref: "#/components/schemas/424Response" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + /2022-06-09/collections/{collectionId}/templates/{templateId}: + # GET TEMPLATE + get: + summary: Get Template + description: | + Fetch the contents of a token template. + + **API scope required**: `nfts.read` + operationId: get-template + tags: + - NFT Templates + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/templateId" + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/TemplateResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # CREATE TEMPLATE IDEMPOTENT + put: + summary: Create Template with ID + description: | + Create a token template with preconfigured metadata + + **API scope required**: `nfts.create` + operationId: create-template-idempotent + tags: + - NFT Templates + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/templateId" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateTemplateBody" + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/TemplateResponse" + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 409: + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/409Response" + 424: + description: Failed Dependency + content: + application/json: + schema: + $ref: "#/components/schemas/424Response" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # EDIT TEMPLATE + patch: + summary: Edit Template + description: | + Edit a Token template. + + **API scope required**: `nfts.update` + operationId: edit-template + tags: + - NFT Templates + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/templateId" + requestBody: + content: + application/json: + schema: + oneOf: + - title: Metadata Update + $ref: "#/components/schemas/Metadata" + - title: Supply Update + $ref: "#/components/schemas/Supply" + responses: + 204: + description: Success + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Service unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + # DELETE TEMPLATE + delete: + summary: Delete Template + description: | + Delete a Token template. + + **API scope required**: `nfts.delete` + operationId: delete-template + tags: + - NFT Templates + parameters: + - $ref: "#/components/parameters/collectionId" + - $ref: "#/components/parameters/templateId" + responses: + 200: + description: Success. + 400: + description: Invalid arguments, please make sure you're following the api specification. + content: + application/json: + schema: + $ref: "#/components/schemas/Error400Response" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + content: + application/json: + schema: + $ref: "#/components/schemas/Error503Response" + + ################################################ + ### ACTIONS + ################################################ + + /2022-06-09/actions/{actionId}: + # GET ACTION STATUS + get: + summary: Get Action Status + description: | + Use this API to poll for the status of asynchonous actions such as NFT mints, transfers, etc. + + **API scope required**: `nfts.create` + operationId: get-action-status + tags: + - Actions + parameters: + - name: actionId + in: path + description: The actionId. + required: true + schema: + type: string + responses: + 200: + description: Success + content: + application/json: + schema: + type: object + properties: + actionId: + type: string + format: uuid + example: "66881a4d-eff9-467a-b19d-a2ff76eef5c2" + action: + type: string + example: "nfts.create" + status: + type: string + example: "pending" + data: + type: object + properties: + collection: + type: object + properties: + id: + type: string + example: "someCollection" + contractAddress: + type: string + example: "0x0B7c736cD6D517b6AFfB3F6151eC662B0000018B" + recipient: + type: object + properties: + walletAddress: + type: string + example: "0x6Def4FF2Efe3731EB2Ca09c625d21bfd6da00000" + token: + type: object + properties: + id: + type: string + example: "66881a4d-eff9-467a-b19d-a2ff76eef5c2" + startedAt: + type: string + format: date-time + example: "2023-10-02T22:10:41.000Z" + resource: + type: string + format: uri + example: "https://staging.crossmint.com/api/2022-06-09/actions/66881a4d-eff9-467a-b19d-a2ff76eef5c2" + 403: + description: Forbidden error, please ensure the credentials are correct. + content: + application/json: + schema: + $ref: "#/components/schemas/Error403Response" + 404: + description: Not found error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error404Response" + 524: + description: A timeout occurred. + content: + application/json: + schema: + $ref: "#/components/schemas/Error524Response" + +################################################ +### COMPONENTS +################################################ + +components: + securitySchemes: + apiKey: + type: apiKey + in: header + name: X-API-KEY + description: Obtained in the Crossmint developer console + + parameters: + collectionId: + name: collectionId + in: path + description: | + This is the identifier for the collection related to the request. Every project has default collections: `default-solana` and `default-polygon`. + + The [create-collection](/api-reference/minting/collection/create-collection) API will result in collections with UUID formatted `collectionId`. + **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` + + The [create-collection-idempotent](/api-reference/minting/collection/create-collection-idempotent) API allows you to specify an arbitrary identifier during the intitial request. + **Example:** `your-custom-identifer` + required: true + example: default-solana + schema: + type: string + + idempotencyKeyHeader: + name: x-idempotency-key + in: header + description: Unique identifier to prevent duplicate requests + schema: + type: string + + templateId: + name: templateId + in: path + description: The template ID + required: true + schema: + type: string + + nftId: + name: id + in: path + description: Unique ID of the minted NFT returned in the mint response + required: true + schema: + type: string + + page: + name: page + in: query + description: The page number you want to query, starting at 1 + required: true + example: 1 + schema: + type: number + + perPage: + name: perPage + in: query + description: How many items you want to be returned in the page. + schema: + type: number + example: 20 + + schemas: + ################################################ + ### REQUEST OBJECTS + ################################################ + + Recipient: + type: string + example: email:testy@crossmint.io:polygon + description: | + Allowed formats: + + `:
` or + + `email::` or + + `userId::` + + [see here for more info](/minting/advanced/specify-recipient) + + ReuploadLinkedFiles: + type: boolean + description: "Any URLs in the metadata object will be resolved and reuploaded to IPFS [Default: true]" + + Compressed: + type: boolean + description: | + **Solana only** Use NFT compression for cheaper mint costs [Default: true] + + PaymentsObject: + type: object + additionalProperties: false + description: "Enable payments for this collection by setting `price`, `recipientAddress` and `currency`" + properties: + price: + type: string + description: "The price of the token in native currency for the selected chain" + recipientAddress: + type: string + description: "The wallet address to receive payouts" + currency: + type: string + description: "The currency for the price of the NFT. Defaults to the native currency of the chain" + + + NFTMetadataOptions: + description: "Optional if [baseURI](/api-reference/minting/collection/set-base-uri) is set." + oneOf: + - title: "[EVM] Metadata Object" + $ref: "#/components/schemas/NFTMetadata" + - title: "[EVM] Metadata URL" + description: Enter a URL to a JSON file containing the metadata contents + type: string + example: https://bafkreici2rl4k4kvnag6gjykuzaaqznveg7bip4y6qx4ekwzukqul23xba.ipfs.nftstorage.link/ + - title: "[Solana] Metadata Object" + $ref: "#/components/schemas/NFTMetadataSolana" + - title: "[Solana] Metadata URL" + description: Enter a URL to a JSON file containing the metadata contents + type: object + additionalProperties: false + properties: + uri: + description: Enter a URL to a JSON file containing the metadata contents + type: string + example: https://bafkreiccjhsemz4jhunfnrw4icx2vqr5ms4ycx5v3ecqvb2uckkgqf5ep4.ipfs.nftstorage.link/ + name: + type: string + description: "The name of your NFT (Max length: 32)" + example: Solana Test NFT + maxLength: 32 + required: + - uri + - name + + NFTMetadata: + type: object + additionalProperties: false + required: + - name + - image + - description + properties: + name: + type: string + description: "The name of your NFT (Max length: 32)" + example: Crossmint Example NFT + maxLength: 32 + image: + type: string + description: Direct link to your NFT image + example: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + description: "A brief description of the NFT (Max length: 64)" + example: My NFT created via the mint API! + maxLength: 64 + animation_url: + type: string + example: "" + description: | + **EVM only** + + [See more info here](/minting/advanced/nft-metadata) + attributes: + type: array + description: "Add attributes to your NFT" + items: + type: object + additionalProperties: false + required: + - trait_type + - value + properties: + display_type: + type: string + description: Display name of your attribute + enum: + - boost_number + - boost_percentage + - number + trait_type: + type: string + description: The name of the trait + value: + type: string + description: The value of the trait + + NFTMetadataSolana: + type: object + additionalProperties: false + required: + - name + - image + - description + properties: + name: + type: string + description: "The name of your NFT (Max length: 32)" + example: Crossmint Example NFT + maxLength: 32 + image: + type: string + description: Direct link to your NFT image + example: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + description: "A brief description of the NFT (Max length: 64)" + example: My NFT created via the mint API! + maxLength: 64 + attributes: + type: array + description: "Add attributes to your NFT" + items: + type: object + additionalProperties: false + required: + - trait_type + - value + properties: + display_type: + type: string + description: Display name of your attribute + enum: + - boost_number + - boost_percentage + - number + trait_type: + type: string + description: The name of the trait + value: + type: string + description: The value of the trait + + CreateCollectionBody: + type: object + additionalProperties: false + properties: + chain: + description: Blockchain you would like to use for this collection + type: string + enum: + - aptos + - arbitrum + - arbitrum-sepolia + - astar-zkevm + - base + - base-sepolia + - bsc + #- bsc-testnet + - ethereum + - ethereum-sepolia + - optimism + - optimism-sepolia + - polygon + - polygon-amoy + - skale-nebula + - skale-nebula-testnet + - solana + - zkyoto + - zora + - zora-sepolia + metadata: + type: object + additionalProperties: false + required: + - name + - description + properties: + name: + type: string + description: "Collection name (Max length: 32)" + example: Sample NFT Collection + maxLength: 32 + imageUrl: + type: string + description: URL pointing to an image that represents the collection + example: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + description: A description of the NFT collection + example: This is a sample NFT collection + maxLength: 64 + symbol: + type: string + description: "**EVM only** NFT collection symbol" + example: XMINT + fungibility: + description: Whether or not this collection is fungible. Only EVM collections may be set as semi-fungible + type: string + enum: + - non-fungible + - semi-fungible + default: non-fungible + supplyLimit: + type: number + description: "The maximum number of tokens that can be minted for this collection" + payments: + $ref: "#/components/schemas/PaymentsObject" + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + required: + - chain + - metadata + + CreateTemplateBody: + type: object + additionalProperties: false + properties: + metadata: + description: See https://docs.crossmint.com/docs/metadata for more info + type: object + additionalProperties: false + properties: + name: + type: string + description: Template name + default: My template + image: + type: string + default: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + default: A new collection with its own dedicated smart contract + maxLength: 64 + onChain: + type: object + additionalProperties: false + description: On-chain details + properties: + tokenId: + type: string + description: The token ID. Only relevant for SFT (ERC-1155) collections. Leave empty for NFT/ERC-721 collections. + example: "1" + supply: + type: object + additionalProperties: false + description: Supply details + properties: + limit: + type: integer + description: Supply limit, Set to 1 for ERC721. + example: 10 + reuploadLinkedFiles: + $ref: "#/components/schemas/ReuploadLinkedFiles" + + Supply: + type: object + additionalProperties: false + properties: + supply: + type: object + additionalProperties: false + description: Supply details + properties: + limit: + type: integer + description: Supply limit. Set to 1 for ERC721. + example: 10 + Metadata: + type: object + additionalProperties: false + properties: + name: + type: string + description: Template name + default: My template + imageUrl: + type: string + default: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + default: A new collection with its own dedicated smart contract + maxLength: 64 + + ################################################ + ### RESPONSE OBJECTS + ################################################ + + EditNFTResponse: + type: object + properties: + actionId: + type: string + example: "d5e24c69-530d-4efd-9201-e6f9d6f647e2" + action: + type: string + example: "nfts.update" + status: + type: string + example: "pending OR succeeded" + data: + type: object + properties: + txId: + type: string + description: | + The onchain transaction ID related to the request. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 0x69cf6d971e6745f25f683db9c87663839be02bdaa4a70f0724f490d7335b0081" + chain: + type: string + example: "polygon" + collection: + type: object + properties: + id: + type: string + example: "c242dcdb-57a7-4944-af9f-2c1472fa70fb" + contractAddress: + type: string + example: "0xc0DeE392CBe1af5f8211A17EAffAA5c358C0fE6d" + token: + type: object + properties: + id: + type: string + example: "27db27cf-1596-4ab0-9826-a6740ffce61a" + owner: + type: object + properties: + walletAddress: + type: string + example: "0x0794f3aa4521d19273D775a08289110523D34DD4" + tokenId: + type: string + example: "1" + changes: + type: array + items: + type: string + example: ["metadata"] + startedAt: + type: string + format: date-time + example: "2024-03-08T00:10:59.000Z" + completedAt: + type: string + format: date-time + description: | + The time this operation completed in UTC. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 2024-03-08T00:11:01.000Z" + resource: + type: string + example: "https://staging.crossmint.com/api/2022-06-09/collections/c242dcdb-57a7-4944-af9f-2c1472fa70fb/nfts/d5e24c69-530d-4efd-9201-e6f9d6f647e2" + + MintResponseSolana200: + type: object + properties: + id: + type: string + onChain: + type: object + properties: + status: + type: string + chain: + type: string + actionId: + type: string + + MintResponseEVM200: + type: object + properties: + id: + type: string + onChain: + type: object + properties: + status: + type: string + chain: + type: string + contractAddress: + type: string + actionId: + type: string + + MintResponseSolana200Subsequent: + allOf: + - $ref: "#/components/schemas/NFTObjectSolana" + - type: object + properties: + actionId: + type: string + description: actionId for the request + + MintStatusSolana200: + allOf: + - $ref: "#/components/schemas/NFTObjectSolana" + - type: object + properties: + action: + type: string + description: URL to API endpoint for requesting status + example: https://staging.crossmint.com/api/2022-06-09/actions/ + + NFTObjectSolana: + type: object + properties: + id: + type: string + metadata: + type: object + properties: + name: + type: string + symbol: + type: string + seller_fee_basis_points: + type: integer + example: 0 + properties: + type: object + properties: + files: + type: array + items: + type: object + properties: + uri: + type: string + type: + type: string + category: + type: string + creators: + type: array + items: + type: object + properties: + address: + type: string + verified: + type: boolean + share: + type: integer + description: + type: string + image: + type: string + attributes: + type: array + items: + type: object + properties: + trait_type: + type: string + value: + type: string + onChain: + type: object + properties: + status: + type: string + example: success + mintHash: + type: string + txId: + type: string + owner: + type: string + chain: + type: string + example: solana + + MintResponseEVM200Subsequent: + allOf: + - $ref: "#/components/schemas/NFTObjectEVM" + - type: object + properties: + actionId: + type: string + description: actionId for the request + + NFTObjectEVM: + type: object + properties: + id: + type: string + metadata: + type: object + properties: + name: + type: string + image: + type: string + description: + type: string + onChain: + type: object + properties: + status: + type: string + tokenId: + type: string + owner: + type: string + txId: + type: string + contractAddress: + type: string + chain: + type: string + + CreateCollectionResponse: + type: object + properties: + id: + type: string + example: "5263650e-6d43-4ed3-9e31-0cf593d076a4" + metadata: + type: object + properties: + name: + type: string + example: "Test Collection" + description: + type: string + example: "Test" + imageUrl: + type: string + example: "https://cdn.io/metadata.json" + symbol: + type: string + example: "XMINT" + fungibility: + type: string + example: "semi-fungible" + onChain: + type: object + properties: + chain: + type: string + example: "polygon" + type: + type: string + example: "erc-1155" + actionId: + type: string + example: "5263650e-6d43-4ed3-9e31-0cf593d076a4" + + GetCollectionResponse: + type: object + properties: + id: + type: string + example: "bb691876-edb3-404c-af3e-c019b8e2ed2c" + metadata: + type: object + properties: + name: + type: string + example: "Test Collection" + description: + type: string + example: "Test" + imageUrl: + type: string + example: "ipfs://QmVocoiYXZLAtheEHV3VF8w4pa68bkPutT8cQZdMrrpzxh" + symbol: + type: string + example: "XMINT" + fungibility: + type: string + example: "non-fungible" + onChain: + type: object + properties: + chain: + type: string + example: "polygon" + type: + type: string + example: "erc-721" + contractAddress: + type: string + example: "0x9564bD85f3D5677D86244dDb06F06bbD22D9d0DB" + supplyLimit: + type: integer + example: 95 + payments: + type: object + properties: + price: + type: string + example: "0.001" + recipientAddress: + type: string + example: "0x6C3b3225759Cbda68F96378A9F0277B4374f9F06" + + UpdateCollectionResponse: + type: object + properties: + actionId: + type: string + example: "e9abb61c-9371-447e-af1a-86fb5c073754" + action: + type: string + example: "collections.update" + status: + type: string + example: "pending" + data: + type: object + properties: + chain: + type: string + example: "arbitrum" + collection: + type: object + properties: + id: + type: string + example: "42c43e55-f92d-4b25-bc99-d8309b6e1f38" + contractAddress: + type: string + example: "0x45ba91BCa91fA0D384022d3C279866811795FcF7" + changes: + type: array + items: + type: string + example: "supplyLimit" + startedAt: + type: string + format: date-time + example: "2023-12-30T00:06:56.000Z" + resource: + type: string + example: "https://staging.crossmint.com/api/2022-06-09/collections/" + + BurnNFTResponse: + type: object + properties: + actionId: + type: string + description: | + Can be used to check the status via the [action status API](/api-reference/common/get-action-status) + example: "201520fc-e0eb-4698-a2f3-c6b50cc7c894" + action: + type: string + description: The action performed, in this case `nfts.delete` + example: "nfts.delete" + status: + type: string + description: Current status of the async operation. One of `pending` or `succeeded` + example: "pending OR succeeded" + data: + type: object + properties: + chain: + type: string + description: Refer to the [supported chains](/introduction/supported-chains) page for more info + example: "polygon" + txId: + type: string + description: | + The onchain transaction ID related to the request. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 0x69cf6d971e6745f25f683db9c87663839be02bdaa4a70f0724f490d7335b0081" + collection: + type: object + properties: + id: + type: string + description: The Crossmint identifier for the collection. Either a UUID or custom string depending on how you create the collection. + example: "default-polygon" + contractAddress: + type: string + description: The on-chain contract address for the given collection. + example: "0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785" + token: + type: object + properties: + id: + type: string + description: The Crossmint identifier for the NFT. This will be a UUID. + example: "799a6f68-e2ea-4126-8577-4298dfcf900c" + tokenId: + type: string + description: The numeric tokenId of the NFT in the contract. + example: "7" + startedAt: + type: string + format: date-time + description: The time this operation was initiated in UTC. + example: "2024-01-10T23:01:45.000Z" + completedAt: + type: string + format: date-time + description: | + The time this operation completed in UTC. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 2024-01-10T23:02:00.000Z" + resource: + type: string + description: The URL path to obtain current status with [action status api](/api-reference/common/get-action-status) + example: "https://staging.crossmint.com/api/2022-06-09/collections/default-polygon/nfts/201520fc-e0eb-4698-a2f3-c6b50cc7c894" + + TemplateResponse: + type: object + properties: + templateId: + type: string + format: uuid + example: "20ed0963-0185-49af-b4a0-2de3169bb367" + metadata: + type: object + properties: + name: + type: string + example: My Token + image: + type: string + example: https://cdn.io/image.png + description: + type: string + example: Sample Token Template + onChain: + type: object + properties: + tokenId: + type: integer + example: 1 + supply: + type: object + properties: + limit: + type: integer + example: 1 + minted: + type: integer + example: 0 + + BatchMintResponse: + type: object + properties: + results: + type: array + items: + $ref: "#/components/schemas/MintResponseEVM200" + required: + - results + + Error400Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Invalid arguments or empty parameter ." + + Error403Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: Malformed API key. / API key provided doesn't have required scopes. + + Error404Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Not found" + + 409Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Already exists" + + 424Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Couldn't fetch metadata from the URI defined on the template: . Ensure this URI is available and publicly accessible." + + Error503Response: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Please try again in a few minutes. If the issue still persists, contact Crossmint support." + + Error524Response: + x-fern-type-name: TimeoutResponse + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "A timeout occurred." + + MintAPIFeatureCollectionNotDeployed: + type: object + properties: + error: + type: boolean + example: true + message: + type: string + example: "Collection is not yet deployed. Please try again in a moment." + + Error: + type: object + properties: + error: + type: boolean + message: + type: string + + ValidationError: + type: object + properties: + index: + type: integer + description: The index of the NFT that caused the validation error. + id: + type: string + description: The idempotent identifier for the NFT, if available. + message: + type: string + description: The validation error message. + + BatchError: + type: object + properties: + error: + type: boolean + message: + type: string + validationErrors: + type: array + items: + $ref: "#/components/schemas/ValidationError" + description: A list of specific validation errors. diff --git a/fern/apis/minting/generators.yml b/fern/apis/minting/generators.yml new file mode 100644 index 0000000..a0c8f35 --- /dev/null +++ b/fern/apis/minting/generators.yml @@ -0,0 +1 @@ +openapi: ./MintingAPIs.yaml \ No newline at end of file diff --git a/fern/apis/payments/PaymentsAPIs.yaml b/fern/apis/payments/PaymentsAPIs.yaml new file mode 100644 index 0000000..462107b --- /dev/null +++ b/fern/apis/payments/PaymentsAPIs.yaml @@ -0,0 +1,605 @@ +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +info: + description: | + N/A + version: 1.0.0 + title: NFT Checkout + contact: + name: Crossmint NFT Checkout APIs + url: "https://www.crossmint.com" + email: support@crossmint.io +tags: + - name: metadata + description: Find out about the data sets + - name: search + description: Search a data set +paths: + /v1-alpha1/collections: # Register collection + post: + responses: + "200": + description: "Success." + "400": + description: "Bad request." + tags: + - Registration + summary: Register NFT Collection + description: | + Register your NFT collection with Crossmint + + **This API is subject to change as it is currently in its alpha form.** + operationId: register-nft-collection + security: + - apiKey: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + chain: + type: string + description: "Crypto chain your NFT is on" + enum: + - solana + - ethereum + - polygon + - bsc + default: solana + contractType: + type: string + description: "The type of your contract." + enum: + - candy-machine + - erc-721 + - erc-1155 + - thirdweb-drop + default: erc-721 + args: + oneOf: + - title: "Candy Machine" + type: object + required: + - candyMachineId + properties: + candyMachineId: + type: string + description: "Candy machine ID" + - title: "EVM" + type: object + required: + - contractAddress + - abi + - mintFunctionName + - toParamName + - contractType + properties: + contractAddress: + type: string + abi: + type: string + items: + type: object + mintFunctionName: + type: string + example: "crossmint(address,uint256)" + toParamName: + type: string + description: "The name of the `to` parameter in the mint function" + quantityParamName: + type: string + metadata: + type: object + required: + - title + - description + - imageUrl + properties: + title: + type: string + description: "Collection title" + description: + type: string + description: "Description of your collection" + imageUrl: + type: string + description: "Image url" + social: + type: object + properties: + twitter: + type: string + description: "A link to your twitter page" + discord: + type: string + description: "An invite link to your discord server" + ownership: + type: string + description: "Ownership of the collection" + enum: + - external + - self + category: + type: string + description: "Verification category" + enum: + - loyalty + - art + - music + - gaming + - ticketing + - charity + - other + scopes: + type: array + items: + type: string + enum: + - payments:credit-card + - payments:cross-chain + required: + - chain + - contractType + - args + - metadata + - ownership + - category + - scopes + put: + responses: + "200": + description: "Success." + "400": + description: "Bad request." + tags: + - Registration + summary: Update Your Collection + description: | + Update your collection information registered on Crossmint + + **This API is subject to change as it is currently in its alpha form.** + operationId: update-nft-collection + security: + - apiKey: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + clientId: + type: string + metadata: + type: object + required: + - title + - imageUrl + properties: + title: + type: string + imageUrl: + type: string + social: + type: object + properties: + twitter: + type: string + description: "A link to your twitter page" + discord: + type: string + description: "An invite link to your discord server" + required: + - clientId + - metadata + /v1-alpha1/checkout/mint: # Checkout a mint + post: + responses: + 200: + description: Checkout url generated + content: + application/json: + schema: + $ref: "#/components/schemas/CheckoutMintSuccess" + 400: + description: | + ### Bad request. + #### This may be for a number of Crossmint compatibility reasons: + • One or more of the provided parameters is missing, incorrect, or in an invalid format + • The `clientId` does not exist + • Minting is unavailable because the collection is disabled + • Minting is unavailable because the developer and/or project has not verified their identity + • Attempting to mint directly into a wallet for an ERC1155 contract. Currently, this is not supported + • The collection is configured improperly for the given contract. An example of this may be that parameters to the mint function in your contract are not specified properly + + #### Or any number of reasons with respect to the minting contract, not limited to: + • The user/wallet is not whitelisted + • The mint is sold out + • The mint has not yet gone live + • The mint period has ended + • The mint limit has been reached for the given user/wallet + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. This may mean either: + • The API key may not exist, or does not have the proper scopes to perform this action (`nfts.checkout`), or + • The `clientId` for the collection is not registered under the same project as the API key. + tags: + - Checkout + summary: Generate Checkout Link + description: "**API scope required**: `nfts.checkout` + Begin the checkout process for a mint + + **This API is subject to change as it is currently in its alpha form.**" + operationId: checkout-mint + security: + - apiKey: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + clientId: + type: string + description: "The clientId of a previously created collection" + userId: + type: string + description: "The userId of a previously created wallet" + emailTo: + type: string + description: "Target email" + mintTo: + type: string + description: "Crypto address to mint the NFT to" + paymentMethod: + type: string + description: "Payment method" + listingId: + type: string + collection: + type: object + properties: + title: + type: string + description: "Collection title" + description: + type: string + description: "Collection description" + photo: + type: string + description: "Photo url" + required: + - title + - description + - photo + redirect: + type: object + properties: + continue: + type: string + cancel: + type: string + mintConfig: + type: object + properties: + totalPrice: + type: string + whPassThroughArgs: + type: string + description: "Any arguments to included in the webhook status updates" + required: + - clientId + - userId + /v1-alpha1/quote: # get quote + get: + responses: + "200": + description: "Success." + content: + application/json: + schema: + $ref: "#/components/schemas/QuoteResponse" + "400": + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/ErrorMsg" + tags: + - Quote Price + summary: Quote Transaction with Fees + description: | + Get the price of a transaction hosted through Crossmint, inclusive of all fees. + + **This API is subject to change as it is currently in its alpha form.** + operationId: quote + security: + - clientId: [] + parameters: + - name: nativePrice + in: query + description: | + Price in specified chain currency to quote. + The chain is derived from the chain your collection is on. + If your chain is on the Solana network, the parameter would be the SOL amount, not Lamports. + required: true + example: 1 + schema: + type: string + - name: quoteCurrency + in: query + description: "Price in specified currency to quote" + required: true + example: usd + schema: + type: string + default: "usd" + enum: + - usd + - eur + - gbp + - aud + - sgd + - hkd + - krw + - inr + - vnd + - jpy +components: + securitySchemes: + apiKey: + type: apiKey + name: X-API-KEY + in: header + clientId: + type: apiKey + in: header + name: X-CLIENT-ID + schemas: + QuoteResponse: + type: object + properties: + currency: + type: string + example: "usd" + price: + type: number + example: 1.23 + Checkout: + required: + - clientId + type: object + properties: + clientId: + type: string + description: "Your Crossmint Developer Client ID, found in the developer console: https://crossmint.com/console/collections" + example: 085f0f5a-9948-11ec-b909-0242ac120002 + collection: + $ref: "#/components/schemas/Collection" + redirect: + $ref: "#/components/schemas/Redirect" + mintConfig: + $ref: "#/components/schemas/MintConfig" + emailTo: + type: string + description: The email address for mint confirmation + example: austin+test@paella.dev + mintTo: + type: string + description: A wallet address to mint the NFT to + example: YKQC3F2FUMexJUaje2suibPNhen2e9Pix1C2f9q7BHY + paymentMethod: + type: string + description: The payment method, either `"fiat"` or `"ETH"` + default: fiat + whPassThroughArgs: + type: object + description: Any arguments to included in the webhook status updates + example: + referralCode: "123" + listingId: + type: string + description: The listing ID in a marketplace. Most contracts will not use this + Collection: + type: object + description: Information about your collection, to be displayed on the checkout page. + properties: + title: + type: string + description: The title of your collection + example: A great collection + description: + type: string + description: A description for your collection + example: This is a fantastic collection of NFTs + photo: + type: string + description: Full URL to an image for your collection. + example: https://i.picsum.photos/id/542/200/300.jpg?hmac=qD8M4ejDPlEc69pGT21BzB7CDiWOcElb_Ke7V8POjm8 + MintConfig: + type: object + description: Arguments sent to your smart contract + properties: + totalPrice: + type: string + example: "0.08" + "...": + type: object + description: Any custom arguments to your minting function should be configured here. + MintStatus: + type: object + properties: + status: + type: string + description: The latest status of the mint + example: success + enum: + - minting + - success + - error + mintAddress: + type: string + description: The address of the mint + example: B1nQxDxmQTfRbXK4Cv1HtEmXKNqTXHEDiD251p9RCR7Q + walletAddress: + type: string + description: The wallet address the NFT is minted to + example: YKQC3F2FUMexJUaje2suibPNhen2e9Pix1C2f9q7BHY + passThroughArgs: + type: string + description: The arguments you sent via the `whPassThroughArgs` from `/checkout/mint` + example: '{"referralCode":"123"}' + NFT: + type: object + properties: + name: + type: string + symbol: + type: string + description: + type: string + image: + type: string + description: A url that represents the image for the NFT + collection: + type: object + properties: + name: + type: string + family: + type: string + attributes: + type: array + items: + type: object + properties: + traitType: + type: string + value: + anyOf: + - type: string + - type: number + - type: object + - type: array + items: {} + properties: + type: object + properties: + category: + type: string + creators: + type: array + items: + type: object + properties: + address: + type: string + share: + type: number + files: + type: array + items: + type: object + properties: + uri: + type: string + type: + type: string + mintHash: + type: string + seller_fee_basis_points: + type: number + Redirect: + type: object + description: The URLs to redirect the user to upon comletion or cancellation of the checkout page. + properties: + continue: + type: string + description: The URL to redirect the customer to when the customer's payment information is accepted. + cancel: + type: string + description: The URL to redirect the customer cancels the payment. + Transfer: + type: object + required: [chain, fromAddress, toAddress, tokenMintAddress] + properties: + chain: + type: string + enum: + - solana + - ethereum + - polygon + - bsc + default: ethereum + tokenId: + type: string + description: The NFT token ID + fromAddress: + type: string + description: The wallet address for the current owner + toAddress: + type: string + description: The wallet address to send the NFT to + tokenMintAddress: + type: string + description: The NFT token mint address + Wallet: + type: object + properties: + chain: + type: string + example: solana + enum: + - solana + - ethereum + - polygon + - bsc + default: solana + publicKey: + type: string + example: C9vzqFSxKVasf55GdZCAFKhKW9zckzx6ekhhsQTretTa + CheckoutMintSuccess: + type: object + properties: + checkoutURL: + type: string + description: A URL to send the user to in order to capture payment and start the minting process + TransferPendingVerification: + type: object + properties: + personaUrl: + type: string + description: A URL to send the user to in order to perform a persona verification. If the user has failed the OTP challenge 3 times, this will be the only option. + Error: + type: object + properties: + error: + type: string + ErrorMsg: + type: object + properties: + error: + type: boolean + message: + type: string + requestBodies: + Checkout: + content: + application/json: + schema: + $ref: "#/components/schemas/Checkout" + required: true + Transfer: + content: + application/json: + schema: + $ref: "#/components/schemas/Transfer" + required: true diff --git a/fern/apis/payments/generators.yml b/fern/apis/payments/generators.yml new file mode 100644 index 0000000..bbb4a50 --- /dev/null +++ b/fern/apis/payments/generators.yml @@ -0,0 +1 @@ +openapi: ./PaymentsAPIs.yaml \ No newline at end of file diff --git a/fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml b/fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml new file mode 100644 index 0000000..5f90511 --- /dev/null +++ b/fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml @@ -0,0 +1,839 @@ +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +security: + - apiKey: [] +info: + description: N/A + version: 1.0.0 + title: Verifiable Credentials + contact: + name: Crossmint Verifiable Credentials APIs + url: https://www.crossmint.com + email: support@crossmint.io + +paths: + "/unstable/credentials/verify": + # VERIFY CREDENTIAL + post: + summary: Verify Credential + description: | + Verify that a credential is valid. + + **API scope required** `credentials.read` + operationId: verify-credential + tags: + - Verifiable Credentials + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + credential: + description: The JSON representing a credential. + type: object + required: + - credential + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + isValid: + type: boolean + example: true/false + error: + type: string + nullable: true + example: null / "error message" + examples: + valid: + description: Valid credential + value: + isValid: true + error: null + invalid revoked: + description: Revoked credential + value: + isValid: false + error: Credential Revoked + invalid expired: + description: Credential expired + value: + isValid: false + error: Credential expired at + invalid proof: + description: Invalid proof + value: + isValid: false + error: Invalid proof + 400: + description: "Bad Request" + + "/unstable/credentials/templates/": + # CREATE VC COLLECTION + post: + summary: Create VC template + description: | + Create a template (similar to an nft collection) for issuing verifiable credentials. + + **API scope required** `credentials:template.create` + operationId: vc-create-template + tags: + - Verifiable Credentials + requestBody: + content: + application/json: + schema: + type: object + properties: + metadata: + type: object + additionalProperties: false + required: + - name + - image + - description + properties: + name: + type: string + description: "The name of your collection (Max length: 32)" + example: Verifiable Credential + maxLength: 32 + description: + type: string + description: "A brief description of credential (Max length: 64)" + example: The owner of this credential is authorized. + maxLength: 64 + chain: + description: The chain to mint the nft on + type: string + enum: + - polygon + credentials: + description: Credentials parameters + type: object + properties: + type: + type: string + description: The type of credentials inside the collection (blank or 'default' in case no custom type is used) + example: degreeForMastersStudent + storage: + type: string + description: Where to store the credential + default: crossmint | decentralized-ipfs | delegated + example: crossmint | decentralized-ipfs | delegated + delegatedStorageEndpoint: + type: string + description: Only if storage is 'delegated', the endpoint to retrieve the credential from + example: undefined + encryption: + type: string + description: Whether to encrypt the credential using the recipient's wallet + default: none | decentralized-lit + example: none | decentralized-lit + delegatedIssuer: + type: object + description: Issuer information, fill only if using delegatedStorage + default: undefined + example: undefined + properties: + did: + type: string + description: The issuer's did + example: did:polygon:0x123456789 + endpoint: + type: string + description: The issuer's endpoint to sign credentials + example: https://issuer.com/sign + token: + type: string + description: Token used for auth on the issuer endpoint + example: "abcd" + required: + - type + required: + - metadata + - chain + - credentials + responses: + 200: + description: Success. Refer to the standard create collection response for more details. + content: + application/json: + schema: + type: string + example: Success. Refer to the standard nft create collection response for more details. + 400: + description: Bad Request + content: + error: + examples: + InvalidCustomType: + description: Invalid Custom type + ChainNotSupported: + description: Chain not supported + SFTsNotSupported: + description: SFTs not supported + CredentialsNotSupported: + description: Credentials not supported on this project + + "/unstable/collections/{collectionId}/nfts/{id}/credentials": + get: + # GET VC BY NFT ID + summary: Get VC by NFT ID + description: | + Get a verifiable credential by the ID associated with the minted NFT. + + This ID will have the format: ``. For example: `d7eb777b-e9b4-4f34-ab5f-ce199111166a` + + **API scope required** `credentials.read`. This endpoint will not work with a client side API key. + operationId: get-vc + tags: + - Verifiable Credentials + parameters: + - name: collectionId + in: path + description: Collection id (template id) + required: true + schema: { type: string } + - name: id + in: path + description: | + UUID of the NFT returned in the NFT creation response. Format is: `` + required: true + schema: { type: string } + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + description: The credential object + example: + $ref: "#/components/examples/Credential" + 400: + description: Bad Request + content: + application/json: + schema: + type: object + example: + error: Credential not issued yet, wait for the mint to complete. + 404: + description: NFT not found + + "/unstable/credentials/{id}": + # GET VC BY ID + get: + summary: Get VC by Credential ID + description: | + Get a verifiable credential by the ID associated with it. + + This ID will have the format: `urn:uuid:`. For example: `urn:uuid:64f9877d-a19a-4205-8d61-f8c2abed5766` + + **API scope required** `credentials.read`. This enpoint will work also with a client side API key. + operationId: get-vc-by-id + tags: + - Verifiable Credentials + parameters: + - name: id + in: path + description: | + Unique ID of the credential as returned in the NFT creation response. Format is: `urn:uuid:` + required: true + schema: { type: string } + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + description: The credential object + example: + $ref: "#/components/examples/Credential" + 400: + description: Bad Request + content: + error: + examples: + NotIssuedYet: + description: Credential not issued yet, wait for the mint to complete. + 404: + description: Credential not found + + # Revoke credential + delete: + summary: Revoke credential by id + description: | + Revoke a verifiable credential by the credential ID. + This involves burning the associated nft. + + This ID will have the format: `urn:uuid:`. For example: `urn:uuid:64f9877d-a19a-4205-8d61-f8c2abed5766` + + **API scope required** `credentials.create`. + operationId: revoke-credential + tags: + - Verifiable Credentials + parameters: + - name: id + in: path + description: | + Unique ID of the credential as returned in the NFT creation response. Format is: `urn:uuid:` + required: true + schema: { type: string } + responses: + 200: + description: Success + content: + application/json: + schema: + $ref: "#/components/schemas/BurnNFTResponse" + 403: + description: Forbidden + 404: + description: Credential not found + 503: + description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. + + "/unstable/nfts/{nftLocator}/credentials": + get: + summary: Get VC by NFT Locator + description: | + Get a verifiable credential by the NFT locator. + + This locator will have the format: `::`. + For example: `polygon:0x1234abcde...:1` + + **API scope required** `credentials.read`. This enpoint will work also with a client side API key. + operationId: get-vc-by-locator + tags: + - Verifiable Credentials + parameters: + - name: nftLocator + in: path + description: NFT on chain locator, in the format of `::` + required: true + schema: { type: string } + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + description: The credential object + example: + $ref: "#/components/examples/Credential" + 400: + description: Bad Request + content: + error: + examples: + NotIssuedYet: + description: Credential not issued yet, wait for the mint to complete. + 404: + description: Nft not found + + "/unstable/credentials/templates/{templateId}/vcs": + # ISSUE VC + post: + summary: Issue VC + description: | + Issue a verifiable credential. Deliver to a web3 wallet or email address. + + **API scope required** `credentials.create` + operationId: issue-vc + tags: + - Verifiable Credentials + parameters: + - name: templateId + in: path + description: Template id of a credential enabled collection + required: true + example: default + schema: { type: string } + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + recipient: + type: string + example: polygon:0x1234abcde... or email::polygon + description: Recipient address in the format of `:
` or `email::`. + metadata: + type: object + additionalProperties: false + required: + - name + - image + - description + properties: + name: + type: string + description: "The name of your NFT (Max length: 32)" + example: Crossmint Example NFT + maxLength: 32 + image: + type: string + description: Direct link to your NFT image + example: https://www.crossmint.com/assets/crossmint/logo.png + description: + type: string + description: "A brief description of the NFT (Max length: 64)" + example: My NFT created via the mint API! + maxLength: 64 + animation_url: + type: string + example: "" + description: | + **EVM only** + + [See more info here](/minting/advanced/nft-metadata) + attributes: + type: array + description: "Add attributes to your NFT" + items: + type: object + required: + - trait_type + - value + properties: + display_type: + type: string + description: Display name of your attribute + enum: + - boost_number + - boost_percentage + - number + trait_type: + type: string + description: The name of the trait + value: + type: string + description: The value of the trait + credential: + type: object + additionalProperties: false + properties: + subject: + type: object + description: The credential claims object, matching the schema defined on the collection types. + example: + subjectName: foo + subjectAge: 20 + claim: "bar" + expiresAt: + type: string + description: optional expiration date in ISO 8601 + default: "2023-08-31T16:34:33.854Z" + required: ["subject"] + required: ["recipient", "credential"] + responses: + 200: + description: Success. + content: + application/json: + schema: + title: "Credential creation Response" + type: object + properties: + credentialId: + type: string + description: The credential id + example: urn:uuid:credentialId + id: + type: string + onChain: + type: object + properties: + status: + type: string + chain: + type: string + contractAddress: + type: string + examples: + Pending: + description: EVM pending + value: + credentialId: urn:uuid:40ada19e-3b4a-4de0-8d61-e0e7aedbfa0 + nft: + onChain: + status: pending + chain: ethereum + contractAddress: "0x123456789" + id: 1938b38c-3037-45dc-8033-333b7ebaee7 + 400: + description: Bad Request + content: + application/json: + examples: + InvalidArguments: + description: Invalid arguments, please make sure you're following the api specification. + CollectionUsupported: + description: Collection does not support credentials + ProjectUnsupported: + description: Project does not support credentials + InvalidSchema: + description: The provided subject schema does not match the collection type + InvalidDate: + description: Invalid expiration date format or date in the past + 403: + description: Forbidden error, please ensure the credentials are correct. + 503: + description: Please try again in a few minutes. If the issue still persists, please contact Crossmint support. + + "/unstable/credentials/types": + post: + summary: Create VC Type + description: | + Create a type with a random UUID. This is how you define a custom schema. + + **API scope required** `credentials.create` + operationId: create-type + tags: + - Verifiable Credentials + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + credentialSubjectSchema: + type: array + items: + properties: + name: + type: string + description: The name of credential subject property + default: user_email + type: + type: "string" + description: The type of credential subject property + default: basetype or nestedTypeSchema + required: + - type + - name + nestedTypeSchema: + type: array + items: + properties: + name: + type: string + default: age + type: + type: string + default: uint16 + required: + - type + - name + example: + { + "credentialSubjectSchema": + [ + { "name": "username", "type": "string" }, + { "name": "courses_completed", "type": "uint64" }, + { "name": "courses", "type": "Course[]" }, + ], + "Course": + [ + { "name": "name", "type": "string" }, + { "name": "grades", "type": "uint64[]" }, + { "name": "class", "type": "Class" }, + ], + "Class": + [{ "name": "name", "type": "string" }, { "name": "teacher", "type": "string" }], + } + required: + - credentialSubjectSchema + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The type name + example: 64f0c05641a512c86786fd3b + 400: + description: "Bad Request" + content: + error: + examples: + Recursion: + description: The type schema is recursive + UnusedDeclaration: + description: The type schema has unused declarations + UndefinedType: + description: The type schema references an undefined type + BaseTypeOverridden: + description: The type schema overrides a base type + MissingCredentialSubjectSchema: + description: The type schema is missing a credential subject schema + + "/unstable/credentials/types/{typeName}": + put: + summary: Create VC Type with name + description: | + Create a type with a given name. This is how you define a custom schema. + + **API scope required** `credentials.create` + operationId: create-type-idempotent + parameters: + - name: typeName + in: path + description: The name of the type + required: true + schema: + type: string + tags: + - Verifiable Credentials + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: false + properties: + credentialSubjectSchema: + type: array + items: + properties: + name: + type: string + description: The name of credential subject property + default: user_email + type: + type: "string" + description: The type of credential subject property + default: basetype or nestedTypeSchema + required: + - type + - name + nestedTypeSchema: + type: array + items: + properties: + name: + type: string + default: age + type: + type: string + default: uint16 + required: + - type + - name + example: + { + "credentialSubjectSchema": + [ + { "name": "username", "type": "string" }, + { "name": "courses_completed", "type": "uint64" }, + { "name": "courses", "type": "Course[]" }, + ], + "Course": + [ + { "name": "name", "type": "string" }, + { "name": "grades", "type": "uint64[]" }, + { "name": "class", "type": "Class" }, + ], + "Class": + [{ "name": "name", "type": "string" }, { "name": "teacher", "type": "string" }], + } + required: + - credentialSubjectSchema + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The type name + example: 64f0c05641a512c86786fd3b + 400: + description: "Bad Request" + content: + error: + examples: + Recursion: + description: The type schema is recursive + UnusedDeclaration: + description: The type schema has unused declarations + UndefinedType: + description: The type schema references an undefined type + BaseTypeOverridden: + description: The type schema overrides a base type + MissingCredentialSubjectSchema: + description: The type schema is missing a credential subject schema + AlreadyDefined: + description: A type with the given name already exists. + + get: + summary: Get a Type + description: | + Get the schema of a given type by name + + **API scope required** `credentials.read` + operationId: get-type + tags: + - Verifiable Credentials + parameters: + - name: typeName + in: path + description: The name of the type + required: true + schema: + type: string + responses: + 200: + description: Success. + content: + application/json: + schema: + type: object + properties: + name: + type: string + example: "64f0c05641a512c86786fd3b" + credentialSubjectSchema: + type: array + items: + type: object + properties: + name: + type: string + type: + type: string + example: + - name: "age" + type: "uint8" + - name: "name" + type: "string" + 400: + description: "Type not found" + +components: + securitySchemes: + apiKey: + type: apiKey + in: header + name: X-API-KEY + description: Obtained in the Crossmint developer console + + schemas: + BurnNFTResponse: + type: object + properties: + actionId: + type: string + description: | + Can be used to check the status via the [action status API](/api-reference/common/get-action-status) + example: "201520fc-e0eb-4698-a2f3-c6b50cc7c894" + action: + type: string + description: The action performed, in this case `nfts.delete` + example: "nfts.delete" + status: + type: string + description: Current status of the async operation. One of `pending` or `succeeded` + example: "pending OR succeeded" + data: + type: object + properties: + chain: + type: string + description: Refer to the [supported chains](/introduction/supported-chains) page for more info + example: "polygon" + txId: + type: string + description: | + The onchain transaction ID related to the request. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 0x69cf6d971e6745f25f683db9c87663839be02bdaa4a70f0724f490d7335b0081" + collection: + type: object + properties: + id: + type: string + description: The Crossmint identifier for the collection. Either a UUID or custom string depending on how you create the collection. + example: "default-polygon" + contractAddress: + type: string + description: The on-chain contract address for the given collection. + example: "0x67a602CBb306b3DBaaC7ECf55b72EED0E04Dc785" + token: + type: object + properties: + id: + type: string + description: The Crossmint identifier for the NFT. This will be a UUID. + example: "799a6f68-e2ea-4126-8577-4298dfcf900c" + tokenId: + type: string + description: The numeric tokenId of the NFT in the contract. + example: "7" + startedAt: + type: string + format: date-time + description: The time this operation was initiated in UTC. + example: "2024-01-10T23:01:45.000Z" + completedAt: + type: string + format: date-time + description: | + The time this operation completed in UTC. + + This is only present when `status` is `succeeded` + example: "succeeded status ONLY - 2024-01-10T23:02:00.000Z" + resource: + type: string + description: The URL path to obtain current status with [action status api](/api-reference/common/get-action-status) + example: "https://staging.crossmint.com/api/2022-06-09/collections/default-polygon/nfts/201520fc-e0eb-4698-a2f3-c6b50cc7c894" + + examples: + Credential: + value: + id: + credentialSubject: + id: 0xSUBJECT_ADDRESS + ...additional fields: ... + nft: + tokenId: + chain: polygon + contractAddress: + expirationDate: "2234-12-12" + "@context": + - https://www.w3.org/2018/credentials/v1 + - https://github.com/haardikk21/ethereum-eip712-signature-2021-spec/blob/main/index.html + issuer: + id: did:0xISSUER_ADDRESS + type: + - VerifiableCredential + - 64f0c05641a512c86786fd3b + issuanceDate: "2023-08-31T16:34:33.854Z" + proof: + proofValue: "ProofValue" + ...additional required fields: ... diff --git a/fern/apis/verifiable-credentials/generators.yml b/fern/apis/verifiable-credentials/generators.yml new file mode 100644 index 0000000..b8b36ac --- /dev/null +++ b/fern/apis/verifiable-credentials/generators.yml @@ -0,0 +1 @@ +openapi: ./VerifiableCredentialsAPIs.yaml \ No newline at end of file diff --git a/fern/apis/wallets/WalletsAPIs.yaml b/fern/apis/wallets/WalletsAPIs.yaml new file mode 100644 index 0000000..42086b2 --- /dev/null +++ b/fern/apis/wallets/WalletsAPIs.yaml @@ -0,0 +1,746 @@ +openapi: 3.0.1 +servers: + - url: "https://staging.crossmint.com/api" + description: "Staging environment (testnets)" + - url: "https://www.crossmint.com/api" + description: "Production environment (mainnets)" +security: + - apiKey: [] +info: + description: >- + N/A + version: 1.0.0 + title: Wallets + contact: + name: Crossmint Wallets APIs + url: https://www.crossmint.com + email: support@crossmint.io +tags: + - name: metadata + description: Find out about the data sets + - name: search + description: Search a data set +paths: + /v1-alpha1/wallets: + post: + responses: + 200: + description: Wallet already exists + content: + application/json: + schema: + type: object + properties: + chain: + type: string + example: ethereum + description: The blockchain the wallet is on + publicKey: + type: string + example: "0xB364346FDb52e42CcC186b3BA3730cb4A87bF5B0" + description: "The address of the created wallet" + 201: + description: Wallet created + content: + application/json: + schema: + type: object + properties: + chain: + type: string + example: ethereum + publicKey: + type: string + example: "0xB364346FDb52e42CcC186b3BA3730cb4A87bF5B0" + 400: + description: Bad request. Most likely the parameters `userId` and `chain` were not included, or were not provided in the proper format + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action (`wallets.create`) + tags: + - Wallet + summary: Create Wallet + description: | + Create a new Crossmint custodial wallet for a user + + **API scope required**: `wallets.create` + operationId: create-wallet + requestBody: + content: + application/json: + schema: + oneOf: + - title: email + type: object + properties: + email: + type: string + description: Provide an email for this wallet to be associated to + chain: + $ref: "#/components/schemas/AllChains" + required: + - email + - chain + - title: userId + type: object + properties: + userId: + type: string + description: Provide an arbitrary ID for this wallet to be associated to + chain: + $ref: "#/components/schemas/AllChains" + required: + - userId + - chain + # - title: phoneNumber + # type: object + # properties: + # phoneNumber: + # type: string + # description: Provide a phone number for this wallet to be associated with, including country code + # example: "+16465551234" + # chain: + # $ref: "#/components/schemas/AllChains" + # required: + # - phoneNumber + # - chain + get: # Get Wallets for User + responses: + 200: + description: Success + content: + application/json: + schema: + type: array + example: + - chain: ethereum + publicKey: "0xB364346FDb52e42CcC186b3BA3730cb4A87bF5B0" + - chain: polygon + publicKey: "0x30E3E8feEc68d5Cb5424113E9d161611c7fc7290" + - chain: solana + publicKey: A9vzqFSxKVasf55GdZCAFKhKW9zckzx6ekhhsQTretTa + items: + $ref: "#/components/schemas/Wallet" + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action (`wallets.read`) + tags: + - Wallet + summary: Get Wallets for User + description: | + Fetch the addresses of a user's Crossmint custodial wallets + + **API scope required**: `wallets.read` + operationId: fetch-wallet + parameters: + - name: userId + description: Unique identifier for your user. Any arbitrary string can be passed here. + in: query + schema: + type: string + - name: email + description: The email used when creating the wallet + in: query + schema: + type: string + # - name: phoneNumber + # in: query + # schema: + # type: string + /2022-06-09/wallets/{identifier}/nfts: + get: # Get NFTs from Wallet + # Mintlify (our docs tool) doesn't support `oneOf` in the responses. These are overridden in the mdx file for this route + responses: + 200: + description: Success + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/NFTEVM" + - $ref: "#/components/schemas/NFTSOL" + #- $ref: "#/components/schemas/NFTCAR" + 400: + description: "Bad request. Either the blockchain prefix is incorrect, the address does not exist, or the locator is malformed" + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + tags: + - Wallet + summary: Get NFTs from Wallet + description: | + Fetch the NFTs in a provided wallet + + **API scope required**: `wallets:nfts.read` + operationId: fetch-content-from-wallet + parameters: + - name: identifier + in: path + description: "The wallet identifier in the format of `:
`, `email::` or `userId::`." + required: true + schema: + type: string + - name: page + in: query + description: "Page index" + required: true + schema: + type: string + default: "1" + - name: perPage + in: query + description: "Number of items to display per page" + required: true + schema: + type: string + default: "20" + /v1-alpha1/wallets/{chain}:{address}/signMessage: + post: # Sign message + responses: + 200: + description: Message has been successfully signed + content: + application/json: + schema: + type: object + properties: + signedMessage: + type: string + description: "This is the result of `ethers.Signer.signMessage`" + example: 0x00000000... + 400: + description: The blockchain requested is not supported + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 404: + description: The specified wallet is not found + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action + tags: + - Sign + summary: Sign Message + description: | + Sign a message using a custodial wallet's key + + **API scope required**: `wallets:messages.sign` + operationId: sign-message + parameters: + - name: chain + in: path + description: "The blockchain network you are using." + required: true + schema: + $ref: "#/components/schemas/EVMChains" + - name: address + in: path + description: "The wallet address you want to sign the message with" + required: true + schema: + type: string + pattern: "^(0x)?[0-9a-fA-F]{40}$" + requestBody: + content: + application/json: + schema: + type: object + required: + - message + properties: + message: + type: string + description: "The message to be signed" + /v1-alpha1/wallets/transfer: + post: + responses: + # 200: + # description: Export started. Status updates for this export are returned through the Exports Webhook. + 202: + description: Verification request sent to user. Status updates for this export are returned through the transfers webhook. + content: + application/json: + schema: + $ref: "#/components/schemas/VerificationRequestSent" + 303: + description: More info needed to start export. This will happen when the operation has a high fraud risk. + content: + application/json: + schema: + $ref: "#/components/schemas/TransferPendingVerification" + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action (`wallets:nfts.transfer`) + 404: + description: The specified wallet cannot be found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + tags: + - Transfer + summary: Transfer NFT (email) + description: | + Transfer NFTs from one wallet to another wallet. Intended for wallets created using `email` option. + + **API scope required**: `wallets:nfts.transfer` + operationId: wallets-transfer + requestBody: + content: + application/json: + schema: + oneOf: + - title: EVM + type: object + properties: + chain: + $ref: "#/components/schemas/EVMChains" + from: + type: string + description: "The wallet address for the current owner" + to: + type: string + description: "The wallet address the token should be transferred to" + contractAddress: + type: string + description: "The contract address of the token to transfer" + tokenId: + type: string + description: "The numeric tokenId of the token to be transferred" + quantity: + type: string + description: "Required for ERC-1155 only, not relevant for ERC-721 tokens" + - title: Solana + type: object + properties: + chain: + type: string + enum: + - solana + default: solana + from: + type: string + description: "The wallet address for the current owner" + to: + type: string + description: "The wallet address the token should be transferred to" + tokenMintAddress: + type: string + description: "The mintHash of the token to transfer" + /v1-alpha1/transfer: + post: + responses: + 200: + description: Export started. Status updates for this export are returned through the Exports Webhook. + 303: + description: More info needed to start export. This will happen when the operation has a high fraud risk. + content: + application/json: + schema: + $ref: "#/components/schemas/TransferPendingVerification" + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + 401: + description: | + Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action (`wallets:nfts.transfer`) + tags: + - Transfer + summary: Transfer NFT (userId) + description: | + Transfer NFTs from one wallet to another wallet. Intended for wallets created with `userId` option. + + **API scope required**: `wallets:nfts.transfer` + operationId: transfer + requestBody: + content: + application/json: + schema: + type: object + properties: + chain: + $ref: "#/components/schemas/AllChains" + tokenId: + type: string + description: "The numeric token ID of the NFT to be transferred, only used for EVM tokens" + fromAddress: + type: string + description: "The wallet address for the current owner" + toAddress: + type: string + description: "The wallet address to send the NFT to" + tokenMintAddress: + type: string + description: | + **Solana**: mintHash + + **EVM**: token contract address +components: + securitySchemes: + apiKey: + type: apiKey + in: header + name: X-API-KEY + description: Obtained in the Crossmint developer console + schemas: + AllChains: + type: string + description: Specify the name of the blockchain + enum: + - arbitrum + - arbitrumnova + - arbitrum-sepolia + - base + - base-sepolia + - bsc + #- bsc-testnet + #- cardano + - ethereum + - ethereum-sepolia + - optimism + - optimism-sepolia + - polygon + - polygon-amoy + - skale-nebula + - skale-nebula-testnet + - solana + - zkyoto + - zora + - zora-sepolia + default: ethereum + EVMChains: + type: string + enum: + - arbitrum + - arbitrumnova + - arbitrum-sepolia + - base + - base-sepolia + - bsc + #- bsc-testnet + - ethereum + - ethereum-sepolia + - optimism + - optimism-sepolia + - polygon + - polygon-amoy + #- polygon-mumbai + - zkyoto + - zora + - zora-sepolia + default: ethereum + Checkout: + required: + - clientId + type: object + properties: + clientId: + type: string + description: "Your Crossmint developer collection ID, found in the developer console: https://www.crossmint.com/console/collections" + example: 085f0f5a-9948-11ec-b909-0242ac120002 + collection: + $ref: "#/components/schemas/Collection" + redirect: + $ref: "#/components/schemas/Redirect" + mintConfig: + $ref: "#/components/schemas/MintConfig" + emailTo: + type: string + description: The email address for mint confirmation + example: testy@crossmint.xyz + mintTo: + type: string + description: A wallet address to mint the NFT to + example: YKQC3F2FUMexJUaje2suibPNhen2e9Pix1C2f9q7BHY + paymentMethod: + type: string + description: The payment method, either `"fiat"` or `"ETH"` + default: fiat + whPassThroughArgs: + type: object + description: Any arguments to included in the webhook status updates + example: + referralCode: "123" + listingId: + type: string + description: The listing ID in a marketplace. Most contracts will not use this + Collection: + type: object + description: Information about your collection, to be displayed on the checkout page. + properties: + title: + type: string + description: The title of your collection + example: A great collection + description: + type: string + description: A description for your collection + example: This is a fantastic collection of NFTs + photo: + type: string + description: Full URL to an image for your collection. + example: https://i.picsum.photos/id/542/200/300.jpg?hmac=qD8M4ejDPlEc69pGT21BzB7CDiWOcElb_Ke7V8POjm8 + MintConfig: + type: object + description: Arguments sent to your smart contract + properties: + totalPrice: + type: string + example: "0.08" + "...": + type: object + description: Any custom arguments to your minting function should be configured here. + MintStatus: + type: object + properties: + status: + type: string + description: The latest status of the mint + example: success + enum: + - minting + - success + - error + mintAddress: + type: string + description: The address of the mint + example: B1nQxDxmQTfRbXK4Cv1HtEmXKNqTXHEDiD251p9RCR7Q + walletAddress: + type: string + description: The wallet address the NFT is minted to + example: YKQC3F2FUMexJUaje2suibPNhen2e9Pix1C2f9q7BHY + passThroughArgs: + type: string + description: The arguments you sent via the `whPassThroughArgs` from `/checkout/mint` + example: '{"referralCode":"123"}' + NFTEVM: + title: EVM + description: EVM + type: array + items: + type: object + properties: + chain: + type: string + description: The blockchain used in the request. + contractAddress: + type: string + description: The token contract address + tokenId: + type: string + description: The numeric tokenId for the specified NFT + metadata: + type: object + properties: + attributes: + type: array + items: + type: object + properties: + trait_type: + type: string + value: + type: string + display_type: + type: string + nullable: true + collection: + type: object + description: + type: string + image: + type: string + description: URL that represents the image for the NFT + animation_url: + type: string + description: Optional URL representing a video or other multimedia file + nullable: true + name: + type: string + locator: + type: string + description: The address of the NFT on the blockchain + tokenStandard: + type: string + description: The type of contract this token is from (ERC-721 or ERC-1155) + NFTSOL: + title: Solana + description: Solana + type: array + items: + type: object + properties: + chain: + type: string + description: The blockchain used in the request, `solana` in this case. + mintHash: + type: string + description: The unique identifier of this NFT on Solana + metadata: + type: object + properties: + name: + type: string + description: + type: string + image: + type: string + description: A URL that represents the image for the NFT + attributes: + type: array + items: + type: object + properties: + value: + anyOf: + - type: string + - type: number + - type: boolean + - type: object + trait_type: + type: string + locator: + type: string + description: The address of the NFT on the blockchain + NFTCAR: + title: Cardano + description: cardano + type: array + items: + type: object + properties: + chain: + type: string + description: The blockchain used in the request, `cardano` in this case. + assetId: + type: string + description: The unique identifier of this NFT on Cardano + metadata: + type: object + properties: + assetId: + type: string + name: + type: string + description: + type: string + image: + type: string + format: uri + attributes: + type: array + items: + type: object + properties: + trait_type: + type: string + value: + type: string + locator: + type: string + description: The address of the NFT on the blockchain + Redirect: + type: object + description: The URLs to redirect the user to upon comletion or cancellation of the checkout page. + properties: + continue: + type: string + description: The URL to redirect the customer to when the customer's payment information is accepted. + cancel: + type: string + description: The URL to redirect the customer cancels the payment. + Transfer: + type: object + required: [chain, fromAddress, toAddress, tokenMintAddress] + properties: + chain: + type: string + example: ethereum + tokenId: + type: string + description: The NFT token ID + fromAddress: + type: string + description: The wallet address for the current owner + toAddress: + type: string + description: The wallet address to send the NFT to + tokenMintAddress: + type: string + description: The NFT token mint address + Wallet: + type: object + properties: + chain: + type: string + example: solana + description: The blockchain the wallet is on + publicKey: + type: string + example: C9vzqFSxKVasf55GdZCAFKhKW9zckzx6ekhhsQTretTa + description: The public address of the wallet + CheckoutMintSuccess: + type: object + properties: + checkoutURL: + type: string + description: A URL to send the user to in order to capture payment and start the minting process + VerificationRequestSent: + type: object + properties: + message: + type: string + example: Verification request sent to user + description: A message indicating the result. + actionId: + type: string + description: An ID that can be used to poll the [actions API](/api-reference/common/get-action-status). + TransferPendingVerification: + type: object + properties: + personaUrl: + type: string + description: A URL to send the user to in order to perform a persona verification. If the user has failed the OTP challenge 3 times, this will be the only option. + Error: + type: object + properties: + error: + type: string + requestBodies: + Checkout: + content: + application/json: + schema: + $ref: "#/components/schemas/Checkout" + required: true + Transfer: + content: + application/json: + schema: + $ref: "#/components/schemas/Transfer" + required: true diff --git a/fern/apis/wallets/generators.yml b/fern/apis/wallets/generators.yml new file mode 100644 index 0000000..77baf8d --- /dev/null +++ b/fern/apis/wallets/generators.yml @@ -0,0 +1 @@ +openapi: ./WalletsAPIs.yaml \ No newline at end of file diff --git a/fern/openapi/openapi-overrides.yml b/openapi/openapi-overrides.yml similarity index 93% rename from fern/openapi/openapi-overrides.yml rename to openapi/openapi-overrides.yml index 7a8870c..fe8c753 100644 --- a/fern/openapi/openapi-overrides.yml +++ b/openapi/openapi-overrides.yml @@ -20,15 +20,15 @@ paths: x-fern-sdk-method-name: edit-order components: schemas: - 400Response: + Error400Response: x-fern-type-name: BadRequestResponse - 403Response: + Error403Response: x-fern-type-name: UnauthorizedResponse - 404Response: + Error404Response: x-fern-type-name: NotFoundResponse - 503Response: + Error503Response: x-fern-type-name: ServiceUnavailabileResponse - 524Response: + Error524Response: x-fern-type-name: TimeoutResponse LineItems: oneOf: diff --git a/fern/openapi/openapi.yaml b/openapi/openapi.yaml similarity index 95% rename from fern/openapi/openapi.yaml rename to openapi/openapi.yaml index d1732b8..61294a1 100644 --- a/fern/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -63,31 +63,31 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/400Response" + $ref: "#/components/schemas/Error400Response" 403: description: Forbidden error, please ensure the credentials are correct. content: application/json: schema: - $ref: "#/components/schemas/403Response" + $ref: "#/components/schemas/Error403Response" 404: description: Not found error. content: application/json: schema: - $ref: "#/components/schemas/404Response" + $ref: "#/components/schemas/Error404Response" 503: description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. content: application/json: schema: - $ref: "#/components/schemas/503Response" + $ref: "#/components/schemas/Error503Response" 524: description: A timeout occurred. content: application/json: schema: - $ref: "#/components/schemas/524Response" + $ref: "#/components/schemas/Error524Response" /2022-06-09/orders/{orderId}: # GET ORDER @@ -114,31 +114,31 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/400Response" + $ref: "#/components/schemas/Error400Response" 403: description: Forbidden error, please ensure the credentials are correct. content: application/json: schema: - $ref: "#/components/schemas/403Response" + $ref: "#/components/schemas/Error403Response" 404: description: Not found error. content: application/json: schema: - $ref: "#/components/schemas/404Response" + $ref: "#/components/schemas/Error404Response" 503: description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. content: application/json: schema: - $ref: "#/components/schemas/503Response" + $ref: "#/components/schemas/Error503Response" 524: description: A timeout occurred. content: application/json: schema: - $ref: "#/components/schemas/524Response" + $ref: "#/components/schemas/Error524Response" # EDIT ORDER patch: @@ -172,31 +172,31 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/400Response" + $ref: "#/components/schemas/Error400Response" 403: description: Forbidden error, please ensure the credentials are correct. content: application/json: schema: - $ref: "#/components/schemas/403Response" + $ref: "#/components/schemas/Error403Response" 404: description: Not found error. content: application/json: schema: - $ref: "#/components/schemas/404Response" + $ref: "#/components/schemas/Error404Response" 503: description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. content: application/json: schema: - $ref: "#/components/schemas/503Response" + $ref: "#/components/schemas/Error503Response" 524: description: A timeout occurred. content: application/json: schema: - $ref: "#/components/schemas/524Response" + $ref: "#/components/schemas/Error524Response" components: securitySchemes: @@ -583,7 +583,7 @@ components: type: string example: "0x02f90....." - 400Response: + Error400Response: type: object properties: error: @@ -593,7 +593,7 @@ components: type: string example: "Invalid arguments or empty parameter ." - 403Response: + Error403Response: type: object properties: error: @@ -603,7 +603,7 @@ components: type: string example: Malformed API key. / API key provided doesn't have required scopes. - 404Response: + Error404Response: type: object properties: error: @@ -613,7 +613,7 @@ components: type: string example: "Not found" - 503Response: + Error503Response: type: object properties: error: @@ -623,7 +623,7 @@ components: type: string example: "Please try again in a few minutes. If the issue still persists, contact Crossmint support." - 524Response: + Error524Response: type: object properties: error: From 1ff83ebbece11a95ee336ce646e2e49f11675499 Mon Sep 17 00:00:00 2001 From: chdeskur Date: Wed, 24 Jul 2024 11:35:24 -0400 Subject: [PATCH 2/6] (chore): update titles, auth --- fern/apis/api/definition/api.yml | 2 ++ fern/apis/minting/MintingAPIs.yaml | 1 + fern/apis/minting/generators.yml | 2 +- fern/apis/wallets/WalletsAPIs.yaml | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/fern/apis/api/definition/api.yml b/fern/apis/api/definition/api.yml index bc6f484..beb9d88 100644 --- a/fern/apis/api/definition/api.yml +++ b/fern/apis/api/definition/api.yml @@ -4,6 +4,8 @@ display-name: Crossmint error-discrimination: strategy: status-code +auth: apiKey + default-environment: Production environments: Production: "https://www.crossmint.com/api" diff --git a/fern/apis/minting/MintingAPIs.yaml b/fern/apis/minting/MintingAPIs.yaml index 903b020..dd784cf 100644 --- a/fern/apis/minting/MintingAPIs.yaml +++ b/fern/apis/minting/MintingAPIs.yaml @@ -2171,6 +2171,7 @@ components: description: Supply limit. Set to 1 for ERC721. example: 10 Metadata: + x-fern-type-name: MintingMetadata type: object additionalProperties: false properties: diff --git a/fern/apis/minting/generators.yml b/fern/apis/minting/generators.yml index a0c8f35..2521a42 100644 --- a/fern/apis/minting/generators.yml +++ b/fern/apis/minting/generators.yml @@ -1 +1 @@ -openapi: ./MintingAPIs.yaml \ No newline at end of file +openapi: ./MintingAPIs.yaml diff --git a/fern/apis/wallets/WalletsAPIs.yaml b/fern/apis/wallets/WalletsAPIs.yaml index 42086b2..1cc57d2 100644 --- a/fern/apis/wallets/WalletsAPIs.yaml +++ b/fern/apis/wallets/WalletsAPIs.yaml @@ -539,6 +539,7 @@ components: description: The arguments you sent via the `whPassThroughArgs` from `/checkout/mint` example: '{"referralCode":"123"}' NFTEVM: + x-fern-type-name: NFTEVM title: EVM description: EVM type: array @@ -589,6 +590,7 @@ components: type: string description: The type of contract this token is from (ERC-721 or ERC-1155) NFTSOL: + x-fern-type-name: NFTSolana title: Solana description: Solana type: array From 06fcf14aba63f9c34a8be1b66757a31ac4404971 Mon Sep 17 00:00:00 2001 From: chdeskur Date: Mon, 29 Jul 2024 08:28:38 -0400 Subject: [PATCH 3/6] openapi updates --- {fern/apis/admin => apis}/AdminAPIs.yaml | 2 + .../apis/headless => apis}/HeadlessAPIs.yaml | 15 + {fern/apis/minting => apis}/MintingAPIs.yaml | 2 + .../apis/payments => apis}/PaymentsAPIs.yaml | 3 + .../VerifiableCredentialsAPIs.yaml | 2 + {fern/apis/wallets => apis}/WalletsAPIs.yaml | 6 + fern/apis/admin/generators.yml | 1 - .../apis/api/definition/admin/__package__.yml | 1 - fern/apis/api/definition/api.yml | 12 - .../api/definition/headless/__package__.yml | 1 - .../api/definition/minting/__package__.yml | 1 - .../api/definition/payments/__package__.yml | 1 - .../verifiable-credentials/__package__.yml | 1 - .../api/definition/wallets/__package__.yml | 1 - fern/apis/api/dependencies.yml | 8 - fern/apis/headless/generators.yml | 1 - fern/apis/minting/generators.yml | 1 - fern/apis/payments/generators.yml | 1 - .../verifiable-credentials/generators.yml | 1 - fern/apis/wallets/generators.yml | 1 - fern/fern.config.json | 2 +- fern/{apis/api => }/generators.yml | 14 +- openapi/openapi-overrides.yml | 58 -- openapi/openapi.yaml | 634 ------------------ 24 files changed, 42 insertions(+), 728 deletions(-) rename {fern/apis/admin => apis}/AdminAPIs.yaml (98%) rename {fern/apis/headless => apis}/HeadlessAPIs.yaml (97%) rename {fern/apis/minting => apis}/MintingAPIs.yaml (99%) rename {fern/apis/payments => apis}/PaymentsAPIs.yaml (99%) rename {fern/apis/verifiable-credentials => apis}/VerifiableCredentialsAPIs.yaml (99%) rename {fern/apis/wallets => apis}/WalletsAPIs.yaml (99%) delete mode 100644 fern/apis/admin/generators.yml delete mode 100644 fern/apis/api/definition/admin/__package__.yml delete mode 100644 fern/apis/api/definition/api.yml delete mode 100644 fern/apis/api/definition/headless/__package__.yml delete mode 100644 fern/apis/api/definition/minting/__package__.yml delete mode 100644 fern/apis/api/definition/payments/__package__.yml delete mode 100644 fern/apis/api/definition/verifiable-credentials/__package__.yml delete mode 100644 fern/apis/api/definition/wallets/__package__.yml delete mode 100644 fern/apis/api/dependencies.yml delete mode 100644 fern/apis/headless/generators.yml delete mode 100644 fern/apis/minting/generators.yml delete mode 100644 fern/apis/payments/generators.yml delete mode 100644 fern/apis/verifiable-credentials/generators.yml delete mode 100644 fern/apis/wallets/generators.yml rename fern/{apis/api => }/generators.yml (54%) delete mode 100644 openapi/openapi-overrides.yml delete mode 100644 openapi/openapi.yaml diff --git a/fern/apis/admin/AdminAPIs.yaml b/apis/AdminAPIs.yaml similarity index 98% rename from fern/apis/admin/AdminAPIs.yaml rename to apis/AdminAPIs.yaml index 284f6a1..718334c 100644 --- a/fern/apis/admin/AdminAPIs.yaml +++ b/apis/AdminAPIs.yaml @@ -3,8 +3,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production security: - apiKey: [] info: diff --git a/fern/apis/headless/HeadlessAPIs.yaml b/apis/HeadlessAPIs.yaml similarity index 97% rename from fern/apis/headless/HeadlessAPIs.yaml rename to apis/HeadlessAPIs.yaml index 19a39dd..e4ef3e9 100644 --- a/fern/apis/headless/HeadlessAPIs.yaml +++ b/apis/HeadlessAPIs.yaml @@ -2,8 +2,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production info: description: | N/A @@ -32,6 +34,7 @@ paths: - apiKey: [] tags: - Headless + x-fern-sdk-group-name: checkout requestBody: required: true content: @@ -100,6 +103,7 @@ paths: - orderClientSecret: [] tags: - Headless + x-fern-sdk-group-name: checkout parameters: - $ref: "#/components/parameters/orderId" responses: @@ -152,6 +156,7 @@ paths: - orderClientSecret: [] tags: - Headless + x-fern-sdk-group-name: checkout parameters: - $ref: "#/components/parameters/orderId" requestBody: @@ -297,6 +302,7 @@ components: oneOf: - type: object title: EVM + x-fern-type-name: EvmPayment additionalProperties: false properties: receiptEmail: @@ -304,6 +310,7 @@ components: format: email description: Email that the receipt will be sent to. method: + x-fern-type-name: EvmPaymentMethods type: string enum: - arbitrum-sepolia @@ -315,6 +322,7 @@ components: - ethereum - optimism currency: + x-fern-type-name: EvmPaymentCurrency type: string enum: - eth @@ -331,6 +339,7 @@ components: - currency - type: object title: Solana + x-fern-type-name: SolanaPayment additionalProperties: false properties: receiptEmail: @@ -338,10 +347,12 @@ components: format: email description: Email that the receipt will be sent to. method: + x-fern-type-name: SolanaPaymentMethods type: string enum: - solana currency: + x-fern-type-name: SolanaPaymentCurrency type: string enum: - sol @@ -358,6 +369,7 @@ components: - currency - type: object title: Fiat + x-fern-type-name: FiatPayment additionalProperties: false properties: receiptEmail: @@ -371,6 +383,7 @@ components: currency: default: usd type: string + x-fern-type-name: FiatPaymentCurrency enum: - usd - eur @@ -387,6 +400,7 @@ components: LineItems: oneOf: - type: object + x-fern-type-name: SingleLineItem title: Single Line Item additionalProperties: false properties: @@ -412,6 +426,7 @@ components: - collectionLocator - type: array title: Multiple Line Items + x-fern-type-name: MultipleLineItems items: type: object additionalProperties: false diff --git a/fern/apis/minting/MintingAPIs.yaml b/apis/MintingAPIs.yaml similarity index 99% rename from fern/apis/minting/MintingAPIs.yaml rename to apis/MintingAPIs.yaml index dd784cf..9cc433e 100644 --- a/fern/apis/minting/MintingAPIs.yaml +++ b/apis/MintingAPIs.yaml @@ -2,8 +2,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production security: - apiKey: [] info: diff --git a/fern/apis/payments/PaymentsAPIs.yaml b/apis/PaymentsAPIs.yaml similarity index 99% rename from fern/apis/payments/PaymentsAPIs.yaml rename to apis/PaymentsAPIs.yaml index 462107b..8d3a9d5 100644 --- a/fern/apis/payments/PaymentsAPIs.yaml +++ b/apis/PaymentsAPIs.yaml @@ -2,8 +2,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production info: description: | N/A @@ -528,6 +530,7 @@ components: type: string description: The URL to redirect the customer cancels the payment. Transfer: + x-fern-type-name: PaymentsTransfer type: object required: [chain, fromAddress, toAddress, tokenMintAddress] properties: diff --git a/fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml b/apis/VerifiableCredentialsAPIs.yaml similarity index 99% rename from fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml rename to apis/VerifiableCredentialsAPIs.yaml index 5f90511..fc14ab5 100644 --- a/fern/apis/verifiable-credentials/VerifiableCredentialsAPIs.yaml +++ b/apis/VerifiableCredentialsAPIs.yaml @@ -2,8 +2,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production security: - apiKey: [] info: diff --git a/fern/apis/wallets/WalletsAPIs.yaml b/apis/WalletsAPIs.yaml similarity index 99% rename from fern/apis/wallets/WalletsAPIs.yaml rename to apis/WalletsAPIs.yaml index 1cc57d2..9393109 100644 --- a/fern/apis/wallets/WalletsAPIs.yaml +++ b/apis/WalletsAPIs.yaml @@ -2,8 +2,10 @@ openapi: 3.0.1 servers: - url: "https://staging.crossmint.com/api" description: "Staging environment (testnets)" + x-fern-server-name: Staging - url: "https://www.crossmint.com/api" description: "Production environment (mainnets)" + x-fern-server-name: Production security: - apiKey: [] info: @@ -301,6 +303,7 @@ paths: $ref: "#/components/schemas/Error" tags: - Transfer + x-fern-sdk-method-name: wallets summary: Transfer NFT (email) description: | Transfer NFTs from one wallet to another wallet. Intended for wallets created using `email` option. @@ -313,6 +316,7 @@ paths: schema: oneOf: - title: EVM + x-fern-type-name: EvmTransfer type: object properties: chain: @@ -371,6 +375,7 @@ paths: Unauthorized. The API key may not exist, or does not have the proper scopes to perform this action (`wallets:nfts.transfer`) tags: - Transfer + x-fern-sdk-method-name: NFT summary: Transfer NFT (userId) description: | Transfer NFTs from one wallet to another wallet. Intended for wallets created with `userId` option. @@ -677,6 +682,7 @@ components: type: string description: The URL to redirect the customer cancels the payment. Transfer: + x-fern-type-name: WalletsTransfer type: object required: [chain, fromAddress, toAddress, tokenMintAddress] properties: diff --git a/fern/apis/admin/generators.yml b/fern/apis/admin/generators.yml deleted file mode 100644 index 68afe92..0000000 --- a/fern/apis/admin/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./AdminAPIs.yaml \ No newline at end of file diff --git a/fern/apis/api/definition/admin/__package__.yml b/fern/apis/api/definition/admin/__package__.yml deleted file mode 100644 index 32cd6e6..0000000 --- a/fern/apis/api/definition/admin/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: admin \ No newline at end of file diff --git a/fern/apis/api/definition/api.yml b/fern/apis/api/definition/api.yml deleted file mode 100644 index beb9d88..0000000 --- a/fern/apis/api/definition/api.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: api -display-name: Crossmint - -error-discrimination: - strategy: status-code - -auth: apiKey - -default-environment: Production -environments: - Production: "https://www.crossmint.com/api" - Staging: "https://staging.crossmint.com/api" \ No newline at end of file diff --git a/fern/apis/api/definition/headless/__package__.yml b/fern/apis/api/definition/headless/__package__.yml deleted file mode 100644 index 7512be8..0000000 --- a/fern/apis/api/definition/headless/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: headless \ No newline at end of file diff --git a/fern/apis/api/definition/minting/__package__.yml b/fern/apis/api/definition/minting/__package__.yml deleted file mode 100644 index 49249f3..0000000 --- a/fern/apis/api/definition/minting/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: minting \ No newline at end of file diff --git a/fern/apis/api/definition/payments/__package__.yml b/fern/apis/api/definition/payments/__package__.yml deleted file mode 100644 index b20c506..0000000 --- a/fern/apis/api/definition/payments/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: payments \ No newline at end of file diff --git a/fern/apis/api/definition/verifiable-credentials/__package__.yml b/fern/apis/api/definition/verifiable-credentials/__package__.yml deleted file mode 100644 index 96c5505..0000000 --- a/fern/apis/api/definition/verifiable-credentials/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: verifiable-credentials \ No newline at end of file diff --git a/fern/apis/api/definition/wallets/__package__.yml b/fern/apis/api/definition/wallets/__package__.yml deleted file mode 100644 index bef3709..0000000 --- a/fern/apis/api/definition/wallets/__package__.yml +++ /dev/null @@ -1 +0,0 @@ -export: wallets \ No newline at end of file diff --git a/fern/apis/api/dependencies.yml b/fern/apis/api/dependencies.yml deleted file mode 100644 index 9f67ea7..0000000 --- a/fern/apis/api/dependencies.yml +++ /dev/null @@ -1,8 +0,0 @@ -dependencies: - admin: ../admin - headless: ../headless - minting: ../minting - payments: ../payments - verifiable-credentials: ../verifiable-credentials - wallets: ../wallets - \ No newline at end of file diff --git a/fern/apis/headless/generators.yml b/fern/apis/headless/generators.yml deleted file mode 100644 index 282243f..0000000 --- a/fern/apis/headless/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./HeadlessAPIs.yaml \ No newline at end of file diff --git a/fern/apis/minting/generators.yml b/fern/apis/minting/generators.yml deleted file mode 100644 index 2521a42..0000000 --- a/fern/apis/minting/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./MintingAPIs.yaml diff --git a/fern/apis/payments/generators.yml b/fern/apis/payments/generators.yml deleted file mode 100644 index bbb4a50..0000000 --- a/fern/apis/payments/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./PaymentsAPIs.yaml \ No newline at end of file diff --git a/fern/apis/verifiable-credentials/generators.yml b/fern/apis/verifiable-credentials/generators.yml deleted file mode 100644 index b8b36ac..0000000 --- a/fern/apis/verifiable-credentials/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./VerifiableCredentialsAPIs.yaml \ No newline at end of file diff --git a/fern/apis/wallets/generators.yml b/fern/apis/wallets/generators.yml deleted file mode 100644 index 77baf8d..0000000 --- a/fern/apis/wallets/generators.yml +++ /dev/null @@ -1 +0,0 @@ -openapi: ./WalletsAPIs.yaml \ No newline at end of file diff --git a/fern/fern.config.json b/fern/fern.config.json index cda7c17..376b705 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "crossmint", - "version": "0.33.5" + "version": "0.36.0" } \ No newline at end of file diff --git a/fern/apis/api/generators.yml b/fern/generators.yml similarity index 54% rename from fern/apis/api/generators.yml rename to fern/generators.yml index 00d24e3..4baa328 100644 --- a/fern/apis/api/generators.yml +++ b/fern/generators.yml @@ -1,17 +1,25 @@ +api: + - ../apis/AdminAPIs.yaml + - ../apis/HeadlessAPIs.yaml + - ../apis/MintingAPIs.yaml + - ../apis/PaymentsAPIs.yaml + - ../apis/VerifiableCredentialsAPIs.yaml + - ../apis/WalletsAPIs.yaml groups: ts-sdk: generators: - name: fernapi/fern-typescript-node-sdk - version: 0.35.0 + version: 0.36.4 output: location: npm package-name: "crossmint" - token: ${NPM_TOKEN} + # token: ${NPM_TOKEN} github: repository: Paella-Labs/typescript-sdk + mode: pull-request smart-casing: true config: namespaceExport: Crossmint allowCustomFetcher: true skipResponseValidation: true - includeApiReference: true + includeApiReference: true \ No newline at end of file diff --git a/openapi/openapi-overrides.yml b/openapi/openapi-overrides.yml deleted file mode 100644 index fe8c753..0000000 --- a/openapi/openapi-overrides.yml +++ /dev/null @@ -1,58 +0,0 @@ -servers: - - url: "https://staging.crossmint.com/api" - x-fern-server-name: Staging - - url: "https://www.crossmint.com/api" - x-fern-server-name: Production -paths: - /2022-06-09/orders: - post: - x-fern-sdk-group-name: - - checkout - x-fern-sdk-method-name: create-order - /2022-06-09/orders/{orderId}: - get: - x-fern-sdk-group-name: - - checkout - x-fern-sdk-method-name: get-order - patch: - x-fern-sdk-group-name: - - checkout - x-fern-sdk-method-name: edit-order -components: - schemas: - Error400Response: - x-fern-type-name: BadRequestResponse - Error403Response: - x-fern-type-name: UnauthorizedResponse - Error404Response: - x-fern-type-name: NotFoundResponse - Error503Response: - x-fern-type-name: ServiceUnavailabileResponse - Error524Response: - x-fern-type-name: TimeoutResponse - LineItems: - oneOf: - - x-fern-type-name: SingleLineItem - - x-fern-type-name: MultipleLineItems - Recipient: - oneOf: - - x-fern-type-name: RecipientEmail - - x-fern-type-name: RecipientWallet - Payment: - oneOf: - - x-fern-type-name: EvmPayment - properties: - method: - x-fern-type-name: EvmPaymentMethods - currency: - x-fern-type-name: EvmPaymentCurrency - - x-fern-type-name: SolanaPayment - properties: - method: - x-fern-type-name: SolanaPaymentMethods - currency: - x-fern-type-name: SolanaPaymentCurrency - - x-fern-type-name: FiatPayment - properties: - currency: - x-fern-type-name: FiatPaymentCurrency \ No newline at end of file diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml deleted file mode 100644 index 61294a1..0000000 --- a/openapi/openapi.yaml +++ /dev/null @@ -1,634 +0,0 @@ -openapi: 3.0.1 -servers: - - url: "https://staging.crossmint.com/api" - description: "Staging environment (testnets)" - - url: "https://www.crossmint.com/api" - description: "Production environment (mainnets)" -info: - description: | - N/A - version: 1.0.0 - title: Headless Checkout - contact: - name: Crossmint Headless NFT Checkout APIs - url: "https://www.crossmint.com" - email: support@crossmint.io -tags: - - name: Headless Checkout - description: APIs to use the headless checkout - -paths: - ################################################ - ### HEADLESS - ################################################ - - /2022-06-09/orders: - # CREATE ORDER - post: - summary: Create Order - description: Creates a new order that can be used to complete a headless checkout. - operationId: create-order - security: - - apiKey: [] - tags: - - Headless - requestBody: - required: true - content: - application/json: - schema: - type: object - additionalProperties: false - required: - - payment - - lineItems - properties: - recipient: - $ref: "#/components/schemas/Recipient" - locale: - $ref: "#/components/schemas/Locale" - payment: - $ref: "#/components/schemas/Payment" - lineItems: - $ref: "#/components/schemas/LineItems" - responses: - 201: - description: "Order successfully created." - content: - application/json: - schema: - $ref: "#/components/schemas/CreateOrderResponse" - 400: - description: Invalid arguments, please make sure you're following the api specification. - content: - application/json: - schema: - $ref: "#/components/schemas/Error400Response" - 403: - description: Forbidden error, please ensure the credentials are correct. - content: - application/json: - schema: - $ref: "#/components/schemas/Error403Response" - 404: - description: Not found error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error404Response" - 503: - description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. - content: - application/json: - schema: - $ref: "#/components/schemas/Error503Response" - 524: - description: A timeout occurred. - content: - application/json: - schema: - $ref: "#/components/schemas/Error524Response" - - /2022-06-09/orders/{orderId}: - # GET ORDER - get: - summary: Get Order - description: Get specific order by ID - operationId: get-order - security: - - apiKey: [] - - orderClientSecret: [] - tags: - - Headless - parameters: - - $ref: "#/components/parameters/orderId" - responses: - 200: - description: "Order successfully created." - content: - application/json: - schema: - $ref: "#/components/schemas/OrderObject" - 400: - description: Invalid arguments, please make sure you're following the api specification. - content: - application/json: - schema: - $ref: "#/components/schemas/Error400Response" - 403: - description: Forbidden error, please ensure the credentials are correct. - content: - application/json: - schema: - $ref: "#/components/schemas/Error403Response" - 404: - description: Not found error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error404Response" - 503: - description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. - content: - application/json: - schema: - $ref: "#/components/schemas/Error503Response" - 524: - description: A timeout occurred. - content: - application/json: - schema: - $ref: "#/components/schemas/Error524Response" - - # EDIT ORDER - patch: - summary: Edit Order - description: >- - Edit an existing order. You can update the recipient, the payment - method, and/or the locale. - operationId: edit-order - security: - - apiKey: [] - - orderClientSecret: [] - tags: - - Headless - parameters: - - $ref: "#/components/parameters/orderId" - requestBody: - required: true - content: - application/json: - schema: - $ref: "#/components/schemas/OrderDTO" - responses: - 200: - description: "Order successfully created." - content: - application/json: - schema: - $ref: "#/components/schemas/OrderObject" - 400: - description: Invalid arguments, please make sure you're following the api specification. - content: - application/json: - schema: - $ref: "#/components/schemas/Error400Response" - 403: - description: Forbidden error, please ensure the credentials are correct. - content: - application/json: - schema: - $ref: "#/components/schemas/Error403Response" - 404: - description: Not found error. - content: - application/json: - schema: - $ref: "#/components/schemas/Error404Response" - 503: - description: Please try again in a few minutes. If the issue still persists, contact Crossmint support. - content: - application/json: - schema: - $ref: "#/components/schemas/Error503Response" - 524: - description: A timeout occurred. - content: - application/json: - schema: - $ref: "#/components/schemas/Error524Response" - -components: - securitySchemes: - apiKey: - type: apiKey - name: X-API-KEY - in: header - - parameters: - orderId: - name: orderId - in: path - description: | - This is the identifier for the order with UUID format. - - **Example:** `9c82ef99-617f-497d-9abb-fd355291681b` - required: true - schema: - type: string - - schemas: - ################################################ - ### REQUEST BODY SCHEMAS - ################################################ - - OrderDTO: - type: object - additionalProperties: false - properties: - recipient: - $ref: "#/components/schemas/Recipient" - locale: - $ref: "#/components/schemas/Locale" - payment: - $ref: "#/components/schemas/Payment" - - Recipient: - oneOf: - - type: object - title: Email - properties: - email: - type: string - format: email - required: - - email - additionalProperties: false - description: >- - Recipient of the items being purchased. Crossmint will create a custodial wallet address for - the user on the fly, that they can later log in to. If no recipient - is passed, an order will be created with the status - 'requires-recipient', until you pass one. - - type: object - title: Wallet - properties: - walletAddress: - type: string - required: - - walletAddress - additionalProperties: false - description: >- - Recipient of the items being purchased. If specifying a recipient by wallet address, - ensure the address is valid for the chain your **collection** is on, - which may differ from the chain the payment is performed on. - Locale: - default: en-US - type: string - enum: - - en-US - - es-ES - - fr-FR - - it-IT - - ko-KR - - pt-PT - - ja-JP - - zh-CN - - zh-TW - - de-DE - - ru-RU - - tr-TR - - uk-UA - - th-TH - - vi-VN - - Klingon - example: en-US - description: >- - Locale for the checkout, in IETF BCP 47. It impacts the email - receipt language. Ensure your UI is set to the same language as - specified here. Throws an error if passed an invalid language. - - Payment: - discriminator: - propertyName: method - oneOf: - - type: object - title: EVM - additionalProperties: false - properties: - receiptEmail: - type: string - format: email - description: Email that the receipt will be sent to. - method: - type: string - enum: - - arbitrum-sepolia - - base-sepolia - - ethereum-sepolia - - optimism-sepolia - - arbitrum - - bsc - - ethereum - - optimism - currency: - type: string - enum: - - eth - - usdc - - degen - - brett - - toshi - payerAddress: - type: string - pattern: ^0x[0-9a-fA-F]{40}$ - description: An EVM wallet address. - required: - - method - - currency - - type: object - title: Solana - additionalProperties: false - properties: - receiptEmail: - type: string - format: email - description: Email that the receipt will be sent to. - method: - type: string - enum: - - solana - currency: - type: string - enum: - - sol - - usdc - - bonk - - wif - - mother - payerAddress: - type: string - pattern: ^[1-9A-HJ-NP-Za-km-z]{32,44}$ - description: A Solana public key. - required: - - method - - currency - - type: object - title: Fiat - additionalProperties: false - properties: - receiptEmail: - type: string - format: email - description: Email that the receipt will be sent to. - method: - type: string - enum: - - stripe-payment-element - currency: - default: usd - type: string - enum: - - usd - - eur - - aud - - gbp - - jpy - - sgd - - hkd - - krw - - inr - - vnd - required: - - method - LineItems: - oneOf: - - type: object - title: Single Line Item - additionalProperties: false - properties: - collectionLocator: - description: >- - The collection locator of the line item. For example: - 'crossmint:'. These fields can be retrieved - from the Crossmint console. - type: string - example: crossmint: - callData: - type: object - additionalProperties: {} - description: Information that you pass to your contract mint function. - properties: - totalPrice: - description: >- - The total price of the line item. It must be the same as the - contract expects to receive. Read - https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig - type: string - required: - - collectionLocator - - type: array - title: Multiple Line Items - items: - type: object - additionalProperties: false - properties: - collectionLocator: - description: >- - The collection locator of the line item. Eg. - 'crossmint::', - 'crossmint:'. These fields can be retrieved - from the Crossmint console. - type: string - callData: - type: object - additionalProperties: {} - description: Information that you pass to your contract mint function. - properties: - totalPrice: - description: >- - The total price of the line item. It must be the same as - the contract expects to receive. Read - https://docs.crossmint.com/nft-checkout/advanced/component-properties#mintconfig - type: string - required: - - collectionLocator - - ################################################ - ### RESPONSE OBJECTS - ################################################ - - CreateOrderResponse: - type: object - properties: - clientSecret: - type: string - description: >- - A token exclusively scoped to a particular order, allowing for the reading or updating of that order. - example: "_removed_" - order: - $ref: "#/components/schemas/OrderObject" - - OrderObject: - type: object - properties: - orderId: - type: string - example: "b2959ca5-65e4-466a-bd26-1bd05cb4f837" - phase: - type: string - example: "payment" - locale: - type: string - example: "en-US" - lineItems: - type: array - items: - type: object - properties: - chain: - type: string - example: "polygon-amoy" - quantity: - type: number - example: 1 - callData: - type: object - properties: - quantity: - type: number - example: 1 - ADDITIONAL_PROPERTIES: - type: string - example: "Your other mint function arguments" - metadata: - type: object - properties: - name: - type: string - example: "Headless Checkout Demo" - description: - type: string - example: "NFT Description" - imageUrl: - type: string - example: "https://cdn.io/image.png" - quote: - type: object - properties: - status: - type: string - example: "valid" - charges: - type: object - properties: - unit: - type: object - properties: - amount: - type: string - example: "0.0001" - currency: - type: string - example: "eth" - totalPrice: - type: object - properties: - amount: - type: string - example: "0.0001" - currency: - type: string - example: "eth" - delivery: - type: object - properties: - status: - type: string - example: "awaiting-payment" - recipient: - type: object - properties: - locator: - type: string - example: "email::" - email: - type: string - example: "testy@crossmint.com" - walletAddress: - type: string - example: "0x1234abcd..." - quote: - type: object - properties: - status: - type: string - example: "valid" - quotedAt: - type: string - example: "2024-06-07T16:55:44.653Z" - expiresAt: - type: string - example: "2024-06-07T17:55:44.653Z" - totalPrice: - type: object - properties: - amount: - type: string - example: "0.0001375741" - currency: - type: string - example: "eth" - payment: - type: object - properties: - status: - type: string - example: "awaiting-payment" - method: - type: string - example: "base-sepolia" - currency: - type: string - example: "eth" - preparation: - type: object - properties: - chain: - type: string - example: "base-sepolia" - payerAddress: - type: string - example: "0x1234abcd..." - serializedTransaction: - type: string - example: "0x02f90....." - - Error400Response: - type: object - properties: - error: - type: boolean - example: true - message: - type: string - example: "Invalid arguments or empty parameter ." - - Error403Response: - type: object - properties: - error: - type: boolean - example: true - message: - type: string - example: Malformed API key. / API key provided doesn't have required scopes. - - Error404Response: - type: object - properties: - error: - type: boolean - example: true - message: - type: string - example: "Not found" - - Error503Response: - type: object - properties: - error: - type: boolean - example: true - message: - type: string - example: "Please try again in a few minutes. If the issue still persists, contact Crossmint support." - - Error524Response: - type: object - properties: - error: - type: boolean - example: true - message: - type: string - example: "A timeout occurred." From b6f1dc1760eca9f052d162579ca15310f99c11b5 Mon Sep 17 00:00:00 2001 From: chdeskur Date: Mon, 29 Jul 2024 08:53:29 -0400 Subject: [PATCH 4/6] update security --- apis/HeadlessAPIs.yaml | 6 ------ apis/PaymentsAPIs.yaml | 6 +----- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/apis/HeadlessAPIs.yaml b/apis/HeadlessAPIs.yaml index e4ef3e9..3db5edf 100644 --- a/apis/HeadlessAPIs.yaml +++ b/apis/HeadlessAPIs.yaml @@ -100,7 +100,6 @@ paths: operationId: get-order security: - apiKey: [] - - orderClientSecret: [] tags: - Headless x-fern-sdk-group-name: checkout @@ -153,7 +152,6 @@ paths: operationId: edit-order security: - apiKey: [] - - orderClientSecret: [] tags: - Headless x-fern-sdk-group-name: checkout @@ -209,10 +207,6 @@ components: type: apiKey name: X-API-KEY in: header - orderClientSecret: - type: apiKey - name: Authorization - in: header parameters: orderId: diff --git a/apis/PaymentsAPIs.yaml b/apis/PaymentsAPIs.yaml index 8d3a9d5..a642f5f 100644 --- a/apis/PaymentsAPIs.yaml +++ b/apis/PaymentsAPIs.yaml @@ -324,7 +324,7 @@ paths: **This API is subject to change as it is currently in its alpha form.** operationId: quote security: - - clientId: [] + - apiKey: [] parameters: - name: nativePrice in: query @@ -361,10 +361,6 @@ components: type: apiKey name: X-API-KEY in: header - clientId: - type: apiKey - in: header - name: X-CLIENT-ID schemas: QuoteResponse: type: object From 7628cbea3e8a6f74c02d7be57028a07c8cd9714d Mon Sep 17 00:00:00 2001 From: chdeskur Date: Mon, 29 Jul 2024 12:59:57 -0400 Subject: [PATCH 5/6] remove pull request mode --- fern/generators.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/fern/generators.yml b/fern/generators.yml index 4baa328..aa62d84 100644 --- a/fern/generators.yml +++ b/fern/generators.yml @@ -16,7 +16,6 @@ groups: # token: ${NPM_TOKEN} github: repository: Paella-Labs/typescript-sdk - mode: pull-request smart-casing: true config: namespaceExport: Crossmint From 1f35b70415b5f2d1f446541716a1494c286f47ef Mon Sep 17 00:00:00 2001 From: chdeskur Date: Mon, 29 Jul 2024 13:00:33 -0400 Subject: [PATCH 6/6] add NPM token --- fern/generators.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fern/generators.yml b/fern/generators.yml index aa62d84..bcf1586 100644 --- a/fern/generators.yml +++ b/fern/generators.yml @@ -13,7 +13,7 @@ groups: output: location: npm package-name: "crossmint" - # token: ${NPM_TOKEN} + token: ${NPM_TOKEN} github: repository: Paella-Labs/typescript-sdk smart-casing: true