Create Payment

Create a payment for an order.

Parameters
  • dataformData, objectRequired

    Form Data needed when creating a new payment for an order.

    • typestringRequired

      Provide Payment type. Current selection is only payments.

    • attributesformData, object

      Attributes object.

      • stripe_tokenstring

        Stripe reusable Source/PaymentMethod token.

      • stripe_payment_method_idstring

        Stripe PaymentMethod ID which was saved before along with Card record.

    • relationshipsformData, object

      Relationships object with order object.

      • orderformData, object

        Add a order relationships link.

        • idstring

          Related Order id.

        • typestring

          Order type; order.

POST/api/v1/payments

{
  const res = await fetch(`${BASE_URL}/api/v1/payments`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)});

  const data = await res.json();
}

RESPONSE