Official Python SDK for the GrabFood Partner API — enables food delivery merchants and platform partners in Southeast Asia to manage orders, store hours, menus, and campaigns programmatically. Auto-generated from Grab's OpenAPI spec using OpenAPITools PythonClientCodegen. IMPORTANT: This SDK covers GrabFood only (merchant/food delivery). Grab rides/mobility has no official Python SDK. The SDK is not published on PyPI — install via GitHub only.
pip install git+https://github.com/grab/grabfood-api-sdk-python.gitVerified import paths — ran on the pinned version, not inferred.
Authentication is a two-step process: obtain an OAuth token from the auth endpoint, then use it as a Bearer token against the GrabFood partner API. The token must be refreshed manually using the expires_in value from the token response — the SDK does not handle token refresh automatically.
Apply for partner access at developer.grab.com before starting integration.
Install only via GitHub: pip install git+https://github.com/grab/grabfood-api-sdk-python.git
Always explicitly set host=PRD_ENV in production: grabfood.Configuration(host=PRD_ENV). Import PRD_ENV from grabfood.configs.config.
Implement token refresh logic using expires_in: store the token issue time, check expiry before each request, and re-authenticate when expired.
For non-GrabFood Grab APIs, use direct HTTP requests against the Grab Partner API with manual OAuth handling.
Verify merchant country scope with Grab during onboarding. Staging environment covers all markets.
Install the SDK directly from GitHub using `pip install git+https://github.com/grab/grabfood-api-sdk-python.git`. Ensure your import statement is `import grabfood`.
Obtain a fresh and valid OAuth access token through the GrabFood Partner API's OAuth flow and include it in your API requests with the `Authorization: Bearer <your_access_token>` header.
Inspect the `ApiException` object's attributes (e.g., `e.status`, `e.reason`, `e.body`) to retrieve detailed error messages from the GrabFood API, then correct your API call's parameters or payload.