Composable Frontend 2.0 Learn more 

  • Payments/
    Paying for an Order/
    CyberSource

    CyberSource Payments

    The CyberSource integration supports the following payment methods:

    • authorize
    • capture
    • purchase
    • refund

    POST Pay by token

    https://useast.api.elasticpath.com/v2/orders/:orderId/payments
    

    Parameters

    Path parameters

    NameRequiredTypeDescription
    orderIdRequiredstringThe Universally Unique Identifier (UUID) of the order that you want to pay for.

    Headers

    NameRequiredTypeDescription
    AuthorizationRequiredstringThe Bearer token required to get access to the API.

    Body

    NameRequiredTypeDescription
    paymentRequiredstringThe CyberSource token.
    methodOptionalstringEnter purchase or authorize.
    amountOptionalintegerSpecifies the amount to be paid for the transaction.
    gatewayOptionalstringEnter cyber_source.

    Request Examples

    Curl

    curl -X POST https://useast.api.elasticpath.com/v2/orders/:orderId/payments \
         -H "Authorization: Bearer XXXX" \
         -H "Content-Type: application/json" \
         -d $'{
            "data": {
              "gateway": "cyber_source",
              "method": "purchase",
              "amount": 100,
              "payment": ";;;;;;11234FS5353FGFRSS2562"
            }
          }'
    

    Using merchant defined fields

    curl -X POST https://useast.api.elasticpath.com/v2/orders/:orderId/payments \
         -H "Authorization: Bearer XXXX" \
         -H "Authorization: Bearer XXXX" \
         -d $ {
        "data": {
            "gateway": "cyber_source",
            "method": "purchase",
            "payment": ";;;;;;A4A0599983621A96E05341588999E7DA"
            "options": {
                "mdd_field_1": "one thing",
                "mdd_field_2": "and another",
                "mdd_field_3": "and even more",
                "mdd_field_4": "and on.."
            }
        }
    }
    

    Response Example

    200 OK

    {
        "data": {
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "type": "transaction",
            "reference": "xxx",
            "gateway": "cyber_source",
            "amount": 100,
            "currency": "USD",
            "transaction-type": "purchase",
            "status": "complete",
            "relationships": {
                "order": {
                    "data": {
                        "type": "order",
                        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
                    }
                }
            },
            "meta": {
                "display_price": {
                    "amount": 100,
                    "currency": "USD",
                    "formatted": "$100.00"
                },
                "created_at": "2019-01-31T17:20:39.378Z"
            }
        }
    }
    
    Previous
    CardConnect Payments