> 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 # CreateReceiptPreset # Package: receipts # Namespace: ReceiptPresets # Method link: https://dev.wix.com/docs/api-reference/business-management/get-paid/receipts/receipt-presets/create-receipt-preset.md ## Permission Scopes: Manage Receipts: SCOPE.RECEIPTS.MANAGE ## Introduction Creates a receipt preset. --- ## REST API ### Schema ``` Method: createReceiptPreset Description: Creates a receipt preset. URL: https://www.wixapis.com/receipts/v1/receipt-presets Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: receiptPreset Method parameters: param name: receiptPreset | type: ReceiptPreset | description: A Receipt preset is a set of customizable receipt configurations that control the information, design, and branding of receipts to align with a site's business needs. | required: true - name: name | type: string | description: Receipt preset name. - name: displaySettings | type: DisplaySettings | description: Display settings. - name: businessDisplayOptions | type: BusinessDisplayOptions | description: Business display options. - name: showBusinessEmail | type: boolean | description: Whether to display the business email in the receipt. - name: showBusinessPhoneNumber | type: boolean | description: Whether to display the business phone number in the receipt. - name: showBusinessAddress | type: boolean | description: Whether to display the business address in the receipt. - name: customerDisplayOptions | type: CustomerDisplayOptions | description: Customer display options. - name: showCustomerEmail | type: boolean | description: Whether to display the customer's email in the receipt. - name: showCustomerPhoneNumber | type: boolean | description: Whether to display the customer's phone number in the receipt. - name: showCustomerShippingAddress | type: boolean | description: Whether to display the customer's shipping address in the receipt. - name: showCustomerBillingAddress | type: boolean | description: Whether to display the customer's billing address in the receipt. - name: showCustomerVatId | type: boolean | description: Whether to display the customer's VAT GUID in the receipt. - name: showCustomerCompanyName | type: boolean | description: Whether to display the customer's company's name. - name: itemsDisplayOptions | type: ItemsDisplayOption | description: Item display options. - name: showItemsDescription | type: boolean | description: Whether to display item descriptions in the receipt. - name: showTax | type: boolean | description: Whether to display item taxes in the receipt. - name: totalsDisplayOptions | type: TotalsDisplayOption | description: Totals display options. - name: showTaxBreakdown | type: boolean | description: Whether to display the tax breakdown in the receipt. - name: showItemSubtotalPerTaxBreakdown | type: boolean | description: Whether to display the item subtotal per tax breakdown in the receipt. - name: customFields | type: CustomFields | description: Custom fields. Values appear on the receipt in the specified order. - name: headerCustomFields | type: array | description: Header custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: businessCustomFields | type: array | description: Business custom fields. - name: customerCustomFields | type: array | description: Customer custom fields. - name: footerCustomFields | type: array | description: Footer custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: displayValues | type: DisplayValues | description: Display values. - name: titleOverride | type: string | description: Text override for receipt title. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt preset. 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: CreateReceiptPresetResponse - name: receiptPreset | type: ReceiptPreset | description: Created receipt preset. - name: id | type: string | description: Receipt preset GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt preset is updated. To prevent conflicting changes, the current revision must be passed when updating the receipt preset. - name: createdDate | type: string | description: Date and time the receipt preset was created. - name: updatedDate | type: string | description: Date and time the receipt preset was last updated. - name: name | type: string | description: Receipt preset name. - name: displaySettings | type: DisplaySettings | description: Display settings. - name: businessDisplayOptions | type: BusinessDisplayOptions | description: Business display options. - name: showBusinessEmail | type: boolean | description: Whether to display the business email in the receipt. - name: showBusinessPhoneNumber | type: boolean | description: Whether to display the business phone number in the receipt. - name: showBusinessAddress | type: boolean | description: Whether to display the business address in the receipt. - name: customerDisplayOptions | type: CustomerDisplayOptions | description: Customer display options. - name: showCustomerEmail | type: boolean | description: Whether to display the customer's email in the receipt. - name: showCustomerPhoneNumber | type: boolean | description: Whether to display the customer's phone number in the receipt. - name: showCustomerShippingAddress | type: boolean | description: Whether to display the customer's shipping address in the receipt. - name: showCustomerBillingAddress | type: boolean | description: Whether to display the customer's billing address in the receipt. - name: showCustomerVatId | type: boolean | description: Whether to display the customer's VAT GUID in the receipt. - name: showCustomerCompanyName | type: boolean | description: Whether to display the customer's company's name. - name: itemsDisplayOptions | type: ItemsDisplayOption | description: Item display options. - name: showItemsDescription | type: boolean | description: Whether to display item descriptions in the receipt. - name: showTax | type: boolean | description: Whether to display item taxes in the receipt. - name: totalsDisplayOptions | type: TotalsDisplayOption | description: Totals display options. - name: showTaxBreakdown | type: boolean | description: Whether to display the tax breakdown in the receipt. - name: showItemSubtotalPerTaxBreakdown | type: boolean | description: Whether to display the item subtotal per tax breakdown in the receipt. - name: customFields | type: CustomFields | description: Custom fields. Values appear on the receipt in the specified order. - name: headerCustomFields | type: array | description: Header custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: businessCustomFields | type: array | description: Business custom fields. - name: customerCustomFields | type: array | description: Customer custom fields. - name: footerCustomFields | type: array | description: Footer custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: default | type: boolean | description: Whether this is the default receipt preset. The default preset is used during receipt creation when a preset isn't specified or doesn't exist. - name: displayValues | type: DisplayValues | description: Display values. - name: titleOverride | type: string | description: Text override for receipt title. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt preset. 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: NO_META_SITE | Description: Site not found. HTTP Code: 500 | Status Code: INTERNAL | Application Code: APP_INSTALLATION_FAILED | Description: Receipts app failed to install. ``` ### Examples ### Create Receipt Preset Creates a Receipt Preset ```curl curl -X POST \ 'https://www.wixapis.com/receipts/v1/receipt-presets' \ -H 'Authorization: ' \ -H 'Content-Type: application/json' \ -d '{ "receiptPreset": { "name": "Invoice preset", "templateSettingsId": "4fd78c54-b722-4300-ac62-ea71ceaec00f", "displayValue": { "titleOverride": "INV-Receipt" }, "displaySettings": { "businessDisplayOptions": { "showBusinessEmail": true, "showBusinessPhoneNumber": true, "showBusinessAddress": true }, "customerDisplayOptions": { "showCustomerEmail": true, "showCustomerPhoneNumber": true, "showCustomerShippingAddress": true, "showCustomerBillingAddress": true, "showCustomerVatId": true }, "itemsDisplayOptions": { "showItemsDescription": true, "showTax": true }, "totalsDisplayOptions": { "showTaxBreakdown": true, "showItemSubtotalPerTaxBreakdown": true } }, "customFields": { "headerCustomFields": [ { "title": "Source", "value": "Invoices" } ], "businessCustomFields": [ { "title": "Business ID", "value": "12345" } ], "customerCustomFields": [ { "title": "Customer Type", "value": "Invoice Customer" } ], "footerCustomFields": [ { "title": "Terms", "value": "This receipt align to the requirements of an example." } ] } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.receipts.ReceiptPresets.createReceiptPreset(receiptPreset) Description: Creates a receipt preset. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: receiptPreset Method parameters: param name: receiptPreset | type: ReceiptPreset | description: A Receipt preset is a set of customizable receipt configurations that control the information, design, and branding of receipts to align with a site's business needs. | required: true - name: name | type: string | description: Receipt preset name. - name: displaySettings | type: DisplaySettings | description: Display settings. - name: businessDisplayOptions | type: BusinessDisplayOptions | description: Business display options. - name: showBusinessEmail | type: boolean | description: Whether to display the business email in the receipt. - name: showBusinessPhoneNumber | type: boolean | description: Whether to display the business phone number in the receipt. - name: showBusinessAddress | type: boolean | description: Whether to display the business address in the receipt. - name: customerDisplayOptions | type: CustomerDisplayOptions | description: Customer display options. - name: showCustomerEmail | type: boolean | description: Whether to display the customer's email in the receipt. - name: showCustomerPhoneNumber | type: boolean | description: Whether to display the customer's phone number in the receipt. - name: showCustomerShippingAddress | type: boolean | description: Whether to display the customer's shipping address in the receipt. - name: showCustomerBillingAddress | type: boolean | description: Whether to display the customer's billing address in the receipt. - name: showCustomerVatId | type: boolean | description: Whether to display the customer's VAT GUID in the receipt. - name: showCustomerCompanyName | type: boolean | description: Whether to display the customer's company's name. - name: itemsDisplayOptions | type: ItemsDisplayOption | description: Item display options. - name: showItemsDescription | type: boolean | description: Whether to display item descriptions in the receipt. - name: showTax | type: boolean | description: Whether to display item taxes in the receipt. - name: totalsDisplayOptions | type: TotalsDisplayOption | description: Totals display options. - name: showTaxBreakdown | type: boolean | description: Whether to display the tax breakdown in the receipt. - name: showItemSubtotalPerTaxBreakdown | type: boolean | description: Whether to display the item subtotal per tax breakdown in the receipt. - name: customFields | type: CustomFields | description: Custom fields. Values appear on the receipt in the specified order. - name: headerCustomFields | type: array | description: Header custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: businessCustomFields | type: array | description: Business custom fields. - name: customerCustomFields | type: array | description: Customer custom fields. - name: footerCustomFields | type: array | description: Footer custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: displayValues | type: DisplayValues | description: Display values. - name: titleOverride | type: string | description: Text override for receipt title. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt preset. 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: _id | type: string | description: Receipt preset GUID. - name: revision | type: string | description: Revision number, which increments by 1 each time the receipt preset is updated. To prevent conflicting changes, the current revision must be passed when updating the receipt preset. - name: _createdDate | type: Date | description: Date and time the receipt preset was created. - name: _updatedDate | type: Date | description: Date and time the receipt preset was last updated. - name: name | type: string | description: Receipt preset name. - name: displaySettings | type: DisplaySettings | description: Display settings. - name: businessDisplayOptions | type: BusinessDisplayOptions | description: Business display options. - name: showBusinessEmail | type: boolean | description: Whether to display the business email in the receipt. - name: showBusinessPhoneNumber | type: boolean | description: Whether to display the business phone number in the receipt. - name: showBusinessAddress | type: boolean | description: Whether to display the business address in the receipt. - name: customerDisplayOptions | type: CustomerDisplayOptions | description: Customer display options. - name: showCustomerEmail | type: boolean | description: Whether to display the customer's email in the receipt. - name: showCustomerPhoneNumber | type: boolean | description: Whether to display the customer's phone number in the receipt. - name: showCustomerShippingAddress | type: boolean | description: Whether to display the customer's shipping address in the receipt. - name: showCustomerBillingAddress | type: boolean | description: Whether to display the customer's billing address in the receipt. - name: showCustomerVatId | type: boolean | description: Whether to display the customer's VAT GUID in the receipt. - name: showCustomerCompanyName | type: boolean | description: Whether to display the customer's company's name. - name: itemsDisplayOptions | type: ItemsDisplayOption | description: Item display options. - name: showItemsDescription | type: boolean | description: Whether to display item descriptions in the receipt. - name: showTax | type: boolean | description: Whether to display item taxes in the receipt. - name: totalsDisplayOptions | type: TotalsDisplayOption | description: Totals display options. - name: showTaxBreakdown | type: boolean | description: Whether to display the tax breakdown in the receipt. - name: showItemSubtotalPerTaxBreakdown | type: boolean | description: Whether to display the item subtotal per tax breakdown in the receipt. - name: customFields | type: CustomFields | description: Custom fields. Values appear on the receipt in the specified order. - name: headerCustomFields | type: array | description: Header custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: businessCustomFields | type: array | description: Business custom fields. - name: customerCustomFields | type: array | description: Customer custom fields. - name: footerCustomFields | type: array | description: Footer custom fields. - name: title | type: string | description: Title. - name: value | type: string | description: Value. - name: default | type: boolean | description: Whether this is the default receipt preset. The default preset is used during receipt creation when a preset isn't specified or doesn't exist. - name: displayValues | type: DisplayValues | description: Display values. - name: titleOverride | type: string | description: Text override for receipt title. - name: extendedFields | type: ExtendedFields | description: Custom field data for the receipt preset. 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: NO_META_SITE | Description: Site not found. HTTP Code: 500 | Status Code: INTERNAL | Application Code: APP_INSTALLATION_FAILED | Description: Receipts app failed to install. ``` ### Examples ### createReceiptPreset ```javascript import { receiptPresets } from '@wix/get-paid'; async function createReceiptPreset(receiptPreset) { const response = await receiptPresets.createReceiptPreset(receiptPreset); }; ``` ### createReceiptPreset (with elevated permissions) ```javascript import { receiptPresets } from '@wix/get-paid'; import { auth } from '@wix/essentials'; async function myCreateReceiptPresetMethod(receiptPreset) { const elevatedCreateReceiptPreset = auth.elevate(receiptPresets.createReceiptPreset); const response = await elevatedCreateReceiptPreset(receiptPreset); } ``` ### createReceiptPreset (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 { receiptPresets } from '@wix/get-paid'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { receiptPresets }, // Include the auth strategy and host as relevant }); async function createReceiptPreset(receiptPreset) { const response = await myWixClient.receiptPresets.createReceiptPreset(receiptPreset); }; ``` ---