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 |
| Required |
attributes.name |
| Optional, default to titleized payment source type |
attributes.payment_source_type |
| Required |
attributes.currency_code |
| Required, unless inherited by market |
attributes.moto |
| Optional, default is 'false' |
attributes.require_capture |
| Optional, deafult is 'true' |
attributes.auto_place |
| Optional, default is 'false' |
attributes.auto_capture |
| Optional, default is 'false' |
attributes.price_amount_cents |
| Required |
attributes.auto_capture_max_amount_cents |
| Optional |
attributes._disable |
| Optional |
attributes._enable |
| Optional |
attributes.reference |
| Optional |
attributes.reference_origin |
| Optional |
attributes.metadata |
| Optional |
relationships.market |
| Optional |
relationships.payment_gateway |
| Required |
Example
The following request creates a new payment method:
Last updated