Create a payment method

How to create a payment method via API

To create a new payment method, send a POST request to the /api/payment_methods endpoint, passing the resource arguments in the request body.

Request

POST https://yourdomain.commercelayer.io/api/payment_methods

Arguments

Body Parameter
Type
Required

type

string

Required

attributes.name

string

Optional, default to titleized payment source type

attributes.payment_source_type

string

Required

attributes.currency_code

string

Required, unless inherited by market

attributes.moto

boolean

Optional, default is 'false'

attributes.require_capture

boolean

Optional, deafult is 'true'

attributes.auto_place

boolean

Optional, default is 'false'

attributes.auto_capture

boolean

Optional, default is 'false'

attributes.price_amount_cents

integer

Required

attributes.auto_capture_max_amount_cents

integer

Optional

attributes._disable

boolean

Optional

attributes._enable

boolean

Optional

attributes.reference

string

Optional

attributes.reference_origin

string

Optional

attributes.metadata

object

Optional

relationships.market

object

Optional

relationships.payment_gateway

object

Required

relationships.store

object

Optional

Example

The following request creates a new payment method:

Last updated