Skip to content

Invalid deliveryStatus error (4000036) when sending consumption request with DeliveryStatus.DELIVERED #183

@eareyereading

Description

@eareyereading

Description

Summary

When sending a consumption request using the Python App Store Server Library, the API returns a 4000036 error indicating that the deliveryStatus field is invalid, even though a valid enum value (DELIVERED) is used.


Request Payload

{
    'transactionId': '520002716506581',
    'customerConsented': True,
    'sampleContentProvided': True,
    'deliveryStatus': DeliveryStatus.DELIVERED,
    'consumptionPercentage': 0,
    'refundPreference': RefundPreference.GRANT_FULL
}

Error Response

(400, 4000036, 'Invalid request. The delivery status field is invalid.')

Stack Trace

File "/code/index.py", line 39, in handler
    processPayload(payload, environment)

File "/code/PayloadProcessor.py", line 74, in processPayload
    handleConsumptionRequest(transaction, environment)

File "/code/PayloadProcessor.py", line 201, in handleConsumptionRequest
    client.send_consumption_information(transactionId, consumptionRequest)

File "/code/python/appstoreserverlibrary/api_client.py", line 882, in send_consumption_information
    self._make_request(f"/inApps/v2/transactions/consumption/{transaction_id}", "PUT", {}, consumption_request, None, None)

File "/code/python/appstoreserverlibrary/api_client.py", line 684, in _make_request
    return self._parse_response(response.status_code, response.headers, lambda: response.json(), destination_class)

File "/code/python/appstoreserverlibrary/api_client.py", line 661, in _parse_response
    raise APIException(status_code, response_body['errorCode'], response_body['errorMessage'])

Expected Behavior

The request should be accepted when using a valid DeliveryStatus enum value such as DELIVERED.


Actual Behavior

The API rejects the request with error code 4000036, stating that the deliveryStatus field is invalid.


Environment

  • Library: app-store-server-library-python
  • API: App Store Server API (Consumption endpoint)
  • Runtime: Python (version 3.12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions