GoCardlessDeveloper Docs
Create a sandbox account

Payer Theme

View as Markdown

Custom colour themes for payment pages and customer notifications.

Create a payer theme associated with a creditor#

POST/branding/payer_themes

Creates a new payer theme associated with a creditor. If a creditor already has payer themes, this will update the existing payer theme linked to the creditor.

POST https://api.gocardless.com/branding/payer_themes HTTP/1.1
Content-Type: application/json
{
  "payer_themes": {
    "header_background_colour": "#BD10E0",
    "link_text_colour": "#7ED321",
    "button_background_colour": "#128DAA",
    "content_box_border_colour": "#BD10E0",
    "links": {
      "creditor": "CR123"
    }
  }
}
@client.payer_themes.create_for_creditor(
  params: {
    "header_background_colour": "#BD10E0",
    "link_text_colour": "#7ED321",
    "button_background_colour": "#128DAA",
    "content_box_border_colour": "#BD10E0",
    "links": {
      "creditor": "CR123"
    }
  }
)
client.payer_themes.create_for_creditor(params={
  "header_background_colour": "#BD10E0",
  "link_text_colour": "#7ED321",
  "button_background_colour": "#128DAA",
  "content_box_border_colour": "#BD10E0",
  "links": {
    "creditor": "CR123"
  }
})
const payerThemes = await client.payerThemes.createForCreditor({
  header_background_colour: "#BD10E0",
  link_text_colour: "#7ED321",
  button_background_colour: "#128DAA",
  content_box_border_colour: "#BD10E0",
  links: {
    creditor: "CR123"
  }
});
$client->payerThemes()->createForCreditor([
  "params" => [
    "header_background_colour" => "#BD10E0",
    "link_text_colour" => "#7ED321",
    "button_background_colour" => "#128DAA",
    "content_box_border_colour" => "#BD10E0",
    "links" => [
      "creditor" => "CR123"
    ]
  ]
]);
PayerTheme payerTheme = client.payerThemes().createForCreditor()
  .withButtonBackgroundColour("#128DAA")
  .withContentBoxBorderColour("#BD10E0")
  .withHeaderBackgroundColour("#BD10E0")
  .withLinkTextColour("#7ED321")
  .withLinksCreditor("CR123")
  .execute();
payerThemeCreateForCreditorParams := gocardless.PayerThemeCreateForCreditorParams{
  ButtonBackgroundColour: "#128DAA",
  ContentBoxBorderColour: "#BD10E0",
  HeaderBackgroundColour: "#BD10E0",
  LinkTextColour: "#7ED321",
  Links: &gocardless.PayerThemeCreateForCreditorParamsLinks{
    Creditor: "CR123",
  },
}

payerThemes, err := client.PayerThemes.CreateForCreditor(ctx, payerThemeCreateForCreditorParams)
var payerThemeCreateForCreditorRequest = new GoCardless.Services.PayerThemeCreateForCreditorRequest()
{
    HeaderBackgroundColour = "#BD10E0",
    LinkTextColour = "#7ED321",
    ButtonBackgroundColour = "#128DAA",
    ContentBoxBorderColour = "#BD10E0",
    Links = new GoCardless.Services.PayerThemeCreateForCreditorRequest.PayerThemeLinks()
    {
        Creditor = "CR0123"
    }
};

var payerThemeCreateForCreditorResponse = await client.PayerThemes.CreateForCreditorAsync(payerThemeCreateForCreditorRequest);
GoCardless.Resources.PayerTheme creditorPayerTheme = payerThemeCreateForCreditorResponse.PayerTheme;
Responsehttp
HTTP/1.1 201 OK
Content-Type: application/json
{
  "payer_themes": {
    "id": "PTH123"
  }
}
Request Body
payer_themesobject
5 properties
header_background_colourstring

Colour for header background (hexcode)

link_text_colourstring

Colour for text links (hexcode)

button_background_colourstring

Colour for buttons background (hexcode)

content_box_border_colourstring

Colour for content box border (hexcode)

linksobject
1 properties
creditorstring

ID of the creditor the payer theme belongs to

Response 201

Resource created successfully

payer_themesobject
1 properties
idstring

Unique identifier, beginning with "PTH".

Errors 400401404422500
400

Bad Request

401

Unauthorised

404

Not found

422

Validation Error

500

Internal Error

Error Body
codeinteger
documentation_urlstring
errorsarray
2 properties
reasonstring
messagestring
messagestring
request_idstring
typestring
metadataobject
linksobject