Update a top-up 

Updates the metadata of a top-up. Other top-up details are not editable by design.

Parameters

  • descriptionstring

    An arbitrary string attached to the object. Often useful for displaying to users.

  • metadataMap

    Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.

Returns

The newly updated top-up object if the call succeeded. Otherwise, this call throws an error.

POST /v1/topups/:id
Stripe.apiKey = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2";
Topup resource = Topup.retrieve("tu_1NG6yj2eZvKYlo2C1FOBiHya");
TopupUpdateParams params =
TopupUpdateParams.builder().putMetadata("order_id", "6735").build();
Topup topup = resource.update(params);
Response
{
"id": "tu_1NG6yj2eZvKYlo2C1FOBiHya",
"object": "topup",
"amount": 2000,
"balance_transaction": null,
"created": 123456789,
"currency": "usd",
"description": "Top-up for Jenny Rosen",
"expected_availability_date": 123456789,
"failure_code": null,
"failure_message": null,
"livemode": false,
"source": null,
"statement_descriptor": "Top-up",
"status": "pending",
"transfer_group": null,
"metadata": {
"order_id": "6735"
}
}

Retrieve a top-up 

Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information.

Parameters

No parameters.

Returns

Returns a top-up if a valid identifier was provided, and throws an error otherwise.

GET /v1/topups/:id
Stripe.apiKey = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2";
Topup topup = Topup.retrieve("tu_1NG6yj2eZvKYlo2C1FOBiHya");
Response
{
"id": "tu_1NG6yj2eZvKYlo2C1FOBiHya",
"object": "topup",
"amount": 2000,
"balance_transaction": null,
"created": 123456789,
"currency": "usd",
"description": "Top-up for Jenny Rosen",
"expected_availability_date": 123456789,
"failure_code": null,
"failure_message": null,
"livemode": false,
"source": null,
"statement_descriptor": "Top-up",
"status": "pending",
"transfer_group": null
}

List all top-ups 

Returns a list of top-ups.

Parameters

  • statusstring

    Only return top-ups that have the given status. One of canceled, failed, pending or succeeded.

More parameters

  • amountMap

  • createdMap

  • ending_beforestring

  • limitinteger

  • starting_afterstring

Returns

A Map containing the data property, which is an array of separate top-up objects. The number of top-ups in the array is limited to the number designated in limit. If no more top-ups are available, the resulting array will be empty.

GET /v1/topups
Stripe.apiKey = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2";
TopupListParams params = TopupListParams.builder().setLimit(3L).build();
TopupCollection topups = Topup.list(params);
Response
{
"object": "list",
"url": "/v1/topups",
"has_more": false,
"data": [
{
"id": "tu_1NG6yj2eZvKYlo2C1FOBiHya",
"object": "topup",
"amount": 2000,
"balance_transaction": null,
"created": 123456789,
"currency": "usd",
"description": "Top-up for Jenny Rosen",
"expected_availability_date": 123456789,
"failure_code": null,
"failure_message": null,
"livemode": false,
"source": null,
"statement_descriptor": "Top-up",
"status": "pending",
"transfer_group": null
}
]
}

Cancel a top-up 

Cancels a top-up. Only pending top-ups can be canceled.

Parameters

No parameters.

Returns

Returns the canceled top-up. If the top-up is already canceled or can’t be canceled, an error is returned.

POST /v1/topups/:id/cancel
Stripe.apiKey = "sk_test_BQokikJ...2HlWgH4olfQ2sk_test_BQokikJOvBiI2HlWgH4olfQ2";
Topup resource = Topup.retrieve("tu_1NG6yj2eZvKYlo2C1FOBiHya");
TopupCancelParams params = TopupCancelParams.builder().build();
Topup topup = resource.cancel(params);
Response
{
"id": "tu_1NG6yj2eZvKYlo2C1FOBiHya",
"object": "topup",
"amount": 2000,
"balance_transaction": null,
"created": 123456789,
"currency": "usd",
"description": "Top-up for Jenny Rosen",
"expected_availability_date": 123456789,
"failure_code": null,
"failure_message": null,
"livemode": false,
"source": null,
"statement_descriptor": "Top-up",
"status": "canceled",
"transfer_group": null
}

Transfers 

A Transfer object is created when you move funds between Stripe accounts as part of Connect.

Before April 6, 2017, transfers also represented movement of funds from a Stripe account to a card or bank account. This behavior has since been split out into a Payout object, with corresponding payout endpoints. For more information, read about the transfer/payout split.

Related guide: Creating separate charges and transfers