From 0f26ea7bcc4c9f23d26bd40a8294106a8e5b8bbf Mon Sep 17 00:00:00 2001 From: andrew-paystack Date: Thu, 24 Jul 2025 22:09:21 +0300 Subject: [PATCH 1/2] Add virtual terminal schema, examples & responses --- base/paystack.yaml | 713 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 713 insertions(+) diff --git a/base/paystack.yaml b/base/paystack.yaml index 22c5013..6d8a40f 100644 --- a/base/paystack.yaml +++ b/base/paystack.yaml @@ -876,6 +876,201 @@ paths: $ref: '#/components/responses/Unauthorized' default: description: Server error + /virtual_terminal: + post: + tags: + - virtualTerminal + summary: Create Virtual Terminal + operationId: virtualTerminal_create + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalCreate' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalCreateSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + get: + tags: + - virtualTerminal + summary: List Virtual Terminals + operationId: virtualTerminal_list + parameters: + - name: perPage + in: query + schema: + type: integer + - name: page + in: query + schema: + type: integer + responses: + '200': + $ref: '#/components/responses/VirtualTerminalListSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + /virtual_terminal/{code}: + parameters: + - name: code + in: path + required: true + schema: + type: string + get: + tags: + - virtualTerminal + summary: Fetch Virtual Terminal + operationId: virtualTerminal_fetch + responses: + '200': + $ref: '#/components/responses/VirtualTerminalFetchSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + put: + tags: + - virtualTerminal + summary: Update Virtual Terminal + operationId: virtualTerminal_update + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalUpdate' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalUpdateSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + /virtual_terminal/{code}/deactivate: + parameters: + - name: code + in: path + required: true + schema: + type: string + put: + tags: + - virtualTerminal + summary: Deactivate Virtual Terminal + operationId: virtualTerminal_deactivate + responses: + '200': + $ref: '#/components/responses/VirtualTerminalDeactivateSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + /virtual_terminal/{code}/destination/assign: + parameters: + - name: code + in: path + required: true + schema: + type: string + post: + tags: + - virtualTerminal + summary: Assign Destination to Virtual Terminal + operationId: virtualTerminal_destinationAssign + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationAssign' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationAssign' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalDestinationAssignSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + /virtual_terminal/{code}/destination/unassign: + parameters: + - name: code + in: path + required: true + schema: + type: string + post: + tags: + - virtualTerminal + summary: Unassign Destination from Virtual Terminal + operationId: virtualTerminal_destinationUnassign + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationUnassign' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationUnassign' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalDestinationUnassignSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server error + /virtual_terminal/{code}/split_code: + parameters: + - name: code + in: path + required: true + schema: + type: string + put: + tags: + - virtualTerminal + summary: Add Split Code to Virtual Terminal + operationId: virtualTerminal_addSplitCode + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalAddSplitCode' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/VirtualTerminalAddSplitCode' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalAddSplitCodeSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server Error + delete: + tags: + - virtualTerminal + summary: Remove Split Code from Virtual Terminal + operationId: virtualTerminal_deleteSplitCode + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDeleteSplitCode' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/VirtualTerminalDeleteSplitCode' + responses: + '200': + $ref: '#/components/responses/VirtualTerminalDeleteSplitCodeSuccess' + '401': + $ref: '#/components/responses/Unauthorized' + default: + description: Server Error /customer: post: tags: @@ -5830,6 +6025,470 @@ components: required: - status - message + VirtualTerminalCreate: + type: object + required: + - name + - destinations + properties: + name: + type: string + description: The name of the virtual terminal + destinations: + type: array + description: Array of objects containing recipients for payment notifications for the Virtual Terminal. + items: + type: object + properties: + target: + type: string + description: The WhatsApp number to receive payment notifications + name: + type: string + description: The name of the associated WhatsApp number + split_code: + type: string + description: Split code to associate with the virtual terminal + metadata: + type: object + description: Additional custom data as key-value pairs + example: + name: "Sample Terminal" + destinations: + - target: "+2548012345678" + name: "John Doe" + - target: "+2548098765432" + name: "Jane Smith" + VirtualTerminalCreateResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: object + properties: + id: + type: integer + name: + type: string + integration: + type: integer + domain: + type: string + code: + type: string + paymentMethods: + type: array + items: {} + active: + type: boolean + metadata: + nullable: true + destinations: + type: array + items: + type: object + properties: + target: + type: string + type: + type: string + name: + type: string + currency: + type: string + required: + - id + - name + - integration + - domain + - code + - paymentMethods + - active + - metadata + - destinations + - currency + required: + - status + - message + - data + VirtualTerminalListResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: array + items: + $ref: '#/components/schemas/VirtualTerminalListResponseArray' + meta: + type: object + properties: + total: + type: integer + skipped: + type: integer + perPage: + anyOf: + - type: string + - type: integer + page: + type: integer + pageCount: + type: integer + VirtualTerminalListResponseArray: + type: object + properties: + id: + type: integer + code: + type: string + name: + type: string + integration: + type: integer + domain: + type: string + paymentMethods: + type: array + items: {} + active: + type: boolean + created_at: + type: string + currency: + type: string + required: + - id + - code + - name + - integration + - domain + - paymentMethods + - active + - created_at + - currency + VirtualTerminalFetchResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: object + properties: + id: + type: integer + code: + type: string + name: + type: string + integration: + type: integer + domain: + type: string + paymentMethods: + type: array + items: {} + active: + type: boolean + created_at: + type: string + connect_account_id: + nullable: true + destinations: + type: array + items: + type: object + properties: + target: + type: string + type: + type: string + name: + type: string + created_at: + type: string + currency: + type: string + required: + - id + - code + - name + - integration + - domain + - paymentMethods + - active + - created_at + - connect_account_id + - destinations + - currency + required: + - status + - message + - data + VirtualTerminalUpdate: + type: object + properties: + name: + description: Name of the virtual terminal + type: string + required: + - name + VirtualTerminalUpdateResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: object + properties: + id: + type: integer + code: + type: string + name: + type: string + integration: + type: integer + domain: + type: string + paymentMethods: + type: array + items: {} + active: + type: boolean + created_at: + type: string + connect_account_id: + nullable: true + destinations: + type: array + items: + type: object + properties: + target: + type: string + type: + type: string + name: + type: string + created_at: + type: string + currency: + type: string + required: + - id + - code + - name + - integration + - domain + - paymentMethods + - active + - created_at + - connect_account_id + - destinations + - currency + required: + - status + - message + - data + VirtualTerminalDeactivateResponse: + type: object + properties: + status: + type: boolean + message: + type: string + required: + - status + - message + VirtualTerminalDestinationAssign: + type: object + required: + - destinations + properties: + destinations: + type: array + description: Array of objects containing recipients for payment notifications for the Virtual Terminal. + items: + type: object + properties: + target: + type: string + description: The WhatsApp number to receive payment notifications + name: + type: string + description: The name of the associated WhatsApp number + required: + - target + - name + example: + destinations: + - target: "+2548012345678" + name: "John Doe" + - target: "+2548098765432" + name: "Jane Smith" + VirtualTerminalDestinationAssignResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: array + items: + type: object + properties: + integration: + type: integer + target: + type: string + name: + type: string + type: + type: string + id: + type: integer + createdAt: + type: string + updatedAt: + type: string + required: + - integration + - target + - name + - type + - id + - createdAt + - updatedAt + required: + - status + - message + - data + VirtualTerminalDestinationUnassign: + type: object + properties: + targets: + type: array + items: + type: string + required: + - targets + example: + targets: + - "+2548012345678" + - "+2548098765432" + VirtualTerminalDestinationUnassignResponse: + type: object + properties: + status: + type: boolean + message: + type: string + required: + - status + - message + VirtualTerminalAddSplitCode: + type: object + required: + - split_code + properties: + split_code: + description: The split code to assign to the virtual terminal + type: string + example: + split_code: SPL_1234567890abcdef + VirtualTerminalAddSplitCodeResponse: + type: object + properties: + status: + type: boolean + message: + type: string + data: + type: object + properties: + id: + type: integer + name: + type: string + type: + type: string + currency: + type: string + integration: + type: integer + domain: + type: string + split_code: + type: string + active: + type: boolean + bearer_type: + type: string + bearer_subaccount: + nullable: true + createdAt: + type: string + updatedAt: + type: string + is_dynamic: + type: boolean + subaccounts: + type: array + items: + $ref: '#/components/schemas/SplitSubaccountsArray' + total_subaccounts: + type: integer + required: + - id + - name + - type + - currency + - integration + - domain + - split_code + - active + - bearer_type + - bearer_subaccount + - createdAt + - updatedAt + - is_dynamic + - subaccounts + - total_subaccounts + required: + - status + - message + - data + VirtualTerminalDeleteSplitCode: + type: object + properties: + split_code: + description: The split code to assign to the virtual terminal + type: string + example: + split_code: SPL_1234567890abcdef + required: + - split_code + VirtualTerminalDeleteSplitCodeResponse: + type: object + properties: + status: + type: boolean + message: + type: string + required: + - status + - message CustomerListResponseArray: type: object properties: @@ -15944,6 +16603,60 @@ components: application/json: schema: $ref: '#/components/schemas/TerminalDecommissionDeviceResponse' + VirtualTerminalCreateSuccess: + description: Virtual Terminal Create response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalCreateResponse' + VirtualTerminalListSuccess: + description: Virtual Terminal Lists response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalListResponse' + VirtualTerminalFetchSuccess: + description: Virtual Terminal Fetch response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalFetchResponse' + VirtualTerminalUpdateSuccess: + description: Virtual Terminal Update response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalUpdateResponse' + VirtualTerminalDeactivateSuccess: + description: Virtual Terminal Deactivate response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDeactivateResponse' + VirtualTerminalDestinationAssignSuccess: + description: Virtual Terminal Deactivate response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationAssignResponse' + VirtualTerminalDestinationUnassignSuccess: + description: Virtual Terminal unassign response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDestinationUnassignResponse' + VirtualTerminalAddSplitCodeSuccess: + description: Virtual Terminal Split Assign response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalAddSplitCodeResponse' + VirtualTerminalDeleteSplitCodeSuccess: + description: Virtual Terminal Split Remove response + content: + application/json: + schema: + $ref: '#/components/schemas/VirtualTerminalDeleteSplitCodeResponse' CustomerListSuccess: description: Customer List response content: From 125fdaffa6425079b321263d94cf5a8baa8617f6 Mon Sep 17 00:00:00 2001 From: andrew-paystack Date: Mon, 28 Jul 2025 12:26:58 +0300 Subject: [PATCH 2/2] rename virtual terminal tags --- base/paystack.yaml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/base/paystack.yaml b/base/paystack.yaml index 6d8a40f..2b91ac4 100644 --- a/base/paystack.yaml +++ b/base/paystack.yaml @@ -23,6 +23,10 @@ tags: description: | A collection of endpoints for building delightful in-person payment experiences x-product-name: Terminal + - name: Virtual Terminal + description: | + A collection of endpoints for building in-person payments without a physical terminal + x-product-name: Virtual Terminal - name: Customer description: | A collection of endpoints for creating and managing customers on an integration @@ -879,7 +883,7 @@ paths: /virtual_terminal: post: tags: - - virtualTerminal + - Virtual Terminal summary: Create Virtual Terminal operationId: virtualTerminal_create requestBody: @@ -896,7 +900,7 @@ paths: description: Server error get: tags: - - virtualTerminal + - Virtual Terminal summary: List Virtual Terminals operationId: virtualTerminal_list parameters: @@ -924,7 +928,7 @@ paths: type: string get: tags: - - virtualTerminal + - Virtual Terminal summary: Fetch Virtual Terminal operationId: virtualTerminal_fetch responses: @@ -936,7 +940,7 @@ paths: description: Server error put: tags: - - virtualTerminal + - Virtual Terminal summary: Update Virtual Terminal operationId: virtualTerminal_update requestBody: @@ -960,7 +964,7 @@ paths: type: string put: tags: - - virtualTerminal + - Virtual Terminal summary: Deactivate Virtual Terminal operationId: virtualTerminal_deactivate responses: @@ -979,7 +983,7 @@ paths: type: string post: tags: - - virtualTerminal + - Virtual Terminal summary: Assign Destination to Virtual Terminal operationId: virtualTerminal_destinationAssign requestBody: @@ -1006,7 +1010,7 @@ paths: type: string post: tags: - - virtualTerminal + - Virtual Terminal summary: Unassign Destination from Virtual Terminal operationId: virtualTerminal_destinationUnassign requestBody: @@ -1033,7 +1037,7 @@ paths: type: string put: tags: - - virtualTerminal + - Virtual Terminal summary: Add Split Code to Virtual Terminal operationId: virtualTerminal_addSplitCode requestBody: @@ -1053,7 +1057,7 @@ paths: description: Server Error delete: tags: - - virtualTerminal + - Virtual Terminal summary: Remove Split Code from Virtual Terminal operationId: virtualTerminal_deleteSplitCode requestBody: