Response to server-side API requests: 400: Bad request
billing_issue_detected_at_date_comparison_error
A billing issue happens when there’s a problem during a subscription renewal attempt, so it always occurs after the transaction date (purchased_at).
To resolve this, make sure the billing issue date (billing_issue_detected_at) is later than the transaction date (purchased_at).
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always billing_issue_detected_at_date_comparison_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
{
"errors": [
{
"source": "billing_issue_detected_at",
"errors": [
"billing_issue_detected_at must be later than purchased_at."
]
}
],
"error_code": "billing_issue_detected_at_date_comparison_error",
"status_code": 400
}
expires_date_error
A user can’t buy a subscription that has already expired. So, the expires_at date (when the subscription expires) should always be later than the purchased_at date (when the transaction occurred).
To fix this, check these dates and ensure that expires_at is after purchased_at.
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always expires_date_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
{
"errors": [
{
"source": "expires_at",
"errors": [
"expires_at must be later than purchased_at."
]
}
],
"error_code": "expires_date_error",
"status_code": 400
}
family_share_price_error
The request failed because the is_family_shared parameter is set to true, meaning the access level is shared with a family member for free. However, the value parameter of the Price object isn’t set to zero.
If is_family_shared should be true, make sure to set the value parameter of the Price object to 0.
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always: family_share_price_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
The profile is not found
{
"errors": [
{
"source": "is_family_shared",
"errors": [
"If is_family_shared is true, price.value must be 0."
]
}
],
"error_code": "family_share_price_error",
"status_code": 400
}
free_trial_price_error
The request failed because the offer_type parameter is set to free_trial, but the value parameter of the Price object isn’t set to zero.
Another possible reason is that the offer_id parameter was included but left null, even though it can’t be null. In this case, either provide a value for offer_id or remove the parameter entirely.
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always: free_trial_price_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
The profile is not found
{
"errors": [
{
"source": "offer_type",
"errors": [
"If offer_type is 'free_trial', price.value must be 0."
]
}
],
"error_code": "free_trial_price_error",
"status_code": 400
}
grace_period_expires_date_error
A grace period is extra time you can give customers to extend their subscription if they couldn’t renew it on time—for instance, if their credit card didn’t go through. This helps keep their settings intact while they resolve any issues. Offering a grace period is optional.
If you do offer a grace period, the expiration date for it (grace_period_expires_at) should be later than the subscription expiration date (expires_at). If not, the grace period expiration time will match the subscription expiration time. In any case, the grace period expiration can’t be earlier than the subscription expiration.
To fix this, make sure the grace period expiration date (grace_period_expires_at) is later than the subscription expiration date (expires_at).
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always grace_period_expires_date_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
{
"errors": [
{
"source": "grace_period_expires_at",
"errors": [
"grace_period_expires_at must be later or equal to expires_at."
]
}
],
"error_code": "grace_period_expires_date_error",
"status_code": 400
}
grace_period_billing_error
The start of a grace period counts as a billing issue. So, if the grace period has started (indicated by the grace_period_expires_at parameter being filled in), its start date should be recorded in the billing_issue_detected_at parameter.
To fix this, either set the start of the grace period in billing_issue_detected_at or, if the grace period hasn’t started yet, remove the grace_period_expires_at parameter.
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Always grace_period_billing_error. |
| status_code | Integer | HTTP status. Always 400. |
Response example
{
"errors": [
{
"source": "grace_period_billing_error",
"errors": [
"If grace_period_expires_at is specified, billing_issue_detected_at must also be specified."
]
}
],
"error_code": "grace_period_billing_error",
"status_code": 400
}
missing_offer_id
The request failed because the offer_category parameter has a value other than introductory or offer_type but doesn’t include an offer_id. In this case, either provide an offer_id or remove the offer_category or offer_type from the request.
Another possible reason is that the offer_id parameter was added but left as null, even though it can’t be null. If that’s the case, either add a value for offer_id or remove the parameter entirely.
Body
| Parameter | Type | Description |
|---|---|---|
| errors | Object |
|
| error_code | String | Short error name. Possible value: missing_offer_id. |
| status_code | Integer | HTTP status. Always 400. |
Response example
The profile is not found
{
"errors": [
{
"source": "offer_category",
"errors": [
"offer_id must be specified for all offer types except 'introductory'."
]
}
],
"error_code": "missing_offer_id",
"status_code": 400
}