The PagSeguro International API uses standard HTTP status codes to indicate the success or failure of an API request. This page outlines the types of errors you may encounter, how to interpret them, and how to troubleshoot.
HTTP Status Codes
The possible HTTP status code return by the International API are listed and described in the following table.
Status Code | Meaning | When it Happens |
---|---|---|
400 | Bad Request | One or more validation errors occurred. Response includes detailed messages. |
401 | Unauthorized | Missing or invalid authentication credentials. Response body is empty. |
422 | Unprocessable Entity | The request is syntactically correct but cannot be processed semantically. |
Response Formats
400 Bad Request
400 Bad Request
Returned when one or more fields are invalid. The API returns an array of error objects so you can validate all issues at once.
{
"errors": [
{
"message": "Value is required and can't be empty",
"location": "body.payer.email"
},
{
"message": "Invalid type given. String expected",
"location": "body.payer.email"
}
]
}
401 Unauthorized
401 Unauthorized
Returned when the request is not authenticated. The response body is empty:
{}
422 Unprocessable Entity
422 Unprocessable Entity
Returned for semantically incorrect requests such as business logic violations.
{
"error": "charge_payment_method_not_enabled"
}
Error List
400 Bad Request
400 Bad Request
Location | Message |
---|---|
header.authorization | Value is required and can't be empty |
body.integration.reference | Value is required and can't be empty |
body.integration.reference | The input does not match against pattern '^([A-Za-z0-9-_])+$' |
body.integration.reference | The input is less than 4 characters long |
body.integration.reference | The input is more than 64 characters long |
body.integration.reference | Invalid type given. String expected |
body.integration.notification_url | The input does not appear to be a valid Url |
body.integration.notification_url | The input is more than 200 characters long |
body.integration.notification_url | Value is required and can't be empty |
body.integration.notification_url | Invalid type given. String expected |
body.integration.language | Value is required and can't be empty |
body.integration.language | Invalid value. Options are: en_US, es_ES, pt_BR, pt_PT, tr_TR |
body.order.currency | Value is required and can't be empty |
body.order.currency | Invalid currency for charge country BR. Options are: BRL |
body.order.currency | Invalid currency for charge country CL. Options are: CLP |
body.order.currency | Invalid currency for charge country CO. Options are: COP |
body.order.currency | Invalid currency for charge country MX. Options are: MXN |
body.order.currency | Invalid currency for charge country PE. Options are: PEN |
body.order.currency | Invalid value. Options are: BRL, CLP, COP, MXN, PEN |
body.order.items | Value is required and can't be empty |
body.order.items | The items count must be less or equal than 100 |
body.order.items.0.quantity | The input is not strictly an integer |
body.order.items.0.quantity | The input is not greater than or equal to 1 |
body.order.items.0.quantity | Value is required and can't be empty |
body.order.items.0.description | Invalid type given. String expected |
body.order.items.0.description | Value is required and can't be empty |
body.order.items.0.description | The input is more than 180 characters long |
body.order.items.0.unit_price | The input is not strictly a float |
body.order.items.0.unit_price | The input is not greater than or equal to 0.01 |
body.order.items.0.unit_price | Value is required and can't be empty |
body.charge.type | Invalid value. Options are: BR, CL, CO, MX, PE |
body.charge.type | Value is required and can't be empty |
body.charge.type | Invalid value. Options are: CREDIT_CARD |
body.charge.type | Value is required and can't be empty |
body.charge.credit_card | Value is required and can't be empty |
body.charge.credit_card | Invalid value. Options are: raw or token |
body.charge.credit_card.raw | The credit card is already expired |
body.charge.credit_card.raw | Value is required and can't be empty |
body.charge.credit_card.raw.number | The input is more than 19 characters long |
body.charge.credit_card.raw.number | The input is less than 12 characters long |
body.charge.credit_card.raw.number | The input must contain only digits |
body.charge.credit_card.raw.number | Value is required and can't be empty |
body.charge.credit_card.raw.number | Invalid type given. String expected |
body.charge.credit_card.raw.cvc | The input is more than 4 characters long |
body.charge.credit_card.raw.cvc | The input is less than 3 characters long |
body.charge.credit_card.raw.cvc | The input must contain only digits |
body.charge.credit_card.raw.cvc | Value is required and can't be empty |
body.charge.credit_card.raw.cvc | Invalid type given. String expected |
body.charge.credit_card.raw.expiration_month | Invalid value. Options are: 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12 |
body.charge.credit_card.raw.expiration_month | Value is required and can't be empty |
body.charge.credit_card.raw.expiration_year | The input does not appear to be a valid year |
body.charge.credit_card.raw.expiration_year | Value is required and can't be empty |
body.charge.credit_card.raw.expiration_year | Invalid type given. String expected |
body.charge.credit_card.raw.holder_name | Invalid type given. String expected |
body.charge.credit_card.raw.holder_name | The input contains leading or trailing blanks |
body.charge.credit_card.raw.holder_name | The input is less than 2 characters long |
body.charge.credit_card.raw.holder_name | The input is more than 26 characters long |
body.charge.credit_card.raw.holder_name | The input contains more than one space between words |
body.charge.credit_card.raw.holder_name | The input contains invalid characters |
body.charge.credit_card.raw.holder_name | Value is required and can't be empty |
body.charge.credit_card.token | Value is required and can't be empty |
body.charge.credit_card.token | Invalid value given |
body.charge.credit_card.token | Invalid type given. String expected |
body.payer.email | Invalid type given. String expected |
body.payer.email | The input is not a valid email address. Use the basic format [email protected] |
body.payer.email | The input is more than 60 characters long |
body.payer.email | Value is required and can't be empty |
body.payer.ip | Invalid type given. String expected |
body.payer.ip | The input is not a valid ip address |
body.payer.ip | The input is more than 39 characters long |
body.payer.ip | Value is required and can't be empty |
body.payer.person.name | Value is required and can't be empty |
body.payer.person.name | Invalid type given. String expected |
body.payer.person.name | The input is less than 4 characters long |
body.payer.person.name | The input is more than 50 characters long |
body.payer.person.name | The input contains leading or trailing blanks |
body.payer.person.name | The input contains invalid characters |
body.payer.person.name | The surnames words must be between 1 and 40 characters long |
body.payer.person.name | The input must have more than one word |
body.payer.person.name | The first name must be greater than or equal to 2 characters long |
body.payer.person.name | The input contains more than one space between words |
body.payer.person.name | Value is required and can't be empty |
body.payer.person.birth_date | Invalid type given. String expected |
body.payer.person.birth_date | The input does not appear to be a valid date |
body.payer.person.birth_date | The input does not fit the date format 'Y-m-d' |
body.payer.person.birth_date | Value is required and can't be empty |
body.payer.person.document.type | Value is required and can't be empty |
body.payer.person.document.type | Invalid value. Options are: CC, CE, CPF, CURP, DNI, NIT, RFC, RUT, TI, RUC |
body.payer.person.document.type | Invalid document for charge country CO. Options are: CC, CE, TI, NIT |
body.payer.person.document.type | Invalid document for charge country MX. Options are: CURP, RFC |
body.payer.person.document.type | Invalid document for charge country CL. Options are: RUT |
body.payer.person.document.type | Invalid document for charge country PE. Options are: DNI, CE, RUC |
body.payer.person.document.type | Invalid document for charge country BR. Options are: CPF |
body.payer.person.document.number | Invalid type given. String expected |
body.payer.person.document.number | Value is required and can't be empty |
body.payer.person.document.number | The input is invalid for document type CPF |
body.payer.person.document.number | The input is invalid for document type CC |
body.payer.person.document.number | The input is invalid for document type CE |
body.payer.person.document.number | The input is invalid for document type TI |
body.payer.person.document.number | The input is invalid for document type NIT |
body.payer.person.document.number | The input is invalid for document type CURP |
body.payer.person.document.number | The input is invalid for document type RFC |
body.payer.person.document.number | The input is invalid for document type RUT |
body.payer.person.document.number | The input is invalid for document type DNI |
body.payer.person.document.number | The input is invalid for document type RUC |
body.payer.person.phone.country_code | The input must contain only digits |
body.payer.person.phone.country_code | The input is more than 3 characters long |
body.payer.person.phone.country_code | Invalid type given. String expected |
body.payer.person.phone.country_code | Value is required and can't be empty |
body.payer.person.phone.number | The input must contain only digits |
body.payer.person.phone.number | The input is more than 11 characters long |
body.payer.person.phone.number | Invalid type given. String expected |
body.payer.person.phone.number | Value is required and can't be empty |
422 Error List
When the server understands the request but cannot process it due to business rule violations, it returns a 422 Unprocessable Entity
error with the following format:
{
"error": "charge_payment_method_not_enabled"
}
Common 422 Errors
Error Code | Meaning |
---|---|
payer_buy_limit_exceed | End-user has exceeded the monthly limit allowed |
charge_payment_method_not_enabled | The payment method is not enabled for the merchant |
integration_reference_already_exists | The merchant reference is already in use by another transaction |