> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # VoidMembershipCharge # Package: memberships # Namespace: MembershipsSPI # Method link: https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/payments/memberships/memberships-service-plugin/void-membership-charge.md ## Introduction This method requests that a membership charge be voided by your app. --- ## REST API ### Schema ``` Method: voidMembershipCharge Description: This method requests that a membership charge be voided by your app. URL: null Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: transactionId Method parameters: param name: transactionId | type: transactionId | description: Transaction GUID to void. | required: true Return type: VoidMembershipChargeResponse EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: TRANSACTION_NOT_FOUND | Description: Transaction not found HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: TRANSACTION_ALREADY_VOIDED | Description: Transaction was already voided HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TRANSACTION_CANNOT_BE_VOIDED | Description: Transaction exists but cannot be voided ``` ### Examples ### Void Membership Charge Void previous membership charge ```curl curl -X POST \ 'https://provider.example.com/v1/void-membership-charge' \ -H 'user-agent: Wix' \ -H 'accept-encoding: gzip, deflate' \ -H 'content-type: text/plain; charset=utf-8' \ --data-binary '{ "transactionId": "a178aeb7-6687-4402-862f-411a8f899205" }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.memberships.MembershipsSPI.voidMembershipCharge(request, metadata) Description: This method requests that a membership charge be voided by your app. Method parameters: param name: metadata | type: Context | description: this message is not directly used by any service, it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform. e.g. SPIs, event-handlers, etc.. NOTE: this context object MUST be provided as the last argument in each Velo method signature. Example: ```typescript export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) { ... } ``` - name: requestId | type: string | description: A unique identifier of the request. You may print this GUID to your logs to help with future debugging and easier correlation with Wix's logs. - name: currency | type: string | description: [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. - name: identity | type: IdentificationData | description: An object that describes the identity that triggered this request. - ONE-OF: - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site. - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site. - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.). - name: appId | type: string | description: GUID of an app. - name: languages | type: array | description: A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. - name: instanceId | type: string | description: The service provider app's instance GUID. param name: request | type: VoidMembershipChargeRequest - name: transactionId | type: string | description: Transaction GUID to void. Return type: PROMISE EMPTY-OBJECT {} Possible Errors: HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: TRANSACTION_NOT_FOUND | Description: Transaction not found HTTP Code: 409 | Status Code: ALREADY_EXISTS | Application Code: TRANSACTION_ALREADY_VOIDED | Description: Transaction was already voided HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TRANSACTION_CANNOT_BE_VOIDED | Description: Transaction exists but cannot be voided ``` ### Examples ### voidMembershipCharge ```javascript import { memberships } from '@wix/ecom/service-plugins'; async function voidMembershipCharge(request,metadata) { const response = await memberships.voidMembershipCharge(request,metadata); }; ``` ### voidMembershipCharge (with elevated permissions) ```javascript import { memberships } from '@wix/ecom/service-plugins'; import { auth } from '@wix/essentials'; async function myVoidMembershipChargeMethod(request,metadata) { const elevatedVoidMembershipCharge = auth.elevate(memberships.voidMembershipCharge); const response = await elevatedVoidMembershipCharge(request,metadata); } ``` ### voidMembershipCharge (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { memberships } from '@wix/ecom/service-plugins'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { memberships }, // Include the auth strategy and host as relevant }); async function voidMembershipCharge(request,metadata) { const response = await myWixClient.memberships.voidMembershipCharge(request,metadata); }; ``` ---