cURL
curl --request POST \ --url https://{site}.payloop.dev/api/subscriptions/{subscription_id}/items \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "item": { "product_handle": "maranhao-familiar", "quantity": 1 } } '
{ "data": { "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a", "activate_on_payment": true, "activated_at": "2023-11-07T05:31:56Z", "balance_in_cents": 123, "created_at": "2023-11-07T05:31:56Z", "current_period_started_at": "2023-11-07T05:31:56Z", "current_period_ends_at": "2023-11-07T05:31:56Z", "interval": 123, "interval_unit": "month", "state": "created", "previous_state": "created", "prepaid": true, "updated_at": "2023-11-07T05:31:56Z", "customer": { "id": 123, "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "email": "[email protected]", "first_name": "John", "last_name": "Doe", "address": "Av. Paulista, 1000", "address_2": "Apto 101", "city": "São Paulo", "state": "SP", "zip": "01310100", "country": "BR", "phone": "11999999999", "document_number": "63054375056 ou 41903356000112" }, "items": [ { "id": 123, "quantity": 123, "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "product": { "id": 123, "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "name": "Maranhão familiar", "description": "Plano familiar com telemedicina para você e sua família", "handle": "maranhao-familiar" }, "price_point": { "id": 123, "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z", "name": "Mensal", "handle": "familiar-mensal", "price_int_cents": 2050 } } ] }, "errors": "<string>", "meta": {} }
Permite adicionar um novo item a uma assinatura existente.
Cabeçalho de autenticação no formato Bearer token.
Id da assinatura
Payload da requisição para adição de um item em uma assinatura.
Estrutura base de dados de um item.
Show child attributes
Novo item adicionado com sucesso.
Objeto de retorno de criação de assinatura.