5. Updating a subscription item

5. Updating a subscription item

Please note that the sandbox URL shall only be used for integration and testing procedures. Once the Payment Service Agreement is signed, you will receive the production environment's URL when you request your account to go live. You can add, update, or remove an item from a previously created subscription.

5.1 Add an item to the subscription

Your POST must be sent to https://sandbox.pagbrasil.com/api/pagstream/subscription/item/add setting the content-type of the request header and body as "x-www-form-urlencoded".

Request parameters:

Field

Description

Required

Length

Field

Description

Required

Length

secret

Secret phrase as defined in the PagBrasil Dashboard

Yes

128

pbtoken

Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings.

Yes

32

subscription

Subscription identification

Yes

9

sku

Unique code that identifies the product or service.

Yes

64

amount_brl

Defines the total amount in Brazilian Real considering the quantity and the discount.

No

3

quantity

Defines the quantity of the product or service.

No

7.2

discount

Discount amount in Brazilian Real applied to that product or service.

No

7.2

5.2 Update an item in the subscription

Your POST must be sent to https://sandbox.pagbrasil.com/api/pagstream/subscription/item/update setting the content-type of the request header and body as "x-www-form-urlencoded".

Request parameters:

Field

Description

Required

Length

Field

Description

Required

Length

secret

Secret phrase as defined in the PagBrasil Dashboard

Yes

128

pbtoken

Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings.

Yes

32

subscription

Subscription identification

Yes

9

sku

Unique code that identifies the product or service.

Yes

64

amount_brl

Defines the total amount in Brazilian Real considering the quantity and the discount.

No

3

quantity

Defines the quantity of the product or service.

No

7.2

discount

Discount amount in Brazilian Real applied to that product or service.

No

7.2

5.3 Remove an item from the subscription

Your POST must be sent to https://sandbox.pagbrasil.com/api/pagstream/subscription/item/delete setting the content-type of the request header and body as "x-www-form-urlencoded".

Request parameters:

Field

Description

Required

Length

Field

Description

Required

Length

secret

Secret phrase as defined in the PagBrasil Dashboard

Yes

128

pbtoken

Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings.

Yes

32

subscription

Subscription identification

Yes

9

sku

Unique code that identifies the product or service.

Yes

64

5.4 Reading the response

Note: The response for add, update and remove an item from a subscription will be exactly the same format as a "/api/pagstream/subscription/get" response (see item 7.2).

CONFIDENTIAL