Error Cases
Stay organized with collections
Save and categorize content based on your preferences.
In case of an error, the DPA is expected to return an HTTP status code along
with an HTTP response that MUST include a JSON object
with more information about the error. The error response body MUST contain an
instance of ErrorResponse.
{
"errorMessage": string,
"cause": enum(ErrorCause)
}
DPA error response MUST correspond to the following:
- User is currently roaming and DPA query is disabled for this user. The DPA
returns a 403 error with USER_ROAMING as the error cause.
- The DPA returns a 404 NOT_FOUND error code indicating to GTAF that the user
key is invalid (i.e., non-existing user key) with INVALID_NUMBER.
- The DPA returns a 410 GONE error code with BAD_CPID as the error cause
indicating to GTAF that the client should get a new user key if key_type
= CPID and the CPID has expired.
- The DPA returns a 501 NOT_IMPLEMENTED error code indicating that it does not
support this call with SERVICE_UNAVAILABLE error cause.
- The DPA returns a 429 TOO MANY REQUESTS with TOO_MANY_REQUESTS error cause
with the Retry-After header indicating that GTAF is making too many requests
to the DPA.
- The DPA returns a 409 CONFLICT error indicating that the request cannot be
completed due to a conflict with the current state of the DPA.
- Service temporarily unavailable. The DPA returns a 503 SERVICE UNAVAILABLE
with the Retry-After header indicating when a new request can be attempted.
- The DPA returns a 500 INTERNAL SERVER ERROR error code for all other
unspecified errors ERROR_CAUSE_UNSPECIFIED as the
error cause.
In case of errors encountered during a purchase, the following error codes
represent failed transaction outcomes:
- The DPA returns a 400 BAD REQUEST error code indicating to GTAF that the
purchased plan ID is invalid.
- The DPA returns a 402 PAYMENT REQUIRED error code indicating to GTAF that
user does not have sufficient balance to complete the purchase.
- The DPA returns a 409 CONFLICT error code indicating to GTAF that the plan
to be purchased is incompatible with the user's current product mix. For
example, if the operator data plan policy disallows mixing postpaid and
prepaid plans, attempting to purchase a prepaid plan for a postpaid user
will therefore lead to a 409 CONFLICT error.
- The DPA returns a 403 FORBIDDEN error code indicating to GTAF that the
current transaction is a duplicate of a previously issued transaction. The
DPA SHOULD return the following error causes in response:
- If the previous transaction was a failure, error cause indicating the
reason for failure.
- If the previous transaction was successful, DUPLICATE_TRANSACTION.
- If the previous transaction is still in queue, REQUEST_QUEUED.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-10-03 UTC."],[[["\u003cp\u003eIn case of an error, the DPA returns an HTTP status code and a JSON object containing error details including an error message and cause.\u003c/p\u003e\n"],["\u003cp\u003eSpecific error codes, such as 403, 404, 410, 501, 429, 409, 503 and 500, are used to indicate various error conditions, including roaming, invalid user keys, expired CPIDs, service unavailability, and internal server errors.\u003c/p\u003e\n"],["\u003cp\u003ePurchase errors are indicated by specific HTTP status codes such as 400, 402, 409, and 403, representing invalid plan IDs, insufficient balance, incompatible product mix, and duplicate transactions respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe 403 FORBIDDEN error for duplicate transactions may include additional error causes to provide more context about the previous transaction's status.\u003c/p\u003e\n"]]],[],null,["# Error Cases\n\nIn case of an error, the DPA is expected to return an HTTP status code along\nwith an HTTP response that MUST include a JSON object\nwith more information about the error. The error response body MUST contain an\ninstance of [ErrorResponse](./reference/rest/v1/ErrorResponse). \n\n {\n \"errorMessage\": string,\n \"cause\": enum(ErrorCause)\n }\n\nDPA error response MUST correspond to the following:\n\n- User is currently roaming and DPA query is disabled for this user. The DPA returns a 403 error with USER_ROAMING as the error cause.\n- The DPA returns a 404 NOT_FOUND error code indicating to GTAF that the *user\n key* is invalid (i.e., non-existing *user key*) with INVALID_NUMBER.\n- The DPA returns a 410 GONE error code with BAD_CPID as the error cause indicating to GTAF that the client should get a new *user key* if *key_type\n = CPID* and the CPID has expired.\n- The DPA returns a 501 NOT_IMPLEMENTED error code indicating that it does not support this call with SERVICE_UNAVAILABLE error cause.\n- The DPA returns a 429 TOO MANY REQUESTS with TOO_MANY_REQUESTS error cause with the Retry-After header indicating that GTAF is making too many requests to the DPA.\n- The DPA returns a 409 CONFLICT error indicating that the request cannot be completed due to a conflict with the current state of the DPA.\n- Service temporarily unavailable. The DPA returns a 503 SERVICE UNAVAILABLE with the Retry-After header indicating when a new request can be attempted.\n- The DPA returns a 500 INTERNAL SERVER ERROR error code for all other unspecified errors ERROR_CAUSE_UNSPECIFIED as the error cause.\n\nIn case of errors encountered during a purchase, the following error codes\nrepresent failed transaction outcomes:\n\n- The DPA returns a 400 BAD REQUEST error code indicating to GTAF that the purchased plan ID is invalid.\n- The DPA returns a 402 PAYMENT REQUIRED error code indicating to GTAF that user does not have sufficient balance to complete the purchase.\n- The DPA returns a 409 CONFLICT error code indicating to GTAF that the plan to be purchased is incompatible with the user's current product mix. For example, if the operator data plan policy disallows mixing postpaid and prepaid plans, attempting to purchase a prepaid plan for a postpaid user will therefore lead to a 409 CONFLICT error.\n- The DPA returns a 403 FORBIDDEN error code indicating to GTAF that the current transaction is a duplicate of a previously issued transaction. The DPA SHOULD return the following error causes in response:\n - If the previous transaction was a failure, error cause indicating the reason for failure.\n - If the previous transaction was successful, DUPLICATE_TRANSACTION.\n - If the previous transaction is still in queue, REQUEST_QUEUED."]]