A divisão de um pagamento é realizada através do recurso Pedido (orders), contendo, além de informações do pedido (como dados do comprador, itens do carrinho e endereço de entrega), informações da cobrança e da divisão do pagamento (como o tipo da divisão, os recebedores e os valores que devem ser destinados a cada um).
Funcionalidades
Endpoint | Finalidade |
---|---|
POST /orders | Permite criar um pedido com divisão do pagamento |
GET /orders/{order_id} | Permite consultar informações referentes ao pedido |
GET /splits/{split_id} | Permite consultar informações referentes à divisão do pagamento |
POST /charges/{charge_id}/cancel | Permite cancelar uma cobrança cujo valor foi dividido |
POST /charges/{char_id}/capture | Permite capturar uma cobrança pré-autorizada podendo informar uma nova regra de divisão de pagamento |
Erros
Ao realizar uma requisição, se ocorrer algum erro de validação dos dados ou de alguma regra referente à divisão do pagamento, são retornados na resposta:
- o tipo do erro (campo “error”);
- o nome do parâmetro que gerou o erro, quando aplicável (campo “parameter_name”);
- uma descrição mais detalhada sobre o erro, como por exemplo a regra de preenchimento do parâmetro que gerou o erro ou a regra de negócio que não foi respeitada na requisição (campo “description”);
- o status code HTTP referente ao erro.
Parameter_name | Error | Description | HTTP Status |
---|---|---|---|
splits.receivers | parameter_required_missing | Payment split receivers must be informed | 400 |
splits.receivers | parameter_required_empty | Payment split receivers must be informed | 400 |
splits.receivers.account.id | parameter_required_missing | Receiver account id must be informed | 400 |
splits.receivers.account.id | parameter_required_empty | Receiver account id must be informed | 400 |
receivers.account.id | invalid_id | The receiver {id da conta PagSeguro} was not found | 404 |
splits.receivers.amount.value | parameter_required_missing | Receiver amount must be informed | 400 |
splits.receivers.amount.value | invalid_amount | Receiver amount must be positive and non-zero | 400 |
-- | invalid_min_receivers | At least two receivers must be informed in a split payment | 400 |
-- | invalid_max_receivers | Transaction must have 2 receivers. If your transaction has more than 2 receivers, please send different transactions for each receiver | 400 |
-- | invalid_receivers_list | Primary seller must be informed in the receivers list and must be the owner of the token | 400 |
-- | invalid_receivers_list | Each split receiver must be informed only once | 400 |
-- | seller_account_required | One or more split receivers cannot receive payments | 400 |
-- | account_inactive | One or more receivers cannot receive payments | 400 |
-- | forbidden | One or more receivers are not allowed to split a payment. If you are interested in our split payment product, please contact us at https://dev.pagseguro.uol.com.br/reference/request-approval. | 403 |
splits.method | parameter_required_missing | Payment split method must be informed | 400 |
splits.method | parameter_required_empty | Payment split method must be FIXED or PERCENTAGE | 400 |
splits.method | invalid_parameter | Payment split method must be FIXED or PERCENTAGE | 400 |
splits.receivers.reason | invalid_parameter | The reason for a receiver to participate in a split payment must be a maximum of 255 characters | 400 |
-- | amount_too_large | The sum of the amounts of each receiver must equal the total amount of the transaction | 400 |
-- | amount_too_smal | The sum of the amounts of each receiver must equal the total amount of the transaction | 400 |
-- | amount_too_large | The sum of the percentages of each receiver must equal 100% | 400 |
-- | amount_too_small | The sum of the percentages of each receiver must equal 100% | 400 |
-- | forbidden | This user is not authorized to perform this query | 403 |
-- | invalid_id | Sorry, the split data for this payment could not be found | 404 |
splits.source | parameter_required_missing | Source must be informed | 400 |
splits.source | parameter_required_empty | At this time, it is only possible to split a payment via API Charge or API Order | 400 |
splits.source | invalid_parameter | At this time, it is only possible to split a payment via API Charge or API Order | 400 |