> 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 # UpdateReceiptsSettings # Package: receipts # Namespace: ReceiptsSettingsService # Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/receipts/receipts-settings/update-receipts-settings.md ## Permission Scopes: Manage Receipts: SCOPE.RECEIPTS.MANAGE ## Introduction Updates a site's receipt settings, or creates them if none exist. --- ## REST API ### Schema ``` Method: updateReceiptsSettings Description: Updates a site's receipt settings, or creates them if none exist. URL: https://www.wixapis.com/receipts/v1/receipts-settings Method: PATCH # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: receiptsSettings, receiptsSettings.revision, receiptsSettings.numbering Method parameters: param name: receiptsSettings | type: ReceiptsSettings | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt settings are updated. To prevent conflicting changes, the current revision must be passed when updating the receipt settings. | required: true - name: numbering | type: Numbering | description: Receipt numbering settings. | required: true - name: prefix | type: string | description: Receipt prefix that will be displayed before the receipt number. - name: nextNumber | type: integer | description: Next receipt number. Used during receipt creation to ensure unique and consecutive numbering. - name: suffix | type: string | description: Receipt suffix that will be displayed after the receipt number. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt settings. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: UpdateReceiptsSettingsResponse - name: receiptsSettings | type: ReceiptsSettings | description: Updated receipt settings. - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt settings are updated. To prevent conflicting changes, the current revision must be passed when updating the receipt settings. - name: createdDate | type: string | description: Date and time the receipt settings were created. - name: updatedDate | type: string | description: Date and time the receipt settings were last updated. - name: numbering | type: Numbering | description: Receipt numbering settings. - name: prefix | type: string | description: Receipt prefix that will be displayed before the receipt number. - name: nextNumber | type: integer | description: Next receipt number. Used during receipt creation to ensure unique and consecutive numbering. - name: suffix | type: string | description: Receipt suffix that will be displayed after the receipt number. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt settings. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NEXT_NUMBER_DESCENDING | Description: Specified number is lower than the already used number for the prefix. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SUFFIX_CONTAINS_ILLEGAL_CHARACTERS | Description: Specified suffix contains illegal characters. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PREFIX_CONTAINS_ILLEGAL_CHARACTERS | Description: Specified prefix contains illegal characters. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NEXT_NUMBER_MISSING | Description: The `nextNumber` field must be specified. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NO_META_SITE | Description: Site not found. ``` ### Examples ### Update Receipts Settings Updates a Receipts Settings ```curl curl -X POST \ 'https://www.wixapis.com/receipts/v1/receipts-settings' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "receiptsSettings": { "revision": "1", "numbering": { "prefix": "2025x-", "nextNumber": 5, "suffix": "-MY" } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.receipts.ReceiptsSettingsService.updateReceiptsSettings(receiptsSettings) Description: Updates a site's receipt settings, or creates them if none exist. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: receiptsSettings, receiptsSettings.revision, receiptsSettings.numbering Method parameters: param name: receiptsSettings | type: ReceiptsSettings | required: true - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt settings are updated. To prevent conflicting changes, the current revision must be passed when updating the receipt settings. | required: true - name: numbering | type: Numbering | description: Receipt numbering settings. | required: true - name: prefix | type: string | description: Receipt prefix that will be displayed before the receipt number. - name: nextNumber | type: integer | description: Next receipt number. Used during receipt creation to ensure unique and consecutive numbering. - name: suffix | type: string | description: Receipt suffix that will be displayed after the receipt number. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt settings. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Return type: PROMISE - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt settings are updated. To prevent conflicting changes, the current revision must be passed when updating the receipt settings. - name: _createdDate | type: Date | description: Date and time the receipt settings were created. - name: _updatedDate | type: Date | description: Date and time the receipt settings were last updated. - name: numbering | type: Numbering | description: Receipt numbering settings. - name: prefix | type: string | description: Receipt prefix that will be displayed before the receipt number. - name: nextNumber | type: integer | description: Next receipt number. Used during receipt creation to ensure unique and consecutive numbering. - name: suffix | type: string | description: Receipt suffix that will be displayed after the receipt number. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt settings. Extended fields must be configured in the app dashboard before they can be accessed with API calls. - name: namespaces | type: object | description: Extended field data. Each key corresponds to the namespace of the app that created the extended fields. The value of each key is structured according to the schema defined when the extended fields were configured. You can only access fields for which you have the appropriate permissions. Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields.md). Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NEXT_NUMBER_DESCENDING | Description: Specified number is lower than the already used number for the prefix. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SUFFIX_CONTAINS_ILLEGAL_CHARACTERS | Description: Specified suffix contains illegal characters. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PREFIX_CONTAINS_ILLEGAL_CHARACTERS | Description: Specified prefix contains illegal characters. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NEXT_NUMBER_MISSING | Description: The `nextNumber` field must be specified. HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: NO_META_SITE | Description: Site not found. ``` ### Examples ### updateReceiptsSettings ```javascript import { receiptsSettings } from '@wix/get-paid'; async function updateReceiptsSettings(receiptsSettings) { const response = await receiptsSettings.updateReceiptsSettings(receiptsSettings); }; ``` ### updateReceiptsSettings (with elevated permissions) ```javascript import { receiptsSettings } from '@wix/get-paid'; import { auth } from '@wix/essentials'; async function myUpdateReceiptsSettingsMethod(receiptsSettings) { const elevatedUpdateReceiptsSettings = auth.elevate(receiptsSettings.updateReceiptsSettings); const response = await elevatedUpdateReceiptsSettings(receiptsSettings); } ``` ### updateReceiptsSettings (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 { receiptsSettings } from '@wix/get-paid'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { receiptsSettings }, // Include the auth strategy and host as relevant }); async function updateReceiptsSettings(receiptsSettings) { const response = await myWixClient.receiptsSettings.updateReceiptsSettings(receiptsSettings); }; ``` ---