---
title: Stripe
slug: payments/JDOI-stripe
docTags: 
createdAt: 2023-12-11T18:01:37.668Z
---

To create a Customer Portal Session URL in Stripe, submit a request with a valid customerId and processorId.

A good request will return a valid response from Stripe, which includes the new Stripe Customer Portal Session URL.

Request and Response sample:

:::CodeblockTabs
Request

```apex
Map<String, Object> requestJSONMap = new Map<String, Object>();
requestJSONMap.put('customerId', 'Customer Id in Stripe');
String reqJSON = JSON.serialize(requestJSONMap);

Map<String, Object> reqObj = new Map<String, Object>();
reqObj.put('version', '1.0');
reqObj.put('action', 'CreateCustomerPortalSessionURL');
reqObj.put('processorId', 'Stripe Account Id');
reqObj.put('requestJSON', reqJSON);

Map<String, Object> resp = bw_payments.BreadwinnerPaymentsAPI.call(reqObj);

System.debug(resp);
```

Response&#x20;

```none
{
  "id": "bps_12345678",
  "object": "billing_portal.session",
  "configuration": "bpc_12345678",
  "created": 1701262898,
  "customer": "cus_OaBD5nipRI8SVt",
  "flow": null,
  "livemode": false,
  "locale": null,
  "on_behalf_of": null,
  "return_url": "https://www.breadwinner.com",
  "url": "https://billing.stripe.com/p/session/test_YWNjdF8x..."
}
```
:::


