Pagamentos recorrentes - API
Observação
Os pagamentos recorrentes foram descontinuados e não são oferecidos aos comerciantes.Como funciona?
Considerar
Pagamentos recorrentes somente está disponível para contas do Brasil, Colômbia, Peru e México.Com a finalidade de garantir o correto uso do sistema, todos os pedidos devem conter o cabeçalho HTTP de autorização com as credenciais do comércio, de maneira que possa ser identificado quem está realizando o pedido. Para esta implementação será usada autorização básica, onde se envia o nome de usuário (API Login) e senha (API Key).
Estes são os dados que devem ser enviados no cabeçalho do pedido: Os dados passam uma codificação base 64 com formato: API Login : API Key
.
Exemplo, se o API Login é 0123ABCDEF
e API Key é A1B2C3D4E5
, então o cabeçalho de autorização seria o seguinte:
Authorization: Basic <base64 of 0123ABCDEF:A1B2C3D4E5>
Authorization: Basic MDEyM0FCQ0RFRjpBMUIyQzNENEU1
POST /payments-api/4.0/service.cgi HTTP/1.1
Host: sandbox.api.payulatam.com
Content-Type: application/json; charset=utf-8
Accept: application/json
Accept-language: es
Content-Length: length
Authorization: Basic MDEyM0FCQ0RFRjpBMUIyQzNENEU1
Apontando os correspondentes URLs:
API
- Teste:
https://sandbox.api.payulatam.com/payments-api/
- Produção:
https://api.payulatam.com/payments-api/
Os métodos disponíveis para os pagamentos recorrentes são Plano, Cliente, Cartão de crédito, Assinatura e Taxa extra. A seguir, você encontrará a descrição de cada um.
1. Plano
Mediante esta funcionalidade você pode registrar os dados do cartão de crédito de um cliente e assim obter um código sequencial token.
As seguintes operações estão disponíveis:
URL | Método | Descrição |
---|---|---|
/rest/v4.9/plans | POST |
Criação de um novo plano para assinaturas associado ao comércio. |
/rest/v4.9/plans/{planCode} | PUT |
Atualizar a informação de um plano para assinaturas.{planCode} : Código de identificação do plano para o comércio. |
/rest/v4.9/plans/{planCode} | GET |
Consultar toda a informação de um plano para assinaturas associado ao comércio.{planCode} : Código de identificação do plano para o comércio. |
/rest/v4.9/plans/{planCode} | DELETE |
Apagar todo um plano para assinaturas associado ao comércio.{planCode} : Código de identificação do plano para o comércio. |
Criação
Exemplo pedido:
{
"accountId": "512321",
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"interval": "MONTH",
"intervalCount": "1",
"maxPaymentsAllowed": "12",
"paymentAttemptsDelay": "1",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": "20000",
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": "1600",
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": "8400",
"currency": "COP"
}
]
}
Exemplo resposta:
{
"id": "b3d406d0-abd4-473c-a557-25aa81ff9032",
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": "512321",
"intervalCount": 1,
"interval": "MONTH",
"maxPaymentsAllowed": 12,
"maxPaymentAttempts": 0,
"paymentAttemptsDelay": 1,
"maxPendingPayments": 0,
"trialDays": 0,
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 20000,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 8400,
"currency": "COP"
}
]
}
Exemplo pedido:
<plan>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<maxPendingPayments>0</maxPendingPayments>
<trialDays>30</trialDays>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
Exemplo resposta:
<plan>
<id>0b63bd6d-9a2b-4c40-a314-a70a6bae27e3</id>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<maxPendingPayments>0</maxPendingPayments>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<trialDays>30</trialDays>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
Atualização
Exemplo pedido:
{
"planCode": "sample-plan-code-001",
"description": "New Sample Plan 001",
"paymentAttemptsDelay": "3",
"maxPendingPayments": "1",
"maxPaymentAttempts": "1",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": "10000",
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": "0",
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": "0",
"currency": "COP"
}
]
}
Exemplo resposta:
{
"id": "6b104e86-d6ca-41b5-ae39-834a55ed1565",
"planCode": "sample-plan-code-001",
"description": "New Sample Plan 001",
"accountId": "512321",
"intervalCount": 1,
"interval": "MONTH",
"maxPaymentsAllowed": 12,
"maxPaymentAttempts": 1,
"paymentAttemptsDelay": 3,
"maxPendingPayments": 1,
"trialDays": 0,
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
]
}
Exemplo pedido:
<plan>
<description>New Sample Plan 001</description>
<maxPaymentAttempts>3</maxPaymentAttempts>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<maxPendingPayments>1</maxPendingPayments>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
Exemplo resposta:
<plan>
<id>6b104e86-d6ca-41b5-ae39-834a55ed1565</id>
<planCode>sample-plan-code-001</planCode>
<description>New Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<maxPendingPayments>1</maxPendingPayments>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<trialDays>0</trialDays>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
Consulta
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/plans/sample-plan-code-001
Exemplo resposta:
{
"id": "2a852bf2-ce67-4920-b9a6-66af2c68b4ae",
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": 1,
"intervalCount": 1,
"interval": "MONTH",
"maxPaymentsAllowed": 12,
"maxPaymentAttempts": 3,
"paymentAttemptsDelay": 1,
"maxPendingPayments": 0,
"trialDays": 30,
"additionalValues": [
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_VALUE",
"value": 20000,
"currency": "COP"
}
]
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/plans/sample-plan-code-001
Exemplo resposta:
<plan>
<id>2a852bf2-ce67-4920-b9a6-66af2c68b4ae</id>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>1</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<maxPendingPayments>0</maxPendingPayments>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<trialDays>30</trialDays>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
Exclusão
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/plans/sample-plan-code-001
Exemplo resposta:
HTTP STATUS: 200 OK
2. Cliente
Um cliente é a unidade que identifica quem será o beneficiário de um produto ou serviço prestado e que se encontra associado a um plano de pagamentos recorrentes.
As seguintes operações estão disponíveis:
URL | Método | Descrição |
---|---|---|
/rest/v4.9/customers/ | POST |
Criação de um cliente no sistema. |
/rest/v4.9/customers/{customerId} | PUT |
Atualiza a informação de um cliente no sistema.{customerId} : Identificador do cliente que se deseja atualizar. |
/rest/v4.9/customers/{customerId} | GET |
Consulta a informação relacionada com o cliente.{customerId} : Identificador do cliente do qual se deseja conhecer a informação associada. |
/rest/v4.9/customers/{customerId} | DELETE |
Apaga um usuário do sistema.{customerId} : Identificador do cliente que se deseja apagar. |
Criação
Exemplo pedido:
{
"fullName": "Pedro E. Perez",
"email": "pperez@payulatam.com"
}
Exemplo resposta:
{
"id": "6ahxar252",
"fullName": "Pedro E. Perez",
"email": "pperez@payulatam.com"
}
Exemplo pedido:
<customer>
<fullName>Pedro E. Perez</fullName>
<email>pperez@payulatam.com</email>
</customer>
Exemplo resposta:
<customer>
<id>6ahxar252</id>
<fullName>Pedro E. Pérez</fullName>
<email>pperez@payulatam.com</email>
</customer>
Atualização
Exemplo pedido:
{
"fullName": "Pedro E. Perez",
"email": "pperez@payulatam.com"
}
Exemplo resposta:
{
"id": "6ahxar252",
"fullName": "Pedro E. Perez",
"email": "pperez@payulatam.com"
}
Exemplo pedido:
<customer>
<fullName>Pedro E. Perez</fullName>
<email>pperez@payulatam.com</email>
</customer>
Exemplo resposta:
<customer>
<id>6ahxar252</id>
<fullName>Pedro E. Pérez</fullName>
<email>pperez@payulatam.com</email>
</customer>
Consulta
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/customers/2mkls9xekm
Exemplo resposta:
{
"id": "2mkls9xekm",
"fullName": "Pedro Perez",
"email": "pperez@payulatam.com",
"creditCards": [
{
"token": "da2224a9-58b7-482a-9866-199de911c23f",
"customerId": "2mkls9xekm",
"number": "************4242",
"name": "Usuario Prueba",
"type": "VISA",
"address": {
"line1": "Street 93B",
"line2": "17 25",
"line3": "Office 301",
"city": "Bogota",
"country": "CO",
"postalCode": "00000",
"phone": "300300300"
}
}
],
"subscriptions": [
{
"id": "2mlhk3qxji",
"quantity": "1",
"installments": "1",
"currentPeriodStart": "2013-08-30T10:46:41.477-05:00",
"currentPeriodEnd": "2013-09-29T10:46:41.477-05:00",
"plan": {
"id": "414215a2-c990-4525-ba84-072181988d09",
"planCode": "PLAN-REST-16",
"description": "Plan rest test",
"accountId": "1",
"intervalCount": "1",
"interval": "MONTH",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": "20000",
"currency": "COP"
}
]
}
}
]
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/customers/2mkls9xekm
Exemplo resposta:
<customer>
<id>2mkls9xekm</id>
<fullName>Pedro Perez</fullName>
<email>pperez@payulatam.com</email>
<creditCards>
<creditCard>
<token>da2224a9-58b7-482a-9866-199de911c23f</token>
<customerId>2mkls9xekm</customerId>
<number>************4242</number>
<name>Usuario Prueba</name>
<type>VISA</type>
<address>
<line1>Calle 93B</line1>
<line2>17 25</line2>
<line3>Oficina 301</line3>
<city>Bogota</city>
<country>CO</country>
<postalCode>00000</postalCode>
<phone>300300300</phone>
</address>
</creditCard>
</creditCards>
<subscriptions>
<subscription>
<id>2mlhk3qxji</id>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2013-08-30T10:46:41.477-05:00</currentPeriodStart>
<currentPeriodEnd>2013-09-29T10:46:41.477-05:00</currentPeriodEnd>
<plan>
<id>414215a2-c990-4525-ba84-072181988d09</id>
<planCode>PLAN-REST-16</planCode>
<description>Plan rest test</description>
<accountId>1</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
</subscriptions>
</customer>
Exclusão
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/customers/7wp1r0atl
Exemplo resposta:
{
"description": "O cliente [7wp1r0atl] foi removido."
}
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/customers/7wp1r0atl
Exemplo resposta:
<response>
<description>O cliente [7wp1r0atl] foi removido</description>
</response>
3. Cartão de crédito
É a forma de pagamento com a qual um Plano se relaciona a um Pagador, é composto pelo número de cartão de crédito (o qual será tokenizado para armazenar os dados de forma segura), a data de vencimento do cartão e alguns dados adicionais de endereço.
As seguintes operações estão disponíveis:
URL | Método | Descrição |
---|---|---|
/rest/v4.9/customers/{customerID}/creditCards | POST |
Criação de um cartão de crédito (Token) e associá-lo a um usuário. {customerId} : Identificador do cliente ao qual será associado o token |
/rest/v4.9/creditCards/{creditCardId} | PUT |
Atualizar a informação de um token.{creditCardId} : Identificador do token que se deseja atualizar. |
/rest/v4.9/creditCards/{creditCardId} | GET |
Consultar a informação de um cartão de crédito (Token) dado seu identificador.{creditCardId} : Token do cartão de crédito que deseja consultar. |
/rest/v4.9/customers/{customerID}/creditCards/{creditCardId} | DELETE |
Apagar um cartão de crédito (Token) associado a um usuário. {customerId} : Identificador do cliente do qual será apagado o token. {creditCardId} : Identificador do token que se deseja apagar. |
Criação
Exemplo pedido:
{
"name": "Sample User Name",
"document": "1020304050",
"number": "4242424242424242",
"expMonth": "01",
"expYear": "2018",
"type": "VISA",
"address": {
"line1": "Address Name",
"line2": "17 25",
"line3": "Of 301",
"postalCode": "00000",
"city": "City Name",
"state": "State Name",
"country": "CO",
"phone": "300300300"
}
}
Exemplo resposta:
{
"token": "8186ca42-2f69-417b-94a0-208bd8e089af"
}
Exemplo pedido:
<creditCard>
<name>Sample User Name</name>
<document>1020304050</document>
<number>4242424242424242</number>
<expMonth>01</expMonth>
<expYear>2018</expYear>
<type>VISA</type>
<address>
<line1>Address Name</line1>
<line2>17 25</line2>
<line3>Of 301</line3>
<postalCode>00000</postalCode>
<city>City Name</city>
<state>State Name</state>
<country>CO</country>
<phone>300300300</phone>
</address>
</creditCard>
Exemplo resposta:
<creditCard>
<token>8186ca42-2f69-417b-94a0-208bd8e089af</token>
</creditCard>
Atualização
Exemplo pedido:
{
"expMonth": "12",
"expYear": "2016",
"name": "Sample user name",
"document": "65858645",
"address": {
"line1": "Sample Address",
"line2": "Cll 93 B",
"line3": "Ofic. 301",
"postalCode": "00000",
"city": "city",
"country": "CO",
"state": "state",
"phone": "2266758"
}
}
Exemplo resposta:
{
"token": "a068e980-a6d7-4a19-b549-75c04f39ec22",
"customerId": "eab38z33hh2",
"number": "424242******4242",
"type": "VISA",
"name": "Sample user name",
"document": "65858645",
"address": {
"line1": "Sample Address",
"line2": "Cll 93 B",
"line3": "Ofic. 301",
"city": "city",
"state": "state",
"country": "CO",
"postalCode": "00000",
"phone": "2266758"
}
}
Exemplo pedido:
<creditCard>
<expMonth>12</expMonth>
<expYear>2016</expYear>
<name>Sample user name</name>
<document>65858645</document>
<address>
<line1>Sample Address</line1>
<line2>Cll 93 B</line2>
<line3>Ofic. 301</line3>
<postalCode>00000</postalCode>
<city>city</city>
<country>CO</country>
<state>state</state>
<phone>2266758</phone>
</address>
</creditCard>
Exemplo resposta:
<creditCard>
<token>a068e980-a6d7-4a19-b549-75c04f39ec22</token>
<customerId>eab38z33hh2</customerId>
<number>424242******4242</number>
<name>Sample user names</name>
<document>65858645</document>
<type>VISA</type>
<address>
<line1>Sample Addresss</line1>
<line2>Cll 93 B</line2>
<line3>Ofic. 301</line3>
<city>city</city>
<state>state</state>
<country>CO</country>
<postalCode>00000</postalCode>
<phone>2266758</phone>
</address>
</creditCard>
Consulta
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/customers/2mkls9xekm
Exemplo resposta:
{
"token": "256f8e39-e37c-4ff3-9b5f-63937ee5c69c",
"customerId": "5whjhimjtpn",
"number": "424242******4242",
"type": "VISA",
"name": "Sample User Name",
"document": "1020304050",
"address": {
"line1": "Address Name",
"line2": "17 25",
"line3": "Of 301",
"city": "City Name",
"state": "State Name",
"country": "CO",
"postalCode": "00000",
"phone": "300300300"
}
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/customers/2mkls9xekm
Exemplo resposta:
<creditCard>
<token>8186ca42-2f69-417b-94a0-208bd8e089af</token>
<customerId>11sgnt8s19</customerId>
<number>************4242</number>
<name>Sample User Name</name>
<type>VISA</type>
<address>
<line1>Address Name</line1>
<line2>17 25</line2>
<line3>Of 301</line3>
<city>City Name</city>
<state>State Name</state>
<country>CO</country>
<postalCode>00000</postalCode>
<phone>300300300</phone>
</address>
</creditCard>
Exclusão
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/customers/{customerID}/creditCards/{creditCardId}
Exemplo resposta:
{
"description": "O cartão de crédito f17e9c5c-c414-4dc0-a145-5b0647f7dbf8 foi removido com sucesso"
}
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/customers/{customerID}/creditCards/{creditCardId}
Exemplo resposta:
<response>
<description>O cartão de crédito f17e9c5c-c414-4dc0-a145-5b0647f7dbf8 foi removido com sucesso</description>
</response>
4. Assinatura
Uma assinatura é a relação entre um plano de pagamentos, um pagador e um cartão de crédito e é o elemento com o qual se controla a execução das cobranças competentes.
As seguintes operações estão disponíveis:
URL | Métodos | Descrição |
---|---|---|
/rest/v4.9/subscriptions/ | POST | Criação de uma nova assinatura de um cliente para um plano. |
/rest/v4.9/subscriptions/{subscriptionId} | PUT | Atualizar a informação associada à assinatura indicada. Neste momento somente é possível atualizar o token do cartão de crédito ao qual se realiza o encargo da assinatura.{subscriptionId} : Identificação da assinatura. |
/rest/v4.9/subscriptions/{subscriptionId} | GET | Consultar a informação básica associada à assinatura indicada.{subscriptionId} : Identificação da assinatura. |
/rest/v4.9/subscriptions/{subscriptionId} | DELETE | Apagar a assinatura, ou seja, a relação do cliente ao plano.{subscriptionId} : Identificação da assinatura. |
Criação
Com todos os elementos novos
Exemplo pedido:
{
"quantity": "1",
"installments": "1",
"trialDays": "15",
"customer": {
"fullName": "Pedro Perez",
"email": "pperez@payulatam.com",
"creditCards": [
{
"name": "Pedro Perez",
"document": "101010123",
"number": "4242424242424242",
"expMonth": "01",
"expYear": "2018",
"type": "VISA",
"address": {
"line1": "Address Name",
"line2": "17 25",
"line3": "Of 301",
"postalCode": "00000",
"city": "City Name",
"state": "State Name",
"country": "CO",
"phone": "300300300"
}
}
]
},
"plan": {
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": "512321",
"intervalCount": "1",
"interval": "MONTH",
"maxPaymentsAllowed": "12",
"maxPaymentAttempts": "3",
"paymentAttemptsDelay": "1",
"maxPendingPayments": "1",
"trialDays": "30",
"additionalValues": [
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 8400,
"currency": "COP"
}
]
}
}
Exemplo resposta:
{
"id": "563cbd0o54z",
"plan": {
"id": "145ad747-adeb-43db-80c0-447c8f7ad8b4",
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": "512321",
"intervalCount": 1,
"interval": "MONTH",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 8400,
"currency": "COP"
}
]
},
"customer": {
"id": "a39e3zvsru6",
"fullName": "Pedro Perez",
"email": "pperez@payulatam.com",
"creditCards": [
{
"token": "7b6d637a-6252-47ee-8d3b-ed91807b3146"
}
]
},
"quantity": "1",
"installments": "1",
"currentPeriodStart": 1402203600000,
"currentPeriodEnd": 1404795599000
}
Exemplo pedido:
<subscription>
<trialDays>30</trialDays>
<installments>1</installments>
<customer>
<fullName>Pedro Perez</fullName>
<email>pperezz@payulatam.com</email>
<creditCards>
<creditCard>
<number>4242424242424242</number>
<name>Sample User Name</name>
<expMonth>1</expMonth>
<expYear>2018</expYear>
<type>VISA</type>
<address>
<line1>Address Name</line1>
<line2>17 25</line2>
<line3>Of 301</line3>
<city>City Name</city>
<state>State Name</state>
<country>CO</country>
<postalCode>00000</postalCode>
<phone>300300300</phone>
</address>
</creditCard>
</creditCards>
</customer>
<plan>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<maxPendingPayments>1</maxPendingPayments>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Exemplo resposta:
<subscription>
<id>26fb7yxfej0</id>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-23T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-22T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>047dbnhsnx9</id>
<fullName>Pedro Perez</fullName>
<email>pperezz@payulatam.com</email>
<creditCards>
<creditCard>
<token>daedc017-bd7d-4887-87b4-13913650c952</token>
</creditCard>
</creditCards>
</customer>
<plan>
<id>77e57940-e149-4f77-a190-271caa7ccb7b</id>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<additionalValues>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Com todos os elementos existentes
Exemplo pedido:
{
"quantity": "1",
"installments": "1",
"trialDays": "10",
"customer": {
"id": "eab38z33hh2",
"creditCards": [
{
"token": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
]
},
"plan": {
"planCode": "sample-plan-code-001"
}
}
Exemplo resposta:
{
"id": "fb6d0m9nqb8",
"plan": {
"id": "6b104e86-d6ca-41b5-ae39-834a55ed1565",
"planCode": "sample-plan-code-001",
"description": "New Sample Plan 001",
"accountId": 512321,
"intervalCount": 1,
"interval": "MONTH",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 0,
"currency": "COP"
}
]
},
"customer": {
"id": "eab38z33hh2",
"fullName": "Pedro Perez",
"email": "pperez@payulatam.com",
"creditCards": [
{
"token": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
]
},
"quantity": 1,
"installments": 1,
"trialDays": "30",
"currentPeriodStart": 1397192400000,
"currentPeriodEnd": 1428728399000
}
Exemplo pedido:
<subscription>
<quantity>1</quantity>
<installments>1</installments>
<trialDays>10</trialDays>
<customer>
<id>eab38z33hh2</id>
<creditCards>
<creditCard>
<token>a068e980-a6d7-4a19-b549-75c04f39ec22</token>
</creditCard>
</creditCards>
</customer>
<plan>
<planCode>sample-plan-code-001</planCode>
</plan>
</subscription>
Exemplo resposta:
<subscription>
<id>fb6d0m9nqb8</id>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-03T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-02T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>eab38z33hh2</id>
<fullName>Pedro Perez</fullName>
<email>pperezz@payulatam.com</email>
<creditCards>
<creditCard>
<token>a068e980-a6d7-4a19-b549-75c04f39ec22</token>
</creditCard>
</creditCards>
</customer>
<plan>
<id>6b104e86-d6ca-41b5-ae39-834a55ed1565</id>
<planCode>sample-plan-code-001</planCode>
<description>New Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Plano e cliente já criados, e um cartão novo
Exemplo pedido:
{
"quantity": "1",
"installments": "1",
"trialDays": "10",
"customer": {
"id": "eab38z33hh2",
"creditCards": [
{
"name": "Sample User Name",
"document": "101010123",
"number": "4242424242424242",
"expMonth": "01",
"expYear": "2018",
"type": "VISA",
"address": {
"line1": "Address Name",
"line2": "17 25",
"line3": "Of 301",
"postalCode": "00000",
"city": "City Name",
"state": "State Name",
"country": "CO",
"phone": "300300300"
}
}
]
},
"plan": {
"planCode": "sample-plan-code-001"
}
}
Exemplo resposta:
{
"id": "c50d94ge25d",
"plan": {
"id": "6b104e86-d6ca-41b5-ae39-834a55ed1565",
"planCode": "sample-plan-code-001",
"description": "New Sample Plan 001",
"accountId": "512321",
"intervalCount": 1,
"interval": "MONTH",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
]
},
"customer": {
"id": "eab38z33hh2",
"fullName": "Pedro Perez",
"email": "pperezz@payulatam.com",
"creditCards": [
{
"token": "508a715f-2feb-46ba-8945-c948821f080e"
}
]
},
"quantity": "1",
"installments": "1",
"currentPeriodStart": 1401771600000,
"currentPeriodEnd": 1404363599000
}
Exemplo pedido:
<subscription>
<trialDays>10</trialDays>
<installments>1</installments>
<customer>
<id>eab38z33hh2</id>
<creditCards>
<creditCard>
<number>4242424242424242</number>
<name>Sample User Name</name>
<expMonth>1</expMonth>
<expYear>2018</expYear>
<type>VISA</type>
<address>
<line1>Address Name</line1>
<line2>17 25</line2>
<line3>Of 301</line3>
<city>City Name</city>
<state>State Name</state>
<country>CO</country>
<postalCode>00000</postalCode>
<phone>300300300</phone>
</address>
</creditCard>
</creditCards>
</customer>
<plan>
<planCode>sample-plan-code-001</planCode>
</plan>
</subscription>
Exemplo resposta:
<subscription>
<id>40adcwryufe</id>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-03T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-02T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>eab38z33hh2</id>
<fullName>Pedro Perez</fullName>
<email>pperezz@payulatam.com</email>
<creditCards>
<creditCard>
<token>508a715f-2feb-46ba-8945-c948821f080e</token>
</creditCard>
</creditCards>
</customer>
<plan>
<id>6b104e86-d6ca-41b5-ae39-834a55ed1565</id>
<planCode>sample-plan-code-001</planCode>
<description>New Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Cliente e cartão já criados, e com plano novo
Exemplo pedido:
{
"installments": "1",
"trialDays": "30",
"customer": {
"id": "eab38z33hh2",
"creditCards": [
{
"token": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
]
},
"plan": {
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": "512321",
"intervalCount": "1",
"interval": "MONTH",
"maxPaymentsAllowed": "12",
"maxPaymentAttempts": "3",
"paymentAttemptsDelay": "1",
"maxPendingPayments": "1",
"trialDays": "30",
"additionalValues": [
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 8400,
"currency": "COP"
}
]
}
}
Exemplo resposta:
{
"id": "320756yk1x0",
"plan": {
"id": "68ee02fa-8d1e-4bc3-88fb-b6e66586df3b",
"planCode": "sample-plan-code-001",
"description": "Sample Plan 001",
"accountId": "512321",
"intervalCount": 1,
"interval": "MONTH",
"additionalValues": [
{
"name": "PLAN_VALUE",
"value": 10000,
"currency": "COP"
},
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_TAX_RETURN_BASE",
"value": 8400,
"currency": "COP"
}
]
},
"customer": {
"id": "eab38z33hh2",
"fullName": "Pedro Perez",
"email": "pperezz@payulatam.com",
"creditCards": [
{
"token": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
]
},
"quantity": "1",
"installments": "1",
"currentPeriodStart": 1403499600000,
"currentPeriodEnd": 1406091599000
}
Exemplo pedido:
<subscription>
<trialDays>30</trialDays>
<installments>1</installments>
<customer>
<id>eab38z33hh2</id>
<creditCards>
<creditCard>
<token>a068e980-a6d7-4a19-b549-75c04f39ec22</token>
</creditCard>
</creditCards>
</customer>
<plan>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<maxPaymentsAllowed>12</maxPaymentsAllowed>
<maxPaymentAttempts>3</maxPaymentAttempts>
<maxPendingPayments>1</maxPendingPayments>
<paymentAttemptsDelay>1</paymentAttemptsDelay>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Exemplo resposta:
<subscription>
<id>17d11h3b2xs</id>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-23T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-22T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>eab38z33hh2</id>
<fullName>Pedro Perez</fullName>
<email>pperezz@payulatam.com</email>
<creditCards>
<creditCard>
<token>a068e980-a6d7-4a19-b549-75c04f39ec22</token>
</creditCard>
</creditCards>
</customer>
<plan>
<id>c653e0ba-e0cb-49d9-9294-1d5617be8f6c</id>
<planCode>sample-plan-code-001</planCode>
<description>Sample Plan 001</description>
<accountId>512321</accountId>
<intervalCount>1</intervalCount>
<interval>MONTH</interval>
<additionalValues>
<additionalValue>
<name>PLAN_TAX</name>
<value>1600</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>PLAN_TAX_RETURN_BASE</name>
<value>8400</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</plan>
</subscription>
Atualização (Cartão de credito de uma assinatura)
Exemplo pedido:
{
"creditCardToken": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
Exemplo resposta:
{
"id": "320756yk1x0",
"plan": {
"id": "68ee02fa-8d1e-4bc3-88fb-b6e66586df3b"
},
"customer": {
"id": "eab38z33hh2"
},
"trialDays": "30",
"quantity": "1",
"installments": "1",
"currentPeriodStart": 1403499600000,
"currentPeriodEnd": 1406091599000,
"creditCardToken": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
Exemplo pedido:
<subscription>
<creditCardToken>a068e980-a6d7-4a19-b549-75c04f39ec22</creditCardToken>
</subscription>
Exemplo resposta:
<subscription>
<id>320756yk1x0</id>
<trialDays>30</trialDays>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-23T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-22T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>eab38z33hh2</id>
</customer>
<plan>
<id>68ee02fa-8d1e-4bc3-88fb-b6e66586df3b</id>
</plan>
<creditCardToken>a068e980-a6d7-4a19-b549-75c04f39ec22</creditCardToken>
</subscription>
Consulta
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/subscriptions/1dhb51hfuu
Exemplo resposta:
{
"id": "320756yk1x0",
"plan": {
"id": "68ee02fa-8d1e-4bc3-88fb-b6e66586df3b"
},
"customer": {
"id": "eab38z33hh2"
},
"trialDays": "30",
"quantity": "1",
"installments": "1",
"currentPeriodStart": 1403499600000,
"currentPeriodEnd": 1406091599000,
"creditCardToken": "a068e980-a6d7-4a19-b549-75c04f39ec22"
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/subscriptions/1dhb51hfuu
Exemplo resposta:
<subscription>
<id>320756yk1x0</id>
<trialDays>30</trialDays>
<quantity>1</quantity>
<installments>1</installments>
<currentPeriodStart>2014-06-23T00:00:00-05:00</currentPeriodStart>
<currentPeriodEnd>2014-07-22T23:59:59-05:00</currentPeriodEnd>
<customer>
<id>eab38z33hh2</id>
</customer>
<plan>
<id>68ee02fa-8d1e-4bc3-88fb-b6e66586df3b</id>
</plan>
<creditCardToken>a068e980-a6d7-4a19-b549-75c04f39ec22</creditCardToken>
</subscription>
Exclusão
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/subscriptions/3hpyu04ij
Exemplo resposta:
{
"description": "A assinatura [3hpyu04ij] foi cancelada"
}
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/subscriptions/3hpyu04ij
Exemplo resposta:
<response>
<description>A assinatura [3hpyu04ij] foi cancelada</description>
</response>
5. Taxas extras
Um encargo pode ser uma cobrança adicional ou um desconto realizado sobre o valor de um dos pagamentos que conformam o plano de pagamentos recorrentes. Estes somente afetam a próxima cobrança pendente e são executados uma única vez.
As seguintes operações estão disponíveis:
URL | Métodos | Descrição |
---|---|---|
/rest/v4.9/subscriptions/{subscriptionId}/recurringBillItems | POST |
Adiciona taxas extras na fatura correspondente ao período atual.{subscriptionId} : Identificação da assinatura. |
/rest/v4.9/recurringBillItems/{recurringBillItemId} | PUT |
Atualiza a informação da taxa extra de uma fatura.{recurringBillItemId} : Identificador da taxa extra. |
/rest/v4.9/recurringBillItems/{recurringBillItemId} | GET |
Consulta a informação da taxa extra de uma fatura a partir de seu identificador.{recurringBillItemId} : Identificador da taxa extra. |
/rest/v4.9/recurringBillItems/{recurringBillItemId} | DELETE |
Apagar uma taxa extra de uma fatura.{recurringBillItemId} : Identificador da taxa extra. |
/rest/v4.9/recurringBillItems/ | GET |
Consulta dos encargos extras das faturas do comércio que cumprem com os filtros estipulados. Os filtros disponíveis são mostrados a seguir e devem ser enviados como named parameters dentro do URL:{subscriptionId} : Identificação da assinatura.{description} : Descrição ingresada en el cargo extra |
Criação
Exemplo pedido:
{
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": "20000",
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": "0",
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": "0",
"currency": "COP"
}
]
}
Exemplo resposta:
{
"id": "522023su5xg",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
],
"subscriptionId": "52b04sx2s6"
}
Exemplo pedido:
<recurringBillItem>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
Exemplo resposta:
<recurringBillItem>
<id>5e174m7lgns</id>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
<subscriptionId>52b04sx2s6</subscriptionId>
</recurringBillItem>
Atualização
Exemplo pedido:
{
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": "20000",
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": "0",
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": "0",
"currency": "COP"
}
]
}
Exemplo resposta:
{
"id": "5e174m7lgns",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
],
"subscriptionId": "52b04sx2s6"
}
Exemplo pedido:
<recurringBillItem>
<isTest>false</isTest>
<id>5e174m7lgns</id>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
Exemplo resposta:
<recurringBillItem>
<id>5e174m7lgns</id>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
<subscriptionId>52b04sx2s6</subscriptionId>
</recurringBillItem>
Consulta
Por id da taxa adicional
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/2uww909obl
Exemplo resposta:
{
"id": "5wm1pxmpiwq",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
}
],
"subscriptionId": "5wjxrja8mz9"
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/2uww909obl
Exemplo resposta:
<recurringBillItem>
<id>2uww909obl</id>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_VALUE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
<additionalValue>
<name>ITEM_TAX_RETURN_BASE</name>
<value>0</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
Por descrição da taxa adicional
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/?description=Cargo%20b
Exemplo resposta:
{
"recurringBillItemList": [
{
"id": "5vsags0qsdo",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
}
],
"subscriptionId": "5vsa272tek7"
},
{
"id": "5wm1pxmpiwq",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
],
"subscriptionId": "5wjxrja8mz9"
}
]
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/?description=Cargo%20b
Exemplo resposta:
<recurringBillItemResponse>
<recurringBillItems>
<recurringBillItem>
<id>2waez3h9ac</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>15000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>24e207ivi</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000.49</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>26gzctvub</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000.49</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>2uxvargit1</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000.49</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>2uy01uio7o</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>10000.49</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>2ve0qtsjzz</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>15000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>2w16yddd98</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>15000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
</recurringBillItems>
</recurringBillItemResponse>
Por assinatura
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/?subscriptionId=26gyv192a
Exemplo resposta:
{
"recurringBillItemList": [
{
"id": "5wjxrkgk7rc",
"description": "Custo do plano",
"additionalValues": [
{
"name": "PLAN_TAX",
"value": 1600,
"currency": "COP"
},
{
"name": "PLAN_VALUE",
"value": 20000,
"currency": "COP"
}
],
"subscriptionId": "5wjxrja8mz9"
},
{
"id": "5wm1pxmpiwq",
"description": "Cargo extra de prueba",
"additionalValues": [
{
"name": "ITEM_VALUE",
"value": 20000,
"currency": "COP"
},
{
"name": "ITEM_TAX",
"value": 0,
"currency": "COP"
},
{
"name": "ITEM_TAX_RETURN_BASE",
"value": 0,
"currency": "COP"
}
],
"subscriptionId": "5wjxrja8mz9"
}
]
}
Exemplo pedido:
GET https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/?subscriptionId=26gyv192a
Exemplo resposta:
<recurringBillItemResponse>
<recurringBillItems>
<recurringBillItem>
<id>2waez3h9ac</id>
<description>Cargo básico</description>
<additionalValues>
<additionalValue>
<name>PLAN_VALUE</name>
<value>15000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
<recurringBillItem>
<id>2uww909obl</id>
<description>Cargo extra de prueba</description>
<additionalValues>
<additionalValue>
<name>ITEM_VALUE</name>
<value>20000</value>
<currency>COP</currency>
</additionalValue>
</additionalValues>
</recurringBillItem>
</recurringBillItems>
</recurringBillItemResponse>
Exclusão
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/ou8ru86nq
Exemplo resposta:
{
"description": "recurring bill item ou8ru86nq has been removed successfully"
}
Exemplo pedido:
DELETE https://api.payulatam.com/payments-api/rest/v4.3/recurringBillItems/ou8ru86nq
Exemplo resposta:
<response>
<description>recurring bill item ou8ru86nq has been removed successfully</description>
</response>