API
Core Resources

Notifications

The Customer Notifications resource is used to dispatch email notifications to customers within Recharge. The endpoint uses your configured Recharge email templates, and will dispatch an email to the address associated with the indicated customer_id. Some email templates require variable values, which are sent through the Customer Notifications resource via the template_vars attribute. See below examples for all available template types.

15 additions in V2, marked New

Everything marked New also works when you send X-Recharge-Version: 2021-11.

#Send email notification

POST/customers/{id}/notifications
Sends a notification email to the customer with the customer_id indicated in the route. To view the upcoming charge email template, visit the Notifications section in your Recharge Merchant Admin Portal.
Scopewrite_notifications
Returns 204 with no content. The request body is not wrapped in a root key.

Body parameters

  • typestringRequired
    Identifies the type of the notifications. Value can be email only.
    Possible values
    emailsms
  • template_typestringRequired
    Identifies the type of the email notifications.
    Possible values
    delayed_checkout_payment_failedget_account_accesssubscription_activationupcoming_chargerepurchase_reminderrepurchase_welcomemembership_enrollmentmembership_cancellationmembership_expirationrepurchase_reminder_smsrepurchase_welcome_smsmembership_upcoming_chargemembership_reactivationmembership_renewal_confirmationmembership_advanced_notice_upcoming_renewal_chargemembership_pricing_removedgift_skipped_shipmentshopify_update_payment_informationshopify_migrate_payment_information
  • An object containing the necessary template variables for this email template type.
    Show child attributesHide child attributes1015 new
    • If needed by the template_type, the address_id associated with the indicated Customer, and the object of the Notification.
    • If needed by the template_type, the charge_id of the Charge for which the notification should be sent.
    • The payment_method_id of the PaymentMethod of the Customer that the notification is about. Used by the shopify_update_payment_information and shopify_migrate_payment_information template types.
    • include_deletedbooleanNew
      Whether a deleted PaymentMethod may be referenced by payment_method_id. Defaults to false. Used by the shopify_update_payment_information template type.
    • Whether the updated payment information should be applied to all of the customer's addresses. Defaults to false. Used by the shopify_migrate_payment_information template type.
    • Deprecated. Use apply_to_all_subscription_addresses instead.
    • order_idintegerNew
      The order_id of an Order on the given address. Optional; used by the subscription_activation template type.
    • membership_idintegerNew
      The membership_id of the Membership for which the notification should be sent. Required by the membership_enrollment, membership_cancellation, membership_expiration, membership_reactivation and membership_renewal_confirmation template types.
    • line_itemsarray of objectsNew
      The line items to feature in the notification. Required (at least one item) by the repurchase_reminder and repurchase_welcome template types.
      Show child attributesHide child attributes55 new
      • idintegerNew
        Unique numeric identifier of the line item.
      • product_idintegerNew
        Identifier of the product of the line item.
      • variant_idintegerNew
        Identifier of the product variant of the line item.
      • quantityintegerNew
        Quantity of the line item.
      • order_idintegerNew
        Identifier of the order the line item was purchased in.
    • notificationobjectNew
      The repurchase notification the email is sent for. Required by the repurchase_reminder and repurchase_welcome template types.
      Show child attributesHide child attributes22 new
      • idintegerNew
        Unique numeric identifier of the repurchase notification.
      • tokenstringNew
        Token of the repurchase notification, used to build the unsubscribe link.
POST/customers/{id}/notifications
curl -X POST 'https://api.rechargeapps.com/customers/18819267/notifications' \
  -H 'X-Recharge-Version: v2' \
  -H 'Content-Type: application/json' \
  -H 'X-Recharge-Access-Token: your_api_token' \
  -d '{
  "type": "email",
  "template_type": "upcoming_charge",
  "template_vars": {
    "address_id": 1234567890,
    "charge_id": 9876543210
  }
}'
Response
{}