POST

List Charges


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Wix calls this method to retrieve a list of charges for a paid instance of your app. This happens when Wix creates an invoice or in case the customer wants to preview how much your app would charge them at the moment.

You must return the charges in the currency that's specified in the request, you aren't allowed to return more than 5 charges, and their sum must be lower than the charge limit.

You may not bill customers for any usage that didn’t occur during the period Wix specifies when retrieving the charges. If Wix discovers that your app has charged customers for usage outside of an invoice's specified period, we may take action such as blocking your app from charging the customer, removing your app from the Wix App Market, revoking your access to the Wix developer program, or pursuing legal action to recover damages caused by overcharging. We understand that mistakes can happen and encourage you to contact the Wix App Market team immediately if you become aware of any overcharging issues so that we can work together to resolve the situation.

Endpoint
POST
{DEPLOYMENT-URI}/v1/charges
Body Params
subscriptionIdstringformat GUID

ID of the subscription for which Wix retrieves your custom charges. To track usage and billing for apps, we recommend to use instanceId instead of the subscriptionId.


currencystringformat CURRENCY

Supported values: AUD, BRL, CAD, EUR, GBP, ILS, INR, JPY, MXN, PLN, RUB, TRY, USD.

3-letter currency code in ISO-4217 alphabetic format of your charges to return. Wix may add supported currencies in the future.


periodStartstringformat date-time

Begin of the period Wix retrieves the app instance's charges for in YYYY-MM-DDThh:mm:ss.sssZ format.


periodEndstringformat date-time

End of the period Wix retrieves the app instance's charges for in YYYY-MM-DDThh:mm:ss.sssZ format.


intentstring

Information about what Wix intends to do with the retrieved charges.

Response Object
chargesArray <ChargeLineItem>maxItems 5

Retrieved charges.

Max: 5 charges

Return your app's custom charges.

The data payload includes the following object as an encoded JWT. Here, we show the request and response objects decoded.

Request
cURL
curl -X POST \ 'https://provider.example.com/v1/charges' \ -H 'Authorization: <AUTH>' \ -d '{ "data": { "request": { "subscriptionId": "efa6b37d-74c6-44bb-b639-28c4af3957dd", "currency": "USD", "periodStart": 1677674012000, "periodEnd": 1680179612000, "intent": "CREATE_INVOICE" }, "metadata": { "requestId": "1680014776.67327419774788218037", "identity": { "identityType": "APP", "appId": "365288ae-38f4-4932-92d5-d45c596c7260" }, "instanceId": "3aa496c3-aa49-4369-84e6-3fa1876f191d" } }, "aud": "6675724b-bf3e-482a-9a00-65616953b570", "iss": "wix.com", "iat": 1680014777, "exp": 1683614777 }'
Response
JSON
{ "charges": [ { "id": "Some Charge Id 1", "description": "Setup fee", "amount": "200.00" }, { "id": "Some Charge Id 2", "description": "Usage charges", "amount": "300.00" } ] }
Did this help?